功能变化: 优化table-seletor选择器
parent
a7de6911f8
commit
2316d93843
|
@ -378,4 +378,5 @@ PLUGINS_URL_PATTERNS = []
|
||||||
# from dvadmin_upgrade_center.settings import * # 升级中心
|
# from dvadmin_upgrade_center.settings import * # 升级中心
|
||||||
# from dvadmin_celery.settings import * # celery 异步任务
|
# from dvadmin_celery.settings import * # celery 异步任务
|
||||||
# ...
|
# ...
|
||||||
|
from dvadmin_drag_h5.settings import *
|
||||||
# ********** 一键导入插件配置结束 **********
|
# ********** 一键导入插件配置结束 **********
|
||||||
|
|
|
@ -201,6 +201,7 @@ export default {
|
||||||
// this.dict = d2CrudPlus.util.dict.mergeDefault(this.dict, true)
|
// this.dict = d2CrudPlus.util.dict.mergeDefault(this.dict, true)
|
||||||
// }
|
// }
|
||||||
// this.initData()
|
// this.initData()
|
||||||
|
console.log(this)
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
_elProps () {
|
_elProps () {
|
||||||
|
@ -327,32 +328,23 @@ export default {
|
||||||
this.$emit('current-change', event)
|
this.$emit('current-change', event)
|
||||||
},
|
},
|
||||||
openDialog () {
|
openDialog () {
|
||||||
if (this.disabled) {
|
const that = this
|
||||||
|
if (that.disabled) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.dialogVisible = true
|
that.dialogVisible = true
|
||||||
setTimeout(() => {
|
if (that.value != null) {
|
||||||
if (this.selected != null) {
|
that.$nextTick(() => {
|
||||||
const ids = this.selected.map(
|
const refs = Object.assign({}, that.$refs)
|
||||||
(item) => item[this._elProps.props.value]
|
const { elTree } = refs
|
||||||
)
|
console.log(elTree)
|
||||||
ids.forEach((id) => {
|
if (that.multiple) {
|
||||||
const current = this.$refs.elTree.store.nodesMap[id]
|
elTree.setCheckboxRow(that.selected, true)
|
||||||
if (current != null) {
|
} else {
|
||||||
this.doExpandParent(current)
|
elTree.setRadioRow(that.selected[0])
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.$nextTick(() => {
|
}
|
||||||
if (this.multiple) {
|
|
||||||
// this.$refs.elTree.setCheckedKeys(ids, this.leafOnly);
|
|
||||||
this.$refs.elTree.setCheckboxRow(ids)
|
|
||||||
} else if (ids.length > 0) {
|
|
||||||
// this.$refs.elTree.setCurrentKey(ids[0]);
|
|
||||||
this.$refs.elTree.setRadioRow(ids[0])
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}, 1)
|
|
||||||
},
|
},
|
||||||
doExpandParent (node) {
|
doExpandParent (node) {
|
||||||
if (node.parent != null) {
|
if (node.parent != null) {
|
||||||
|
@ -412,20 +404,6 @@ export default {
|
||||||
// 获取选中的行数据
|
// 获取选中的行数据
|
||||||
refreshSelected () {
|
refreshSelected () {
|
||||||
let nodes = null
|
let nodes = null
|
||||||
// if (this.multiple) {
|
|
||||||
// nodes = this.$refs.elTree.getCheckedNodes(
|
|
||||||
// this.leafOnly,
|
|
||||||
// this.includeHalfChecked
|
|
||||||
// );
|
|
||||||
// } else {
|
|
||||||
// const node = this.$refs.elTree.getCurrentNode();
|
|
||||||
// if (node == null) {
|
|
||||||
// nodes = [];
|
|
||||||
// } else {
|
|
||||||
// nodes = [node];
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (this.multiple) {
|
if (this.multiple) {
|
||||||
nodes = this.$refs.elTree.getCheckboxRecords()
|
nodes = this.$refs.elTree.getCheckboxRecords()
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue