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