浏览代码

feat:标讯收藏相关业务及数据模型

yangfeng 1 年之前
父节点
当前提交
41b0201287

+ 17 - 10
apps/bigmember_pc/src/assets/style/component/collect-tags-box.scss

@@ -5,7 +5,6 @@
   max-height: 360px;
   position: absolute;
   top: 0;
-  right: 0;
   width: 332px;
   padding: 20px 16px;
   background: #ffffff;
@@ -63,14 +62,15 @@
     background-color: #ececec;
   }
   .tag-close {
-    display: inline-block;
-    width: 16px;
-    height: 16px;
-    margin-left: 8px;
-    background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAEwSURBVHgB7ZWxDYMwEEXPER1NRmEFJggUiJpJQiahRhSECViBUdzQIYgdgYQIPnwXmkT+DcbY/s9n3wHg5PTPKoriejRGYB+rqrpP0xT1fR9mWSaBaO77fiuEeCZJ8gAqwGyez68dBWIxV83gbSJEboK47HXWda1DF626Ar2gTUi35lo6iqbxuwBxHEvP80JF3lEg9sxhjp5pDnoHdCSGYWjVDj4W3B4HZo4dHQpgC8E1twI4gtANrrk1AAYxP1nmJAAEArjmZIADiI5TsC5AlJRS5zWcJVIEDLd9LXIUrCNgSjVqsWIBYHnOqZhrHR6BTZGhVEwSAKXCcSHEGebfQBjvAKe8cv6iRgC1i4ZijkHotUxz0TtQlmWuFrpxKtxyHOM4Nmma5sAVJaednH5SLxmyS6JIrGjkAAAAAElFTkSuQmCC);
-    background-position: center 2px;
-    background-repeat: no-repeat;
-    background-size: contain;
+    // display: inline-block;
+    // width: 16px;
+    // height: 16px;
+    margin-left: 2px;
+    font-size: 16px;
+    // background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAEwSURBVHgB7ZWxDYMwEEXPER1NRmEFJggUiJpJQiahRhSECViBUdzQIYgdgYQIPnwXmkT+DcbY/s9n3wHg5PTPKoriejRGYB+rqrpP0xT1fR9mWSaBaO77fiuEeCZJ8gAqwGyez68dBWIxV83gbSJEboK47HXWda1DF626Ar2gTUi35lo6iqbxuwBxHEvP80JF3lEg9sxhjp5pDnoHdCSGYWjVDj4W3B4HZo4dHQpgC8E1twI4gtANrrk1AAYxP1nmJAAEArjmZIADiI5TsC5AlJRS5zWcJVIEDLd9LXIUrCNgSjVqsWIBYHnOqZhrHR6BTZGhVEwSAKXCcSHEGebfQBjvAKe8cv6iRgC1i4ZijkHotUxz0TtQlmWuFrpxKtxyHOM4Nmma5sAVJaednH5SLxmyS6JIrGjkAAAAAElFTkSuQmCC);
+    // background-position: center 2px;
+    // background-repeat: no-repeat;
+    // background-size: contain;
   }
   .tags-inputs {
     position: relative;
@@ -98,7 +98,7 @@
 
         .tag-label {
           display: inline-block;
-          padding: 5px 12px;
+          padding: 1px 6px 1px 8px;
           font-size: 14px;
           line-height: 1.2;
           margin: 5px;
@@ -108,6 +108,13 @@
           border-radius: 4px;
           background: #f5f6f7;
           color: #1d1d1d;
+          &:hover{
+            color: #2cb7ca;
+            border-color: #2cb7ca;
+            .tag-close{
+              color: #2cb7ca;
+            }
+          }
         }
       }
 

+ 4 - 1
apps/bigmember_pc/src/components/filter-items/CollectTagSelector.vue

@@ -119,7 +119,7 @@ export default {
   },
   computed: {
     calcTitle() {
-      return `标签管理 <em class="highlight-text">${this.tagsList.length}</em>`
+      return `标签管理 <em class="highlight-text">${this.drawerTags.length}</em>`
     },
     drawerTags() {
       return this.tagsList.filter(item => item.name !== '全部')
@@ -273,6 +273,9 @@ export default {
         color: #fff;
         border-color: #2abed1;
       }
+      &:first-child{
+        margin-left: 0;
+      }
     }
   }
   .manage-button{

+ 0 - 129
apps/bigmember_pc/src/views/collection/composables/constant/list-header-actions.js

@@ -1,129 +0,0 @@
-/**
- * ListHeaderActionItem类用于创建列表头部操作项。
- * @param {Object} config 配置对象,包含key, icon, label, badge等属性。
- */
-class ListHeaderActionItem {
-  constructor(config) {
-    this.key = config.key // 操作项的唯一标识
-    this.isActive = config.isActive || false // 是否激活状态
-    this.icon = config.icon || '' // 操作项的图标
-    this.label = config.label || '' // 操作项的标签文本
-    this.badge = config.badge || '' // 操作项的徽标文本(如未使用,则为空)
-  }
-}
-
-/**
- * 创建一个具有激活状态的列表头部操作项。
- * @param {Object} config 配置对象,用于创建操作项的初始状态。
- * @param {Object} activeConfig 激活状态下的配置对象,可选。
- * @returns {ListHeaderActionItem} 返回一个包含激活状态的操作项实例。
- */
-function createListHeaderActionItem(config, activeConfig = {}) {
-  const item = new ListHeaderActionItem(config)
-  item.active = new ListHeaderActionItem(
-    Object.assign({}, config, activeConfig) // 结合config和activeConfig创建激活状态的实例
-  )
-  return item
-}
-
-// 列表头部操作项集合
-const ListHeaderActions = {}
-
-/**
- * 安装列表头部操作项,初始化ListHeaderActions数组。
- * @returns {Array} 返回初始化后的ListHeaderActions数组。
- */
-function installListHeader() {
-  const list = []
-  // 精简列表操作项
-  list.push(
-    createListHeaderActionItem({
-      key: 'refined-list',
-      icon: 'icon-liebiao',
-      label: '精简列表',
-      isActive: true
-    })
-  )
-
-  // 详细列表操作项
-  list.push(
-    createListHeaderActionItem({
-      key: 'detailed-list',
-      icon: 'icon-xiangxiliebiao',
-      label: '详细列表',
-      badge: 'icon-have-vip'
-    })
-  )
-
-  // 表格操作项,带vip徽标
-  list.push(
-    createListHeaderActionItem({
-      key: 'table',
-      icon: 'icon-biaoge',
-      label: '表格'
-    })
-  )
-
-  // 数据导出操作项
-  list.push(
-    createListHeaderActionItem({
-      key: 'data-export',
-      icon: 'icon-shujudaochu',
-      label: '数据导出'
-    })
-  )
-
-  // 修改标签操作项
-  list.push(
-    createListHeaderActionItem({
-      key: 'edit-tags',
-      icon: 'icon-edit',
-      label: '修改标签'
-    })
-  )
-
-  // 取消操作项
-  list.push(
-    createListHeaderActionItem({
-      key: 'cancel-collect',
-      icon: 'icon-shoucang_weishoucang',
-      label: '取消收藏'
-    })
-  )
-
-  // 标讯收藏操作项
-  list.push(
-    createListHeaderActionItem({
-      key: 'collect-bid',
-      icon: 'icon-shoucang_weishoucang',
-      label: '标讯收藏'
-    })
-  )
-
-  // 分发操作项
-  list.push(
-    createListHeaderActionItem({
-      key: 'distribute-bid',
-      icon: 'icon-shoudongfenfa',
-      label: '分发'
-    })
-  )
-  // 收录操作项
-  list.push(
-    createListHeaderActionItem({
-      key: 'employ-bid',
-      icon: 'icon-a-Property1shoulu',
-      label: '收录'
-    })
-  )
-
-  list.forEach((item) => {
-    ListHeaderActions[item.key] = item
-  })
-}
-
-// 调用installListHeader安装列表头部操作项
-installListHeader()
-
-// 导出ListHeaderActions
-export { ListHeaderActions }

+ 0 - 9
apps/bigmember_pc/src/views/collection/constant/search-filters.js

@@ -5,7 +5,6 @@ import ContactSelector from '@/components/filter-items/ContactSelector.vue'
 import AmountRangeSelector from '@/components/filter-items/AmountRangeSelector.vue'
 import IndustrySelector from '@/components/filter-items/IndustrySelector.vue'
 import RegionSelector from '@/components/filter-items/RegionSelector'
-import SelectorWithBasePower from '@/components/filter-items/SelectorWithBasePower.vue'
 import CollectSearchInput from '@/components/filter-items/CollectSearchInput.vue'
 import InfoTypeSelector from '@/components/filter-items/InfoTypeDropdown.vue'
 import { dataCollectTagModel } from '../model/modules/data-collect-tag'
@@ -56,14 +55,6 @@ const moreFiltersNeedVipKeyList = [
 
 
 function createSearchBidBaseSchema(conf = {}) {
-  console.log(conf, 'conf')
-  const isLogin = conf.isLogin || false
-  const vipUser = conf.vipUser || false
-  const oldUser = conf.oldUser || false
-  const showVip = conf.showVip || false
-  const infoType = conf.infoType
-  const isInApp = conf.isInApp || false
-  const isVip = conf.isVip || false
   const tagsList = conf.tagsList || []
 
   const SearchBidBaseSchema = [

+ 47 - 21
apps/bigmember_pc/src/views/collection/index.vue

@@ -1,11 +1,12 @@
 <script setup>
-import { ref } from 'vue'
+import { onMounted, ref } from 'vue'
 import SearchFilter from '@/views/collection/components/search-filter.vue'
 import SearchList from '@/views/search/layout/search-list.vue'
 import SearchListTable from '@/views/search/bidding/components/search-list-table.vue'
 import ArticleItem from '@/components/article-item/ArticleItem.vue'
 import Empty from '@/components/common/Empty.vue'
 import CustomDialog from '@/components/dialog/Dialog.vue'
+import BidRenewDialog from '@/views/BidrenewalDialog/index.vue'
 // 导入业务模型
 import { useSearchBidModel, SearchBidModel } from './model/index'
 // 初始化模型
@@ -18,9 +19,6 @@ const {
   inInjectBI,
   isVip,
   isFree,
-  vt,
-  filterState,
-  inputKeywordsState,
   listState,
   activeItemStyleType,
   searchListProps,
@@ -42,15 +40,11 @@ const {
   vipDialogConf,
   closeVipDialog,
   onJoinBid,
+  BidrenewalDialogRef,
   onAddInfoOfBI,
   onSingleAddInfo,
-  timeSelectorText,
-  collectElementRef,
-  onFreeTaste,
-  interceptKeywords,
   getLabelQuery,
-  addLabelQuery,
-  deleteLabelQuery,
+  isDefaultParams
 } = SearchBidModel
 
 // 开通超级订阅
@@ -58,11 +52,12 @@ function toBuySvip () {
   window.open('/swordfish/page_big_pc/free/svip/buy?type=buy')
 }
 
-const {
-  show: showVipDialog,
-  text: vipDialogText,
-  type: vipDialogType
-} = vipDialogConf
+// 前往收藏
+function goCollect() {
+  location.href = '/jylab/supsearch/index.html?publishtime=thisyear'
+} 
+
+const { show: showVipDialog, text: vipDialogText, type: vipDialogType } = vipDialogConf
 
 // 列表-单条-配置
 const articleRef = ref({
@@ -74,9 +69,7 @@ const articleRef = ref({
   collect: !isInBI.value,
   push: false
 })
-doQuery()
-getLabelQuery()
-console.log(searchListProps, 'searchListProps')
+
 </script>
 <template>
   <div class="collection-page">
@@ -144,9 +137,12 @@ console.log(searchListProps, 'searchListProps')
         </template>
         <template #empty>
           <empty :mtb60="false"  images="jy-back.png">
-            <div class="hasNoData_tiptext">
-              <p>对不起,没有找到 <span class="highlight-text">{{ timeSelectorText }}</span> 相关匹配的信息,</p>
-              <p>修改时间范围或换个搜索词试试吧</p>
+            <div v-if="isDefaultParams" class="no-data-container">
+              <p>暂未收藏标讯</p>
+              <button class="collect-btn" @click="goCollect">前往收藏</button>
+            </div>
+            <div v-else class="no-data-container">
+              <p>暂无数据</p>
             </div>
           </empty>
         </template>
@@ -188,6 +184,20 @@ console.log(searchListProps, 'searchListProps')
         </div>
       </div>
     </div>
+     <!--数据导出提示框-->
+    <custom-dialog
+      @close="showDataExportDialog = false"
+      customClass="export-class-dialog"
+      width="388px"
+      :show-footer="false"
+      :show-close="true"
+      :visible="showDataExportDialog"
+    >
+      <export-tip
+        @setExport="setExport"
+        @checkBoxChange="exportDialogChange"
+      ></export-tip>
+    </custom-dialog>
     <CustomDialog
       title="开通超级订阅"
       customClass="open-vip-dialog"
@@ -202,6 +212,8 @@ console.log(searchListProps, 'searchListProps')
         <button class="action-button cancel" @click="closeVipDialog">取消</button>
       </template>
     </CustomDialog>
+    <!-- 参标更新状态弹窗 -->
+    <BidRenewDialog ref="BidrenewalDialogRef"></BidRenewDialog>
   </div>
 </template>
 
@@ -282,6 +294,20 @@ console.log(searchListProps, 'searchListProps')
       cursor: pointer;
     }
   }
+  .no-data-container{
+    padding-bottom: 40px;
+    text-align: center;
+    font-size: 16px;
+  }
+  .collect-btn{
+    width: 108px;
+    height: 30px;
+    margin-top: 24px;
+    background: #2ABED1;
+    color: #fff;
+    font-size: 14px;
+    border-radius: 4px
+  }
   ::v-deep{
     .search-header-container{
       border-bottom: 1px solid #ececec;

+ 20 - 73
apps/bigmember_pc/src/views/collection/model/base.js

@@ -1,15 +1,8 @@
-import { computed, reactive, ref, toRefs, onMounted,onBeforeMount, onBeforeUnmount, getCurrentInstance } from 'vue'
-import { without, throttle } from 'lodash'
+import { computed, reactive, ref, toRefs, onMounted, getCurrentInstance } from 'vue'
+import { without } from 'lodash'
 import { useStore } from '@/store'
 import { useRoute, useRouter } from 'vue-router/composables'
-import { MessageBox } from 'element-ui'
-import  {
-  FilterHistoryAjaxModelRestore,
-  FilterHistoryAjaxModel2ViewModel,
-  getParam,
-  openLinkInWorkspace,
-  InContainer
-} from '@/utils'
+import  { openLinkInWorkspace, InContainer } from '@/utils'
 import $bus from '@/utils/bus'
 // 筛选条件动态组件方法
 import { getCreateSearchSchema } from '@/views/collection/constant/index'
@@ -17,35 +10,26 @@ import { getCreateSearchSchema } from '@/views/collection/constant/index'
 import useQuickCollectBidModel from '@jy/data-models/modules/quick-collect-bid/model'
 // 扩展业务模型
 import { useSearchFilterModel } from './modules/filter'
-import { useSearchListHeaderActionsModel } from './modules/list-header-actions'
-// 数据导出业务
-import { dataExportActionsModel } from './modules/data-export-actions'
-// 标讯收藏业务
+// 标讯取消收藏业务
 import { dataCollectActionModel } from './modules/data-collect-actions'
-// 添加业务
-import { dataAddActionsModel } from './modules/data-add-actions'
 // 标签业务
 import { dataCollectTagModel } from './modules/data-collect-tag'
+// 添加业务
+import { dataAddActionsModel } from '@/views/search/bidding/model/modules/data-add-actions'
 // 参标业务
-import { joinBidActionsModel } from './modules/join-bid-actions'
+import { joinBidActionsModel } from '@/views/search/bidding/model/modules/join-bid-actions'
+// 数据导出业务
+import { dataExportActionsModel } from '@/views/search/bidding/model/modules/data-export-actions'
+import { useSearchListHeaderActionsModel } from '@/views/search/bidding/model/modules/list-header-actions'
 
 
 export default function () {
   const that = getCurrentInstance().proxy
 
-  const router = useRouter()
   // 是否是免费用户
   const isFree = computed(() => {
     return useStore().getters['user/isFree']
   })
-  // 企业管理员
-  const isEntAdmin = computed(() => {
-    return useStore().getters['user/isEntAdmin']
-  })
-  // 部门管理员
-  const isDepartmentAdmin = computed(() => {
-    return useStore().getters['user/isDepartmentAdmin']
-  })
   // 是否登录
   const isLogin = computed(() => {
     return useStore().getters['user/loginFlag']
@@ -79,6 +63,7 @@ export default function () {
   })
 
   onMounted(() => {
+    doQuery()
     window.addEventListener('scroll', watchScroll)
   })
 
@@ -102,12 +87,9 @@ export default function () {
     doToggleItemSelection,
     doToggleListSelection,
     doClearAllSelection,
-    doQuery: doRunQuery,
-    getLabelQuery,
-    tagsList
+    doQuery: doRunQuery
   } = APIModel
-  console.log(APIModel, 'APIModel')
- 
+
   /**
    * 筛选v-model数据
    */
@@ -178,7 +160,6 @@ export default function () {
     searchBidMoreVipSchema.value = SearchBidMoreSchema.value?.filter(
       (s) => s.vipMark
     )
-    console.log(searchBidMoreFreeSchema.value, searchBidMoreVipSchema.value, 'base')
 
 
     function doUpdateData(schema, type) {
@@ -321,18 +302,6 @@ export default function () {
         onClickCancelCollect($event)
         break
       }
-      // case 'collect-bid' : {
-      //   onClickDataCollect($event)
-      //   break
-      // }
-      // case 'distribute-bid': {
-      //   onClickDataDistribute()
-      //   break
-      // }
-      // case 'employ-bid' : {
-      //   onClickDataEmploy()
-      //   break
-      // }
     }
   }
   function detailListClick (key) {
@@ -488,10 +457,6 @@ export default function () {
     if(isLogin.value) {
       // 获取参标的数据
       getJoinBidInfo(listIds.value)
-      // BI 是否批量收录,获取收录数据
-      // if(inBIPropertyIframe || inResourceBIIframe) {
-      //   getEmployData(listIds.value)
-      // }
       // 个人报告嵌套BI页面
       if(inInjectBI) {
         getBidAddInfos()
@@ -612,9 +577,8 @@ export default function () {
   /*******数据导出 end ***********/
 
   /*******修改标签 start ***********/
-  const { onEditTags } = dataCollectTagModel({ that })
+  const { onEditTags, tagsList } = dataCollectTagModel({ that })
   function onClickEditTags(e) {
-    console.log('修改标签')
     const config = {
       total: listState.total,
       isSelectSomeCheckbox: isSelectSomeCheckbox.value,
@@ -654,27 +618,11 @@ export default function () {
   })
   /********* 标讯收藏部分end ********/
 
-  // 处理数据列表为空时,需要展示的提示文案包含时间
-  const timeSelectorText = computed(() => {
-    const publishTime = filterState.value.publishTime
-    const split = '_'
-    const { publishTimeText } = FilterHistoryAjaxModel2ViewModel.formatTime(publishTime, split)
-    let result = ''
-    if(publishTimeText) {
-      if(publishTimeText.includes('最')) {
-        result = publishTimeText.replace('最', '')
-      } else if(publishTimeText.includes('以后')){
-        result = publishTimeText.replace('以后', '')
-      }else if(publishTimeText.includes('以前')) {
-        result = publishTimeText.replace('以前', '')
-      } else {
-        result = publishTimeText
-      }
-    } else {
-      result = '近一年'
-    }
-
-    return result
+  // 处理数据列表为空时,区分未匹配到数据和暂无收藏两种情况(是否为默认参数)
+  const isDefaultParams = computed(() => {
+    const filterParams = getFormatOfFilter()
+    const isParams = Object.values(filterParams).every(el => el === '')
+    return isParams
   })
 
   /********参标start *********/
@@ -805,10 +753,9 @@ export default function () {
     onAddInfoOfBI,
     onSingleAddInfo,
     BidrenewalDialogRef,
-    timeSelectorText,
     collectElementRef,
     onFreeTaste,
-    getLabelQuery,
+    isDefaultParams,
     tagsList
   }
 }

+ 0 - 57
apps/bigmember_pc/src/views/collection/model/modules/data-add-actions.js

@@ -1,57 +0,0 @@
-import { ref } from 'vue'
-import { ajaxGetInfoIds, ajaxSetInfoId } from '@/api/modules/bi'
-import $bus from '@/utils/bus'
-import { difference } from 'lodash'
-import { showToast } from '@/components/toast'
-
-export function dataAddActionsModel () {
-  let hadAddList = []
-
-  // 获取已添加的信息id
-  async function getBidAddInfos () {
-    const { error_code: code, data } = await ajaxGetInfoIds()
-    if(code === 0) {
-      const ids = data || []
-      $bus.$emit('bidding:updateDataAddStatus', { type: 'add', ids })
-      hadAddList = hadAddList.concat(ids)
-    }
-  }
-  async function doAddInfoOfBI(objParams) {
-    const { item, ids } = objParams
-    // 已添加过不处理
-    if(item?.isAdd){
-      return
-    }
-    let infoIds = []
-    if(item) {
-      infoIds = [item.id]
-    }
-    if(ids) {
-      if (ids.length > 0) {
-        infoIds = difference(ids, hadAddList )
-      } else {
-        return showToast('尚未选择数据,请选择')
-      }
-
-    }
-    if(!infoIds.length) {
-      return showToast('所选数据均已添加过,请重新选择')
-    }
-    const params = {
-      info_id: infoIds.join(','),
-      source: 2
-    }
-    const { data, error_code: code } = await ajaxSetInfoId(params)
-    if (code === 0 && data?.status === 1) {
-      showToast('添加成功')
-      getBidAddInfos()
-    } else {
-      showToast('添加操作失败')
-    }
-  }
-
-  return {
-    getBidAddInfos,
-    doAddInfoOfBI
-  }
-}

+ 44 - 44
apps/bigmember_pc/src/views/collection/model/modules/data-collect-tag.js

@@ -1,16 +1,17 @@
-import { computed, onMounted, ref } from 'vue'
+import { computed, onMounted, ref, watch } from 'vue'
 import { useStore } from '@/store'
 import { getEventTarget } from '@/utils/jq-help'
 import $bus from '@/utils/bus'
 import { getBidCollTagList, saveBidCollAddTag, createBidTag } from '@/api/modules/'
 // API 业务模型
-import useQuickCollectBidModel from '@jy/data-models/modules/quick-collect-bid/model'
+import usePersonalTagsModel from '@jy/data-models/modules/quick-collect-bid/model/tags'
 // 解构基础业务
-const APIModel = useQuickCollectBidModel({})
+const APIModel = usePersonalTagsModel({})
 const {
   getLabelQuery,
   addLabelQuery,
-  deleteLabelQuery
+  deleteLabelQuery,
+  tagsList
 } = APIModel
 
 // 是否登录
@@ -23,6 +24,7 @@ export function dataCollectTagModel (params) {
   const bidInfo = ref([])
 
   onMounted(() => {
+    getLabelQuery()
     initCollectEvent()
   })
 
@@ -51,22 +53,11 @@ export function dataCollectTagModel (params) {
       binfo,
       event
     }
-    console.log(bidInfo, event, 'bidInfo')
     ajaxForEditTagsChange(reParams)
   }
 
-  async function getLabelFn() {
-    const { data } = await getLabelQuery()
-    console.log(data, 'getLabel')
-  }
-
   async function addLabelFn(name) {
-    const { success, data } = await addLabelQuery({ name: name })
-    if (success && data) {
-      getLabelQuery()
-    } else {
-      that.$toast(msg)
-    }
+    await addLabelQuery({ name: name })
   }
 
   async function deleteLabelFn(params) {
@@ -76,13 +67,13 @@ export function dataCollectTagModel (params) {
       lids: value,
       lname: name
     }
-    const { success, data, msg } = await deleteLabelQuery(formatParams)
-    if (success && data) {
-      that.$toast('标签已删除')
-      getLabelQuery()
-    } else {
-      that.$toast(msg)
-    }
+    await deleteLabelQuery(formatParams)
+    // const { success, data, msg } = await deleteLabelQuery(formatParams)
+    // if (success && data) {
+    //   this.$toast('标签已删除')
+    // } else {
+    //   that.$toast(msg)
+    // }
   }
 
   async function ajaxForEditTagsChange(reParams, callback) {
@@ -103,7 +94,7 @@ export function dataCollectTagModel (params) {
         left: left
       })
     bidInfo.value = binfo
-    window.getUserTags()
+    window.getUserTags(true)
   }
 
   // 处理收藏弹出的标签框
@@ -208,10 +199,10 @@ export function dataCollectTagModel (params) {
           '<span class="tag-label" data-index=' +
           i +
           ' data-id="' +
-          v.lid +
+          v.id +
           '">'
-        ht += '<em>' + v.lname + '</em>'
-        ht += '<i class="tag-close"></i>'
+        ht += '<em>' + v.name + '</em>'
+        ht += '<i class="iconfont icon-close tag-close"></i>'
         ht += '</span>'
       })
       $('.tag-labels')
@@ -236,14 +227,14 @@ export function dataCollectTagModel (params) {
             '<span class="tags-item" data-count=' +
             v.count +
             ' data-id=' +
-            v.lid +
+            v.id +
             '>' +
-            v.lanme +
+            v.name +
             '</span>'
         })
         $('.tags-list').html(ht)
         pushListActiveTags.forEach(function (s, j) {
-          $('.tags-list .tags-item[data-id="' + s.lid + '"]').addClass(
+          $('.tags-list .tags-item[data-id="' + s.id + '"]').addClass(
             'tags-active'
           )
         })
@@ -255,13 +246,13 @@ export function dataCollectTagModel (params) {
           $(this).toggleClass('tags-active')
           if ($(this).hasClass('tags-active')) {
             pushListActiveTags.push({
-              lid: id,
-              lname: name
+              id: id,
+              name: name
             })
             inputTagList()
           } else {
             var newArr = pushListActiveTags.filter(function (item) {
-              return item.lid != id
+              return item.id != id
             })
             pushListActiveTags = newArr
             inputTagList()
@@ -272,12 +263,19 @@ export function dataCollectTagModel (params) {
     }
 
     // 获取用户自定义标签
-    function getUserTags() {
-      getBidCollTagList().then((r) => {
-        if (r.error_code == 0 && Array.isArray(r.data)) {
-          renderTagsList(r.data.reverse())
-        }
-      })
+    function getUserTags(first = false) {
+      // getBidCollTagList().then((r) => {
+      //   if (r.error_code == 0 && Array.isArray(r.data)) {
+      //     renderTagsList(r.data.reverse())
+      //   }
+      // })
+      if (first) {
+        renderTagsList(tagsList.value)
+      } else {
+        getLabelQuery().then(res => {
+          renderTagsList(tagsList.value)
+        })
+      }
     }
 
     window.getUserTags = getUserTags
@@ -312,8 +310,8 @@ export function dataCollectTagModel (params) {
           // 添加标签成功后 绑定标签
           if (pushListActiveTags.length < 3) {
             pushListActiveTags.push({
-              lid: r.data,
-              lname: name
+              id: r.data,
+              name: name
             })
           }
           getUserTags()
@@ -336,7 +334,6 @@ export function dataCollectTagModel (params) {
       }
     }
 
-    // getUserTags()
   }
 
   //计算收藏标签框的位置数据
@@ -346,7 +343,7 @@ export function dataCollectTagModel (params) {
     const containerHeight = that.$el.clientHeight
     const cardWidth = 332
     const cardHeight = 362
-    var top = parseInt($(getEventTarget(e)).position().top) + 40
+    var top = parseInt($(getEventTarget(e)).position().top) + 42
     var left = parseInt($(getEventTarget(e)).offset().left) - 300
 
     if (top >= containerHeight - cardHeight) {
@@ -365,6 +362,9 @@ export function dataCollectTagModel (params) {
   }
 
   return {
-    onEditTags
+    onEditTags,
+    addLabelFn,
+    deleteLabelFn,
+    tagsList
   }
 }

+ 0 - 117
apps/bigmember_pc/src/views/collection/model/modules/data-export-actions.js

@@ -1,117 +0,0 @@
-import { computed, ref } from 'vue'
-import $bus from '@/utils/bus'
-import {
-  ajaxGetDontPromptAgain,
-  ajaxSetDontPromptAgain,
-  getPushListExport,
-  defaultSelectEnt,
-  searchIndexDataExport
-} from '@/api/modules/'
-
-import { useStore } from '@/store'
-import  { FilterHistoryViewModel2AjaxModel, openOuterLink } from '@/utils'
-
-// 是否登录
-const isLogin = computed(() => {
-  return useStore().getters['user/loginFlag']
-})
-
-export function dataExportActionsModel () {
-  const exportLoading = ref(false)
-  const showDataExportDialog = ref(false)
-
-  // 数据导出获取的筛选条件
-  const filterFormatParams = ref({})
-
-  async function dataExport (config) {
-    const { listState, selectCheckboxCount, selectIds, filter } = config
-    // 未登录跳转登录
-    if (!isLogin.value) {
-      $bus.$emit('bidding:goLogin')
-      return
-    }
-    if (!listState.total) return
-
-    filterFormatParams.value = FilterHistoryViewModel2AjaxModel.formatAll(filter)
-    exportLoading.value = true
-    // 查询是否需要弹窗
-    const { error_code: code, isPrompt } = await ajaxGetDontPromptAgain()
-    if(code === 0) {
-      exportLoading.value = false
-
-      let countBool = false
-      // 限制2000条提示弹窗
-      if(selectCheckboxCount > 0) {
-        countBool = selectCheckboxCount >= 20000
-      } else {
-        countBool = listState.total >= 20000
-      }
-      if (isPrompt && countBool) {
-        showDataExportDialog.value = isPrompt
-      } else {
-        toDataExportEvent(selectIds)
-      }
-    } else {
-      toDataExportEvent(selectIds)
-    }
-  }
-  // 根据条件获取到导出id, 并跳转到导出付费页
-  async function toDataExportEvent (selectIds) {
-    try {
-      // 判断是否选择过企业。未选择过调用 selectEnt 选择一个默认的企业
-      await defaultSelectEnt()
-      const { area, city, district } = FilterHistoryViewModel2AjaxModel.formatAreaCity(filterFormatParams.value.regionMap)
-      let searchGroup = filterFormatParams.value.searchGroup === 3 ? 1 : filterFormatParams.value.searchGroup
-      const dParams = {
-        scope: area, // 地区省份(数据导出接口用到)
-        area, // 地区省份(保存筛选接口用到)
-        city,
-        district,
-        ...filterFormatParams.value,
-        searchGroup
-      }
-      const params = Object.assign(dParams, {
-        selectIds: selectIds ? selectIds.join(',') : null
-      })
-      const { _id } = await searchIndexDataExport(params)
-      if (!_id) return
-      const link = `/front/dataExport/toCreateOrderPage/${_id}`
-      openOuterLink(link, true)
-    } catch (error) {
-    } finally {
-      exportLoading.value = false
-    }
-  }
-  // 超过2000条确认导出
-  function setExport () {
-    toDataExportEvent()
-  }
-  // 超过2000条是否在提示
-  async function  exportDialogChange(data) {
-    const params = {
-      status: data ? 1 : 0
-    }
-    const { error_code: code } = await ajaxSetDontPromptAgain(params)
-  }
-
-  //携带当前检索跳转数据导出支付页面
-  function toPayDataExport (config) {
-   const { listState, selectCheckboxCount, selectIds, filter } = config
-   filterFormatParams.value = FilterHistoryViewModel2AjaxModel.formatAll(filter)
-    // 未登录跳转登录
-    if (!isLogin.value) {
-      $bus.$emit('bidding:goLogin')
-      return
-    } else {
-      toDataExportEvent()
-    }
-  }
-
-  return {
-    dataExport,
-    setExport,
-    exportDialogChange,
-    showDataExportDialog,
-    toPayDataExport
-  }
-}

+ 1 - 2
apps/bigmember_pc/src/views/collection/model/modules/filter.js

@@ -38,9 +38,8 @@ export function useSearchFilterModel(conf) {
     return getFormatApiBaseParams()
  }
   // 格式化招标采购基础筛选条件
-  function getFormatApiBaseParams (expendObj = {}) {
+  function getFormatApiBaseParams () {
     const { selectTime, publishTime, regionMap, industry, buyerclass, subtype, _expand } = filterState.value
-    console.log(publishTime, filterState.value, 'publishTime')
     const { area, city, district } = FilterHistoryViewModel2AjaxModel.formatAreaCity(regionMap)
     const rPublishTime = publishTime?.indexOf('_') > -1 ? FilterHistoryViewModel2AjaxModel.formatExactTime(publishTime, '-') :  FilterHistoryViewModel2AjaxModel.formatTime(publishTime, true, '-')
     const rIndustry = FilterHistoryViewModel2AjaxModel.formatIndustry(industry)

+ 0 - 56
apps/bigmember_pc/src/views/collection/model/modules/join-bid-actions.js

@@ -1,56 +0,0 @@
-import { ref } from 'vue'
-import { getBidIsJoin, joinBidAction } from '@/api/modules/'
-import { showToast } from '@/components/toast'
-import $bus from '@/utils/bus'
-
-export function joinBidActionsModel () {
-  const  BidrenewalDialogRef = ref(null)
-
-  async function getJoinBidInfo(listIds) {
-      const ids = listIds.join()
-      const { error_code: code, data } = await getBidIsJoin({ ids })
-      if (code === 0 && data) {
-        $bus.$emit('bidding:updateListJoinStatus', {joinData: data})
-      }
-  }
-  // 参标
-  async function onJoinBid(item) {
-    // 终止参标
-    if (item.joinBid) {
-      showToast('如需终止参标,需要在详情页进行操作。')
-      return
-    }
-    // 参标
-    const params = {
-      bidIds: item.id
-    }
-    try {
-      const {
-        error_code: code,
-        error_msg: msg,
-        data
-      } = await joinBidAction('in', params)
-      if (code === 0 && data) {
-        // showToast.$toast('已参标,请前往我的参标项目列表查看。')
-        // 拉起参标更新弹窗
-        if(BidrenewalDialogRef.value) {
-          BidrenewalDialogRef.value.passVisible = true
-          BidrenewalDialogRef.value.setid(item.id)
-          BidrenewalDialogRef.value.refreshData()
-        }
-        $bus.$emit('bidding:updateListJoinStatus', { item })
-      } else if (code === -1) {
-        showToast.$toast(msg || '操作错误,请稍后重试')
-      }
-    } catch (e) {
-      console.warn(e)
-      showToast.$toast('操作错误,请稍后重试')
-    }
-  }
-
-  return {
-    BidrenewalDialogRef,
-    getJoinBidInfo,
-    onJoinBid
-  }
-}

+ 0 - 96
apps/bigmember_pc/src/views/collection/model/modules/list-header-actions.js

@@ -1,96 +0,0 @@
-import { computed, ref } from 'vue'
-import { ListHeaderActions } from '@/views/collection/composables/constant/list-header-actions'
-
-// 列表顶部操作按钮
-const actions = [
-  ['refined-list', 'detailed-list', 'table'],
-  ['data-export'],
-  ['edit-tags'],
-  ['cancel-collect']
-  // ['distribute-bid'],
-  // ['employ-bid']
-]
-
-// 列表 Item 样式风格切换,用于兼容旧参数
-const ItemStyleTypes = {
-  'refined-list': 'S',
-  'detailed-list': 'D',
-  table: 'T'
-}
-
-// 权限列表,过滤操作按钮权限
-const limitActions = ref({
-  'refined-list': false,
-  'detailed-list': false,
-  'table': false,
-  'data-export': false,
-  'edit-tags': false,
-  'cancel-collect': false
-  // 'collect-bid': false,
-  // 'distribute-bid': false,
-  // 'employ-bid': false
-})
-
-// 默认的风格样式
-const defaultItemStyleType = 'refined-list'
-
-export function useSearchListHeaderActionsModel() {
-  // 默认的风格样式
-  const listItemStyleType = ref(defaultItemStyleType)
-
-  // 当前激活的风格样式
-  const activeItemStyleType = computed(() => {
-    return ItemStyleTypes[listItemStyleType.value]
-  })
-
-  // 需要高亮 active 的顶部操作按钮
-  const activeHeaderActions = ref([defaultItemStyleType])
-
-  // 需要禁用的 disable 的顶部操作按钮
-  const disabledHeaderActions = ref([])
-
-  // 顶部操作按钮图标等配置填充
-  const headerActions = computed(() => {
-    if (actions.length > 0) {
-      // 过滤权限
-      const authActions = actions.map(acItem => {
-        if (Array.isArray(acItem)) {
-          const arr = acItem.filter(flagKey => {
-            return flagKey && limitActions.value[flagKey]
-          })
-          return  arr
-        }
-        return []
-      }).filter(item => {
-        return item.length > 0
-      })
-
-      // 变更actions状态字段
-      const updateAction =  authActions.map((actions) => {
-        if (Array.isArray(actions)) {
-          return actions.map((actionKey) => {
-            const result = ListHeaderActions[actionKey]
-            // 对应高亮上方 activeHeaderActions 中的按钮
-            result.isActive = activeHeaderActions.value.includes(actionKey)
-            // 禁用某指定操作
-            result.disabled = disabledHeaderActions.value.includes(actionKey)
-            return result
-          })
-        }
-        return []
-      })
-      return updateAction
-    } else {
-      return []
-    }
-  })
-
-  return {
-    headerActions,
-    listItemStyleType,
-    activeItemStyleType,
-    activeHeaderActions,
-    disabledHeaderActions,
-    limitActions
-  }
-}

+ 1 - 1
data/data-models/modules/quick-collect-bid/api/collect-api.js

@@ -16,7 +16,7 @@ export function ajaxCollectBidList(data) {
  */
 export function ajaxCollectTagsList() {
   return useRequest({
-    url: '/publicapply/bidcoll/getLabel',
+    url: `/publicapply/bidcoll/getLabel?t=${Date.now()}`,
     method: 'post'
   })
 }

+ 2 - 13
data/data-models/modules/quick-collect-bid/model/index.js

@@ -1,7 +1,7 @@
 import { ref, computed, toRefs, reactive } from 'vue'
 import { intersection, without } from 'lodash'
 import CollectBidListApi from '../plugins/collect-list'
-import CollectTagsApi from '../plugins/collect-tags'
+// import CollectTagsApi from '../plugins/collect-tags'
 
 function useQuickCollectBidModel({ params }) {
   const useApiModel = new CollectBidListApi(params)
@@ -64,13 +64,6 @@ function useQuickCollectBidModel({ params }) {
     selectIds.value = []
   }
 
-  /**
-   * 获取用户个人标签
-   */
-  const useTagsListApi = new CollectTagsApi()
-  const { getLabelQuery, addLabelQuery, deleteLabelQuery } = useTagsListApi
-  const { tagsList } = toRefs(reactive(useTagsListApi))
-
   return {
     list,
     total,
@@ -85,11 +78,7 @@ function useQuickCollectBidModel({ params }) {
     doToggleItemSelection,
     doToggleListSelection,
     doClearAllSelection,
-    doQuery,
-    getLabelQuery,
-    addLabelQuery,
-    deleteLabelQuery,
-    tagsList
+    doQuery
   }
 }
 

+ 17 - 0
data/data-models/modules/quick-collect-bid/model/tags.js

@@ -0,0 +1,17 @@
+import { toRefs, reactive } from 'vue'
+import CollectTagsApi from '../plugins/collect-tags'
+
+function usePersonalTagsModel({ params }) {
+  const useTagsListApi = new CollectTagsApi(params)
+  const { getLabelQuery, addLabelQuery, deleteLabelQuery } = useTagsListApi
+  const { tagsList } = toRefs(reactive(useTagsListApi))
+
+  return {
+    getLabelQuery,
+    addLabelQuery,
+    deleteLabelQuery,
+    tagsList
+  }
+}
+
+export default usePersonalTagsModel

+ 18 - 10
data/data-models/modules/quick-collect-bid/plugins/collect-tags.js

@@ -3,10 +3,10 @@ import { ajaxCollectTagsList, ajaxAddLabel, ajaxDeleteLabel } from '../api/colle
 
 class CollectTagsApi {
   constructor(config = {}) {
-    this.loading = false
-    this.finished = false
     this.tagsList = []
-    this.getLabelQuery = this.runQuery.bind(this)
+    this.getLabelQuery = this.getQuery.bind(this)
+    this.addLabelQuery = this.addQuery.bind(this)
+    this.deleteLabelQuery = this.deleteQuery.bind(this)
   }
 
   /**
@@ -14,9 +14,7 @@ class CollectTagsApi {
    * @returns {Promise<{success: boolean, tagsList: []}>}
    */
 
-  async runQuery() {
-    this.loading = true
-    this.finished = false
+  async getQuery() {
     this.tagsList = []
     const result = await this.ajaxQuery()
     if (result.success) {
@@ -30,8 +28,6 @@ class CollectTagsApi {
     } else {
       this.tagsList = []
     }
-    this.finished = true
-    this.loading = false
     return result
   }
 
@@ -49,11 +45,17 @@ class CollectTagsApi {
   /**
    * 添加用户标签
    */
-  async addLabelQuery(params) {
+  async addQuery(params, callback) {
     return ajaxAddLabel(params).then((res) => {
       let success = res?.error_code === 0
       let msg = res?.error_msg
 
+      if(success && res.data) {
+        // 更新取标签列表
+        this.getLabelQuery()
+        callback && callback()
+      }
+
       return {
         success: success,
         data: res.data,
@@ -65,11 +67,17 @@ class CollectTagsApi {
   /**
    * 删除用户标签
    */
-  async deleteLabelQuery(params) {
+  async deleteQuery(params, callback) {
     return ajaxDeleteLabel(params).then((res) => {
       let success = res?.error_code === 0
       let msg = res?.error_msg
 
+      if(success && res.data) {
+        // 更新取标签列表
+        this.getLabelQuery()
+        callback && callback()
+      }
+
       return {
         success: success,
         data: res.data,

+ 3 - 3
data/data-models/modules/quick-search-history/api/search-history.js

@@ -5,7 +5,7 @@ import qs from 'qs'
 // type: 1-标讯搜索历史记录  2-企业历史搜索 3-企业历史浏览 4-采购单位历史搜索 5-采购单位历史浏览
 export function ajaxGetSearchHistory(data) {
   return useRequest({
-    url: `/publicapply/history/get`,
+    url: '/publicapply/history/get',
     method: 'post',
     data: qs.stringify(data)
   })
@@ -15,7 +15,7 @@ export function ajaxGetSearchHistory(data) {
 // type: 1-标讯搜索历史记录  2-企业历史搜索 3-企业历史浏览 4-采购单位历史搜索 5-采购单位历史浏览
 export function ajaxClearSearchHistory(data) {
   return useRequest({
-    url: `/publicapply/history/del`,
+    url: '/publicapply/history/del',
     method: 'post',
     data: qs.stringify(data)
   })
@@ -24,7 +24,7 @@ export function ajaxClearSearchHistory(data) {
 // 保存浏览记录(企业画像、采购单位画像)
 export function ajaxSaveViewHistory(data) {
   return useRequest({
-    url: `/publicapply/history/savePortrait`,
+    url: '/publicapply/history/savePortrait',
     method: 'post',
     data: qs.stringify(data)
   })