网格调整完毕

This commit is contained in:
aixianling
2022-06-01 10:10:34 +08:00
parent 49aa0a6276
commit 58c3d89297
3 changed files with 18 additions and 45 deletions

View File

@@ -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)
}

View File

@@ -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: "请输入数字"},

View File

@@ -51,7 +51,6 @@
<el-button
type="primary"
icon="iconfont iconAdd"
:disabled="info.girdLevel === '3'"
@click="(isEdit = false), toAdd()"
>新增
</el-button>
@@ -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) {