NEZ-2842 feat: 新增可编辑已添加的条件

This commit is contained in:
zhangyu
2023-06-05 18:35:48 +08:00
parent a93ec987b5
commit f6f577e895
3 changed files with 223 additions and 69 deletions

View File

@@ -1093,3 +1093,37 @@ export function dealLegendAlias (legend, expression) {
return expression
}
}
// 滚动加载更多
let heightLoad = function () {
}
export const loadMore = {
bind (el, binding) {
console.log(el, binding)
// 获取element定义scroll
const selectDom = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap')
// selectDom.addEventListener('scroll', function (e) {
// console.log(e)
// const height = this.scrollHeight - this.scrollTop <= this.clientHeight
// if (height) {
// binding.value()
// }
// })
heightLoad = function () {
const height = this.scrollHeight - this.scrollTop <= this.clientHeight
if (height && el.hasMore) {
binding.value.load()
}
}
selectDom.addEventListener('scroll', heightLoad)
},
update (el, binding) {
el.hasMore = binding.value.hasMore
},
unbind (el, binding) {
const selectDom = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap')
if (selectDom) {
selectDom.removeEventListener('scroll', heightLoad)
}
}
}