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

wendiang

parent b49a2fef
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</a> </a>
</div> </div>
<Content :class="!showMenu?'con_bord':''"> <Content :class="!showMenu?'con_bord':''">
<Word ref="dataTable" :treeId='treeId'/> <Word ref="dataTable" :treeId="treeId" :addShow="addShow" :ids='ids'/>
</Content> </Content>
</Layout> </Layout>
</div> </div>
...@@ -58,7 +58,9 @@ export default { ...@@ -58,7 +58,9 @@ export default {
model8: "", model8: "",
keys: "", keys: "",
expand: false, expand: false,
treeId:0, treeId: 0,
addShow: false,
ids:[]
}; };
}, },
mounted() { mounted() {
...@@ -131,13 +133,28 @@ export default { ...@@ -131,13 +133,28 @@ export default {
change(a, b) { change(a, b) {
// console.log(a) // console.log(a)
console.log(b); console.log(b);
if (b.children.length == 0) {
this.treeId = b.id; this.treeId = b.id;
if (b.children.length == 0) {
this.addShow = true;
this.$refs.dataTable.$refs.grid.reload(this.easySearch); this.$refs.dataTable.$refs.grid.reload(this.easySearch);
} else { } 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 }) { renderContent(h, { root, node, data }) {
return h( return h(
......
...@@ -80,7 +80,7 @@ export default { ...@@ -80,7 +80,7 @@ export default {
keys: { op: "refName,name", value: null }, keys: { op: "refName,name", value: null },
categoryId: { categoryId: {
op: "In", op: "In",
value: this.treeId, value: this.ids,
}, },
}, },
modal: false, modal: false,
...@@ -255,6 +255,8 @@ export default { ...@@ -255,6 +255,8 @@ export default {
}, },
props: { props: {
treeId: Number, treeId: Number,
addShow: Boolean,
ids: Array,
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
...@@ -291,10 +293,14 @@ export default { ...@@ -291,10 +293,14 @@ export default {
this.$refs.grid.reload(this.easySearch); this.$refs.grid.reload(this.easySearch);
}, },
add() { add() {
if (this.addShow == false) {
this.$Message.error("请在分类最子集新增文档");
} else {
this.curId = 0; this.curId = 0;
this.title = "新增"; this.title = "新增";
this.detail = () => import("./add"); this.detail = () => import("./add");
this.modal = true; this.modal = true;
}
}, },
copy(id) { copy(id) {
this.curId = id; this.curId = id;
...@@ -347,11 +353,23 @@ export default { ...@@ -347,11 +353,23 @@ export default {
}, },
}, },
watch: { watch: {
treeId(v) { // treeId(v) {
if (v != 0) { // alert(v)
this.easySearch.categoryId.value = 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); 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