Przeglądaj źródła

🎨 修改细节问题

快乐的梦鱼 1 miesiąc temu
rodzic
commit
f009a23a80

+ 5 - 2
src/api/CommonContent.ts

@@ -289,7 +289,10 @@ export class CategoryListItem extends DataModel<CategoryListItem> {
 
 export class CommonContentApi extends AppServerRequestModule<DataModel> {
 
-  constructor(mainBodyId = ApiCofig.mainBodyId, modelId = 0, debugName = 'CommonContent', mainBodyColumnId?: number) {
+  constructor(
+    mainBodyId = ApiCofig.mainBodyId, 
+    modelId = 0, debugName = 'CommonContent', 
+    mainBodyColumnId?: number|number[]) {
     super();
     this.modelId = modelId;
     this.mainBodyId = mainBodyId;
@@ -298,7 +301,7 @@ export class CommonContentApi extends AppServerRequestModule<DataModel> {
   }
 
   public mainBodyId: number;
-  public mainBodyColumnId?: number;
+  public mainBodyColumnId?: number|number[];
   public modelId: number;
   protected debugName: string;
 

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

@@ -3,7 +3,7 @@ import { CommonContentApi } from '../CommonContent';
 export class ProductsContentApi extends CommonContentApi {
 
   constructor() {
-    super(undefined, 16, "非遗保护名录-非遗产品(作品)");
+    super(undefined, 16, "非遗保护名录-非遗产品(作品)", [295,317]);
   }
 }
 

+ 3 - 0
src/common/components/SimpleDropDownPicker.vue

@@ -60,5 +60,8 @@ function confirm(e: { value: SimpleDropDownPickerItem[] }) {
   padding: 16rpx 18rpx;
   border-radius: 30rpx;
   background: #FFFFFF;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
 }
 </style>

+ 7 - 1
src/pages.json

@@ -79,7 +79,13 @@
     {
       "path": "pages/inhert/intangible/details",
       "style": {
-        "navigationBarTitleText": "非遗详情"
+        "navigationBarTitleText": "非遗项目详情"
+      }
+    },
+    {
+      "path": "pages/inhert/product/details",
+      "style": {
+        "navigationBarTitleText": "非遗作品详情"
       }
     },
     {

+ 10 - 1
src/pages/article/common/CommonListPage.vue

@@ -36,6 +36,7 @@
         clearButton="auto" 
         cancelButton="none"
         @confirm="doSearch"
+        @clear="doSearch"
       />
     </view>
     <!-- 下拉框 -->
@@ -51,6 +52,7 @@
           v-if="drop.activeTab == undefined || drop.activeTab == tab"
           :modelValue="dropDownValues[k]"
           :columns="drop.options" 
+          :style="{maxWidth: `${100/dropDownNames.length}%`}"
           @update:modelValue="(v) => handleChangeDropDownValue(k, v)"
         />
       </template>
@@ -226,7 +228,7 @@ const props = defineProps({
    * 点击详情跳转页面路径
    */
   detailsPage: {
-    type: String,
+    type: [String,Object],
     default: '/pages/article/details'
   },
   /**
@@ -272,6 +274,13 @@ function goDetails(item: any, id: number) {
     emit('goCustomDetails', item, id)
     return;
   }
+  if (typeof props.detailsPage == 'object') {
+    navTo(props.detailsPage[tab.value], { 
+      ...props.detailsPage.params, 
+      id 
+    })
+    return; 
+  }
   navTo(props.detailsPage, { 
     ...props.detailsParams,
     id

+ 1 - 1
src/pages/inhert.vue

@@ -65,7 +65,7 @@
               :image="item.image"
               :bottomLocate="item.bottomLocate"
               :bottomScore="item.bottomScore"
-              @click="navTo('inhert/intangible/details', { id: item.id })"
+              @click="navTo('inhert/product/details', { id: item.id })"
             />
           </view>
         </scroll-view>

+ 20 - 17
src/pages/inhert/artifact/list.vue

@@ -1,22 +1,25 @@
 <template>
   <view class="d-flex flex-column bg-base">
-    <u-tabs 
-      :list="tabs" 
-      lineWidth="30"
-      lineColor="#d9492e"
-      :activeStyle="{
-        color: '#000',
-        fontWeight: 'bold',
-        transform: 'scale(1.05)'
-      }"
-      :inactiveStyle="{
-        color: '#606266',
-        transform: 'scale(1)'
-      }"
-      :scrollable="false"
-      class="top-tab"
-      @click="(e: any) => tab = e.index"
-    />
+
+    <view class="top-tab">
+      <u-tabs 
+        :list="tabs" 
+        lineWidth="30"
+        lineColor="#d9492e"
+        :activeStyle="{
+          color: '#000',
+          fontWeight: 'bold',
+          transform: 'scale(1.05)'
+        }"
+        :inactiveStyle="{
+          color: '#606266',
+          transform: 'scale(1)'
+        }"
+        :scrollable="false"
+        class="top-tab"
+        @click="(e: any) => tab = e.index"
+      />
+    </view>
 
     <view class="d-flex flex-col p-2">
       <uni-search-bar 

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

@@ -28,6 +28,7 @@ async function loadData(
     ichType: dropDownValues[0] == 0 ? undefined: dropDownValues[0],
     level: dropDownValues[1] == 0 ? undefined: dropDownValues[1],
     region: dropDownValues[2] == 0 ? undefined: dropDownValues[2],
+    keywords: searchText,
   }), page, pageSize));
   res.list.forEach((p) => {
     p.desc = p.ichName as string;

+ 221 - 0
src/pages/inhert/intangible/DetailsCommon.vue

@@ -0,0 +1,221 @@
+<template>
+  <DetailTabPage
+    :load="load"
+    :extraTabs="[
+      {
+        id: 5,
+        name: '传习所',
+        visible: true,
+      },
+      {
+        id: 6,
+        name: '传承人',
+        visible: true,
+      },
+      {
+        id: 7,
+        name: `非遗${commonRefName}`,
+        visible: true,
+      },
+      {
+        id: 8,
+        name: '地理位置',
+        visible: true,
+      }
+    ]"
+  >
+    <template #extraTabs="{ content, tabCurrentId }">
+      <template v-if="tabCurrentId==5">
+        <!-- 非遗传习中心 -->
+        <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 v-else-if="tabCurrentId==6">
+        <!-- 非遗传承人 -->
+        <CommonListPage 
+          :showSearch="false"
+          :hasBg="false"
+          :load="(page: number, pageSize: number) => loadSubList(page, pageSize, content, 'inheritorsList')"
+          detailsPage="/pages/inhert/inheritor/details"
+          :detailsParams="{
+            mainBodyColumnId: InheritorContent.mainBodyColumnId,
+            modelId: InheritorContent.modelId,
+          }"
+        />
+      </template>
+      <template v-else-if="tabCurrentId==7">
+        <!-- 非遗产品(作品) -->
+        <CommonListPage 
+          :showSearch="false"
+          :hasBg="false"
+          :load="(page: number, pageSize: number) => loadSubList(page, pageSize, content, 'associationMeList')"
+          :detailsPage="`/pages/inhert/${commonRefTarget}/details`"
+          :detailsParams="{
+            mainBodyColumnId: ProductsContent.mainBodyColumnId,
+            modelId: ProductsContent.modelId,
+          }"
+        />
+      </template>
+      <template v-else-if="tabCurrentId==8">
+        <!-- 地理位置 -->
+        <view class="d-flex flex-col mt-3 mb-2">
+         <HomeTitle title="地理位置" />
+          <map id="map"
+            class="w-100 height-350 mt-3"
+            :latitude="content.latitude"
+            :longitude="content.longitude"
+            :markers="[
+              {
+                id: 1,
+                latitude: content.latitude,
+                longitude: content.longitude,
+                iconPath: ImagesUrls.IconMarker,
+                width: 40,
+                height: 40,
+              }
+            ]"
+            :scale="15"
+          />
+          <view class="d-flex flex-row justify-between bg-light radius-base p-2 mt-2">
+            <view>
+              <text class="iconfont icon-navigation"></text>
+              <text class="address">{{ content.address }}</text>
+            </view>
+            <view class="d-flex flex-row align-center" @click="navTo('/pages/travel/nav/navto', {
+              latitude: content.latitude,
+              longitude: content.longitude,
+            })">
+              <text class="color-orange">去这里</text>
+              <text class="iconfont icon-arrow-right"></text>
+            </view>
+          </view>
+        </view>
+      </template>
+    </template>
+    <template #titleEnd="{ content }">
+      <u-tag 
+        v-if="content.levelText"
+        :text="content.levelText"
+        size="mini" plain color="#d9492e"
+        class="flex-shrink-0"
+      />
+    </template>
+    <template #titleExtra="{ content }">
+      <view class="d-flex flex-col">
+        <IntroBlock 
+          small
+          :descItems="[
+            {
+              label: '地址',
+              value: content.address,
+            },
+            {
+              label: '项目级别',
+              value: content.levelText ,
+            },
+            {
+              label: '项目类别',
+              value: content.ichTypeText,
+            },
+            {
+              label: '批次时间',
+              value: content.batchText,
+            },
+            {
+              label: '所属区域',
+              value: content.regionText ,
+            },
+            {
+              label: '保护单位',
+              value: content.unit 
+            },
+          ]"
+        />
+      </view>
+    </template>
+  </DetailTabPage>
+</template>
+<script setup lang="ts">
+import DetailTabPage from "@/pages/article/common/DetailTabPage.vue";
+import ProjectsContent from "@/api/inheritor/ProjectsContent";
+import CommonListPage from "@/pages/article/common/CommonListPage.vue";
+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 ImagesUrls from "@/common/config/ImagesUrls";
+
+defineProps({	
+  commonRefName : {
+    type: String,
+    default: '',
+  },
+  commonRefTarget : {
+    type: String,
+    default: '',
+  },
+})
+
+async function load(id: number, tabsArray: Ref<TabControlItem[]>) {
+  const d = await ProjectsContent.getContentDetail(
+    id, 
+    undefined, 
+    querys.value.modelId > 0 ? querys.value.modelId : undefined
+  );
+  tabsArray.value[4].visible = Boolean(d.ichSitesList && (d.ichSitesList as any[]).length > 0);
+  tabsArray.value[5].visible = Boolean(d.inheritorsList && (d.inheritorsList as any[]).length > 0);
+  tabsArray.value[6].visible = Boolean(d.associationMeList && (d.associationMeList as any[]).length > 0);
+  tabsArray.value[7].visible = Boolean(d.longitude && d.latitude);
+  return d;
+}
+async function loadSubList(page: number, pageSize: number, content: any, subList: string) {
+  let list = (content[subList] as any[] || [])
+    .slice((page - 1) * pageSize, page * pageSize);
+
+  if (subList == 'associationMeList') {
+    list.filter((p) => p.modelId == ProjectsContent.modelId).forEach((p) => {
+      p.bottomTags = [
+        p.levelText,
+        p.ichTypeText,
+        p.batchText,
+      ];
+    })
+  } else if (subList == 'ichSitesList') {
+    list.forEach((p) => {
+      p.bottomTags = [
+        content.ichTypeText,
+      ];
+    })
+  } else if (subList == 'inheritorsList') {
+    list.forEach((p) => {
+      p.bottomTags = [
+        p.levelText,
+        p.nation,
+        content.ichTypeText,
+      ];
+    }) 
+  }
+  return {
+    list,
+    total: list.length,
+  }
+}
+
+const { querys } = useLoadQuerys({ modelId: 0 })
+</script>
+
+<style lang="scss">
+
+</style>

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

@@ -1,211 +1,7 @@
 <template>
-  <DetailTabPage
-    :load="load"
-    :extraTabs="[
-      {
-        id: 5,
-        name: '传习所',
-        visible: true,
-      },
-      {
-        id: 6,
-        name: '传承人',
-        visible: true,
-      },
-      {
-        id: 7,
-        name: '非遗作品',
-        visible: true,
-      },
-      {
-        id: 8,
-        name: '地理位置',
-        visible: true,
-      }
-    ]"
-  >
-    <template #extraTabs="{ content, tabCurrentId }">
-      <template v-if="tabCurrentId==5">
-        <!-- 非遗传习中心 -->
-        <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 v-else-if="tabCurrentId==6">
-        <!-- 非遗传承人 -->
-        <CommonListPage 
-          :showSearch="false"
-          :hasBg="false"
-          :load="(page: number, pageSize: number) => loadSubList(page, pageSize, content, 'inheritorsList')"
-          detailsPage="/pages/inhert/inheritor/details"
-          :detailsParams="{
-            mainBodyColumnId: InheritorContent.mainBodyColumnId,
-            modelId: InheritorContent.modelId,
-          }"
-        />
-      </template>
-      <template v-else-if="tabCurrentId==7">
-        <!-- 非遗产品(作品) -->
-        <CommonListPage 
-          :showSearch="false"
-          :hasBg="false"
-          :load="(page: number, pageSize: number) => loadSubList(page, pageSize, content, 'associationMeList')"
-          detailsPage="/pages/inhert/intangible/details"
-          :detailsParams="{
-            mainBodyColumnId: ProductsContent.mainBodyColumnId,
-            modelId: ProductsContent.modelId,
-          }"
-        />
-      </template>
-      <template v-else-if="tabCurrentId==8">
-        <!-- 地理位置 -->
-        <view class="d-flex flex-col mt-3 mb-2">
-         <HomeTitle title="地理位置" />
-          <map id="map"
-            class="w-100 height-350 mt-3"
-            :latitude="content.latitude"
-            :longitude="content.longitude"
-            :markers="[
-              {
-                id: 1,
-                latitude: content.latitude,
-                longitude: content.longitude,
-                iconPath: ImagesUrls.IconMarker,
-                width: 40,
-                height: 40,
-              }
-            ]"
-            :scale="15"
-          />
-          <view class="d-flex flex-row justify-between bg-light radius-base p-2 mt-2">
-            <view>
-              <text class="iconfont icon-navigation"></text>
-              <text class="address">{{ content.address }}</text>
-            </view>
-            <view class="d-flex flex-row align-center" @click="navTo('/pages/travel/nav/navto', {
-              latitude: content.latitude,
-              longitude: content.longitude,
-            })">
-              <text class="color-orange">去这里</text>
-              <text class="iconfont icon-arrow-right"></text>
-            </view>
-          </view>
-        </view>
-      </template>
-    </template>
-    <template #titleEnd="{ content }">
-      <u-tag 
-        v-if="content.levelText"
-        :text="content.levelText"
-        size="mini" plain color="#d9492e"
-        class="flex-shrink-0"
-      />
-    </template>
-    <template #titleExtra="{ content }">
-      <view class="d-flex flex-col">
-        <IntroBlock 
-          small
-          :descItems="[
-            {
-              label: '地址',
-              value: content.address,
-            },
-            {
-              label: '项目级别',
-              value: content.levelText ,
-            },
-            {
-              label: '项目类别',
-              value: content.ichTypeText,
-            },
-            {
-              label: '批次时间',
-              value: content.batchText,
-            },
-            {
-              label: '所属区域',
-              value: content.regionText ,
-            },
-            {
-              label: '保护单位',
-              value: content.unit 
-            },
-          ]"
-        />
-      </view>
-    </template>
-  </DetailTabPage>
+  <DetailsCommon commonRefName="作品" commonRefTarget="product" />
 </template>
-<script setup lang="ts">
-import DetailTabPage from "@/pages/article/common/DetailTabPage.vue";
-import ProjectsContent from "@/api/inheritor/ProjectsContent";
-import CommonListPage from "@/pages/article/common/CommonListPage.vue";
-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 ImagesUrls from "@/common/config/ImagesUrls";
-
-async function load(id: number, tabsArray: Ref<TabControlItem[]>) {
-  const d = await ProjectsContent.getContentDetail(
-    id, 
-    undefined, 
-    querys.value.modelId > 0 ? querys.value.modelId : undefined
-  );
-  tabsArray.value[4].visible = Boolean(d.ichSitesList && (d.ichSitesList as any[]).length > 0);
-  tabsArray.value[5].visible = Boolean(d.inheritorsList && (d.inheritorsList as any[]).length > 0);
-  tabsArray.value[6].visible = Boolean(d.associationMeList && (d.associationMeList as any[]).length > 0);
-  tabsArray.value[7].visible = Boolean(d.longitude && d.latitude);
-  return d;
-}
-async function loadSubList(page: number, pageSize: number, content: any, subList: string) {
-  let list = (content[subList] as any[] || [])
-    .slice((page - 1) * pageSize, page * pageSize);
-
-  if (subList == 'associationMeList') {
-    list.filter((p) => p.modelId == ProjectsContent.modelId).forEach((p) => {
-      p.bottomTags = [
-        p.levelText,
-        p.ichTypeText,
-        p.batchText,
-      ];
-    })
-  } else if (subList == 'ichSitesList') {
-    list.forEach((p) => {
-      p.bottomTags = [
-        content.levelText,
-        content.ichTypeText,
-      ];
-    })
-  } else if (subList == 'inheritorsList') {
-    list.forEach((p) => {
-      p.bottomTags = [
-        p.levelText,
-        p.nation,
-        content.ichTypeText,
-      ];
-    }) 
-  }
-  return {
-    list,
-    total: list.length,
-  }
-}
 
-const { querys } = useLoadQuerys({ modelId: 0 })
+<script setup lang="ts">
+import DetailsCommon from './DetailsCommon.vue';
 </script>
-
-<style lang="scss">
-
-</style>

+ 5 - 2
src/pages/inhert/intangible/list.vue

@@ -3,7 +3,10 @@
     title="非遗"
     itemType="image-large-2"
     showTotal
-    detailsPage="/pages/inhert/intangible/details"
+    :detailsPage="[
+      '/pages/inhert/intangible/details',
+      '/pages/inhert/product/details',
+    ]"
     :dropDownNames="dropdownNames"
     :tabs="[
       { id: 0, name: '非遗项目' },
@@ -43,7 +46,7 @@ async function loadData(
     ichType: tabSelect !== 0 || dropDownValues[0] == 0 ? undefined: dropDownValues[0],
     level: tabSelect !== 0 || dropDownValues[1] == 0 ? undefined: dropDownValues[1],
     region: tabSelect !== 0 || dropDownValues[2] == 0 ? undefined: dropDownValues[2],
-    keyword: searchText,
+    keywords: searchText,
   }), page, pageSize));
 
   res.list.forEach((item) => {

+ 2 - 0
src/pages/inhert/old/list.vue

@@ -29,7 +29,9 @@ async function loadData(
   const res = (await CommonContent.getContentList(new GetContentListParams()
     .setModelId(17)
     .setMainBodyColumnId(312)
+    .setKeywords(searchText)
     .setSelfValues({
+
     })
   , page, pageSize));
   res.list.forEach((p) => {

+ 7 - 0
src/pages/inhert/product/details.vue

@@ -0,0 +1,7 @@
+<template>
+  <DetailsCommon commonRefName="项目" commonRefTarget="intangible" />
+</template>
+
+<script setup lang="ts">
+import DetailsCommon from '../intangible/DetailsCommon.vue';
+</script>