Przeglądaj źródła

Merge branch 'dev/1.0.36_zsy' of jianyu/web into feature/v1.0.36

zhangsiya 1 rok temu
rodzic
commit
5adf99f2ec

+ 178 - 5
apps/bigmember_pc/src/assets/js/selector.js

@@ -68,7 +68,8 @@ export const cateListMapExp = {
 
 // 信息类型数据
 // 在[@/components/selector/InfoTypeSelectorCard.vue]中使用
-export const infoTypeListExp = [
+// 信息类型筛选数据拆分(仅超前项目:采购意向,拟建项目)
+export const infoTypeAdvancedList = [
   {
     name: '全部',
     value: '',
@@ -88,10 +89,20 @@ export const infoTypeListExp = [
     showHelp: true,
     level: 1,
     children: []
+  }
+]
+
+// 信息类型筛选数据拆分(移除超前项目)
+export const infoTypeNotAdvancedList = [
+  {
+    name: '全部',
+    value: '',
+    level: 0,
+    children: []
   },
   {
     name: '招标预告',
-    value: '',
+    value: '招标预告',
     level: 1,
     children: [
       {
@@ -123,7 +134,7 @@ export const infoTypeListExp = [
   },
   {
     name: '招标公告',
-    value: '',
+    value: '招标公告',
     level: 1,
     children: [
       {
@@ -170,7 +181,7 @@ export const infoTypeListExp = [
   },
   {
     name: '招标结果',
-    value: '',
+    value: '招标结果',
     level: 1,
     children: [
       {
@@ -197,7 +208,7 @@ export const infoTypeListExp = [
   },
   {
     name: '招标信用信息',
-    value: '',
+    value: '招标信用信息',
     level: 1,
     children: [
       {
@@ -219,6 +230,168 @@ export const infoTypeListExp = [
   }
 ]
 
+// 信息类型筛选数据(包含全部信息类型的完整数据)
+export const infoTypeListExp = (function () {
+  const arr = [...infoTypeAdvancedList]
+  infoTypeNotAdvancedList.forEach((item) => {
+    if (item.level !== 0 && item.value) {
+      arr.push(item)
+    }
+  })
+  return arr
+})()
+
+// export const infoTypeListExp = [
+//   {
+//     name: '全部',
+//     value: '',
+//     level: 0,
+//     children: []
+//   },
+//   {
+//     name: '拟建项目',
+//     value: '拟建',
+//     showHelp: true,
+//     level: 1,
+//     children: []
+//   },
+//   {
+//     name: '采购意向',
+//     value: '采购意向',
+//     showHelp: true,
+//     level: 1,
+//     children: []
+//   },
+//   {
+//     name: '招标预告',
+//     value: '',
+//     level: 1,
+//     children: [
+//       {
+//         name: '预告',
+//         value: '预告',
+//         level: 2
+//       },
+//       {
+//         name: '预审',
+//         value: '预审',
+//         level: 2
+//       },
+//       {
+//         name: '预审结果',
+//         value: '预审结果',
+//         level: 2
+//       },
+//       {
+//         name: '论证意见',
+//         value: '论证意见',
+//         level: 2
+//       },
+//       {
+//         name: '需求公示',
+//         value: '需求公示',
+//         level: 2
+//       }
+//     ]
+//   },
+//   {
+//     name: '招标公告',
+//     value: '',
+//     level: 1,
+//     children: [
+//       {
+//         name: '招标',
+//         value: '招标',
+//         level: 2
+//       },
+//       {
+//         name: '邀标',
+//         value: '邀标',
+//         level: 2
+//       },
+//       {
+//         name: '询价',
+//         value: '询价',
+//         level: 2
+//       },
+//       {
+//         name: '竞谈',
+//         value: '竞谈',
+//         level: 2
+//       },
+//       {
+//         name: '单一',
+//         value: '单一',
+//         level: 2
+//       },
+//       {
+//         name: '竞价',
+//         value: '竞价',
+//         level: 2
+//       },
+//       {
+//         name: '变更',
+//         value: '变更',
+//         level: 2
+//       }
+//       // {
+//       //   name: '其它',
+//       //   value: '其它',
+//       //   level: 2
+//       // }
+//     ]
+//   },
+//   {
+//     name: '招标结果',
+//     value: '',
+//     level: 1,
+//     children: [
+//       {
+//         name: '中标',
+//         value: '中标',
+//         level: 2
+//       },
+//       {
+//         name: '成交',
+//         value: '成交',
+//         level: 2
+//       },
+//       {
+//         name: '废标',
+//         value: '废标',
+//         level: 2
+//       },
+//       {
+//         name: '流标',
+//         value: '流标',
+//         level: 2
+//       }
+//     ]
+//   },
+//   {
+//     name: '招标信用信息',
+//     value: '',
+//     level: 1,
+//     children: [
+//       {
+//         name: '合同',
+//         value: '合同',
+//         level: 2
+//       },
+//       {
+//         name: '验收',
+//         value: '验收',
+//         level: 2
+//       },
+//       {
+//         name: '违规',
+//         value: '违规',
+//         level: 2
+//       }
+//     ]
+//   }
+// ]
+
 // 行业分类数据
 // 在[@/components/selector/IndustrySelectorCard.vue]中使用
 export const industryListMapExp = {

+ 17 - 53
apps/bigmember_pc/src/views/search/bidding/components/search-bid-filter.vue

@@ -1,72 +1,36 @@
 <script setup>
-import { ref, computed } from 'vue'
+import { ref, computed, watch } from 'vue'
 import { SearchBidModel } from '../model/index'
 import SearchSchemaFilter from '@/views/search/components/search-schema-filter.vue'
 import SelectorWithBasePower from '@/components/filter-items/SelectorWithBasePower.vue'
 import $bus from '@/utils/bus'
-import {
-  createSearchBidBaseSchema,
-  createSearchBidMoreSchema
-} from '@/views/search/bidding/constant/search-filters'
-
-import { getEntSearchPower } from '@/api/modules'
 
 const {
+  isVip,
   isLogin,
   isInApp,
   isInWeb,
+  activeTab,
   guideGoWorkSpace,
   filterState,
   doQuery,
   showFilter,
-  goLogin
+  goLogin,
+  disposeFilterSchema,
+  onChangeTab,
 } = SearchBidModel
 
+const  {
+  SearchBidBaseSchema,
+  SearchBidMoreSchema,
+  searchBidMoreFreeSchema,
+  searchBidMoreVipSchema
+} = disposeFilterSchema()
 
-// 是否是VIP
-const isVip = ref(false)
-// 是否是老用户
-const isOld = ref(false)
-
-const SearchBidBaseSchema = ref([])
-const SearchBidMoreSchema = ref([])
-
-const searchBidMoreFreeSchema = ref([])
-const searchBidMoreVipSchema = ref([])
-
-const conf = computed(() => {
-  return {
-    vipUser: isVip.value && isInApp.value,
-    oldUser: isOld.value && isInApp.value,
-    showVip: isLogin.value && isInApp.value
-  }
+watch(activeTab, (newVal) => {
+  disposeFilterSchema()
 })
 
-
-// 获取用户信息
-async function getUserPowerInfo () {
-  const { error_code: code, data } = await getEntSearchPower()
-  if (code === 0 && data) {
-    const { entniche, member, vip,  isOld: old } = data
-    isVip.value = entniche || member || vip > 0
-    isOld.value = old
-    disposeSchema()
-  }
-}
-if(isLogin.value) {
-  getUserPowerInfo()
-} else {
-  disposeSchema()
-}
-
-function disposeSchema () {
-  SearchBidBaseSchema.value =  createSearchBidBaseSchema(conf.value)
-  SearchBidMoreSchema.value =  createSearchBidMoreSchema()
-
-  searchBidMoreFreeSchema.value = SearchBidMoreSchema.value?.filter((s) => !s.vipMark)
-  searchBidMoreVipSchema.value = SearchBidMoreSchema.value?.filter((s) => s.vipMark)
-}
-
 const customMoreSchema = computed(() => {
   return {
     vipShow: true,
@@ -116,10 +80,10 @@ function doChangeFilter() {
       <!--  更多筛选  -->
       <div
         class="more-filters-container"
-        :class="{ 'wrap-line': !conf.vipUser }"
+        :class="{ 'wrap-line': !isVip }"
       >
         <search-schema-filter
-          v-if="conf.vipUser"
+          v-if="isVip && isInApp"
           v-model="filterState"
           :schema="SearchBidMoreSchema"
           :show-label="false"
@@ -137,7 +101,7 @@ function doChangeFilter() {
             :vipConf="customMoreSchema.vipConf"
             v-model="filterState"
             vipMask
-            :vipShow="isInApp && isLogin"
+            :vipShow="isInApp && isVip"
             @clickMask="noPower"
             @change="doChangeFilter"
           ></SelectorWithBasePower>

+ 20 - 1
apps/bigmember_pc/src/views/search/bidding/constant/search-filters.js

@@ -29,10 +29,28 @@ const moreFiltersNeedVipKeyList = [
   'buyer',
 ]
 
+// 处理当前信息类型--展示数据类型
+function infoTypeDataType (val) {
+  let result = 'all'
+  switch (val) {
+    case 0:
+      result = 'all'
+      break
+    case 1:
+      result = 'base'
+      break
+    case 2:
+      result = 'advance'
+      break
+  }
+  return result
+}
+
 function createSearchBidBaseSchema(conf = {}) {
   const vipUser = conf.vipUser || false
   const oldUser = conf.oldUser || false
   const showVip = conf.showVip || false
+  const infoType = infoTypeDataType(conf.infoType)
 
   // 发布时间
   const publishTimeExpandFree = {
@@ -115,7 +133,8 @@ function createSearchBidBaseSchema(conf = {}) {
         component: InfoTypeSelector,
         props: {
           showLabel: false,
-          selectorType: 'line'
+          selectorType: 'line',
+          showDataType: infoType
         },
         hooks: {}
       }

+ 51 - 2
apps/bigmember_pc/src/views/search/bidding/model/base.js

@@ -6,6 +6,8 @@ import { MessageBox } from 'element-ui'
 import { mixinVisited } from '@/utils/mixins/visited-setup.js'
 import  { FilterHistoryAjaxModelRestore, getParam, openLinkInWorkspace, InContainer} from '@/utils'
 import $bus from '@/utils/bus'
+// 筛选条件动态组件方法
+import { createSearchBidBaseSchema, createSearchBidMoreSchema } from '@/views/search/bidding/constant/search-filters'
 // API 业务模型
 import useQuickSearchModel from '@jy/data-models/modules/quick-search/model'
 // 扩展业务模型
@@ -28,6 +30,7 @@ import { dataEmployActionsModel } from './modules/data-employ-actions'
 // 添加业务
 import { dataAddActionsModel } from './modules/data-add-actions'
 
+
 export default function () {
   const that = getCurrentInstance().proxy
 
@@ -44,11 +47,25 @@ export default function () {
   const isDepartmentAdmin = computed(() => {
     return useStore().getters['user/isDepartmentAdmin']
   })
-
   // 是否登录
   const isLogin = computed(() => {
     return useStore().getters['user/loginFlag']
   })
+  // 用户权限
+  const userPowerInfo = computed(() => {
+    return useStore().getters['user/getInfo']
+  })
+  // 是否是vip
+  const isVip = computed (() => {
+    const { entniche, memberStatus, vipStatus } = userPowerInfo.value
+    return entniche || memberStatus > 0 || vipStatus > 0
+  })
+  // 是否是老用户
+  const isOld = computed (() => {
+    const { isOld } = userPowerInfo.value
+    return isOld
+  })
+
 
   // 是否在工作台内
   const isInApp = ref(InContainer.inApp)
@@ -78,7 +95,6 @@ export default function () {
     return inResourceBIIframe || inResourceBIIframe || inInjectBI
   })
 
-
   // 解构基础业务
   const APIModel = useQuickSearchModel({
     type: 'search-bid'
@@ -131,6 +147,36 @@ export default function () {
     doQuery()
   }
 
+  // 筛选条件动态配置处理
+  function disposeFilterSchema () {
+    const conf = ref({
+      vipUser: isVip.value && isInApp.value,
+      oldUser: isOld.value && isInApp.value,
+      showVip: isLogin.value && isInApp.value,
+      infoType: activeTab.value
+    })
+
+    // 标准筛选
+    const SearchBidBaseSchema = ref([])
+    const SearchBidMoreSchema = ref([])
+    // 更多筛选
+    const searchBidMoreFreeSchema = ref([])
+    const searchBidMoreVipSchema = ref([])
+
+    SearchBidBaseSchema.value =  createSearchBidBaseSchema(conf.value)
+    SearchBidMoreSchema.value =  createSearchBidMoreSchema()
+
+    searchBidMoreFreeSchema.value = SearchBidMoreSchema.value?.filter((s) => !s.vipMark)
+    searchBidMoreVipSchema.value = SearchBidMoreSchema.value?.filter((s) => s.vipMark)
+
+    return {
+      SearchBidBaseSchema,
+      SearchBidMoreSchema,
+      searchBidMoreFreeSchema,
+      searchBidMoreVipSchema
+    }
+  }
+
   // 列表状态
   const listState = reactive({
     finished,
@@ -888,6 +934,7 @@ export default function () {
     inBIPropertyIframe,
     inInjectBI,
     isInBI,
+    isVip,
     goLogin,
     guideGoWorkSpace,
     cooperateCode,
@@ -899,6 +946,7 @@ export default function () {
     filterState,
     listState,
     activeItemStyleType,
+    disposeFilterSchema,
     doQuery,
     doListHeaderAction,
     doChangeAllSelect,
@@ -906,6 +954,7 @@ export default function () {
     doChangePageNum,
     doChangePageSize,
     onChangeTab,
+    activeTab,
     vipDialogConf,
     closeVipDialog,
     onSaveFilter, // 以下存筛选条件相关