diff --git a/src/pages/searchCenter/pages/standardSearch.vue b/src/pages/searchCenter/pages/standardSearch.vue index a3e724097..f892ae472 100644 --- a/src/pages/searchCenter/pages/standardSearch.vue +++ b/src/pages/searchCenter/pages/standardSearch.vue @@ -36,7 +36,7 @@ @@ -739,6 +739,8 @@ * @date: 2018/12/19 11:38:21 */ optChecked (key, value) { + console.log(value) + console.log(this.selectIndex) if (value === 'All') { this.AllCheck = true // 点击全部-显示分页 @@ -775,12 +777,18 @@ index: 0 } } + let originOptions = this.searchOriginOptions + this.searchOptions.NYLXCLASS = originOptions.NYLXCLASS + this.searchOptions.NYLXCLASS.title = '能源类型' + this.searchOptions.NYLXCLASS.index = 1 + // 适用车辆类型 + this.searchOptions.CLLX = originOptions.CLLX + this.searchOptions.CLLX.index = 2 this.searchCondition.selectIndex = ['All'] + this.selectIndex = value this.searchSarByInputKey() + this.$forceUpdate() } else { - this.AllPage = false - this.Allitems = [] - this.AllCheck = false let index = this.searchCondition[key].indexOf(value) // 资源类型为单选且必选 if (key !== 'selectIndex') { @@ -876,6 +884,12 @@ this.searchCondition[key].splice(0, 1, value) } } + this.AllPage = this.selectIndex === 'All' ? true : false + this.Allitems = [] + this.AllCheck = this.selectIndex === 'All' ? true : false + if (this.selectIndex === 'All'){ + this.searchSarByInputKey() + } } }, // 统计搜索条件结果个数 @@ -1257,6 +1271,12 @@ if (filterOptions.module) { filterOptions.module.options = [] } + filterOptions.NYLXCLASS = originOptions.NYLXCLASS + filterOptions.NYLXCLASS.title = '能源类型' + filterOptions.NYLXCLASS.index = 1 + // 适用车辆类型 + filterOptions.CLLX = originOptions.CLLX + filterOptions.CLLX.index = 2 break } this.searchOptions = filterOptions @@ -1287,13 +1307,19 @@ if (this.keywords === undefined) { this.keywords = '' } - const Alllist = { - selectIndex: 'fulltextserch', - selectValue: this.keywords, - page: this.pageAll, - pageSize: this.$store.getters.userInfo.configContent + const AllList = {} + let searchCondition = this.searchCondition + let searchKeys = Object.keys(this.searchOptions) + for (let key in searchCondition) { + if (searchKeys.indexOf(key) !== -1) { + AllList[key] = searchCondition[key].join(',') === 'all' ? '' : searchCondition[key].join(',') + } } - this.$http.post('search/searchCenter/searchSarBykey', Alllist, { + AllList.selectIndex = 'fulltextserch' + AllList.selectValue = this.keywords + AllList.page = this.pageAll + AllList.pageSize = this.$store.getters.userInfo.configContent + this.$http.post('search/searchCenter/searchSarBykey', AllList, { _this: this, loading: 'resultLoading' }, res => { @@ -2562,6 +2588,8 @@ }) }) this.searchCondition['standSort'].splice(0, 1, 'all') + this.searchCondition['NYLXCLASS'].splice(0, 1, 'all') + this.searchCondition['CLLX'].splice(0, 1, 'all') } }, mounted () {