|
@@ -55,6 +55,7 @@ export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
searchGroup: '',
|
|
searchGroup: '',
|
|
|
|
+ filterHistoryOrigin: [],
|
|
filterHistory: [],
|
|
filterHistory: [],
|
|
lastFilters: {},
|
|
lastFilters: {},
|
|
lastFiltersFormatted: {}
|
|
lastFiltersFormatted: {}
|
|
@@ -99,19 +100,32 @@ export default {
|
|
const lastFilters = this.$storage.get(BIDDING_SEARCH_LAST_FILTERS_CACHE_KEY, false, { login: true })
|
|
const lastFilters = this.$storage.get(BIDDING_SEARCH_LAST_FILTERS_CACHE_KEY, false, { login: true })
|
|
if (lastFilters) {
|
|
if (lastFilters) {
|
|
this.lastFilters = lastFilters
|
|
this.lastFilters = lastFilters
|
|
- const card = this.formatFilterItems(lastFilters)
|
|
|
|
|
|
+ const card = this.formatFilterItems(this.lastFilters)
|
|
this.lastFiltersFormatted = card
|
|
this.lastFiltersFormatted = card
|
|
this.syncInput(card.keywordsText)
|
|
this.syncInput(card.keywordsText)
|
|
} else {
|
|
} else {
|
|
// 获取已存筛选列表第一个
|
|
// 获取已存筛选列表第一个
|
|
- const list = this.filterHistory
|
|
|
|
|
|
+ const list = this.filterHistoryOrigin
|
|
if (Array.isArray(list) && list.length > 0) {
|
|
if (Array.isArray(list) && list.length > 0) {
|
|
- const card = list[0]
|
|
|
|
|
|
+ this.lastFilters = list[0]
|
|
|
|
+ const card = this.formatFilterItems(this.lastFilters)
|
|
this.lastFiltersFormatted = card
|
|
this.lastFiltersFormatted = card
|
|
this.syncInput(card.keywordsText)
|
|
this.syncInput(card.keywordsText)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 修改关键词
|
|
|
|
+ syncInputToCacheFilters() {
|
|
|
|
+ const lastFilters = this.lastFilters
|
|
|
|
+ const inputText = this.topSearch.input
|
|
|
|
+ if (lastFilters) {
|
|
|
|
+ lastFilters.searchvalue = inputText
|
|
|
|
+ }
|
|
|
|
+ const card = this.formatFilterItems(lastFilters)
|
|
|
|
+ if (card) {
|
|
|
|
+ this.lastFiltersFormatted = card
|
|
|
|
+ }
|
|
|
|
+ },
|
|
syncInput(text = '') {
|
|
syncInput(text = '') {
|
|
this.topSearch.input = text
|
|
this.topSearch.input = text
|
|
},
|
|
},
|
|
@@ -198,6 +212,7 @@ export default {
|
|
} = await getBiddingFilterList()
|
|
} = await getBiddingFilterList()
|
|
if (code === 0) {
|
|
if (code === 0) {
|
|
if (Array.isArray(data)) {
|
|
if (Array.isArray(data)) {
|
|
|
|
+ this.filterHistoryOrigin = data
|
|
this.filterHistory =
|
|
this.filterHistory =
|
|
data.slice(0, 3).map(this.formatFilterItems) || []
|
|
data.slice(0, 3).map(this.formatFilterItems) || []
|
|
}
|
|
}
|