|
@@ -404,6 +404,7 @@ import { AppIcon, AppEmpty, ProjectCell } from '@/ui'
|
|
import { setUserSubInfo, getFreeSubscribeInfo } from '@/api/modules/public'
|
|
import { setUserSubInfo, getFreeSubscribeInfo } from '@/api/modules/public'
|
|
import { leadGetDate } from '@/api/modules/leadGeneration'
|
|
import { leadGetDate } from '@/api/modules/leadGeneration'
|
|
import { LINKS } from '@/data'
|
|
import { LINKS } from '@/data'
|
|
|
|
+import { BIDDING_SEARCH_LAST_FILTERS_CACHE_KEY } from '@/utils/constant'
|
|
import { throttle } from 'lodash'
|
|
import { throttle } from 'lodash'
|
|
import toLogin from '@/utils/mixins/modules/to-login'
|
|
import toLogin from '@/utils/mixins/modules/to-login'
|
|
import { mixinPoints } from '@/utils/mixins/modules/points'
|
|
import { mixinPoints } from '@/utils/mixins/modules/points'
|
|
@@ -1056,13 +1057,14 @@ export default {
|
|
const { searchFilters = {} } = this.$refs
|
|
const { searchFilters = {} } = this.$refs
|
|
let { filters } = this.$route.params
|
|
let { filters } = this.$route.params
|
|
if (!filters) {
|
|
if (!filters) {
|
|
|
|
+ // 取标讯详情页-推荐项目模块-查看更多 跳转过来带的筛选条件
|
|
filters = this.$storage.get('bidding-search-filters-restore', false, {
|
|
filters = this.$storage.get('bidding-search-filters-restore', false, {
|
|
storage: sessionStorage,
|
|
storage: sessionStorage,
|
|
login: true
|
|
login: true
|
|
})
|
|
})
|
|
}
|
|
}
|
|
console.log(filters)
|
|
console.log(filters)
|
|
- if (!filters) return
|
|
|
|
|
|
+ if (!filters || Object.keys(filters).length === 0) return
|
|
const { getScopeOptions = [], getTimeOptions = [] } = searchFilters
|
|
const { getScopeOptions = [], getTimeOptions = [] } = searchFilters
|
|
this.topSearch.input = filters.keywords.join(' ')
|
|
this.topSearch.input = filters.keywords.join(' ')
|
|
// 恢复searchGroup
|
|
// 恢复searchGroup
|
|
@@ -1204,6 +1206,7 @@ export default {
|
|
},
|
|
},
|
|
doSearch(conf = {}) {
|
|
doSearch(conf = {}) {
|
|
const { from } = conf
|
|
const { from } = conf
|
|
|
|
+ this.saveFilterToLocal()
|
|
if (from === 'searchModeAutoChangedSearch') {
|
|
if (from === 'searchModeAutoChangedSearch') {
|
|
// 当前搜索来自 自动切换搜索模式
|
|
// 当前搜索来自 自动切换搜索模式
|
|
// do something...
|
|
// do something...
|
|
@@ -2036,8 +2039,8 @@ export default {
|
|
console.warn(error)
|
|
console.warn(error)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // 保存筛选条件
|
|
|
|
- async saveFilterToHistory() {
|
|
|
|
|
|
+ // 获取已存筛选的参数
|
|
|
|
+ getSaveFilterToHistoryParams() {
|
|
const params = this.getFilterParams2()
|
|
const params = this.getFilterParams2()
|
|
|
|
|
|
delete params.scope
|
|
delete params.scope
|
|
@@ -2045,6 +2048,15 @@ export default {
|
|
if (params.subtype) {
|
|
if (params.subtype) {
|
|
params.subtype = params.subtype.replace('拟建项目', '拟建')
|
|
params.subtype = params.subtype.replace('拟建项目', '拟建')
|
|
}
|
|
}
|
|
|
|
+ return {
|
|
|
|
+ ...params,
|
|
|
|
+ regionMap: this.filters.area
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 保存筛选条件
|
|
|
|
+ async saveFilterToHistory() {
|
|
|
|
+ const params = this.getSaveFilterToHistoryParams()
|
|
|
|
+
|
|
// if (!params.searchvalue) {
|
|
// if (!params.searchvalue) {
|
|
// return this.$toast('请先输入关键词')
|
|
// return this.$toast('请先输入关键词')
|
|
// }
|
|
// }
|
|
@@ -2053,10 +2065,7 @@ export default {
|
|
return this.$toast(`对不起,最多可保存${maxCount}个筛选条件。`)
|
|
return this.$toast(`对不起,最多可保存${maxCount}个筛选条件。`)
|
|
}
|
|
}
|
|
const loading = this.$toast.loading({ duration: 0 })
|
|
const loading = this.$toast.loading({ duration: 0 })
|
|
- const resultParams = {
|
|
|
|
- ...params,
|
|
|
|
- regionMap: this.filters.area
|
|
|
|
- }
|
|
|
|
|
|
+ const resultParams = params
|
|
try {
|
|
try {
|
|
const {
|
|
const {
|
|
data: id,
|
|
data: id,
|
|
@@ -2087,13 +2096,12 @@ export default {
|
|
},
|
|
},
|
|
async beforeFilterHistoryDialogClose(action, done) {
|
|
async beforeFilterHistoryDialogClose(action, done) {
|
|
if (action === 'confirm') {
|
|
if (action === 'confirm') {
|
|
- const params = this.getFilterParams2()
|
|
|
|
|
|
+ const params = this.getSaveFilterToHistoryParams()
|
|
const { currentFilterParamsKey } = this.pageState
|
|
const { currentFilterParamsKey } = this.pageState
|
|
try {
|
|
try {
|
|
const { error_code: code = 0, error_msg: msg } =
|
|
const { error_code: code = 0, error_msg: msg } =
|
|
await addBiddingFilter({
|
|
await addBiddingFilter({
|
|
...params,
|
|
...params,
|
|
- regionMap: this.filters.area,
|
|
|
|
inkey: currentFilterParamsKey
|
|
inkey: currentFilterParamsKey
|
|
})
|
|
})
|
|
if (code === 0) {
|
|
if (code === 0) {
|
|
@@ -2307,6 +2315,15 @@ export default {
|
|
}
|
|
}
|
|
this.doSearch()
|
|
this.doSearch()
|
|
},
|
|
},
|
|
|
|
+ // 保存筛选条件到本地
|
|
|
|
+ saveFilterToLocal() {
|
|
|
|
+ // 将已存筛选的筛选条件保存到本地,恢复时候可以走已存筛选的恢复
|
|
|
|
+ const params = this.getSaveFilterToHistoryParams()
|
|
|
|
+ this.$storage.set(
|
|
|
|
+ BIDDING_SEARCH_LAST_FILTERS_CACHE_KEY,
|
|
|
|
+ params
|
|
|
|
+ )
|
|
|
|
+ },
|
|
beforeTabActiveChange(name) {
|
|
beforeTabActiveChange(name) {
|
|
if (name === 'detailedList') {
|
|
if (name === 'detailedList') {
|
|
if (this.noLoginOrFree) {
|
|
if (this.noLoginOrFree) {
|