inheritor.vue 16 KB

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