Procházet zdrojové kódy

🎨 修改细节问题

快乐的梦鱼 před 1 měsícem
rodič
revize
2f3b27b2a9

+ 1 - 1
src/api/CommonContent.ts

@@ -215,7 +215,7 @@ export class GetContentDetailItem extends DataModel<GetContentDetailItem> {
           clientSide: 'date',
           serverSide: 'string',
         };
-      if (key.endsWith('List')) {
+      else if (key.endsWith('List')) {
         return [
           { clientSide: 'map', serverSide: 'original'},
           { clientSide: 'array', clientSideChildDataModel: GetContentDetailItem, serverSide: 'original' },

+ 1 - 1
src/api/inheritor/ProjectsContent.ts

@@ -3,7 +3,7 @@ import { CommonContentApi } from '../CommonContent';
 export class ProjectsContentApi extends CommonContentApi {
 
   constructor() {
-    super(undefined, 2, "非遗保护名录-非遗代表性项目", 258);
+    super(undefined, 2, "非遗保护名录-非遗代表性项目");
   }
 }
 

+ 0 - 4
src/common/composeabe/SimplePageListLoader.ts

@@ -43,10 +43,6 @@ export function useSimplePageListLoader<T, P = any>(
       const res = (await loader(page.value, pageSize, lastParams));
       list.value = list.value.concat(res.list as T[]);
       total.value = res.total;
-
-      if (!(res.list instanceof Array))
-        throw new Error('list is not array!');
-
       loadStatus.value = res.list.length > 0 ? 'finished' : 'nomore';
       loadError.value = '';
       loading = false;

+ 5 - 0
src/common/scss/common.scss

@@ -34,6 +34,11 @@
   }
 }
 
+.top-tab {
+  position: sticky;
+  top: -2px;
+  z-index: 10;
+}
 
 //Fix
 

+ 21 - 20
src/pages/article/common/CommonListPage.vue

@@ -6,25 +6,26 @@
       hasBg ? 'bg-base p-3' : ''
     ]"
   >
-    <u-tabs 
-      v-if="tabs"
-      :list="tabs" 
-      :current="tab"
-      lineWidth="30"
-      lineColor="#d9492e"
-      :activeStyle="{
-        color: '#000',
-        fontWeight: 'bold',
-        transform: 'scale(1.05)'
-      }"
-      :inactiveStyle="{
-        color: '#606266',
-        transform: 'scale(1)'
-      }"
-      :scrollable="tabs && tabs.length > 5"
-      class="top-tab"
-      @click="handleTabClick"
-    />
+    <view class="top-tab bg-base">
+      <u-tabs 
+        v-if="tabs"
+        :list="tabs" 
+        :current="tab"
+        lineWidth="30"
+        lineColor="#d9492e"
+        :activeStyle="{
+          color: '#000',
+          fontWeight: 'bold',
+          transform: 'scale(1.05)'
+        }"
+        :inactiveStyle="{
+          color: '#606266',
+          transform: 'scale(1)'
+        }"
+        :scrollable="tabs && tabs.length > 5" 
+        @click="handleTabClick"
+      />
+    </view>
     <!-- 搜索 -->
     <view v-if="showSearch" class="d-flex flex-col">
       <uni-search-bar 
@@ -48,7 +49,7 @@
       <template v-for="(drop, k) in dropDownNames" :key="k" >
         <SimpleDropDownPicker 
           v-if="drop.activeTab == undefined || drop.activeTab == tab"
-          :modelValue="dropDownValues[k] || drop.defaultSelectedValue"
+          :modelValue="dropDownValues[k]"
           :columns="drop.options" 
           @update:modelValue="(v) => handleChangeDropDownValue(k, v)"
         />

+ 21 - 1
src/pages/inhert/inheritor/details.vue

@@ -11,6 +11,11 @@
         id: 6,
         name: '非遗项目',
         visible: true,
+      },
+      {
+        id: 7,
+        name: '传习所',
+        visible: true,
       }
     ]"
     :showHead="false"
@@ -33,6 +38,19 @@
           }"
         />
       </template>
+      <template v-else-if="tabCurrentId==6">
+        <!-- 传习所 -->
+        <CommonListPage 
+          :showSearch="false"
+          :hasBg="false"
+          :load="(page: number, pageSize: number) => loadSubList(page, pageSize, content, 'ichSitesList')"
+          detailsPage="/pages/inhert/intangible/details"
+          :detailsParams="{
+            mainBodyColumnId: SeminarContent.mainBodyColumnId,
+            modelId: SeminarContent.modelId,
+          }"
+        />
+      </template>
     </template>
     <template #title="{ content }">
       <view class="d-flex flex-col">
@@ -86,7 +104,7 @@
           }, 
           {
             label: '传承人级别',
-            value: content.levelLext || '暂无',
+            value: content.levelText || '暂无',
           }, 
           {
             label: '公布批次',
@@ -102,6 +120,7 @@ import type { TabControlItem } from "@/common/composeabe/TabControl";
 import type { Ref } from "vue";
 import RoundTags from "@/pages/parts/RoundTags.vue";
 import commonParserStyle from "@/common/style/commonParserStyle";
+import SeminarContent from "@/api/inheritor/SeminarContent";
 import InheritorContent from "@/api/inheritor/InheritorContent";
 import ProjectsContent from "@/api/inheritor/ProjectsContent";
 import IntroBlock from "@/pages/article/common/IntroBlock.vue";
@@ -112,6 +131,7 @@ async function load(id: number, tabsArray: Ref<TabControlItem[]>) {
   const d = await InheritorContent.getContentDetail(id);
   tabsArray.value[4].visible = Boolean(d.prize);
   tabsArray.value[5].visible = Boolean(d.associationMeList && d.associationMeList.length > 0);
+  tabsArray.value[6].visible = Boolean(d.ichSitesList && (d.ichSitesList as any[]).length > 0);
   return d;
 }
 async function loadSubList(page: number, pageSize: number, content: any, subList: string) {

+ 1 - 1
src/pages/inhert/inheritor/list.vue

@@ -26,7 +26,7 @@ async function loadData(
 ) {
   const res = (await InheritorContent.getContentList(new GetContentListParams().setSelfValues({
     ichType: dropDownValues[0] == 0 ? undefined: dropDownValues[0],
-    ichLevel: dropDownValues[1] == 0 ? undefined: dropDownValues[1],
+    level: dropDownValues[1] == 0 ? undefined: dropDownValues[1],
     region: dropDownValues[2] == 0 ? undefined: dropDownValues[2],
   }), page, pageSize));
   res.list.forEach((p) => {

+ 3 - 3
src/pages/inhert/intangible/details.vue

@@ -151,10 +151,10 @@ import IntroBlock from "@/pages/article/common/IntroBlock.vue";
 import { useLoadQuerys } from "@/common/composeabe/LoadQuerys";
 import type { TabControlItem } from "@/common/composeabe/TabControl";
 import type { Ref } from "vue";
+import { navTo } from "@/common/utils/PageAction";
 import InheritorContent from "@/api/inheritor/InheritorContent";
 import ProductsContent from "@/api/inheritor/ProductsContent";
 import SeminarContent from "@/api/inheritor/SeminarContent";
-import { navTo } from "@/common/utils/PageAction";
 import ImagesUrls from "@/common/config/ImagesUrls";
 
 async function load(id: number, tabsArray: Ref<TabControlItem[]>) {
@@ -170,11 +170,11 @@ async function load(id: number, tabsArray: Ref<TabControlItem[]>) {
   return d;
 }
 async function loadSubList(page: number, pageSize: number, content: any, subList: string) {
-  const list = (content[subList] as any[] || [])
+  let list = (content[subList] as any[] || [])
     .slice((page - 1) * pageSize, page * pageSize);
 
   if (subList == 'associationMeList') {
-    list.forEach((p) => {
+    list.filter((p) => p.modelId == ProjectsContent.modelId).forEach((p) => {
       p.bottomTags = [
         p.levelText,
         p.ichTypeText,

+ 1 - 1
src/pages/inhert/village/details.vue

@@ -31,7 +31,7 @@
             :descItems="[
               {
                 label: '保护级别',
-                value: data.historyLevelRext ,
+                value: data.historyLevelText ,
               },
               {
                 label: '非遗级别',

+ 1 - 1
src/pages/inhert/village/list.vue

@@ -32,7 +32,7 @@ async function loadData(
     p.bottomTags = [
       p.levelText, 
       p.batchText,
-      p.historyLevel,
+      p.historyLevelText,
     ];
   })
   return { list: list, total: list.length }

+ 3 - 2
src/pages/introduction/character.vue

@@ -4,6 +4,7 @@
     :title="'历史人物'"
     :dropDownNames="[]"
     itemType="article-character"
+    showTotal
     detailsPage="/pages/inhert/inheritor/details"
     :load="loadData"
   />
@@ -12,7 +13,7 @@
 <script setup lang="ts">
 import { GetContentListParams } from '@/api/CommonContent';
 import CharacterContentApi from '@/api/introduction/CharacterContent';
-import CommonListPage, { type DropDownNames } from '@/pages/article/common/CommonListPage.vue';
+import CommonListPage from '@/pages/article/common/CommonListPage.vue';
 
 async function loadData(
   page: number, 
@@ -24,7 +25,7 @@ async function loadData(
     .getContentList(new GetContentListParams().setSelfValues({
       keywords: searchText,
     }), page, pageSize)
-  ).list;
+  );
 }
 </script>