Bladeren bron

🐛 文物页细节修改

imengyu 1 maand geleden
bovenliggende
commit
c94d372469
2 gewijzigde bestanden met toevoegingen van 12 en 18 verwijderingen
  1. 1 0
      src/components/content/CommonListBlock.vue
  2. 11 18
      src/views/inheritor/moveable.vue

+ 1 - 0
src/components/content/CommonListBlock.vue

@@ -114,6 +114,7 @@ export interface DropdownCommonItem {
 }
 export interface DropDownNames {
   options: (string|DropdownCommonItem)[],
+  label?: string,
   defaultSelectedValue: number|string,
 }
 

+ 11 - 18
src/views/inheritor/moveable.vue

@@ -2,10 +2,8 @@
   <!-- 文化传承 - 可移动文物 -->
   <CommonListPage
     :title="'可移动文物'"
-    :prevPage="{ title: '保护传承' }"
     :dropDownNames="dropdownNames"
     :pageSize="8"
-    :rowType="2"
     :load="loadData"
     :loadDetail="loadDetail"
     :tagsData="tagsData"
@@ -15,17 +13,15 @@
 </template>
 
 <script setup lang="ts">
-import CommonContent, { GetContentListParams } from '@/api/CommonContent';
-import MoveableContent from '@/api/inheritor/MoveableContent';
-import type { DropDownNames } from '@/components/content/CommonListPage.vue';
+import { GetContentListParams } from '@/api/CommonContent';
 import { onMounted, ref } from 'vue';
+import MoveableContent from '@/api/inheritor/MoveableContent';
+import type { DropDownNames } from '@/components/content/CommonListBlock.vue';
 
 async function loadDetail(id: number, item: any) {
   const res = await MoveableContent.getContentDetail(id);
   res.addItems = [
-    { name: '地理位置', text: item.code, span: 12 },
-    { name: '建筑时间', text: item.ichTypeText, span: 12 },
-    { name: '保护级别', text: item.levelText, span: 12 },
+    { name: '保护级别', text: item.crTypeText || '未定级', span: 12 },
   ];
   return res;
 }
@@ -49,14 +45,9 @@ async function loadData(
     total: res.total,
     data: res.list.map((item, index) => {
       return {
-        id: item.id,
-        title: item.title ?? '!!title!!',
-        desc: item.desc,
-        image: item.image,
+        ...item,
         addItems: [
-          { name: '地理位置', text: item.code, span: 12 },
-          { name: '建筑时间', text: item.ichTypeText, span: 12 },
-          { name: '保护级别', text: item.declarationRegion, span: 12 },
+          { name: '保护级别', text: item.crTypeText || '未定级', span: 12 },
         ],
       };
     }),
@@ -71,7 +62,7 @@ const tagsData = ref([
 
 
 onMounted(async () => {
-  tagsData.value = tagsData.value.concat((await CommonContent.getCategoryList(3)).map((item) => ({
+  tagsData.value = tagsData.value.concat((await MoveableContent.getCategoryList(310)).map((item) => ({
     id: item.id,
     name: item.title,
   })));
@@ -79,20 +70,22 @@ onMounted(async () => {
     options: [{
       id: 0, 
       name: '全部'
-    }].concat((await CommonContent.getCategoryList(2)).map((item) => ({
+    }].concat((await MoveableContent.getCategoryList(2)).map((item) => ({
       id: item.id,
       name: item.title,
     }))),
+    label: '文物级别',
     defaultSelectedValue: 0,
   });
   dropdownNames.value.push({ 
     options: [{
       id: 0, 
       name: '全部'
-    }].concat((await CommonContent.getCategoryList(1)).map((item) => ({
+    }].concat((await MoveableContent.getCategoryList(1)).map((item) => ({
       id: item.id,
       name: item.title,
     }))),
+    label: '区域',
     defaultSelectedValue: 0,
   });
 })