feat: 搜索中心一般检索
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
<div class="search-box">
|
<div class="search-box">
|
||||||
<div class="home-input">
|
<div class="home-input">
|
||||||
<el-input
|
<el-input
|
||||||
placeholder="请输入查询条件"
|
placeholder="请输入查询条件111"
|
||||||
clearable
|
clearable
|
||||||
v-model="keywords"
|
v-model="keywords"
|
||||||
@keyup.enter.native="searchSarByInputKeyByCondition">
|
@keyup.enter.native="searchSarByInputKeyByCondition">
|
||||||
@@ -207,8 +207,115 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
searchSarByInputKeyByCondition() {
|
dateFormat2(str){
|
||||||
|
return dateFormat(str)
|
||||||
},
|
},
|
||||||
|
searchSarByInputKey (status) {
|
||||||
|
if (status === 'All') {
|
||||||
|
this.AllCheck = true
|
||||||
|
}
|
||||||
|
if (this.AllCheck) {
|
||||||
|
if (this.keywords === undefined) {
|
||||||
|
this.keywords = ''
|
||||||
|
}
|
||||||
|
const Alllist = {
|
||||||
|
selectIndex: 'fulltextserch',
|
||||||
|
selectValue: this.keywords,
|
||||||
|
page: this.pageAll,
|
||||||
|
pageSize: this.$store.getters.userInfo.configContent
|
||||||
|
}
|
||||||
|
this.$http.post('search/searchCenter/searchSarBykey', Alllist, {
|
||||||
|
_this: this,
|
||||||
|
loading: 'resultLoading'
|
||||||
|
}, res => {
|
||||||
|
if (res.ok) {
|
||||||
|
this.Allitems = res.data.list.map((item) => {
|
||||||
|
if (item.textContent) {
|
||||||
|
this.str = item.textContent
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
textContent: this.str.replace(/null/g, '- -')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.totalAll = res.data.count
|
||||||
|
this.AllCheck = true
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
}, e => {
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.searchSarBykey()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
searchSarBykey () {
|
||||||
|
let searchCondition = this.searchCondition
|
||||||
|
let condition = {}
|
||||||
|
let searchKeys = Object.keys(this.searchOptions)
|
||||||
|
for (let key in searchCondition) {
|
||||||
|
if (searchKeys.indexOf(key) !== -1) {
|
||||||
|
if (condition.selectIndex === 'laws') {
|
||||||
|
condition.SYCLLX = condition.CLLX
|
||||||
|
condition.WSSFCY = condition.CYSD
|
||||||
|
}
|
||||||
|
condition[key] = searchCondition[key].join(',') === 'all' ? '' : searchCondition[key].join(',')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.resultKeyword != null && this.resultKeyword !== '') {
|
||||||
|
condition.resultKeyword = this.resultKeyword
|
||||||
|
}
|
||||||
|
condition.page = this.page
|
||||||
|
condition.pageSize = this.$store.getters.userInfo.configContent
|
||||||
|
condition.selectValue = this.keywords
|
||||||
|
if (condition.selectIndex === 'bussstand') {
|
||||||
|
condition.selectIndex = 'stand'
|
||||||
|
condition.standType = 'FOREIGN'
|
||||||
|
} else if (condition.selectIndex === 'stand') {
|
||||||
|
condition.standType = 'INLAND'
|
||||||
|
}
|
||||||
|
if(condition.selectIndex === 'enterprise'){
|
||||||
|
condition.selectIndex='bussstand'
|
||||||
|
condition.standState = condition.BUSSSTATE
|
||||||
|
condition.ZQCBM = condition.ORGLIST
|
||||||
|
}
|
||||||
|
// 查询为国内外政策时,改变查询参数名
|
||||||
|
if (condition.selectIndex === 'laws') {
|
||||||
|
condition.SYCLLX = condition.CLLX
|
||||||
|
condition.WSSFCY = condition.CYSD
|
||||||
|
delete condition.CLLX
|
||||||
|
delete condition.CYSD
|
||||||
|
}
|
||||||
|
if(condition.selectValue === undefined){
|
||||||
|
condition.selectValue = ''
|
||||||
|
}
|
||||||
|
this.$http.post('search/searchCenter/searchSarBykey', condition, {
|
||||||
|
_this: this,
|
||||||
|
loading: 'resultLoading'
|
||||||
|
}, res => {
|
||||||
|
if (res.ok) {
|
||||||
|
this.total = res.data.count
|
||||||
|
this.resultData = res.data.list
|
||||||
|
this.selectGroupdata(res.data)
|
||||||
|
} else {
|
||||||
|
this.total = 0
|
||||||
|
this.resultData = []
|
||||||
|
this.selectGroupdata(res.data)
|
||||||
|
// this.getSearchHistoty()
|
||||||
|
}
|
||||||
|
}, e => {
|
||||||
|
this.total = 0
|
||||||
|
this.resultData = []
|
||||||
|
console.error(e)
|
||||||
|
// this.getSearchHistoty()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
searchSarByInputKeyByCondition() {
|
||||||
|
console.log(11111111111111111111111111)
|
||||||
|
this.pageAll = 1
|
||||||
|
this.page = 1
|
||||||
|
this.searchSarByInputKey()
|
||||||
|
},
|
||||||
|
|
||||||
//查询选项
|
//查询选项
|
||||||
queryOptions() {
|
queryOptions() {
|
||||||
let _this = this;
|
let _this = this;
|
||||||
@@ -342,12 +449,6 @@ export default {
|
|||||||
cancelCollectStandard() {
|
cancelCollectStandard() {
|
||||||
|
|
||||||
},
|
},
|
||||||
//条件检索
|
|
||||||
searchSarByInputKey(status) {
|
|
||||||
if (status === "All") {
|
|
||||||
this.AllCheck = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
PersonalCenter
|
PersonalCenter
|
||||||
@@ -367,6 +468,12 @@ export default {
|
|||||||
if (globalInputSearch !== 'allvalue') {
|
if (globalInputSearch !== 'allvalue') {
|
||||||
this.keywords = globalInputSearch
|
this.keywords = globalInputSearch
|
||||||
}
|
}
|
||||||
|
if (this.$route.params.selectKey === 'All') {
|
||||||
|
// 从首页进入一般检索-资源类型查询全部
|
||||||
|
this.searchSarByInputKey('All')
|
||||||
|
} else {
|
||||||
|
this.searchSarBykey()
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
unmounted() {
|
unmounted() {
|
||||||
|
|||||||
Reference in New Issue
Block a user