优化 base 模块

This commit is contained in:
icssoa 2021-03-12 17:52:20 +08:00
parent 84820b831a
commit 790e1519cc
3 changed files with 8 additions and 6 deletions

View File

@ -95,6 +95,7 @@ export default {
}, },
onCheckStrictlyChange() { onCheckStrictlyChange() {
this.form.departmentIdList = [];
this.visible = false; this.visible = false;
this.$nextTick(() => { this.$nextTick(() => {

View File

@ -91,6 +91,10 @@ export default {
methods: { methods: {
openCM(e, d, n) { openCM(e, d, n) {
if (!d) {
d = this.list[0] || {};
}
let list = [ let list = [
{ {
label: "新增", label: "新增",
@ -115,10 +119,6 @@ export default {
} }
]; ];
if (!d) {
d = this.list[0];
}
if (d.parentId) { if (d.parentId) {
list.push({ list.push({
label: "删除", label: "删除",
@ -148,7 +148,7 @@ export default {
return data.parentId; return data.parentId;
}, },
allowDrop(draggingNode, dropNode) { allowDrop(_, dropNode) {
return dropNode.data.parentId; return dropNode.data.parentId;
}, },
@ -175,6 +175,7 @@ export default {
}, },
rowEdit(e) { rowEdit(e) {
console.log(e);
const method = e.id ? "update" : "add"; const method = e.id ? "update" : "add";
Form.open({ Form.open({

View File

@ -80,7 +80,7 @@ export default {
fn(this.list); fn(this.list);
this.checked = ids.filter(id => (val || []).includes(id)); this.checked = ids.filter(id => (val || []).find(e => e == id));
}, },
refresh() { refresh() {