ソースを参照

📦 增加已传承谱系

快乐的梦鱼 2 ヶ月 前
コミット
a4dead7854
共有3 個のファイルを変更した19 個の追加9 個の削除を含む
  1. 9 8
      src/pages/details/TabDetailView.vue
  2. 10 0
      src/pages/details/intangible.vue
  3. 0 1
      src/pages/inheritor/index.vue

+ 9 - 8
src/pages/details/TabDetailView.vue

@@ -12,7 +12,7 @@
       <SimplePageContentLoader :loader="loader">
         <div v-if="loader.content.value" class="content news-detail">
           
-          <div class="d-flex flex-row justify-content-start">
+          <div class="d-flex flex-row justify-content-start mb-3">
             <div class="back-button2" @click="back">
               <img src="@/assets/images/news/IconBack.png" />
               <span>返回列表</span>
@@ -31,9 +31,9 @@
           <!-- Tab -->
           <TagBar
             class="mb-3"
-            :tags="contentProps.tabs.filter(p => p.visible).map((p, i) => ({ id: p.id, name: p.text })) || []"
+            :tags="crrentVisibleTabs.map((p, i) => ({ id: p.id, name: p.text })) || []"
             :margin="[30, 70]" 
-            v-model:selectedTag="currentTabIndex"
+            v-model:selectedTag="currentTabId"
           />
           <!-- 基础信息 -->
           <div v-show="currentTabId==0">
@@ -109,7 +109,7 @@
             <a-empty v-if="!loader.content.value.video && !loader.content.value.audio" />
           </div>
           <!-- 其他 -->
-          <slot name="extraTab" :currentTabIndex="currentTabIndex" :currentTabId="currentTabId" :content="loader.content.value" />
+          <slot name="extraTab" :currentTabId="currentTabId" :content="loader.content.value" />
 
           <ContentNode />
 
@@ -177,8 +177,9 @@ watch(() => route.query.id, (v) => {
   loader.loadData(undefined, true);
 })
 
-const currentTabIndex = ref(0);
-const currentTabId = computed(() => contentProps.value.tabs[currentTabIndex.value]?.id || 0);
+const crrentVisibleTabs = computed(() => contentProps.value.tabs.filter((item) => item.visible));
+
+const currentTabId = ref(0);
 const contentProps = computed(() => {
   return loader.content.value?.contentProps as {
     tabs: { 
@@ -192,10 +193,10 @@ const contentProps = computed(() => {
 })
 
 watch(route, () => {
-  currentTabIndex.value = 0;
+  currentTabId.value = 0;
 });
 onMounted(() => {
-  currentTabIndex.value = 0;
+  currentTabId.value = 0;
 })
 
 function back() {

+ 10 - 0
src/pages/details/intangible.vue

@@ -109,6 +109,15 @@
           modelId: ProjectsContent.modelId,
         }"
       />
+      <!-- 传承谱系 -->
+      <div v-show="currentTabId==10">
+        <SimpleRichHtml 
+          class="news-content"
+          :contents="[
+            content.pedigree
+          ]" 
+        />
+      </div>
     </template>
   </TabDetailView>
 </template>
@@ -168,6 +177,7 @@ async function loadData(id: number) {
       { id: 4, text: '非遗作品', visible: Boolean(d.worksList && (d.worksList as any[]).length > 0) },
       { id: 5, text: '非遗传习中心', visible: Boolean(d.ichSitesList && (d.ichSitesList as any[]).length > 0) },
       { id: 6, text: '非遗传承人', visible: Boolean(d.inheritorsList && (d.inheritorsList as any[]).length > 0) },
+      { id: 10, text: '传承谱系', visible: Boolean(d.pedigree) },
       { id: 7, text: '相关资讯', visible: Boolean(d.associationMeList && (d.associationMeList as any[]).length > 0) },
     ]
   };

+ 0 - 1
src/pages/inheritor/index.vue

@@ -254,7 +254,6 @@ const overviewsLoader = await useSSrSimpleDataLoader('overviews', async () => {
     )).list[0]?.overview || NO_CONTENT_STRING,
   ]
 });
-
 const statsData = await useSSrSimpleDataLoader('stats', async () => {
   const data = (await IndexContent.getStats());
   const semiCount = (await SeminarContent.getContentList(new GetContentListParams(), 1, 1)).total;