This commit is contained in:
姚宇浩 2024-09-02 16:59:47 +08:00
parent 88effb1c9d
commit d41ffa7356
3 changed files with 113 additions and 55 deletions

BIN
dist.zip

Binary file not shown.

View File

@ -461,7 +461,7 @@ const addPd = computed(() => {
//
const input1 = ref("");
const input2 = ref([]);
const input3=ref("")
const input3 = ref("");
const dialogVisible = ref(false);
const dialogVisible2 = ref(false);
const dialogVisible3 = ref(false);
@ -1090,7 +1090,7 @@ const getCssj = async () => {
* 地块编辑
*/
//
const jsqx = ref(true);
const jsqx = ref(false);
const qxkey = "ggfwyth123";
const qxvalue = ref("");
const bjtitle = computed(() => {
@ -1340,44 +1340,44 @@ const backEdit = () => {
drawing.value = false;
};
//
const shangchuan = async () => {
//0.00328
// for (const item of xkzDk) {
// let a = [];
// a.push(item.point);
// // console.log(JSON.stringify(a));
// let sj = {
// id: item.id,
// data: JSON.stringify(a),
// };
// await http.post(`/api/ggfwyth/regionalDivision/edit`, sj).then((res) => {
// if (res.code == 200) {
// ElMessage.success({
// message: "",
// });
// }
// });
// await new Promise((resolve) => setTimeout(resolve, 1000));
// }
//
for (const item of xkzCenter) {
let sj = {
id: item.id,
data: JSON.stringify(item.center),
};
console.log(sj);
await http
.post(`/api/ggfwyth/regionalDivision/updateCsCenter`, sj)
.then((res) => {
if (res.code == 200) {
ElMessage.success({
message: "保存成功",
});
}
});
await new Promise((resolve) => setTimeout(resolve, 1000));
}
};
// const shangchuan = async () => {
// //0.00328
// // for (const item of xkzDk) {
// // let a = [];
// // a.push(item.point);
// // // console.log(JSON.stringify(a));
// // let sj = {
// // id: item.id,
// // data: JSON.stringify(a),
// // };
// // await http.post(`/api/ggfwyth/regionalDivision/edit`, sj).then((res) => {
// // if (res.code == 200) {
// // ElMessage.success({
// // message: "",
// // });
// // }
// // });
// // await new Promise((resolve) => setTimeout(resolve, 1000));
// // }
// //
// for (const item of xkzCenter) {
// let sj = {
// id: item.id,
// data: JSON.stringify(item.center),
// };
// console.log(sj);
// await http
// .post(`/api/ggfwyth/regionalDivision/updateCsCenter`, sj)
// .then((res) => {
// if (res.code == 200) {
// ElMessage.success({
// message: "",
// });
// }
// });
// await new Promise((resolve) => setTimeout(resolve, 1000));
// }
// };
//
const saveDK = async () => {
loadingss.value = true;
@ -1415,9 +1415,9 @@ const nameEdit = () => {
dialogVisible.value = true;
};
//
const xzEdit=()=>{
const xzEdit = () => {
dialogVisible4.value = true;
}
};
const centerEdit = () => {
dialogVisible3.value = true;
};
@ -1456,10 +1456,62 @@ const csName = async () => {
});
}, 500);
};
const ssxzEdit=()=>{
const ssxzEdit = async () => {
console.log(cs_choose_arr.value[0]);
console.log(xuanzhongCs.value);
let arrJWD2 = [[[]]];
cs_choose_arr.value[0].points.forEach((item, index) => {
let arr1 = [];
arr1.push(item?.latLng.lng);
arr1.push(item?.latLng.lat);
arrJWD2[0][0].push(arr1);
});
let data1 = {
type: "Feature",
id: "",
geometry: {
type: "MultiPolygon",
coordinates: [],
},
properties: {
name: "",
center: [],
layer: "乡镇",
},
};
let sj = {
id: xuanzhongCs.value[0].id,
name: input3.value,
data: {},
};
data1.id = `${input3.value}_${xuanzhongCs.value[0].name}`;
data1.geometry.coordinates = [...arrJWD2];
data1.properties.name = xuanzhongCs.value[0].name;
data1.properties.center = xuanzhongCs.value[0].center;
sj.data = JSON.stringify(data1);
console.log(sj);
}
await http
.post(`/api/ggfwyth/regionalDivision/updateVillageAffiliationTown`, sj)
.then((res) => {
if (res.code == 200) {
ElMessage.success({
message: "添加成功",
});
input3.value = "";
dialogVisible4.value = false;
}
});
await getCssj();
await loadCs(cfJd.value);
cs_choose_arr.value.forEach((item, index) => {
map.removeOverlay(cs_choose_arr.value[index]);
});
cs_dd_arr.value.forEach((item, index) => {
map.removeOverlay(cs_dd_arr.value[index]);
});
};
const csCenter = async () => {
let regionalDivisionEditDTO = {
id: changeCsqkId.value,
@ -3269,6 +3321,7 @@ let offsetX = 0.01095; // 横向偏移量
let offsetY = 0.00314; //
let offsetX2 = 0.01; //
let offsetY2 = 0.00328; //
const isclick = ref('');
const addPolygonCounty = () => {
map.clearOverlays();
let fillColor = "#ffffff";
@ -3298,8 +3351,12 @@ const addPolygonCounty = () => {
map.addOverlay(polygon);
polygon.addEventListener("click", async () => {
// if (cfJd.value == "" && item.name=='') {
// if (cfJd.value == "" && item.name == "") {
// if (isclick.value=='') {
// return;
// } else {
// }
// }
if (showEdit.value) {
return;
@ -3534,9 +3591,6 @@ const addPolygonCountyCs = () => {
// itemm[1] = itemm[1] + 0.00328;
// });
item.point[0].map((p) => points.push(new BMapGL.Point(...p)));
// let offsetPoints2 = points.map((point) =>
// offsetPoint2(point, offsetX2, offsetY2)
// );
if (points.length) {
//
cs_qk_arr.value[index] = new BMapGL.Polygon(points, {
@ -3550,14 +3604,18 @@ const addPolygonCountyCs = () => {
});
map.addOverlay(cs_qk_arr.value[index]);
cs_qk_arr.value[index].addEventListener("click", async () => {
console.log("cunshee");
// if(item.name == '' || item.name == '' || item.name == '' || item.name=='' || item.name=='' || item.name==''){
// isclick.value=item.name;
// }else{
// isclick.value=item.name;
// }
if (drawing.value) {
return;
}
loadingss.value = true;
cs_dd_arr.value = [];
xuanzhongCs.value=[];
xuanzhongCs.value = [];
cfCs.value = item.name;
title_cs.value = item.name;
sfdd.value = true;
@ -4010,7 +4068,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();
await getXzsj();

View File

@ -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 替换成空,这个
},