inheritor.vue 16 KB

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