快乐的梦鱼 пре 1 недеља
родитељ
комит
9b8c47271f

+ 13 - 3
src/pages/article/common/CommonListPage.vue

@@ -36,7 +36,7 @@
     >
       <template v-for="(drop, k) in dropDownNames" :key="k" >
         <SimpleDropDownPicker 
-          v-if="!drop.activeTab || drop.activeTab.includes(tabCurrentIndex)"
+          v-if="!drop.activeTab || drop.activeTab.includes(tabCurrentId)"
           :modelValue="dropDownValues[k]"
           :columns="drop.options"
           :style="{maxWidth: `${100/dropDownNames.length}%`}"
@@ -45,7 +45,7 @@
       </template>
       <view 
         v-if="(showTotal && dropDownVisibleCount < 3 && dropDownVisibleCount != 0)" 
-        class="d-flex flex-row align-center mt-3 size-s color-primary text-bold"
+        class="d-flex flex-row align-center pt-3 pb-3 size-s color-primary text-bold"
       >
         <text>总共有 {{ listLoader.total }} 个</text>
       </view>
@@ -154,8 +154,17 @@ function getItemClass(index: number) {
 }
 
 export interface DropDownNames {
+  /**
+   * 下拉框选项
+   */
   options: SimpleDropDownPickerItem[],
+  /**
+   * 默认选中值
+   */
   defaultSelectedValue: number|string,
+  /**
+   * 显示Tab的ID
+   */
   activeTab?: number[],
 }
 export interface CommonListItem extends Record<string, any>  {
@@ -281,7 +290,7 @@ const emit = defineEmits([ 'goCustomDetails' ])
 const dropDownVisibleCount = computed(() => {
   let c = 0;
   for (const element of props.dropDownNames) {
-    if (!element.activeTab || element.activeTab.includes(tabCurrentIndex.value))
+    if (!element.activeTab || element.activeTab.includes(tabCurrentId.value))
       c++;
   }
   return c;
@@ -297,6 +306,7 @@ const listLoader = useSimplePageListLoader(props.pageSize, async (page, pageSize
   )
 });
 const tabCurrentIndex = ref(0)
+const tabCurrentId = computed(() => props.tabs?.[tabCurrentIndex.value]?.id ?? -1)
 
 function handleChangeDropDownValue(index: number, value: number) {
   dropDownValues.value[index] = value;

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

@@ -61,7 +61,6 @@ onLoad(async (querys) => {
       id: item.id,
       name: item.title,
     }))),
-    activeTab: [0],
     defaultSelectedValue: querys?.level ?? 0,
   });
   console.log('level', querys?.level);

+ 30 - 12
src/pages/inhert/intangible/list.vue

@@ -49,23 +49,41 @@ async function loadData(
   tabSelect: number,
 ) {
   let api;
+  let res;
   switch (tabSelect) {
-    case 0: api = ProjectsContent; break;
+    case 0: 
+      res = (await ProjectsContent.getContentList(new GetContentListParams().setSelfValues({
+        ichType: dropDownValues[0] == 0 ? undefined: dropDownValues[0],
+        level: dropDownValues[1] == 0 ? undefined: dropDownValues[1],
+        region: dropDownValues[2] == 0 ? undefined: dropDownValues[2],
+        pid: 0,
+        keywords: searchText,
+      }), page, pageSize));
+      break;
     case 2: return {
       list: [],
       total: 0,
     };
     default:
-    case 1: api = ProductsContent; break;
-    case 3: api = SeminarContent; break;
-    case 4: api = UnitContent; break;
+    case 1: 
+      res = (await ProductsContent.getContentList(new GetContentListParams().setSelfValues({
+        level: dropDownValues[1] == 0 ? undefined: dropDownValues[1],
+        region: dropDownValues[2] == 0 ? undefined: dropDownValues[2],
+        keywords: searchText,
+      }), page, pageSize));
+    break;
+    case 3:
+      res = (await SeminarContent.getContentList(new GetContentListParams().setSelfValues({
+        region: dropDownValues[2] == 0 ? undefined: dropDownValues[2],
+        keywords: searchText,
+      }), page, pageSize));
+     break;
+    case 4: 
+      res = (await UnitContent.getContentList(new GetContentListParams().setSelfValues({
+        keywords: searchText,
+      }), page, pageSize));
+     break;
   }
-  const res = (await api.getContentList(new GetContentListParams().setSelfValues({
-    ichType: tabSelect !== 0 || dropDownValues[0] == 0 ? undefined: dropDownValues[0],
-    level: (tabSelect !== 0 && tabSelect !== 2) || dropDownValues[1] == 0 ? undefined: dropDownValues[1],
-    region: tabSelect !== 0 || dropDownValues[2] == 0 ? undefined: dropDownValues[2],
-    keywords: searchText,
-  }), page, pageSize));
 
   res.list.forEach((item) => {
     item.bottomTags = [
@@ -102,7 +120,7 @@ onLoad(async (querys) => {
       id: item.id,
       name: item.title,
     }))),
-    activeTab: [0,3],
+    activeTab: [0,2],
     defaultSelectedValue: querys?.level ?? 0,
   });
   dropdownNames.value.push({ 
@@ -113,7 +131,7 @@ onLoad(async (querys) => {
       id: item.id,
       name: item.title,
     }))),
-    activeTab: [0],
+    activeTab: [0,3],
     defaultSelectedValue: 0,
   });
   await waitTimeOut(800);

+ 0 - 1
src/pages/inhert/seminar/list.vue

@@ -61,7 +61,6 @@ onLoad(async (querys) => {
       id: item.id,
       name: item.title,
     }))),
-    activeTab: [0],
     defaultSelectedValue: querys?.level ?? 0,
   });
   dropdownNames.value.push({  

+ 1 - 0
src/pages/inhert/unit/list.vue

@@ -31,6 +31,7 @@ async function loadData(
     .setKeywords(searchText)
   , page, pageSize));
   res.list.forEach((p) => {
+    p.desc = '';
     p.bottomTags = [
       p.levelText, 
       p.ichTypeText, 

+ 2 - 2
src/pages/introduction/inhert.vue

@@ -156,7 +156,7 @@ const intangibleData = useSimpleDataLoader(async () =>
   }))
 );
 const inheritorData = useSimpleDataLoader(async () => 
-  (await InheritorContent.getContentList(new GetContentListParams(), 1, 4)).list.map(p => ({
+  (await InheritorContent.getContentList(new GetContentListParams(), 2, 4)).list.map(p => ({
     id: p.id,
     title: p.title, 
     desc: p.desc, 
@@ -173,7 +173,7 @@ const unitData = useSimpleDataLoader(async () =>
   (await UnitContent.getContentList(new GetContentListParams(), 1, 4)).list.map(p => ({
     id: p.id,
     title: p.title, 
-    desc: p.desc, 
+    desc: '', 
     image: p.thumbnail || p.image,
     bottomTags: [
       p.levelText, 

+ 1 - 1
src/pages/travel/fashion/list.vue

@@ -82,7 +82,7 @@ async function loadData(
     })
   , page, pageSize));
   res.list.forEach((p) => {
-    p.desc = p.ichName as string;
+    p.desc = `来源:${p.from}\n` + (p.desc || '');
     p.bottomTags = [
       p.levelText, 
       p.batchText,