This commit is contained in:
parent
2051d49d98
commit
4bcc4eaf5d
|
@ -54,7 +54,6 @@
|
|||
controls
|
||||
playsinline
|
||||
autoplay="autoplay"
|
||||
style="width: 100%; height: auto;"
|
||||
>
|
||||
<source :src="attachmentLink" type="application/x-mpegURL" />
|
||||
</video>
|
||||
|
|
|
@ -958,26 +958,33 @@ const setActiveStyle = (overlay) => {
|
|||
overlay.setOptions(activeStyle);
|
||||
};
|
||||
const clickHandler = (e) => {
|
||||
console.log(5555, e);
|
||||
console.log(5555);
|
||||
let target = polyLayer.pickOverlays(e.target);
|
||||
if (target && target[0]) {
|
||||
selectedOverlay = target[0];
|
||||
setActiveStyle(selectedOverlay);
|
||||
movepoy.open(selectedOverlay);
|
||||
console.log("5-1", selectedOverlay);
|
||||
// nextTick(() => {
|
||||
setActiveStyle(selectedOverlay);
|
||||
movepoy.open(selectedOverlay);
|
||||
// });
|
||||
} else {
|
||||
console.log(888);
|
||||
console.log("5-2");
|
||||
|
||||
polyLayer.resetStyle();
|
||||
}
|
||||
};
|
||||
//开始平移
|
||||
const moveEdit = () => {
|
||||
console.log(11111, cs_choose_arr.value[0]);
|
||||
map.removeEventListener("click", markera);
|
||||
if (currentMarker !== null) {
|
||||
map.removeOverlay(currentMarker);
|
||||
}
|
||||
//
|
||||
// map.value = map;
|
||||
selectedOverlay = null;
|
||||
sceneMove = null;
|
||||
movepoy = null;
|
||||
select = null;
|
||||
|
||||
map.addGeoJSONLayer(polyLayer);
|
||||
polyLayer.addOverlay(cs_choose_arr.value[0]);
|
||||
sceneMove = new DrawScene(map);
|
||||
|
@ -988,20 +995,24 @@ const moveEdit = () => {
|
|||
type: DrawingType.DRAWING_POINT,
|
||||
});
|
||||
select.open();
|
||||
polyLayer.resetStyle();
|
||||
sceneMove.addEventListener(OperateEventType.CLICK, clickHandler);
|
||||
};
|
||||
//取消移动
|
||||
const moveCancel = () => {
|
||||
sceneMove.removeEventListener(OperateEventType.CLICK, clickHandler);
|
||||
polyLayer.resetStyle();
|
||||
cs_choose_arr.value.forEach((item, index) => {
|
||||
map.removeOverlay(cs_choose_arr.value[index]);
|
||||
});
|
||||
addCsChoose();
|
||||
polyLayer.resetStyle();
|
||||
};
|
||||
//保存移动
|
||||
const moveSave = () => {
|
||||
console.log(22222, cs_choose_arr.value[0]);
|
||||
// select.close();
|
||||
// movepoy.close(selectedOverlay);
|
||||
polyLayer.resetStyle();
|
||||
arrJWD = [[[]]];
|
||||
sceneMove.removeEventListener(OperateEventType.CLICK, clickHandler);
|
||||
cs_choose_arr.value[0].points.forEach((item, index) => {
|
||||
|
@ -1011,17 +1022,50 @@ const moveSave = () => {
|
|||
arrJWD[0][0].push(arr1);
|
||||
});
|
||||
console.log("arrJWD", arrJWD);
|
||||
saveDK();
|
||||
|
||||
moveDK();
|
||||
};
|
||||
//取消移动模式
|
||||
//退出移动模式
|
||||
const moveBack = () => {
|
||||
// select.close();
|
||||
sceneMove.removeEventListener(OperateEventType.CLICK, clickHandler);
|
||||
polyLayer.resetStyle();
|
||||
// cs_choose_arr.value.forEach((item, index) => {
|
||||
// map.removeOverlay(cs_choose_arr.value[index]);
|
||||
// });
|
||||
// addCsChoose();
|
||||
move_mode.value = false;
|
||||
drawing.value = false;
|
||||
};
|
||||
//移动保存
|
||||
const moveDK = async () => {
|
||||
loadingss.value = true;
|
||||
await http
|
||||
.post(
|
||||
`/api/ggfwyth/regionalDivision/edit?id=${
|
||||
changeCsqkId.value
|
||||
}&data=${JSON.stringify(arrJWD)}`
|
||||
)
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
ElMessage.success({
|
||||
message: "保存成功",
|
||||
});
|
||||
}
|
||||
});
|
||||
await getCssj();
|
||||
await loadCs(cfJd.value);
|
||||
cs_choose_arr.value.forEach((item, index) => {
|
||||
map.removeOverlay(cs_choose_arr.value[index]);
|
||||
});
|
||||
addCsChoose();
|
||||
move_mode.value = false;
|
||||
drawing.value = false;
|
||||
chooseCsList.value.length = 0;
|
||||
xkzDk.forEach((itemm, indexx) => {
|
||||
if (itemm.name == cfCs.value) {
|
||||
chooseCsList.value.push(itemm);
|
||||
addCsChoose();
|
||||
}
|
||||
});
|
||||
loadingss.value = false;
|
||||
};
|
||||
//编辑模式
|
||||
const editmode = () => {
|
||||
|
|
Loading…
Reference in New Issue