瀏覽代碼

📦 修改细节问题

imengyu 1 月之前
父節點
當前提交
d2e06d6721

+ 1 - 1
nuxt.config.ts

@@ -27,7 +27,7 @@ export default defineNuxtConfig({
     transpile: ['@imengyu/vue-scroll-rect'],
   },
   routeRules: {
-    '/': { swr: 1/* 1800 */ },
+    '/': { swr: 1800 },
     '/about/': { swr: 86400 },
     '/communicate/': { swr: 86400 },
     '/fusion/': { swr: 86400 },

+ 1 - 1
src/components/Footer.vue

@@ -24,7 +24,7 @@
             <img src="@/assets/images/footer/GonganLogo.png" />
             闽公网安备 44040202000131号
           </a>
-          <a href="#">闽ICP备09020130号</a>
+          <a href="http://beian.miit.gov.cn/">闽ICP备09020130号</a>
         </div>
       </div>
     </div>

+ 132 - 122
src/components/content/CommonListBlock.vue

@@ -1,134 +1,136 @@
 <template>
   <!-- 通用列表页详情 -->
-  <div class="content mb-2">
-    <!-- 搜素栏 -->
-    <div class="row mt-3 align-items-center">
-      <!-- 左栏 -->
-      <div class="col-sm-12 col-md-6 col-lg-6">
-        <!-- 分类 -->
-        <TagBar 
-          :tags="tagsData || []"
-          :margin="[30, 70]" 
-          v-model:selectedTag="selectedTag"
-        />
-        <!-- 标题 -->
-        <div v-if="showNav" class="nav-back-title">
-          <img src="@/assets/images/BackArrow.png" alt="返回" @click="router.back()" />
-          <h2>{{ title }}</h2>
+  <div v-show="show" >
+    <div class="content mb-2">
+      <!-- 搜素栏 -->
+      <div class="row mt-3 align-items-center">
+        <!-- 左栏 -->
+        <div class="col-sm-12 col-md-6 col-lg-6">
+          <!-- 分类 -->
+          <TagBar 
+            :tags="tagsData || []"
+            :margin="[30, 70]" 
+            v-model:selectedTag="selectedTag"
+          />
+          <!-- 标题 -->
+          <div v-if="showNav" class="nav-back-title">
+            <img src="@/assets/images/BackArrow.png" alt="返回" @click="router.back()" />
+            <h2>{{ title }}</h2>
+          </div>
+          <!-- 标题 -->
+          <div v-if="showTotal" class="nav-back-title">
+            共有 {{ newsLoader.total }} 个{{ title }}
+          </div>
         </div>
-        <!-- 标题 -->
-        <div v-if="showTotal" class="nav-back-title">
-          共有 {{ newsLoader.total }} 个{{ title }}
+        <!-- 右栏 -->
+        <div class="col-sm-12 col-md-6 col-lg-6 d-flex flex-row justify-content-end align-items-start" style="gap:5px">
+          <Dropdown
+            v-for="(drop, k) in dropDownNames" :key="k" 
+            :selectedValue="dropDownValues[k]"
+            :options="drop.options" 
+            labelKey="name"
+            valueKey="id"
+            style="max-width: 150px"
+            @update:selectedValue="(v) => handleChangeDropDownValue(k, v)"
+          />
+          <SimpleInput v-if="showSearch" v-model="searchText" placeholder="请输入关键词" @enter="handleSearch">
+            <template #suffix>
+              <IconSearch
+                class="search-icon"
+                src="@/assets/images/news/IconSearch.png"
+                alt="搜索" 
+                @click="newsLoader.loadData(undefined, true)"
+              />
+            </template>
+          </SimpleInput>
+          <button class="tab-button" v-if="showTableSwitch" @click="tableListShow=!tableListShow">
+            ▼ 清单
+          </button>
         </div>
       </div>
-      <!-- 右栏 -->
-      <div class="col-sm-12 col-md-6 col-lg-6 d-flex flex-row justify-content-end align-items-start" style="gap:5px">
-        <Dropdown
-          v-for="(drop, k) in dropDownNames" :key="k" 
-          :selectedValue="dropDownValues[k]"
-          :options="drop.options" 
-          labelKey="name"
-          valueKey="id"
-          style="max-width: 150px"
-          @update:selectedValue="(v) => handleChangeDropDownValue(k, v)"
-        />
-        <SimpleInput v-if="showSearch" v-model="searchText" placeholder="请输入关键词" @enter="handleSearch">
-          <template #suffix>
-            <IconSearch
-              class="search-icon"
-              src="@/assets/images/news/IconSearch.png"
-              alt="搜索" 
-              @click="newsLoader.loadData(undefined, true)"
-            />
-          </template>
-        </SimpleInput>
-        <button class="tab-button" v-if="showTableSwitch" @click="tableListShow=!tableListShow">
-          ▼ 清单
-        </button>
-      </div>
     </div>
-  </div>
-  <div 
-    :class="[
-      'content', 
-      'news-list',
-      rowCount === 1 ? '' : 'grid',
-    ]"
-  >
-    <!-- 新闻列表 -->
-    <SimplePageContentLoader :loader="newsLoader">
-      <div v-if="tableListShow" class="table-list">
-        <table>
-          <thead>
-            <tr>
-              <th>序号</th>
-              <th>{{ tableSwitchOptions.title ?? '标题'}}</th>
-              <th v-for="(t, k) in newsLoader.list.value[0]?.addItems || []" :key="k">{{ t.name }}</th>
-            </tr>
-          </thead>
-          <tbody>
-            <tr v-for="(item, k) in newsLoader.list.value" :key="item.id">
-              <td>{{ (newsLoader.page.value - 1) * 100 + k + 1 }}</td>
-              <td>{{ item.title }}</td>
-              <td v-for="(t, k) in item.addItems || []" :key="k">{{ t.text }}</td>
-            </tr>
-          </tbody>
-        </table>
-      </div>
-      <div v-else class="list">
-        <div 
-          v-for="(item, k) in newsLoader.list.value"
-          :key="item.id"
-          :class="'item user-select-none main-clickable row-type'+rowType"
-          :style="{ width: rowWidth }"
-          @click="handleShowDetail(item)"
-        >
-          <a class="d-none" :href="router.resolve({ path: props.detailsPage, query: { id: item.id }}).href" />
-          <img
-            :src="item.image || defaultImage" alt="新闻图片" 
-          />
-          <TitleDescBlock
-            :title="item.title"
-            :desc="item.desc"
+    <div 
+      :class="[
+        'content', 
+        'news-list',
+        rowCount === 1 ? '' : 'grid',
+      ]"
+    >
+      <!-- 新闻列表 -->
+      <SimplePageContentLoader :loader="newsLoader">
+        <div v-if="tableListShow" class="table-list">
+          <table>
+            <thead>
+              <tr>
+                <th>序号</th>
+                <th>{{ tableSwitchOptions.title ?? '标题'}}</th>
+                <th v-for="(t, k) in newsLoader.list.value[0]?.addItems || []" :key="k">{{ t.name }}</th>
+              </tr>
+            </thead>
+            <tbody>
+              <tr v-for="(item, k) in newsLoader.list.value" :key="item.id">
+                <td>{{ (newsLoader.page.value - 1) * 100 + k + 1 }}</td>
+                <td>{{ item.title }}</td>
+                <td v-for="(t, k) in item.addItems || []" :key="k">{{ t.text }}</td>
+              </tr>
+            </tbody>
+          </table>
+        </div>
+        <div v-else class="list">
+          <div 
+            v-for="(item, k) in newsLoader.list.value"
+            :key="item.id"
+            :class="'item user-select-none main-clickable row-type'+rowType"
+            :style="{ width: rowWidth }"
+            @click="handleShowDetail(item)"
           >
-            <template #addon>
-              <div v-if="item.bottomTags" class="tags">
-                <div
-                  v-for="(tag, k) in item.bottomTags"
-                  :key="k"
-                  :class="tag ? '' : 'd-none'"
-                >{{ tag }}</div>
-              </div>
-              <div v-if="item.addItems" class="extra">
-                <div 
-                  v-for="(addItem, k) in item.addItems" 
-                  :key="k" 
-                  class="d-flex flex-row align-items-center"
-                  :class="[
-                    addItem.text ? '' : 'd-none',
-                  ]"
-                >
-                  <span class="desc">{{ addItem.name }}:</span>
-                  <span>{{ addItem.text }}</span>
+            <a class="d-none" :href="router.resolve({ path: props.detailsPage, query: { id: item.id }}).href" />
+            <img
+              :src="item.image || defaultImage" alt="新闻图片" 
+            />
+            <TitleDescBlock
+              :title="item.title"
+              :desc="item.desc"
+            >
+              <template #addon>
+                <div v-if="item.bottomTags" class="tags">
+                  <div
+                    v-for="(tag, k) in item.bottomTags"
+                    :key="k"
+                    :class="tag ? '' : 'd-none'"
+                  >{{ tag }}</div>
                 </div>
-              </div>
-            </template>
-          </TitleDescBlock>
+                <div v-if="item.addItems" class="extra">
+                  <div 
+                    v-for="(addItem, k) in item.addItems" 
+                    :key="k" 
+                    class="d-flex flex-row align-items-center"
+                    :class="[
+                      addItem.text ? '' : 'd-none',
+                    ]"
+                  >
+                    <span class="desc">{{ addItem.name }}:</span>
+                    <span>{{ addItem.text }}</span>
+                  </div>
+                </div>
+              </template>
+            </TitleDescBlock>
+          </div>
+          <div 
+            v-for="count of placeholderItemCount"
+            :key="count"
+            class="item empty"
+            :style="{ width: rowWidth }"
+          />
         </div>
-        <div 
-          v-for="count of placeholderItemCount"
-          :key="count"
-          class="item empty"
-          :style="{ width: rowWidth }"
-        />
-      </div>
-    </SimplePageContentLoader>
+      </SimplePageContentLoader>
+    </div>
+    <!-- 分页 -->
+    <Pagination
+      v-model:currentPage="newsLoader.page.value"
+      :totalPages="newsLoader.totalPages.value"
+    />
   </div>
-  <!-- 分页 -->
-  <Pagination
-    v-model:currentPage="newsLoader.page.value"
-    :totalPages="newsLoader.totalPages.value"
-  />
 </template>
 
 <script setup lang="ts">
@@ -160,6 +162,10 @@ const props = defineProps({
     type: String,
     default: '',
   },
+  show: {
+    type: Boolean,
+    default: true,
+  },
   showTableSwitch: {
     type: Boolean,
     default: false,
@@ -232,6 +238,10 @@ const props = defineProps({
     type: Function as PropType<(item: any) => void>,
     default: null,
   },
+  subName: {
+    type: String,
+    default: '',
+  },
   /**
    * 点击详情跳转页面路径
    */
@@ -306,7 +316,7 @@ const selectedTag = ref(props.defaultSelectTag);
 const pageSize = ref(props.pageSize);
 const route = useRoute();
 
-const newsLoader = await useSSrSimplePagerDataLoader(route.fullPath + '/list', Number(route.query.page || 1), pageSize, (page, size) => props.load(
+const newsLoader = await useSSrSimplePagerDataLoader(route.fullPath + '/list' + props.subName, Number(route.query.page || 1), pageSize, (page, size) => props.load(
   page, size, 
   selectedTag.value, 
   searchText.value,

+ 5 - 1
src/components/display/SimpleRichHtml.vue

@@ -1,5 +1,5 @@
 <template>
-  <div ref="scrollContainer" class="nana-rich-html-container">
+  <div v-show="show" ref="scrollContainer" class="nana-rich-html-container">
     <div class="rich-html">
       <slot name="prepend" />
       <template 
@@ -46,6 +46,10 @@ const props = defineProps({
     type: Boolean,
     default: false,
   },
+  show: {
+    type: Boolean,
+    default: true,
+  },
 })
 
 const id = CommonUtils.genNonDuplicateIDHEX(12);

+ 5 - 7
src/pages/details/TabDetailView.vue

@@ -34,7 +34,7 @@
             v-model:selectedTag="currentTabIndex"
           />
           <!-- 基础信息 -->
-          <div v-if="currentTabId==0">
+          <div v-show="currentTabId==0">
             <SimpleRichHtml 
               class="news-content"
               :contents="[
@@ -64,7 +64,7 @@
             </SimpleRichHtml>
           </div>
           <!-- 图片 -->
-          <div v-else-if="currentTabId==1">
+          <div v-show="currentTabId==1">
             <ImageGrid
               v-if="loader.content.value.images && loader.content.value.images.length > 0"
               :data="loader.content.value.images"
@@ -75,7 +75,7 @@
             <a-empty v-else />
           </div>
           <!-- 音频 -->
-          <div v-else-if="currentTabId==2">
+          <div v-show="currentTabId==2">
             <video 
               v-if="loader.content.value.video"
               class="news-video mt-3"
@@ -91,7 +91,7 @@
             <a-empty v-if="!loader.content.value.video && !loader.content.value.audio" />
           </div>
           <!-- 视频 -->
-          <div v-else-if="currentTabId==3">
+          <div v-show="currentTabId==3">
             <video 
               v-if="loader.content.value.video"
               class="news-video mt-3"
@@ -107,9 +107,7 @@
             <a-empty v-if="!loader.content.value.video && !loader.content.value.audio" />
           </div>
           <!-- 其他 -->
-          <div v-else>
-            <slot name="extraTab" :currentTabIndex="currentTabIndex" :currentTabId="currentTabId" :content="loader.content.value" />
-          </div>
+          <slot name="extraTab" :currentTabIndex="currentTabIndex" :currentTabId="currentTabId" :content="loader.content.value" />
 
           <ContentNode />
 

+ 3 - 9
src/pages/details/artifact.vue

@@ -42,15 +42,9 @@
         <!-- VR参观 -->
         <iframe :src="(content.vr as string)" style="width: 100%;height: 80vh"/>
       </template>
-      <template v-else-if="currentTabId==5">
-        <SimpleRichHtml :contents="[ content.protectedArea as string ]" /> 
-      </template>
-      <template v-else-if="currentTabId==6">
-        <SimpleRichHtml :contents="[ content.environment as string ]" /> 
-      </template>
-      <template v-else-if="currentTabId==7">
-        <SimpleRichHtml :contents="[ content.value as string ]" /> 
-      </template>
+      <SimpleRichHtml :show="currentTabId==5" :contents="[ content.protectedArea as string ]" /> 
+      <SimpleRichHtml :show="currentTabId==6" :contents="[ content.environment as string ]" /> 
+      <SimpleRichHtml :show="currentTabId==7" :contents="[ content.value as string ]" /> 
     </template>
   </TabDetailView>
 </template>

+ 53 - 53
src/pages/details/intangible.vue

@@ -34,58 +34,58 @@
       />
     </template>
     <template #extraTab="{ currentTabId, content }">
-      <template v-if="currentTabId==4">
-        <!-- 非遗产品(作品) -->
-        <CommonListBlock 
-          :showTotal="true"
-          :showSearch="false"
-          :load="(page: number, pageSize: number) => loadSubList(page, pageSize, content, 'worksMeList')"
-          detailsPage="/details/intangible"
-          :detailsParams="{
-            mainBodyColumnId: ProjectsContent.mainBodyColumnId,
-            modelId: ProjectsContent.modelId,
-          }"
-        />
-      </template>
-      <template v-else-if="currentTabId==5">
-        <!-- 非遗传习中心 -->
-        <CommonListBlock 
-          :showTotal="true"
-          :showSearch="false"
-          :load="(page: number, pageSize: number) => loadSubList(page, pageSize, content, 'ichSitesList')"
-          detailsPage="/details/intangible"
-          :detailsParams="{
-            mainBodyColumnId: ProjectsContent.mainBodyColumnId,
-            modelId: ProjectsContent.modelId,
-          }"
-        />
-      </template>
-      <template v-else-if="currentTabId==6">
-        <!-- 非遗传承人 -->
-        <CommonListBlock 
-          :showTotal="true"
-          :showSearch="false"
-          :load="(page: number, pageSize: number) => loadSubList(page, pageSize, content, 'inheritorsList')"
-          detailsPage="/details/intangible"
-          :detailsParams="{
-            mainBodyColumnId: ProjectsContent.mainBodyColumnId,
-            modelId: ProjectsContent.modelId,
-          }"
-        />
-      </template>
-      <template v-if="currentTabId==6">
-        <!-- 相关非遗 -->
-        <CommonListBlock 
-          :showTotal="true"
-          :showSearch="false"
-          :load="(page: number, pageSize: number) => loadSubList(page, pageSize, content, 'associationMeList')"
-          detailsPage="/details/intangible"
-          :detailsParams="{
-            mainBodyColumnId: ProjectsContent.mainBodyColumnId,
-            modelId: ProjectsContent.modelId,
-          }"
-        />
-      </template>
+      <!-- 非遗产品(作品) -->
+      <CommonListBlock 
+        subName="worksMeList"
+        :show="currentTabId==4"
+        :showTotal="true"
+        :showSearch="false"
+        :load="(page: number, pageSize: number) => loadSubList(page, pageSize, content, 'worksMeList')"
+        detailsPage="/details/intangible"
+        :detailsParams="{
+          mainBodyColumnId: ProjectsContent.mainBodyColumnId,
+          modelId: ProjectsContent.modelId,
+        }"
+      />
+      <!-- 非遗传习中心 -->
+      <CommonListBlock 
+        subName="ichSitesList"
+        :show="currentTabId==5"
+        :showTotal="true"
+        :showSearch="false"
+        :load="(page: number, pageSize: number) => loadSubList(page, pageSize, content, 'ichSitesList')"
+        detailsPage="/details/intangible"
+        :detailsParams="{
+          mainBodyColumnId: ProjectsContent.mainBodyColumnId,
+          modelId: ProjectsContent.modelId,
+        }"
+      />
+      <!-- 非遗传承人 -->
+      <CommonListBlock 
+        subName="inheritorsList"
+        :show="currentTabId==6"
+        :showTotal="true"
+        :showSearch="false"
+        :load="(page: number, pageSize: number) => loadSubList(page, pageSize, content, 'inheritorsList')"
+        detailsPage="/details/intangible"
+        :detailsParams="{
+          mainBodyColumnId: ProjectsContent.mainBodyColumnId,
+          modelId: ProjectsContent.modelId,
+        }"
+      />
+      <!-- 相关资讯 -->
+      <CommonListBlock 
+        subName="associationMeList"
+        :show="currentTabId==7"
+        :showTotal="true"
+        :showSearch="false"
+        :load="(page: number, pageSize: number) => loadSubList(page, pageSize, content, 'associationMeList')"
+        detailsPage="/details/intangible"
+        :detailsParams="{
+          mainBodyColumnId: ProjectsContent.mainBodyColumnId,
+          modelId: ProjectsContent.modelId,
+        }"
+      />
     </template>
   </TabDetailView>
 </template>
@@ -144,7 +144,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: 7, text: '相关非遗', visible: Boolean(d.associationMeList && (d.associationMeList as any[]).length > 0) },
+      { id: 7, text: '相关资讯', visible: Boolean(d.associationMeList && (d.associationMeList as any[]).length > 0) },
     ]
   };
   return d;

+ 1 - 1
src/pages/inheritor/moveable.vue

@@ -7,7 +7,7 @@
     :loadDetail="loadDetail"
     :tagsData="tagsData"
     :defaultSelectTag="tagsData[0].id"
-    detailsPage="/inheritor/artifact-detail"
+    detailsPage="/details/artifact"
   />
 </template>
 

+ 1 - 1
src/pages/inheritor/unmoveable.vue

@@ -9,7 +9,7 @@
     :loadDetail="loadDetail"
     :tagsData="tagsData"
     :defaultSelectTag="tagsData[0].id"
-    detailsPage="/inheritor/artifact-detail"
+    detailsPage="/details/artifact"
   />
 </template>