This commit is contained in:
parent
d6c5de75ab
commit
820c30a177
|
@ -260,7 +260,9 @@
|
|||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="addNew()"> 确认添加 </el-button>
|
||||
<el-button type="primary" @click="addNew()" :disabled="addPd">
|
||||
确认添加
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
@ -330,6 +332,17 @@ const add_new_cs = reactive({
|
|||
center: [],
|
||||
area: [[[]]],
|
||||
});
|
||||
const addPd = computed(() => {
|
||||
if (
|
||||
add_new_cs.name == "" ||
|
||||
add_new_cs.center.length == 0 ||
|
||||
add_new_cs.area.length == 0
|
||||
) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
//编辑村名
|
||||
const input1 = ref("");
|
||||
const dialogVisible = ref(false);
|
||||
|
@ -375,9 +388,9 @@ var map = null;
|
|||
//默认龙游县灰色地块
|
||||
const mapTownDataDK = reactive([]);
|
||||
//社区地块
|
||||
const xkzDk = reactive([]);
|
||||
var xkzDk = [];
|
||||
//社区中心点
|
||||
const xkzCenter = reactive([]);
|
||||
var xkzCenter = [];
|
||||
//村社颜色列表
|
||||
const colorList = [
|
||||
{
|
||||
|
@ -883,6 +896,7 @@ const getCssj = async () => {
|
|||
await http.get("/api/ggfwyth/regionalDivision/getDetails").then((res) => {
|
||||
if (res.code == 200) {
|
||||
cssj = JSON.parse(res.data);
|
||||
console.log(4444);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@ -949,6 +963,7 @@ const closeEdit = async () => {
|
|||
};
|
||||
//退出
|
||||
const backEdit = () => {
|
||||
BMAP();
|
||||
cs_choose_arr.value[0].disableEditing();
|
||||
cs_choose_arr.value.forEach((item, index) => {
|
||||
map.removeOverlay(cs_choose_arr.value[index]);
|
||||
|
@ -959,6 +974,7 @@ const backEdit = () => {
|
|||
};
|
||||
//上传编辑的地块
|
||||
const saveDK = async () => {
|
||||
loadingss.value = true;
|
||||
await http
|
||||
.post(
|
||||
`/api/ggfwyth/regionalDivision/edit?id=${
|
||||
|
@ -985,6 +1001,7 @@ const saveDK = async () => {
|
|||
addCsChoose();
|
||||
}
|
||||
});
|
||||
loadingss.value = false;
|
||||
};
|
||||
//修改村名
|
||||
const nameEdit = () => {
|
||||
|
@ -1089,6 +1106,7 @@ const look = () => {
|
|||
};
|
||||
//添加请求
|
||||
const addNew = async () => {
|
||||
loadingss.value = true;
|
||||
let data1 = {
|
||||
type: "Feature",
|
||||
id: "",
|
||||
|
@ -1130,12 +1148,15 @@ const addNew = async () => {
|
|||
}
|
||||
});
|
||||
addCsUnChoose();
|
||||
loadingss.value = false;
|
||||
};
|
||||
//删除
|
||||
const deleteCs = async () => {
|
||||
ElMessageBox.confirm("确定要删除当前村社?")
|
||||
.then(() => {
|
||||
loadingss.value = true;
|
||||
http
|
||||
|
||||
.post(`/api/ggfwyth/regionalDivision/del?id=${changeCsqkId.value}`)
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
|
@ -1149,14 +1170,23 @@ const deleteCs = async () => {
|
|||
cs_dd_arr.value.forEach((item, index) => {
|
||||
map.removeOverlay(cs_dd_arr.value[index]);
|
||||
});
|
||||
let a;
|
||||
let b;
|
||||
xkzCenter.forEach((item, index) => {
|
||||
if (item.id == changeCsqkId.value) {
|
||||
a = index;
|
||||
}
|
||||
});
|
||||
xkzDk.forEach((item, index) => {
|
||||
if (item.id == changeCsqkId.value) {
|
||||
b = index;
|
||||
}
|
||||
});
|
||||
xkzCenter.splice(a, 1);
|
||||
xkzDk.splice(b, 1);
|
||||
loadingss.value = false;
|
||||
}
|
||||
});
|
||||
setTimeout(() => {
|
||||
getCssj();
|
||||
}, 300);
|
||||
setTimeout(() => {
|
||||
loadCs(cfJd.value);
|
||||
}, 500);
|
||||
})
|
||||
.catch(() => {
|
||||
// catch error
|
||||
|
@ -2886,6 +2916,7 @@ const loadCs = async (name) => {
|
|||
});
|
||||
}
|
||||
}
|
||||
console.log(6666);
|
||||
};
|
||||
//添加村社区块
|
||||
const addPolygonCountyCs = () => {
|
||||
|
@ -3396,7 +3427,7 @@ const reset_font2 = () => {
|
|||
"scale(" + width / 1920 + "," + height / 1080 + ")";
|
||||
};
|
||||
onMounted(async () => {
|
||||
tools.data.set("token", "6b0e380b4a8f46baae4923f83faf670d");
|
||||
// tools.data.set("token", "6b0e380b4a8f46baae4923f83faf670d");
|
||||
loadingss.value = true;
|
||||
reset_font();
|
||||
initMap();
|
||||
|
|
|
@ -15,8 +15,8 @@ export default defineConfig({
|
|||
// 第一个代理
|
||||
"/api": {
|
||||
// 匹配到啥来进行方向代理
|
||||
// target: "http://10.0.0.65:8095/", //刘进
|
||||
target: "http://220.191.238.50:996/", //线上
|
||||
target: "http://10.0.0.65:8095/", //刘进
|
||||
// target: "http://220.191.238.50:996/", //线上
|
||||
changeOrigin: true, //是否支持跨域
|
||||
//rewrite: (path) => path.replace(/^\/api/, '') // 如果不需要api 直接把路径上的api 替换成空,这个
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue