feat: There is no way the, 搜索中心优化
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
v-model="checkState"
|
||||
class="search-group-item"
|
||||
placeholder="请选择"
|
||||
@change="checkStateFunc"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in jumpPage"
|
||||
@@ -14,6 +15,20 @@
|
||||
></el-option>
|
||||
</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">
|
||||
<el-input
|
||||
@keyup.native.enter="search"
|
||||
@@ -37,6 +52,8 @@ export default {
|
||||
return {
|
||||
// 当前查询状态
|
||||
checkState: 'All',
|
||||
showType: false,
|
||||
checkStateType: 'titleSearch',
|
||||
// 查询内容
|
||||
checkContent: '',
|
||||
jumpPage: [
|
||||
@@ -61,17 +78,35 @@ export default {
|
||||
value: 'enterprise'
|
||||
}
|
||||
],
|
||||
jumpPageType: [
|
||||
{
|
||||
label: '标题检索',
|
||||
value: 'titleSearch'
|
||||
},
|
||||
{
|
||||
label: '全文检索',
|
||||
value: 'allTextSearch'
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
methods: {
|
||||
checkStateFunc(data){
|
||||
if(data === 'All'){
|
||||
this.showType = true
|
||||
}else {
|
||||
this.showType = false
|
||||
}
|
||||
},
|
||||
search() {
|
||||
this.$router.push({
|
||||
name: 'StandardSearch',
|
||||
params: {
|
||||
selectKey: this.checkState,
|
||||
searchValue: this.checkContent || undefined
|
||||
searchValue: this.checkContent || undefined,
|
||||
allType: this.checkStateType,
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -86,12 +121,28 @@ export default {
|
||||
},
|
||||
},
|
||||
mounted(){
|
||||
|
||||
this.checkStateFunc(this.checkState)
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<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 {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
@@ -103,7 +154,7 @@ export default {
|
||||
::v-deep {
|
||||
.el-input__inner {
|
||||
text-align: center;
|
||||
width: 18vm;
|
||||
width: 12vw !important;
|
||||
height: 40px;
|
||||
color: #333333;
|
||||
font-size: 15px;
|
||||
|
||||
@@ -35,6 +35,21 @@
|
||||
<div class="search-condition">
|
||||
<div class="condition-btn" @click="conditionBtnOpen = !conditionBtnOpen" v-if="showConditionBtn">{{ toggleConditionTips }}</div>
|
||||
<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-title">{{ condition.title }}</div>
|
||||
<ul :class="[key, {'is-close': condition.isClose}]">
|
||||
@@ -343,6 +358,7 @@
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
selectType: 'titleSearch',
|
||||
externalStatus:'',
|
||||
itermsConditionsTitle1: '',
|
||||
itermsConditionsTitle2: '',
|
||||
@@ -482,6 +498,10 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
searchClick(type) {
|
||||
this.selectType = type
|
||||
this.searchSarByInputKey()
|
||||
},
|
||||
optionsFun(items){
|
||||
if(Object.prototype.toString.call(items) === '[object Object]'){
|
||||
return items;
|
||||
@@ -1379,6 +1399,7 @@
|
||||
}
|
||||
AllList.selectIndex = 'fulltextserch'
|
||||
AllList.selectValue = this.keywords
|
||||
AllList.selectType = this.selectType
|
||||
AllList.page = this.pageAll
|
||||
AllList.pageSize = this.$store.getters.userInfo.configContent
|
||||
this.$http.post('search/searchCenter/searchSarBykey', AllList, {
|
||||
@@ -1438,6 +1459,7 @@
|
||||
if(condition.selectValue === undefined){
|
||||
condition.selectValue = ''
|
||||
}
|
||||
condition.selectType = this.selectType
|
||||
this.$http.post('search/searchCenter/searchSarBykey', condition, {
|
||||
_this: this,
|
||||
loading: 'resultLoading'
|
||||
|
||||
Reference in New Issue
Block a user