Commit a4731f52 by xuyl

去除门店远程搜索

1 parent 9949eb05
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
</el-form-item> </el-form-item>
<el-form-item label="选择门店:" prop="selectStore" class="settingSelect"> <el-form-item label="选择门店:" prop="selectStore" class="settingSelect">
<!-- <SearchDropDown :label="'msgMerchantName'" :value="'msgMerchantId'"></SearchDropDown>--> <!-- <SearchDropDown :label="'msgMerchantName'" :value="'msgMerchantId'"></SearchDropDown>-->
<el-select ref="selectLabel" clearable filterable remote :remote-method="remoteMethod" v-el-select-loadmore="loadmore" v-model="basicForm.selectStore" placeholder="请选择门店" @change="selectChange" @clear="clearDrop"> <el-select ref="selectLabel" clearable filterable v-model="basicForm.selectStore" placeholder="请选择门店" @change="selectChange">
<el-option v-for="(item, i) in dataItems" :key="i" :label="item.msgMerchantName" :value="item.msgMerchantId"></el-option> <el-option v-for="(item, i) in dataItems" :key="i" :label="item.msgMerchantName" :value="item.msgMerchantId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -273,76 +273,18 @@ export default { ...@@ -273,76 +273,18 @@ export default {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.boxHeight = clientHeight - 200 this.boxHeight = clientHeight - 200
this.loadUpData(this.pageData, '') this.loadUpData()
},
directives: {
/** 下拉框懒加载 */
'el-select-loadmore': {
bind(el, binding) {
const SELECTWRAP_DOM = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap')
SELECTWRAP_DOM.addEventListener('scroll', function() {
const condition = this.scrollHeight - this.scrollTop <= this.clientHeight
if (condition) {
binding.value()
}
})
}
}
}, },
methods: { methods: {
clearDrop() {
this.pageData = { async loadUpData() {
pageNum: 1, const params = {
pageSize: 40 pageNum: 1,
} pageSize: 10000
this.searchContentStorage = '' }
this.dataItems = []
this.loadUpData(this.pageData, '')
},
loadmore() {
this.pageData.pageNum++
let acquireCount = this.pageData.pageNum * this.pageData.pageSize
if (acquireCount - this.totalNum >= this.pageData.pageSize) {
return
}
if (this.searchContentStorage) {
this.loadUpData(this.pageData, this.searchContentStorage)
} else {
this.loadUpData(this.pageData, '') //类似于分页查询
}
},
async loadUpData(pageData, searchVal) {
let params = {
...pageData,
merchantName: searchVal
}
await this.$apis.wechatGroup.getStoreList(params).then(res => { await this.$apis.wechatGroup.getStoreList(params).then(res => {
this.totalNum = res.count this.dataItems = res.data
this.arrBack = res.data
}) })
this.dataItems = [...this.dataItems, ...this.arrBack]
},
async remoteMethod(searchValue) {
if (searchValue !== '') {
this.searchContentStorage = searchValue
;(this.pageData = {
pageNum: 1,
pageSize: 40
}),
(this.dataItems = [])
this.timer = setTimeout(() => {
this.loadUpData(this.pageData, searchValue)
}, 300)
} else {
this.dataItems = []
this.loadUpData(
{
pageNum: 1,
pageSize: 40
},
''
)
}
}, },
selectChange(val) { selectChange(val) {
// 选择门店时,替换欢迎语组件当中的所有merchantId // 选择门店时,替换欢迎语组件当中的所有merchantId
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!