inheritor.vue 15 KB

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