Commit 5a2006ed authored by zhanglw's avatar zhanglw

搜索跳转

parent b0895a4d
......@@ -3,10 +3,10 @@
<div class="search-btn">
<el-input v-model="query.keyword" clearable placeholder="请输入关键字" style="width: 600px" />
<el-select v-model="query.productType" placeholder="全部产品" style="width: 160px">
<el-option v-for="item in [{value:undefined,label:'全部产品'}, ...dict.product_type]" :key="item.value" :label="item.label" :value="item.value" />
<el-option v-for="item in [{value:'',label:'全部产品'}, ...dict.product_type]" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<el-select v-model="query.area" placeholder="区域" style="width: 100px">
<el-option v-for="item in [{value:undefined,label:'全地区'}, ...dict.area_province]" :key="item.value" :label="item.label" :value="item.value" />
<el-option v-for="item in [{value:'',label:'全地区'}, ...dict.area_province]" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<el-button icon="el-icon-search" class="btn" @click="search">搜索</el-button>
</div>
......
......@@ -21,7 +21,7 @@
</el-col>
<el-col :span="3">
<el-select v-model="query.productType" placeholder="全部产品">
<el-option v-for="item in [{value:undefined,label:'全部产品'}, ...dict.product_type]" :key="item.value" :label="item.label" :value="item.value" />
<el-option v-for="item in [{value:'',label:'全部产品'}, ...dict.product_type]" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-col>
<el-col :span="3">
......@@ -40,9 +40,9 @@
</el-row>
<el-row style="padding-top: 10px">
<el-col :span="2">
<div class="search-item" :class="query.type===undefined?'active':''">
<div class="search-item" :class="query.type===''?'active':''">
<span class="touch label" @click="setQuertType()">默认排序</span>
<span v-if="query.type===undefined">
<span v-if="query.type===''">
<i v-if="query.sort" class="el-icon-sort-up touch" />
<i v-else class="el-icon-sort-down touch" />
</span>
......@@ -204,8 +204,9 @@ export default {
imgSrcStart: process.env.VUE_APP_BASE_API,
query: {
keyword: '',
area: undefined,
type: undefined,
productType: '',
area: '',
type: '',
sort: false
},
page: 1,
......@@ -352,7 +353,7 @@ export default {
},
mounted() {
this.$nextTick(() => {
console.log(this.$route.params)
this.query = Object.assign(this.query, this.$route.params)
HttpReq.webClientApi.homePageGetSearch({
preview: false
}).then((res) => {
......@@ -362,7 +363,7 @@ export default {
},
methods: {
onDictReady(dict) {
this.areaOpts = [{ value: undefined, label: '全部' }, ...dict.area_province]
this.areaOpts = [{ value: '', label: '全部' }, ...dict.area_province]
},
search() {
Object.keys(this.query).length !== 0 && Object.keys(this.query).forEach(item => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment