This commit is contained in:
duanxiaohai 2024-09-02 17:24:32 +08:00
commit 1bda24499a
3 changed files with 109 additions and 52 deletions

BIN
dist.zip

Binary file not shown.

View File

@ -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;
@ -1456,8 +1456,61 @@ 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 = {
@ -3268,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";
@ -3297,11 +3351,13 @@ const addPolygonCounty = () => {
map.addOverlay(polygon);
polygon.addEventListener("click", async () => {
console.log(item.name);
if (cfJd.value == "湖镇镇" && item.name == "模环乡") {
return;
}
// if (cfJd.value == "" && item.name == "") {
// if (isclick.value=='') {
// return;
// } else {
// }
// }
if (showEdit.value) {
return;
}
@ -3535,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, {
@ -3551,7 +3604,11 @@ 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;
@ -4011,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 替换成空,这个
},