罗世杰:Dropdown生成query
This commit is contained in:
@@ -30,15 +30,38 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeIndex: -1
|
||||
activeIndex: -1,
|
||||
queryInfo: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleMask() {
|
||||
this.$emit('cancelDrop');
|
||||
},
|
||||
sendQueryInfo() {
|
||||
if (this.type === '行业') {
|
||||
this.queryInfo = {
|
||||
business: this.list[this.activeIndex]
|
||||
}
|
||||
} else if (this.type === '区域') {
|
||||
this.queryInfo = {
|
||||
region: this.list[this.activeIndex]
|
||||
}
|
||||
} else if (this.type === '面积') {
|
||||
this.queryInfo = {
|
||||
areaType: this.activeIndex + 1
|
||||
}
|
||||
} else if (this.type === '筛选') {
|
||||
this.queryInfo = {
|
||||
sortType: this.activeIndex + 1
|
||||
}
|
||||
}
|
||||
// 发送queryInfo
|
||||
this.$emit('getQueryInfo', this.queryInfo);
|
||||
},
|
||||
async handleActive(index) {
|
||||
this.activeIndex = index;
|
||||
this.sendQueryInfo(index);
|
||||
// 设置一个定时器,等待200毫秒
|
||||
const delayPromise = this.delay(200);
|
||||
// 等待定时器完成
|
||||
@@ -55,8 +78,7 @@
|
||||
}, ms);
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user