diff --git a/dist.zip b/dist.zip deleted file mode 100644 index 872a580..0000000 Binary files a/dist.zip and /dev/null differ diff --git a/src/view/sy_map.vue b/src/view/sy_map.vue index 66ce6b0..64b2fe3 100644 --- a/src/view/sy_map.vue +++ b/src/view/sy_map.vue @@ -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=='模环乡') { - // return; + // 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(); diff --git a/vite.config.js b/vite.config.js index 7708875..99753df 100644 --- a/vite.config.js +++ b/vite.config.js @@ -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 替换成空,这个 },