This commit is contained in:
duanxiaohai 2024-08-26 14:22:06 +08:00
commit 9c0e098d9b
3 changed files with 160 additions and 18 deletions

View File

@ -54,6 +54,7 @@
controls
playsinline
autoplay="autoplay"
style="width: 100%; height: auto;"
>
<source :src="attachmentLink" type="application/x-mpegURL" />
</video>
@ -110,12 +111,13 @@ watch(
num.value = true;
}
// if (hlsUriSslNow.value != "" && props.hlsUriSsl != hlsUriSslNow.value)
data.title = props.sxtname;
cameraShow.value = newVal;
hlsUriSslNow.value = props.hlsUriSsl;
data.title = props.sxtname;
console.log(hlsUriSslNow.value, props.sxtname, 5555);
attachmentLink.value = hlsUriSslNow.value;
dp.value = null;
// console.log(hlsUriSslNow.value, props.sxtname, 5555);
//dom
if (num.value) {
console.log(22222, document.getElementById("videoBox"));
@ -154,6 +156,9 @@ const options = {
muted: true,
preload: "auto",
controls: true,
hls:{
}
};
const loadVideo = () => {
@ -176,8 +181,6 @@ const closeDialog = () => {
};
</script>
<style lang="scss" scoped>
//
::v-deep .video-js .vjs-big-play-button {

View File

@ -112,7 +112,7 @@
<div class="jbggfwq">
<div class="title">
<div class="title_name">
<span > 基本公共服务圈</span>
<span> 基本公共服务圈</span>
</div>
</div>
<div class="jbggfwq_content">
@ -157,11 +157,19 @@
</div>
</div>
<div class="btns" v-if="showEdit">
<div class="btnopen" @click="nameEdit" v-if="!add_mode && !edit_mode">
<div
class="btnopen"
@click="nameEdit"
v-if="!add_mode && !edit_mode && !move_mode"
>
修改村名
</div>
<div class="btnsave" @click="addmode" v-if="!edit_mode && !add_mode">
添加
<div
class="btnsave"
@click="addmode"
v-if="!edit_mode && !add_mode && !move_mode"
>
添加模式
</div>
<div style="display: flex" v-if="add_mode">
<div class="btnsave" @click="draw">添加地块</div>
@ -170,18 +178,43 @@
<div class="btnsave" @click="look">查看添加列表</div>
<div class="btnsave" @click="addBack">退出添加</div>
</div>
<div class="btnsave" @click="editmode" v-if="!edit_mode && !add_mode">
编辑
<div
class="btnsave"
@click="editmode"
v-if="!edit_mode && !add_mode && !move_mode"
>
编辑模式
</div>
<div style="display: flex" v-if="edit_mode">
<div class="btnsave" @click="openEdit">编辑地块</div>
<div class="btnsave" @click="saveEdit">保存地块</div>
<div class="btnsave" @click="closeEdit">退出编辑</div>
</div>
<div class="btnsave" v-if="!add_mode && !edit_mode" @click="deleteCs">
<div
class="btnsave"
@click="movemode"
v-if="!edit_mode && !add_mode && !move_mode"
>
移动模式
</div>
<div style="display: flex" v-if="move_mode">
<div class="btnsave" @click="moveEdit">移动地块</div>
<div class="btnsave" @click="moveCancel">取消移动</div>
<div class="btnsave" @click="moveSave">保存移动</div>
<div class="btnsave" @click="moveBack">退出移动</div>
</div>
<div
class="btnsave"
v-if="!add_mode && !edit_mode && !move_mode"
@click="deleteCs"
>
删除地块
</div>
<div class="btnclose" @click="backEdit" v-if="!add_mode && !edit_mode">
<div
class="btnclose"
@click="backEdit"
v-if="!add_mode && !edit_mode && !move_mode"
>
退出
</div>
</div>
@ -335,12 +368,20 @@ import DialogCamera from "./dialog/dialogCameras.vue";
import personDetail from "./person/index.vue";
// import gcj02towgs84 from "@/utils/gcj02towgs84.js";
// import { DrawScene, AreaMeasure, MarkerDraw } from "bmap-draw";
import { DrawScene, PolygonDraw } from "bmap-draw";
import {
DrawScene,
PolygonDraw,
PolygonMove,
Select,
DrawingType,
OperateEventType,
} from "bmap-draw";
//---------------
//
const drawing = ref(false);
const add_mode = ref(false);
const edit_mode = ref(false);
const move_mode = ref(false);
const add_new_cs = reactive({
name: "",
center: [],
@ -881,11 +922,112 @@ const getCssj = async () => {
}
});
};
//
const movemode = () => {
drawing.value = true;
move_mode.value = true;
selectedOverlay = null;
sceneMove = null;
movepoy = null;
select = null;
arrJWD = [[[]]];
};
//
var selectedOverlay = null;
var sceneMove;
var movepoy;
var select;
const normalStyle = {
fillColor: "#ad9ff8",
strokeColor: "#4f2ff1",
strokeWeight: 2,
fillOpacity: 0.6,
};
const activeStyle = {
fillColor: "#d6b0fd",
strokeColor: "#ad70eb",
strokeWeight: 2,
fillOpacity: 0.6,
};
const polyLayer = new BMapGL.GeoJSONLayer("poly", {
dataSource: null,
polygonStyle: normalStyle,
});
const setActiveStyle = (overlay) => {
polyLayer.resetStyle();
overlay.setOptions(activeStyle);
};
const clickHandler = (e) => {
console.log(5555, e);
let target = polyLayer.pickOverlays(e.target);
if (target && target[0]) {
selectedOverlay = target[0];
setActiveStyle(selectedOverlay);
movepoy.open(selectedOverlay);
} else {
console.log(888);
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;
map.addGeoJSONLayer(polyLayer);
polyLayer.addOverlay(cs_choose_arr.value[0]);
sceneMove = new DrawScene(map);
movepoy = new PolygonMove(sceneMove);
movepoy.setCurrentModel(PolygonMove.MODEL.MOVE);
select = new Select(sceneMove, {
type: DrawingType.DRAWING_POINT,
});
select.open();
sceneMove.addEventListener(OperateEventType.CLICK, clickHandler);
};
//
const moveCancel = () => {
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();
sceneMove.removeEventListener(OperateEventType.CLICK, clickHandler);
cs_choose_arr.value[0].points.forEach((item, index) => {
let arr1 = [];
arr1.push(item?.latLng.lng);
arr1.push(item?.latLng.lat);
arrJWD[0][0].push(arr1);
});
console.log("arrJWD", arrJWD);
saveDK();
};
//
const moveBack = () => {
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 editmode = () => {
drawing.value = true;
edit_mode.value = true;
};
//
var arrJWD = [[[]]];
//bd09bd09
@ -949,9 +1091,6 @@ const closeEdit = async () => {
//退
const backEdit = () => {
BMAP();
// cs_choose_arr.value.forEach((item, index) => {
// map.removeOverlay(cs_choose_arr.value[index]);
// });
showEdit.value = false;
drawing.value = false;
};

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