|
@@ -55,7 +55,7 @@
|
|
|
class="ex-line-2"
|
|
|
@onChange="changeBusiness"
|
|
|
ref="businessScopeSelector"
|
|
|
- :initList="getScopeKeyList"
|
|
|
+ :initList="getScopeKeyListFull"
|
|
|
selectorType="line"
|
|
|
>
|
|
|
<div slot="header">业务范围:</div>
|
|
@@ -185,10 +185,22 @@ export default {
|
|
|
showD3: false,
|
|
|
alreadyNum: 0,
|
|
|
remainNum: 0
|
|
|
+ },
|
|
|
+ cacheFilter: {
|
|
|
+ business_scope: []
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ formatScopeKey(list) {
|
|
|
+ return list.map((v) => {
|
|
|
+ let str = v.key.join(' ')
|
|
|
+ if (v?.appendkey) {
|
|
|
+ str = str + ' ' + v?.appendkey.join(' ')
|
|
|
+ }
|
|
|
+ return str
|
|
|
+ })
|
|
|
+ },
|
|
|
showMonitorDialog(data) {
|
|
|
const { remainNum, alreadyNum } = data
|
|
|
this.monitorInfo.remainNum = remainNum
|
|
@@ -363,7 +375,6 @@ export default {
|
|
|
},
|
|
|
changeBusiness(item) {
|
|
|
item = item.map((v) => v.split(' ')[0])
|
|
|
- console.log(item, 'xx')
|
|
|
let tempArr = []
|
|
|
this.scope.forEach((v) => {
|
|
|
if (item.includes(v.key.join(' '))) {
|
|
@@ -397,9 +408,52 @@ export default {
|
|
|
sessionStorage.getItem('potential_cor_list_search') || '{}'
|
|
|
)
|
|
|
console.log(cacheFilter)
|
|
|
+
|
|
|
+ if (cacheFilter?.area) {
|
|
|
+ this.filters.area = { [cacheFilter.area]: [] } || {}
|
|
|
+ }
|
|
|
+ if (cacheFilter?.industry) {
|
|
|
+ if (cacheFilter?.industry?.indexOf('_') > -1) {
|
|
|
+ try {
|
|
|
+ const splitResult = cacheFilter.industry.split('_')
|
|
|
+ const result = {
|
|
|
+ [splitResult[0]]: [splitResult[1]]
|
|
|
+ }
|
|
|
+ this.filters.industry = result
|
|
|
+ } catch (e) {
|
|
|
+ console.warn(e)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.filters.industry = [cacheFilter?.industry] || []
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (cacheFilter?.buyerClass) {
|
|
|
+ this.filters.buyerclass = [cacheFilter?.buyerClass] || []
|
|
|
+ }
|
|
|
+ if (cacheFilter?.keywords) {
|
|
|
+ const tempKey = [
|
|
|
+ {
|
|
|
+ key: [cacheFilter?.keywords],
|
|
|
+ notkey: [],
|
|
|
+ appendkey: null,
|
|
|
+ matchway: 1,
|
|
|
+ updatetime: Date.now()
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ this.filters.business_scope = [].concat(tempKey)
|
|
|
+ this.cacheFilter.business_scope = [].concat(tempKey)
|
|
|
+ }
|
|
|
} catch (e) {
|
|
|
console.warn(e)
|
|
|
}
|
|
|
+ },
|
|
|
+ doResetSelectorForCahce() {
|
|
|
+ this.$refs.areaSelector.setCitySelected(this.filters.area)
|
|
|
+ this.$refs.industrySelector.setIndustryState(this.filters.industry)
|
|
|
+ this.$refs.buyerclassSelector.setCateState(this.filters.buyerclass)
|
|
|
+ this.$refs.businessScopeSelector.setState(
|
|
|
+ this.formatScopeKey(this.filters.business_scope)
|
|
|
+ )
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -412,21 +466,34 @@ export default {
|
|
|
return this.topInfo[this.$route.params.type || 'c']
|
|
|
},
|
|
|
getScopeKeyList() {
|
|
|
- return this.scope.map((v) => {
|
|
|
- let str = v.key.join(' ')
|
|
|
- if (v?.appendkey) {
|
|
|
- str = str + ' ' + v?.appendkey.join(' ')
|
|
|
- }
|
|
|
- return str
|
|
|
- })
|
|
|
+ return this.formatScopeKey(this.scope)
|
|
|
+ },
|
|
|
+ getCacheScopeKeyList() {
|
|
|
+ return this.formatScopeKey(this.cacheFilter.business_scope)
|
|
|
+ },
|
|
|
+ getScopeKeyListFull() {
|
|
|
+ if (this.isUseCache) {
|
|
|
+ return [].concat(this.getCacheScopeKeyList, this.getScopeKeyList)
|
|
|
+ } else {
|
|
|
+ return this.getScopeKeyList
|
|
|
+ }
|
|
|
+ },
|
|
|
+ isUseCache() {
|
|
|
+ return this.$route.query.mark === '1'
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
this.changeBusiness([])
|
|
|
this.recoverCreate()
|
|
|
+ if (this.isUseCache) {
|
|
|
+ this.doResetSelectorForCahce()
|
|
|
+ }
|
|
|
},
|
|
|
activated() {
|
|
|
this.changeBusiness([])
|
|
|
+ if (this.isUseCache) {
|
|
|
+ this.doResetSelectorForCahce()
|
|
|
+ }
|
|
|
},
|
|
|
async created() {
|
|
|
if (!this.isDeleteAllScope) {
|
|
@@ -434,6 +501,9 @@ export default {
|
|
|
}
|
|
|
this.filters.business_scope = this.scope
|
|
|
// 从缓存中获取详情页筛选项
|
|
|
+ if (this.isUseCache) {
|
|
|
+ this.doResetArticleCacheFilter()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|