This commit is contained in:
yanran200730
2022-01-18 17:34:34 +08:00
parent a7ab45c070
commit 6a53c29da5
3 changed files with 6 additions and 3 deletions

View File

@@ -275,6 +275,9 @@ export default {
return { return {
girdName: [ girdName: [
{required: true, message: "请填写网格名称", trigger: "change"}, {required: true, message: "请填写网格名称", trigger: "change"},
],
girdLevel: [
{required: true, message: "请选择网格层级", trigger: "change"},
] ]
}; };
}, },

View File

@@ -334,7 +334,7 @@ export default {
this.info = { ...this.treeObj.treeList[0] }; this.info = { ...this.treeObj.treeList[0] };
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.treeObj.treeList[0].id) this.treeObj.treeList.length && this.$refs.tree.setCurrentKey(this.treeObj.treeList[0].id)
}) })
} }
}); });
@@ -389,7 +389,7 @@ export default {
params: { params: {
...this.searchObj, ...this.searchObj,
...this.page, ...this.page,
parentGirdId: this.searchId, parentGirdId: this.info.girdLevel === '0' ? '' : this.searchId,
}, },
}) })
.then((res) => { .then((res) => {

View File

@@ -106,7 +106,7 @@ export default {
this.treeObj.treeList = res.data; this.treeObj.treeList = res.data;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.tree.setCurrentKey(res.data[0].id) res.data.length && this.$refs.tree.setCurrentKey(res.data[0].id)
}) })
} }
}) })