Commit 35d2f07e authored by 仇晓婷's avatar 仇晓婷

wendiang

parent b49a2fef
......@@ -33,7 +33,7 @@
</a>
</div>
<Content :class="!showMenu?'con_bord':''">
<Word ref="dataTable" :treeId='treeId'/>
<Word ref="dataTable" :treeId="treeId" :addShow="addShow" :ids='ids'/>
</Content>
</Layout>
</div>
......@@ -58,7 +58,9 @@ export default {
model8: "",
keys: "",
expand: false,
treeId:0,
treeId: 0,
addShow: false,
ids:[]
};
},
mounted() {
......@@ -131,13 +133,28 @@ export default {
change(a, b) {
// console.log(a)
console.log(b);
if (b.children.length == 0) {
this.treeId = b.id;
if (b.children.length == 0) {
this.addShow = true;
this.$refs.dataTable.$refs.grid.reload(this.easySearch);
} else {
this.treeId = 0;
this.addShow = false;
}
let ids = [];
ids.push(b.value);
if (b.children) {
addId(b.children);
function addId(data) {
data.map((u) => {
ids.push(u.value);
if (u.children) {
addId(u.children);
}
});
}
}
alert(this.treeId )
console.log(ids)
this.ids = ids;
},
renderContent(h, { root, node, data }) {
return h(
......
......@@ -80,7 +80,7 @@ export default {
keys: { op: "refName,name", value: null },
categoryId: {
op: "In",
value: this.treeId,
value: this.ids,
},
},
modal: false,
......@@ -255,6 +255,8 @@ export default {
},
props: {
treeId: Number,
addShow: Boolean,
ids: Array,
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
......@@ -291,10 +293,14 @@ export default {
this.$refs.grid.reload(this.easySearch);
},
add() {
if (this.addShow == false) {
this.$Message.error("请在分类最子集新增文档");
} else {
this.curId = 0;
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
}
},
copy(id) {
this.curId = id;
......@@ -347,11 +353,23 @@ export default {
},
},
watch: {
treeId(v) {
if (v != 0) {
this.easySearch.categoryId.value = v;
// treeId(v) {
// alert(v)
// if (v != 0) {
// // this.easySearch.categoryId.value = v;
// this.$refs.grid.reload(this.easySearch);
// }
// },
ids: {
handler(newName, oldName) {
// console.log("ovo", newName, oldName);
// console.log(newName);
this.easySearch.categoryId.value = newName;
this.$refs.grid.reload(this.easySearch);
}
},
// immediate: true,
deep: true,
},
},
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment