This commit is contained in:
姚宇浩 2024-08-21 10:37:49 +08:00
parent 853947650f
commit 61aa74ef6c
1 changed files with 71 additions and 14 deletions

View File

@ -2,7 +2,7 @@
<div class="module">
<teleport to="body">
<div id="map" style="width: 100vw; height: 100vh" v-show="openD"></div>
<div class="left" style="width: 517px">
<div class="left" style="width: 517px" v-show="!showEdit">
<div class="lyx">
<div class="title">
<div class="title_name">
@ -108,7 +108,7 @@
</div>
</div>
</div>
<div class="right" style="width: 517px">
<div class="right" style="width: 517px" v-show="!showEdit">
<div class="jbggfwq">
<div class="title">
<div class="title_name"><span> 基本公共服务圈</span></div>
@ -155,8 +155,11 @@
</div>
</div>
<div class="btns" v-if="showEdit">
<div class="btnopen" @click="openEdit">编辑</div>
<div class="btnsave" @click="saveEdit">保存</div>
<div class="btnsave" @click="nameEdit">修改村名</div>
<div class="btnopen" @click="openEdit">编辑地块</div>
<div class="btnsave" @click="saveEdit">保存地块</div>
<div class="btnsave">添加地块</div>
<div class="btnsave">删除地块</div>
<div class="btnclose" @click="closeEdit">取消</div>
</div>
@ -208,6 +211,18 @@
<div class="text">加载中...</div>
</div>
</div>
<el-dialog v-model="dialogVisible" title="修改村名" width="500">
<el-input
v-model="input1"
style="width: 240px"
placeholder="请输入新村名"
/>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="csName()"> 确认修改 </el-button>
</div>
</template>
</el-dialog>
</teleport>
</div>
</template>
@ -263,6 +278,9 @@ import Dialog from "./dialog/dialogMapDp.vue";
import personDetail from "./person/index.vue";
import gcj02towgs84 from "@/utils/gcj02towgs84.js";
//---------------
//
const input1 = ref("");
const dialogVisible = ref(false);
//
const loadingss = ref(false);
const loadTable = ref(false);
@ -867,16 +885,16 @@ const closeEdit = async () => {
});
addCsChoose();
showEdit.value = false;
let a = document.documentElement.getElementsByClassName("left")[0];
a.style.opacity = "1";
let b = document.documentElement.getElementsByClassName("right")[0];
b.style.opacity = "1";
// let a = document.documentElement.getElementsByClassName("left")[0];
// a.style.opacity = "1";
// let b = document.documentElement.getElementsByClassName("right")[0];
// b.style.opacity = "1";
};
//
const saveDK = async () => {
await http
.post(
`/api/ggfwyth/regionalDivision/addCsManagerRegionalDivision?id=${
`/api/ggfwyth/regionalDivision/updateCsManagerRegionalDivision?id=${
changeCsqkId.value
}&data=${JSON.stringify(arrJWD)}`
)
@ -901,7 +919,44 @@ const saveDK = async () => {
}
});
};
//
const nameEdit = () => {
dialogVisible.value = true;
};
const csName = async () => {
let n=input1.value;
await http
.post(
`/api/ggfwyth/regionalDivision/updateCsName?id=${changeCsqkId.value}&data=${input1.value}`
)
.then((res) => {
if (res.code == 200) {
ElMessage.success({
message: "修改村名成功",
offset: 100, //
});
}
});
input1.value = "";
dialogVisible.value = false;
await getCssj();
await loadCs(cfJd.value);
cs_dd_arr.value.forEach((item, index) => {
map.removeOverlay(cs_dd_arr.value[index]);
});
cs_dd_arr.value = [];
xkzCenter.forEach((a) => {
if (a.name == n) {
cs_dd_arr.value.push(a);
}
});
console.log("cs_dd_arr.value", cs_dd_arr.value);
setTimeout(() => {
cs_dd_arr.value.map((item, index) => {
DGcreateCs(item, index);
});
}, 500);
};
//
const csh = () => {
clear();
@ -2931,6 +2986,8 @@ const createCs2 = (polygon, indexx) => {
};
//
const DGcreateCs = (polygon, indexx) => {
console.log(7777777777);
function createLabelDOM() {
var content = document.createElement("div");
content.style.display = "flex";
@ -2987,10 +3044,10 @@ const DGcreateCs = (polygon, indexx) => {
console.log(polygon.id);
changeCsqkId.value = polygon.id;
showEdit.value = !showEdit.value;
let a = document.documentElement.getElementsByClassName("left")[0];
a.style.opacity = "0";
let b = document.documentElement.getElementsByClassName("right")[0];
b.style.opacity = "0";
// let a = document.documentElement.getElementsByClassName("left")[0];
// a.style.opacity = "0";
// let b = document.documentElement.getElementsByClassName("right")[0];
// b.style.opacity = "0";
}
});
};