inheritor.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. <template>
  2. <!-- 传承人提交首页 -->
  3. <div class="about main-background main-background-type0">
  4. <div class="nav-placeholder">
  5. </div>
  6. <!-- 表单 -->
  7. <section class="main-section large">
  8. <div class="content">
  9. <div class="title left-right">
  10. <span style="width:160px;"></span>
  11. <h2>非遗数字化资源信息校对</h2>
  12. <small class="text-secondary">技术支持:18649931391</small>
  13. </div>
  14. <a-tabs v-model:activeKey="activeKey" centered>
  15. <a-tab-pane key="1" tab="非遗项目">
  16. <EmptyToRecord title="非遗项目" :loader="ichData" @edit="router.push({ name: 'FormIch' })">
  17. <a-alert v-if="ichData.content.value!.progress == -1" message="提交的信息被退回,您可以去修改" type="error" class="mt-3" showIcon>
  18. <template #action>
  19. <a-button size="small" type="primary" @click="router.push({ name: 'FormIch' })">去修改</a-button>
  20. </template>
  21. </a-alert>
  22. <a-descriptions class="mt-3" title="非遗项目信息" v-if="ichData.content.value" bordered :column="{ xs: 1, sm: 1, md: 1, lg: 2 }">
  23. <a-descriptions-item label="标题"><ShowValueOrNull :value="ichData.content.value.title" /></a-descriptions-item>
  24. <a-descriptions-item label="简介" :span="3"><SimpleRichHtml :contents="[ ichData.content.value.intro ]" /></a-descriptions-item>
  25. <a-descriptions-item label="类别"><ShowValueOrNull :value="ichData.content.value.ichTypeText" /></a-descriptions-item>
  26. <a-descriptions-item label="级别"><ShowValueOrNull :value="ichData.content.value.levelText" /></a-descriptions-item>
  27. <a-descriptions-item label="级别"><ShowValueOrNull :value="ichData.content.value.levelText" /></a-descriptions-item>
  28. <a-descriptions-item label="批次"><ShowValueOrNull :value="ichData.content.value.batchText" /></a-descriptions-item>
  29. <a-descriptions-item label="区域"><ShowValueOrNull :value="ichData.content.value.regionText" /></a-descriptions-item>
  30. <a-descriptions-item label="保护单位"><ShowValueOrNull :value="ichData.content.value.unit" /></a-descriptions-item>
  31. <a-descriptions-item v-if="ichData.content.value.image" label="图片">
  32. <a-image :src="ichData.content.value.image" style="max-width:300px;" />
  33. </a-descriptions-item>
  34. <a-descriptions-item v-if="ichData.content.value.video" label="视频">
  35. <video controls :src="ichData.content.value.video" style="max-width:300px;" />
  36. </a-descriptions-item>
  37. <a-descriptions-item v-if="ichData.content.value.audio" label="音频">
  38. <audio controls :src="ichData.content.value.audio" style="max-width:300px;" />
  39. </a-descriptions-item>
  40. <a-descriptions-item label="类型"><ShowValueOrNull :value="ichData.content.value.typeText" /></a-descriptions-item>
  41. <a-descriptions-item v-if="ichData.content.value.latitude && ichData.content.value.longitude" label="地图">
  42. <SimplePointedMap :longitude="ichData.content.value.longitude" :latitude="ichData.content.value.latitude" :zoom="15" height="300px" />
  43. </a-descriptions-item>
  44. </a-descriptions>
  45. </EmptyToRecord>
  46. </a-tab-pane>
  47. <a-tab-pane key="2" tab="传承人">
  48. <EmptyToRecord title="传承人" :loader="inheritorData" @edit="router.push({ name: 'FormInheritor' })">
  49. <a-alert v-if="inheritorData.content.value!.progress == -1" message="提交的信息被退回,您可以去修改" type="error" class="mt-3" showIcon>
  50. <template #action>
  51. <a-button size="small" type="primary" @click="router.push({ name: 'FormInheritor' })">去修改</a-button>
  52. </template>
  53. </a-alert>
  54. <a-descriptions class="mt-3" title="传承人信息" v-if="inheritorData.content.value" bordered :column="{ xs: 1, sm: 1, md: 1, lg: 2 }">
  55. <a-descriptions-item label="名字"><ShowValueOrNull :value="inheritorData.content.value.title" /></a-descriptions-item>
  56. <a-descriptions-item v-if="inheritorData.content.value.image" label="头像">
  57. <a-avatar :src="inheritorData.content.value.image" size="large" />
  58. </a-descriptions-item>
  59. <a-descriptions-item label="传承人等级"><ShowValueOrNull :value="inheritorData.content.value.levelText" /></a-descriptions-item>
  60. <a-descriptions-item label="传承人批次"><ShowValueOrNull :value="inheritorData.content.value.batchText" /></a-descriptions-item>
  61. <a-descriptions-item label="别称"><ShowValueOrNull :value="inheritorData.content.value.alsoName" /></a-descriptions-item>
  62. <a-descriptions-item label="时代"><ShowValueOrNull :value="inheritorData.content.value.age" /></a-descriptions-item>
  63. <a-descriptions-item label="出生地"><ShowValueOrNull :value="inheritorData.content.value.birthplace" /></a-descriptions-item>
  64. <a-descriptions-item label="民族"><ShowValueOrNull :value="inheritorData.content.value.nation" /></a-descriptions-item>
  65. <a-descriptions-item label="出生日期"><ShowValueOrNull :value="inheritorData.content.value.dateBirth" /></a-descriptions-item>
  66. <a-descriptions-item label="逝世日期"><ShowValueOrNull :value="inheritorData.content.value.deathBirth" /></a-descriptions-item>
  67. <a-descriptions-item label="单位"><ShowValueOrNull :value="inheritorData.content.value.unit" /></a-descriptions-item>
  68. <a-descriptions-item label="区域"><ShowValueOrNull :value="inheritorData.content.value.regionText" /></a-descriptions-item>
  69. <a-descriptions-item label="简介" :span="3"><SimpleRichHtml :contents="[ inheritorData.content.value.intro ]" /></a-descriptions-item>
  70. <a-descriptions-item label="描述" :span="3"><SimpleRichHtml :contents="[ inheritorData.content.value.content! ]" /></a-descriptions-item>
  71. <a-descriptions-item label="奖项/成就" :span="3"><SimpleRichHtml :contents="[ inheritorData.content.value.prize ]" /></a-descriptions-item>
  72. <a-descriptions-item v-if="inheritorData.content.value.images" label="代表性图片">
  73. <ImageGrid :data="inheritorData.content.value.images" />
  74. </a-descriptions-item>
  75. <a-descriptions-item v-if="inheritorData.content.value.video" label="视频">
  76. <video controls :src="inheritorData.content.value.video" style="max-width:300px;" />
  77. </a-descriptions-item>
  78. <a-descriptions-item v-if="inheritorData.content.value.audio" label="音频">
  79. <audio controls :src="inheritorData.content.value.audio" style="max-width:300px;" />
  80. </a-descriptions-item>
  81. </a-descriptions>
  82. </EmptyToRecord>
  83. </a-tab-pane>
  84. <a-tab-pane key="3" tab="传习所">
  85. <EmptyToRecord title="传习所" :loader="seminarData" @edit="router.push({ name: 'FormSeminar' })">
  86. <a-alert v-if="seminarData.content.value?.progress == -1" message="提交的信息被退回,您可以去修改" type="warning" showIcon></a-alert>
  87. <a-descriptions class="mt-3" title="传习所信息" v-if="seminarData.content.value" bordered :column="{ xs: 1, sm: 1, md: 1, lg: 2 }">
  88. <a-descriptions-item label="标题"><ShowValueOrNull :value="seminarData.content.value.title" /></a-descriptions-item>
  89. <a-descriptions-item label="简介" :span="3"><SimpleRichHtml :contents="[ seminarData.content.value.desc as string ]" /></a-descriptions-item>
  90. <a-descriptions-item label="介绍" :span="3"><SimpleRichHtml :contents="[ seminarData.content.value.content as string ]" /></a-descriptions-item>
  91. <a-descriptions-item v-if="seminarData.content.value.latitude && seminarData.content.value.longitude" label="地图">
  92. <SimplePointedMap :longitude="seminarData.content.value.longitude" :latitude="seminarData.content.value.latitude" :zoom="15" height="300px" />
  93. </a-descriptions-item>
  94. <a-descriptions-item label="地址"><ShowValueOrNull :value="seminarData.content.value.address" /></a-descriptions-item>
  95. <a-descriptions-item label="批次"><ShowValueOrNull :value="seminarData.content.value.batchText" /></a-descriptions-item>
  96. <a-descriptions-item label="级别"><ShowValueOrNull :value="seminarData.content.value.levelText" /></a-descriptions-item>
  97. <a-descriptions-item label="联系人"><ShowValueOrNull :value="seminarData.content.value.contact" /></a-descriptions-item>
  98. <a-descriptions-item label="联系电话"><ShowValueOrNull :value="seminarData.content.value.mobile" /></a-descriptions-item>
  99. <a-descriptions-item label="单位类型"><ShowValueOrNull :value="seminarData.content.value.ichSiteTypeText" /></a-descriptions-item>
  100. <a-descriptions-item label="单位"><ShowValueOrNull :value="seminarData.content.value.unit" /></a-descriptions-item>
  101. <a-descriptions-item v-if="seminarData.content.value.latitude && seminarData.content.value.longitude" label="地图">
  102. <SimplePointedMap :longitude="seminarData.content.value.longitude" :latitude="seminarData.content.value.latitude" :zoom="15" height="300px" />
  103. </a-descriptions-item>
  104. <a-descriptions-item v-if="seminarData.content.value.image" label="图片">
  105. <a-image :src="seminarData.content.value.image" style="max-width:300px;" />
  106. </a-descriptions-item>
  107. <a-descriptions-item v-if="seminarData.content.value.video" label="视频">
  108. <video controls :src="seminarData.content.value.video" style="max-width:300px;" />
  109. </a-descriptions-item>
  110. <a-descriptions-item v-if="seminarData.content.value.audio" label="音频">
  111. <audio controls :src="seminarData.content.value.audio" style="max-width:300px;" />
  112. </a-descriptions-item>
  113. <a-descriptions-item label="类型"><ShowValueOrNull :value="seminarData.content.value.typeText" /></a-descriptions-item>
  114. </a-descriptions>
  115. </EmptyToRecord>
  116. </a-tab-pane>
  117. <a-tab-pane key="4" tab="作品">
  118. <EmptyToRecord title="作品" buttonText="新增作品" :loader="ichData" :showEdited="false" @edit="router.push({ name: 'FormWork' })">
  119. <div class="d-flex justify-content-end">
  120. <a-button type="primary" @click="router.push({ name: 'FormWork' })">+ 新增</a-button>
  121. </div>
  122. <a-list class="light-round" item-layout="horizontal" :data-source="worksData || []">
  123. <template #renderItem="{ item }">
  124. <a-list-item>
  125. <a-list-item-meta
  126. :title="item.title"
  127. :description="item.desc"
  128. >
  129. <template #avatar>
  130. <a-avatar :src="item.image" />
  131. </template>
  132. </a-list-item-meta>
  133. <template #actions>
  134. <a key="list-loadmore-edit" @click="router.push({ name: 'FormWork', query: { id: item.id } })">编辑</a>
  135. </template>
  136. </a-list-item>
  137. </template>
  138. </a-list>
  139. </EmptyToRecord>
  140. </a-tab-pane>
  141. <!-- <a-tab-pane key="5" tab="五年计划">
  142. <EmptyToRecord title="五年计划" :model="planData" :showEdited="false" @edit="router.push({ name: 'FormPlan' })">
  143. <div class="d-flex justify-content-end">
  144. <a-button type="primary" @click="router.push({ name: 'FormPlan' })">+ 新增</a-button>
  145. </div>
  146. <a-list item-layout="horizontal" :data-source="planData">
  147. <template #renderItem="{ item }">
  148. <a-list-item>
  149. <a-list-item-meta
  150. :title="item.name"
  151. :description="item.desc"
  152. />
  153. <template #actions>
  154. <a-badge v-if="item.progress === -1" status="error" text="不通过" />
  155. <a-badge v-else-if="item.progress === 0" status="processing" text="待审核" />
  156. <a-badge v-else-if="item.progress === 1" status="success" text="已通过" />
  157. <a key="list-loadmore-edit" @click="router.push({ name: 'FormPlan', query: { id: item.id } })">编辑</a>
  158. </template>
  159. </a-list-item>
  160. </template>
  161. </a-list>
  162. </EmptyToRecord>
  163. </a-tab-pane> -->
  164. </a-tabs>
  165. </div>
  166. </section>
  167. <a-modal v-model:open="showInMessage" title="提示">
  168. <p>尊敬的非遗传承人您好!</p>
  169. <p>您手中的技艺、口中的故事,是闽南文化代代相传的 “活瑰宝”,更是咱闽南人抹不去的文化根脉。咱们建闽南文化生态数据库,就是想把这些珍贵的传承智慧好好存下来、护起来,让更多人看见,让后代能接续。</p>
  170. <p>您此刻录入的每一段细节、每一句讲解,都不是简单的记录 —— 是给您的手艺留 “活档案”,更是为闽南文化的传承添 “实底气”。恳请您多费心、多细致,这份用心,才能让咱的非遗真正 “活” 在未来,传得更远!</p>
  171. <template #footer>
  172. <a-button key="submit" type="primary" @click="closeInMessage">好的</a-button>
  173. </template>
  174. </a-modal>
  175. </div>
  176. </template>
  177. <script setup lang="ts">
  178. import { onMounted, ref, watch } from 'vue';
  179. import { useRoute, useRouter } from 'vue-router';
  180. import type { IchInfo, InheritorInfo, InheritorWorkInfo, PlanInfo, SeminarInfo } from '@/api/inheritor/InheritorContent';
  181. import InheritorContent from '@/api/inheritor/InheritorContent';
  182. import ImageGrid from '@/components/content/ImageGrid.vue';
  183. import SimplePointedMap from '@/components/content/SimplePointedMap.vue';
  184. import SimpleRichHtml from '@/components/display/SimpleRichHtml.vue';
  185. import ShowValueOrNull from '@/components/dynamicf/Display/ShowValueOrNull.vue';
  186. import EmptyToRecord from '@/components/parts/EmptyToRecord.vue';
  187. import { SettingsUtils } from '@imengyu/imengyu-utils';
  188. import { useSimpleDataLoader } from '@/composeable/SimpleDataLoader';
  189. import { RequestApiError } from '@imengyu/imengyu-utils/dist/request';
  190. const router = useRouter();
  191. const route = useRoute();
  192. const activeKey = ref(route.query.tab as string || '1');
  193. const planData = ref<PlanInfo[]>([]);
  194. const worksData = ref<InheritorWorkInfo[]>([]);
  195. const showInMessage = ref(false);
  196. watch(activeKey, (newValue) => {
  197. router.replace({ query: { tab: newValue } });
  198. });
  199. const ichData = useSimpleDataLoader(async () => {
  200. const data = await InheritorContent.getIchInfo(undefined);
  201. planData.value = await InheritorContent.getPlanList(data.id);
  202. worksData.value = await InheritorContent.getIchWorksInfo({
  203. ichId: data.id,
  204. page: 1,
  205. pageSize: 100,
  206. });
  207. return data;
  208. });
  209. const inheritorData = useSimpleDataLoader<InheritorInfo|null>(async () => {
  210. try {
  211. return await InheritorContent.getInheritorInfo(undefined)
  212. } catch (e) {
  213. if (e instanceof RequestApiError) {
  214. if (e.errorMessage === '暂无信息,等待采集')
  215. return null;
  216. }
  217. throw e;
  218. }
  219. });
  220. const seminarData = useSimpleDataLoader<SeminarInfo|null>(async () => {
  221. try {
  222. return await InheritorContent.getSeminarInfo(undefined);
  223. } catch (e) {
  224. if (e instanceof RequestApiError) {
  225. if (e.errorMessage === '暂无信息,等待采集')
  226. return null;
  227. }
  228. throw e;
  229. }
  230. });
  231. function openInMessage() {
  232. const lastTime = new Date(parseInt('' + SettingsUtils.getSettings('inheritorShowInMessageLastTime', 0)));
  233. if (new Date().getTime() - lastTime.getTime() > 1000 * 3600 * 48) {
  234. showInMessage.value = true;
  235. }
  236. }
  237. function closeInMessage() {
  238. SettingsUtils.setSettings('inheritorShowInMessageLastTime', new Date().getTime());
  239. showInMessage.value = false;
  240. }
  241. </script>