网格调整完毕

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) { format (list) {
return list.map(item => { return list.map(item => {
if (item.girdLevel !== '2') {
item.disabled = true
}
if (item.girdList && item.girdList.length) { if (item.girdList && item.girdList.length) {
item.girdList = this.format(item.girdList) item.girdList = this.format(item.girdList)
} }

View File

@@ -100,9 +100,6 @@ export default {
girdName: [ girdName: [
{required: true, message: "请输入网格名称", trigger: "change"}, {required: true, message: "请输入网格名称", trigger: "change"},
], ],
girdLevel: [
{required: true, message: "请选择网格层级", trigger: "change"},
],
girdCode: [ girdCode: [
{required: true, message: "请输入网格编号"}, {required: true, message: "请输入网格编号"},
{pattern: /^\d+$/g, message: "请输入数字"}, {pattern: /^\d+$/g, message: "请输入数字"},

View File

@@ -51,7 +51,6 @@
<el-button <el-button
type="primary" type="primary"
icon="iconfont iconAdd" icon="iconfont iconAdd"
:disabled="info.girdLevel === '3'"
@click="(isEdit = false), toAdd()" @click="(isEdit = false), toAdd()"
>新增 >新增
</el-button> </el-button>
@@ -188,7 +187,6 @@ export default {
path: [], path: [],
overlays: [], overlays: [],
isEdit: false, isEdit: false,
searchId: "",
fileList: [], fileList: [],
dialog: false, dialog: false,
gridInfo: {}, gridInfo: {},
@@ -202,7 +200,7 @@ export default {
created() { created() {
this.getTreeList(); this.getTreeList();
this.getList(); this.getList();
this.dict.load("girdLevel", "girdType", "isLastLevel", "plottingStatus", "girdMemberType"); this.dict.load("girdType", "isLastLevel", "plottingStatus", "girdMemberType");
}, },
computed: { computed: {
colConfigs() { colConfigs() {
@@ -215,24 +213,22 @@ export default {
{slot: "options"} {slot: "options"}
]; ];
}, },
isTopGrid() {
return this.info.id == this.treeObj.treeList?.[0]?.id
}
}, },
methods: { methods: {
handleNodeClick(val) { handleNodeClick(val) {
this.info = {...val}; this.info = this.$copy(val);
this.searchId = val.id;
this.getList(); this.getList();
}, },
getTreeList() { getTreeList() {
this.instance.post("/app/appgirdinfo/listAllByTop").then(res => { this.instance.post("/app/appgirdinfo/listAllByTop").then(res => {
if (res?.data) { if (res?.data) {
this.treeObj.treeList = [res.data]; this.treeObj.treeList = [res.data];
this.info = res.data
this.$nextTick(() => { 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; return data.girdName.indexOf(value) !== -1;
}, },
deleteById(ids) { deleteById(ids) {
ids && ids && this.$confirm("删除网格后会清除网格内网格员和责任家庭信息如有下级网格会同步删除下级网格所有数据!", {
this.$confirm("删除网格后会清除网格内网格员和责任家庭信息如有下级网格会同步删除下级网格所有数据!", {
type: "error", type: "error",
}) }).then(() => {
.then(() => { this.instance.post("/app/appgirdinfo/delete", null, {params: {ids}}).then((res) => {
this.instance
.post("/app/appgirdinfo/delete", null, {
params: {ids},
})
.then((res) => {
if (res?.code == 0) { if (res?.code == 0) {
this.$message.success("删除成功!"); this.$message.success("删除成功!");
this.getList(); this.getList();
this.getTreeList(); this.getTreeList();
} }
}); });
}) }).catch(() => 0);
.catch(() => {
});
}, },
deleteTree(ids) { deleteTree(ids) {
ids && ids && this.$confirm("是否要删除该网格区块", {
this.$confirm("是否要删除该网格区块", {
type: "error", type: "error",
}) }).then(() => {
.then(() => { this.instance.post("/app/appgirdinfo/delete", null, {
this.instance params: {ids}
.post("/app/appgirdinfo/delete", null, { }).then((res) => {
params: {ids},
})
.then((res) => {
if (res?.code == 0) { if (res?.code == 0) {
this.$message.success("删除成功!"); this.$message.success("删除成功!");
this.getTreeList(); this.getTreeList();
} }
}); });
}) }).catch(() => 0);
.catch(() => {
});
}, },
getList() { getList() {
this.instance.post("/app/appgirdinfo/list", null, { this.instance.post("/app/appgirdinfo/list", null, {
params: { params: {
...this.searchObj, ...this.searchObj,
...this.page, ...this.page,
parentGirdId: this.info.girdLevel === '0' ? '' : this.searchId, parentGirdId: this.isTopGrid ? '' : this.info.id,
}, },
}).then((res) => { }).then((res) => {
if (res?.data) { if (res?.data) {