Commit 63a2249d by 胡悦

添加头部搜索

1 parent ec6f3c37
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: huyue
* @LastEditTime: 2023-07-17 11:47:03
* @LastEditTime: 2023-07-17 15:30:54
* @FilePath: \dj-data-view\src\components\ViewTitle.vue
* @Description: 页面头部组件
-->
......@@ -74,7 +74,6 @@ export default {
},
mounted() {
this.timer()
console.log(this.merchantList)
},
methods: {
timer() {
......@@ -93,16 +92,18 @@ export default {
this.search = ''
},
async searchMerchant() {
const _searchData = await this.api.solar.getMerchant({})
const _searchData = await this.api.solar.getMerchant({
merchantName: this.search
})
const _dataList = _searchData.data.dataList
_dataList.forEach(item => {
item.merchantname = item.merchantName
})
this.merchantList = _dataList
},
handleInput: utils.throttle(function(e) {
handleInput: utils.debounce(function(e) {
this.searchMerchant()
}, 2000 / 25),
}, 1000 / 25),
clickOutside() {
this.isShow = false
}
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-05 15:11:53
* @LastEditors: huyue
* @LastEditTime: 2023-07-17 10:36:40
* @LastEditTime: 2023-07-17 15:30:16
-->
<template>
<div v-click-outside="handleClickOutside" @mouseleave="handleMouseLeave" v-show="isShow" class="select-box" :style="{'width': boxWidth}">
......@@ -72,16 +72,9 @@ export default {
empty: '暂无数据'
}
},
watch: {
'dataList'(val) {
console.log(val)
}
},
mounted() {
const { valueName, isObject, dataList, defaultValue } = this
console.log(defaultValue)
this.value = defaultValue || (isObject ? dataList[0][valueName] : dataList[0])
console.log(this.value)
},
methods: {
select(item) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!