feat: There is no way the, 搜索中心优化

This commit is contained in:
super_liu
2022-05-23 17:21:21 +08:00
parent 25a92aec07
commit 695f153cee
2 changed files with 76 additions and 3 deletions
@@ -5,6 +5,7 @@
v-model="checkState" v-model="checkState"
class="search-group-item" class="search-group-item"
placeholder="请选择" placeholder="请选择"
@change="checkStateFunc"
> >
<el-option <el-option
v-for="item in jumpPage" v-for="item in jumpPage"
@@ -14,6 +15,20 @@
></el-option> ></el-option>
</el-select> </el-select>
<el-select
v-if="showType"
v-model="checkStateType"
class="search-group-itemType"
placeholder="请选择"
>
<el-option
v-for="item in jumpPageType"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
<div class="search-condition"> <div class="search-condition">
<el-input <el-input
@keyup.native.enter="search" @keyup.native.enter="search"
@@ -37,6 +52,8 @@ export default {
return { return {
// 当前查询状态 // 当前查询状态
checkState: 'All', checkState: 'All',
showType: false,
checkStateType: 'titleSearch',
// 查询内容 // 查询内容
checkContent: '', checkContent: '',
jumpPage: [ jumpPage: [
@@ -61,17 +78,35 @@ export default {
value: 'enterprise' value: 'enterprise'
} }
], ],
jumpPageType: [
{
label: '标题检索',
value: 'titleSearch'
},
{
label: '全文检索',
value: 'allTextSearch'
},
],
} }
}, },
computed: {}, computed: {},
watch: {}, watch: {},
methods: { methods: {
checkStateFunc(data){
if(data === 'All'){
this.showType = true
}else {
this.showType = false
}
},
search() { search() {
this.$router.push({ this.$router.push({
name: 'StandardSearch', name: 'StandardSearch',
params: { params: {
selectKey: this.checkState, selectKey: this.checkState,
searchValue: this.checkContent || undefined searchValue: this.checkContent || undefined,
allType: this.checkStateType,
} }
}) })
}, },
@@ -86,12 +121,28 @@ export default {
}, },
}, },
mounted(){ mounted(){
this.checkStateFunc(this.checkState)
}, },
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
/deep/ .search-group-itemType {
margin-right: 20px;
border-radius: 5px;
.el-input__inner {
text-align: center;
width: 10vw !important;
height: 40px;
color: #333333;
font-size: 15px;
border: 0;
border-radius: 3px;
background-color: #FFFFFF;
box-shadow:1px -2px 10px rgba(0,0,0,0.1);
}
}
.search-group { .search-group {
display: flex; display: flex;
width: 100%; width: 100%;
@@ -103,7 +154,7 @@ export default {
::v-deep { ::v-deep {
.el-input__inner { .el-input__inner {
text-align: center; text-align: center;
width: 18vm; width: 12vw !important;
height: 40px; height: 40px;
color: #333333; color: #333333;
font-size: 15px; font-size: 15px;
@@ -35,6 +35,21 @@
<div class="search-condition"> <div class="search-condition">
<div class="condition-btn" @click="conditionBtnOpen = !conditionBtnOpen" v-if="showConditionBtn">{{ toggleConditionTips }}</div> <div class="condition-btn" @click="conditionBtnOpen = !conditionBtnOpen" v-if="showConditionBtn">{{ toggleConditionTips }}</div>
<div class="condition-content"> <div class="condition-content">
<div class="condition-item" v-if="selectIndex === 'All'">
<div class="condition-item-title">检索方式</div>
<ul>
<li>
<span :class="{'selected': selectType === 'allTextSearch'}" @click="searchClick('allTextSearch')">
全文检索
</span>
</li>
<li>
<span :class="{'selected': selectType === 'titleSearch'}" @click="searchClick('titleSearch')">
标题检索
</span>
</li>
</ul>
</div>
<div class="condition-item" v-for="(condition, key) of searchOptions" :key="condition.index + key" v-if="condition.index < 5 || conditionBtnOpen"> <div class="condition-item" v-for="(condition, key) of searchOptions" :key="condition.index + key" v-if="condition.index < 5 || conditionBtnOpen">
<div class="condition-item-title">{{ condition.title }}</div> <div class="condition-item-title">{{ condition.title }}</div>
<ul :class="[key, {'is-close': condition.isClose}]"> <ul :class="[key, {'is-close': condition.isClose}]">
@@ -343,6 +358,7 @@
}, },
data () { data () {
return { return {
selectType: 'titleSearch',
externalStatus:'', externalStatus:'',
itermsConditionsTitle1: '', itermsConditionsTitle1: '',
itermsConditionsTitle2: '', itermsConditionsTitle2: '',
@@ -482,6 +498,10 @@
} }
}, },
methods: { methods: {
searchClick(type) {
this.selectType = type
this.searchSarByInputKey()
},
optionsFun(items){ optionsFun(items){
if(Object.prototype.toString.call(items) === '[object Object]'){ if(Object.prototype.toString.call(items) === '[object Object]'){
return items; return items;
@@ -1379,6 +1399,7 @@
} }
AllList.selectIndex = 'fulltextserch' AllList.selectIndex = 'fulltextserch'
AllList.selectValue = this.keywords AllList.selectValue = this.keywords
AllList.selectType = this.selectType
AllList.page = this.pageAll AllList.page = this.pageAll
AllList.pageSize = this.$store.getters.userInfo.configContent AllList.pageSize = this.$store.getters.userInfo.configContent
this.$http.post('search/searchCenter/searchSarBykey', AllList, { this.$http.post('search/searchCenter/searchSarBykey', AllList, {
@@ -1438,6 +1459,7 @@
if(condition.selectValue === undefined){ if(condition.selectValue === undefined){
condition.selectValue = '' condition.selectValue = ''
} }
condition.selectType = this.selectType
this.$http.post('search/searchCenter/searchSarBykey', condition, { this.$http.post('search/searchCenter/searchSarBykey', condition, {
_this: this, _this: this,
loading: 'resultLoading' loading: 'resultLoading'