Explorar o código

feat: 跳转工作台处理

zhangsiya hai 1 ano
pai
achega
dad67cafbe

+ 8 - 5
apps/bigmember_pc/src/views/search/bidding/components/search-bid-filter.vue

@@ -12,12 +12,14 @@ import {
 import { getEntSearchPower } from '@/api/modules'
 
 const {
-  goLogin,
   isLogin,
   isInApp,
+  isInWeb,
+  guideGoWorkSpace,
   filterState,
   doQuery,
-  showFilter
+  showFilter,
+  goLogin
 } = SearchBidModel
 
 
@@ -91,15 +93,16 @@ function doChangeFilter() {
   doQuery()
 }
 
+
 </script>
 
 <template>
-  <el-collapse-transition >
+  <el-collapse-transition>
     <div class="search-bid-filter" v-show="showFilter">
-      <div class="guide-go-workspace">
+      <div class="guide-go-workspace" v-if="isInWeb">
         最近五年数据查询以及更多筛选条件请
         <span class="highlight-text">"</span>
-        <span class="cursor-button highlight-text" @click="goLogin">{{ isLogin ? '' : '登录后' }}进入工作台</span>
+        <span class="cursor-button highlight-text" @click="guideGoWorkSpace">{{ isLogin ? '' : '登录后' }}进入工作台</span>
         <span class="highlight-text">"</span>
         检索
       </div>

+ 57 - 27
apps/bigmember_pc/src/views/search/bidding/model/base.js

@@ -52,6 +52,7 @@ export default function () {
 
   // 是否在工作台内
   const isInApp = ref(InContainer.inApp)
+  const isInWeb = ref(InContainer.inWeb)
 
   // 是否是渠道商
   const cooperateCode = ref(false)
@@ -454,6 +455,18 @@ export default function () {
     showFilter.value = !showFilter.value
   }
 
+  // 组合好的筛选条件
+  function packageFilter () {
+    const originParams = Object.assign(
+      {
+        searchGroup: activeTab.value,
+      },
+      filterState.value,
+      inputKeywordsState.value
+    )
+    return originParams
+  }
+
   /******开通超级订阅弹窗start**********/
 
   // 开通超级订阅弹窗配置
@@ -496,16 +509,33 @@ export default function () {
   }
   // 跳转到工作台
   function goWorkSpace () {
-    var formNode_ = $('#zbSeatchT')
-    var goHref_ = location.origin + '/jylab/supsearch/index.html'
-    window.location.replace('/swordfish/page_big_pc/search/bidding')
-    // if(getParam('tab') === '2') {
-    //   // 超前项目查询
-    //   window.location.replace('/page_workDesktop/work-bench/page?link=' + encodeURIComponent(goHref_ + '?goback&tab=2&' + formNode_.serialize()))
-    // } else {
-    //   window.location.replace('/page_workDesktop/work-bench/page?link=' + encodeURIComponent(goHref_ + '?goback&' + formNode_.serialize()))
-    // }
-  }
+    const goHref_ = location.origin + '/jylab/supsearch/index.html'
+    // 组件筛选条件
+    const originParams = packageFilter()
+    sessionStorage.setItem('search:bidding:filter', JSON.stringify(originParams))
+    window.location.replace(location.origin + '/swordfish/page_big_pc/search/bidding?goback=true')
+
+    // window.location.replace(`/page_workDesktop/work-bench/page?link=${encodeURIComponent(goHref_ + 'goback=')}`)
+  }
+
+  // onMounted(() => {
+  //   if(useRoute().query.goback) {
+  //     goBackFilter()
+  //   }
+  // })
+  //
+  // // 回显
+  // function goBackFilter () {
+  //   const sFilter = sessionStorage.getItem('search:bidding:filter')
+  //   const backFilter = sFilter ? JSON.parse(sFilter) : null
+  //   if(backFilter) {
+  //     that.$nextTick(() => {
+  //       restoreFilter(backFilter, 'pageBack')
+  //       sessionStorage.removeItem('search:bidding:filter')
+  //     })
+  //   }
+  // }
+
 
 
   /** 保存、重置筛选条件部分 start ****/
@@ -525,13 +555,7 @@ export default function () {
    * 保存筛选条件
    */
   async function onSaveFilter() {
-    const originParams = Object.assign(
-      {
-        searchGroup: activeTab.value,
-      },
-      filterState.value,
-      inputKeywordsState.value
-    )
+    const originParams = packageFilter()
     const config = { filter: originParams }
     await checkFilterPass(config)
   }
@@ -559,16 +583,21 @@ export default function () {
           })
         })
         .catch(() => {
-          restoreFilter(item)
+          restoreFilter(item, 'saveBack')
           historyFilterDialogVisible.value = false
         })
     } else {
-      restoreFilter(item)
+      restoreFilter(item, 'saveBack')
     }
   }
-  function restoreFilter (viewFilter) {
+  function restoreFilter (viewFilter, type) {
     onResetFilter()
-    const resultFilter = FilterHistoryAjaxModelRestore.formatAll(viewFilter)
+    let resultFilter = {}
+    if(type === 'saveBack') {
+      resultFilter = FilterHistoryAjaxModelRestore.formatAll(viewFilter)
+    } else {
+      resultFilter = viewFilter
+    }
     filterState.value = {
       publishTime: resultFilter.publishTime,
       selectType: resultFilter.selectType,
@@ -597,7 +626,9 @@ export default function () {
       selectMoreKey: resultFilter.additionalWords?.length > 0
     }
     doChangeTab({ key: resultFilter.searchGroup })
-    historyFilterDialogVisible.value = false
+    if(type === 'saveBack') {
+      historyFilterDialogVisible.value = false
+    }
     doQuery()
   }
 
@@ -678,11 +709,8 @@ export default function () {
       goLogin()
       return
     }
-    const originParams = Object.assign(
-      {},
-      filterState.value,
-      inputKeywordsState.value
-    )
+
+    const originParams = packageFilter()
     const params = {
       listState: listState,
       selectCheckboxCount: selectCheckboxCount.value,
@@ -855,11 +883,13 @@ export default function () {
   return {
     isLogin,
     isInApp,
+    isInWeb,
     inResourceBIIframe,
     inBIPropertyIframe,
     inInjectBI,
     isInBI,
     goLogin,
+    guideGoWorkSpace,
     cooperateCode,
     list,
     searchModelOptions,

+ 1 - 1
apps/bigmember_pc/src/views/search/components/SearchHeader.vue

@@ -95,7 +95,7 @@ export default {
     },
     onSearch() {
       this.$emit('search')
-      this.setUrlQuery()
+      // this.setUrlQuery()
     },
     setUrlQuery: function () {
       const isSame = this.searchQuery.keywords === this.searchContent