diff --git a/project/grid/AppCommunityManage/components/Add.vue b/project/grid/AppCommunityManage/components/Add.vue index fcaf118d..19b89e89 100644 --- a/project/grid/AppCommunityManage/components/Add.vue +++ b/project/grid/AppCommunityManage/components/Add.vue @@ -142,10 +142,6 @@ export default { format (list) { return list.map(item => { - if (item.girdLevel !== '2') { - item.disabled = true - } - if (item.girdList && item.girdList.length) { item.girdList = this.format(item.girdList) } diff --git a/project/grid/AppGridBlock/components/add.vue b/project/grid/AppGridBlock/components/add.vue index 3666d3da..d01f5a14 100644 --- a/project/grid/AppGridBlock/components/add.vue +++ b/project/grid/AppGridBlock/components/add.vue @@ -100,9 +100,6 @@ export default { girdName: [ {required: true, message: "请输入网格名称", trigger: "change"}, ], - girdLevel: [ - {required: true, message: "请选择网格层级", trigger: "change"}, - ], girdCode: [ {required: true, message: "请输入网格编号"}, {pattern: /^\d+$/g, message: "请输入数字"}, diff --git a/project/grid/AppGridBlock/components/list.vue b/project/grid/AppGridBlock/components/list.vue index 775cfce8..0dfca6b4 100644 --- a/project/grid/AppGridBlock/components/list.vue +++ b/project/grid/AppGridBlock/components/list.vue @@ -51,7 +51,6 @@ 新增 @@ -188,7 +187,6 @@ export default { path: [], overlays: [], isEdit: false, - searchId: "", fileList: [], dialog: false, gridInfo: {}, @@ -202,7 +200,7 @@ export default { created() { this.getTreeList(); this.getList(); - this.dict.load("girdLevel", "girdType", "isLastLevel", "plottingStatus", "girdMemberType"); + this.dict.load("girdType", "isLastLevel", "plottingStatus", "girdMemberType"); }, computed: { colConfigs() { @@ -215,24 +213,22 @@ export default { {slot: "options"} ]; }, + isTopGrid() { + return this.info.id == this.treeObj.treeList?.[0]?.id + } }, methods: { handleNodeClick(val) { - this.info = {...val}; - this.searchId = val.id; + this.info = this.$copy(val); this.getList(); }, getTreeList() { this.instance.post("/app/appgirdinfo/listAllByTop").then(res => { if (res?.data) { this.treeObj.treeList = [res.data]; + this.info = res.data this.$nextTick(() => { - if (this.treeObj.treeList.length && !this.info.girdLevel) { - this.$refs.tree.setCurrentKey(this.treeObj.treeList[0].id) - this.info = {...this.treeObj.treeList[0]}; - } else { - this.$refs.tree.setCurrentKey(this.info.id) - } + this.$refs.tree.setCurrentKey(this.info.id) }) } }); @@ -242,54 +238,38 @@ export default { return data.girdName.indexOf(value) !== -1; }, deleteById(ids) { - ids && - this.$confirm("删除网格后,会清除网格内网格员和责任家庭信息,如有下级网格,会同步删除下级网格所有数据!", { + ids && this.$confirm("删除网格后,会清除网格内网格员和责任家庭信息,如有下级网格,会同步删除下级网格所有数据!", { type: "error", - }) - .then(() => { - this.instance - .post("/app/appgirdinfo/delete", null, { - params: {ids}, - }) - .then((res) => { + }).then(() => { + this.instance.post("/app/appgirdinfo/delete", null, {params: {ids}}).then((res) => { if (res?.code == 0) { this.$message.success("删除成功!"); - this.getList(); this.getTreeList(); } }); - }) - .catch(() => { - }); + }).catch(() => 0); }, deleteTree(ids) { - ids && - this.$confirm("是否要删除该网格区块?", { + ids && this.$confirm("是否要删除该网格区块?", { type: "error", - }) - .then(() => { - this.instance - .post("/app/appgirdinfo/delete", null, { - params: {ids}, - }) - .then((res) => { + }).then(() => { + this.instance.post("/app/appgirdinfo/delete", null, { + params: {ids} + }).then((res) => { if (res?.code == 0) { this.$message.success("删除成功!"); - this.getTreeList(); } }); - }) - .catch(() => { - }); + }).catch(() => 0); }, getList() { this.instance.post("/app/appgirdinfo/list", null, { params: { ...this.searchObj, ...this.page, - parentGirdId: this.info.girdLevel === '0' ? '' : this.searchId, + parentGirdId: this.isTopGrid ? '' : this.info.id, }, }).then((res) => { if (res?.data) {