diff --git a/src/components/earthMap/Toolbar.vue b/src/components/earthMap/Toolbar.vue
index bf6e818..ed8462f 100644
--- a/src/components/earthMap/Toolbar.vue
+++ b/src/components/earthMap/Toolbar.vue
@@ -44,7 +44,6 @@
-
@@ -74,6 +73,10 @@
添加模型
路径巡检
管控区域
+
添加区域
+
添加监控点
+
添加微波探测
+
添加雷达
@@ -86,6 +89,12 @@
+
+
+
+
+
+
@@ -123,6 +132,9 @@
import drawShapeIMG from '@/assets/earthMap/toolbar/drawShapeIMG.png';
import drawShapeMilitaryIMG from '@/assets/earthMap/toolbar/drawShapeMilitaryIMG.png';
+ import AddMonitorPointCom from '@/components/earthMap/toolbar/AddMonitorPointCom.vue';
+ import AddWaveCom from '@/components/earthMap/toolbar/AddWaveCom.vue';
+ import AddRadarCom from '@/components/earthMap/toolbar/AddRadarCom.vue';
// import mitt from '/@/utils/mitt';
import $mitt from '@/utils/earthMap/mitt';
import { defHttp } from '/@/utils/http/axios';
@@ -146,6 +158,9 @@
DrawShape,
DrawShapeMilitary,
KeyControlAreaList,
+ AddMonitorPointCom,
+ AddWaveCom,
+ AddRadarCom,
},
setup(props) {
const { proxy }: any = getCurrentInstance();
@@ -181,6 +196,12 @@
const drawShapePackage: any = ref(null);
const drawShapeMilitaryShow = ref(false);
+ // 监控点弹窗
+ const addMonitorPointComShow = ref(false);
+ // 微波弹窗
+ const addWaveComShow = ref(false);
+ // 雷达弹窗
+ const addRadarComShow = ref(false);
//计算属性
const title = computed(() => {
return '';
@@ -234,9 +255,9 @@
warnInfoMan();
});
//调用绘画组件,res.show为展示状态,res为传递数据
- $mitt.on('drawShapeShow', function (res:any) {
+ $mitt.on('drawShapeShow', function (res: any) {
drawShapeShow.value = res.show;
- drawShapePackage.value = res
+ drawShapePackage.value = res;
});
}
//数据绑定
@@ -946,17 +967,19 @@
//绘画图形
function drawShape() {
//基本绘图没有被使用中,则关闭
- if(drawShapeMilitaryShow.value && store.shapeUsing == false)
- {drawShapeMilitaryShow.value = false}
+ if (drawShapeMilitaryShow.value && store.shapeUsing == false) {
+ drawShapeMilitaryShow.value = false;
+ }
//清空数据
- drawShapePackage.value = null
+ drawShapePackage.value = null;
drawShapeShow.value = !drawShapeShow.value;
}
//绘画图形-军事态势
function drawShapeMilitary() {
//基本绘图没有被使用中,则关闭
- if(drawShapeShow.value && store.shapeUsing == false)
- {drawShapeShow.value = false}
+ if (drawShapeShow.value && store.shapeUsing == false) {
+ drawShapeShow.value = false;
+ }
drawShapeMilitaryShow.value = !drawShapeMilitaryShow.value;
}
@@ -1051,6 +1074,246 @@
// )
}
+ // 添加监控点
+ function addMonitorPoint() {
+ addMonitorPointComShow.value = true;
+ }
+ // 添加微波
+ function addWave() {
+ addWaveComShow.value = true;
+ }
+ // 添加雷达
+ function addRadar() {
+ addRadarComShow.value = true;
+ }
+ // 添加区域
+ function addArea() {
+ $mitt.emit('drawShapeShow', { show: true, title: '区域创建工具', from: 'addArea' });
+ $mitt.on('addAreaFinished', (t: any) => {
+ console.log('addAreaFinished', t);
+ //t 为drawShape传过来的临时图形
+ t.creating = true;
+ // 监控t数据,完成创建后调用后续方法
+ window.XE.MVVM.watch(t, 'creating', (n: any) => {
+ console.log('creating', n);
+ if (n == false) {
+ //面
+ let positions: any = [];
+ if (t._polygon) {
+ positions = t._polygon._polyline.positions;
+ }
+ //线
+ else if (t._polyline) {
+ positions = t._polyline.positions;
+ } else {
+ positions = t.positions;
+ }
+ //销毁临时图形
+ t.destroy();
+ /**
+ * 控制时序,处理完数据再调用方法 addPolyline
+ * 否则会出现在数据滞后在图形创建时,导致数据错误
+ *
+ */
+ nextTick(() => {
+ addPolyline(positions);
+ });
+ }
+ });
+ });
+ }
+ /**
+ * @params 需要调用 addArea 方法进行绘图,获取坐标点position
+ */
+ function addPolyline(positions: any = null) {
+ // 关闭此窗体
+ // cancel();
+ // 创建区域
+ const currentModel = new window.XE.Obj.Polyline(window.$earth);
+ // 设置配置参数
+ const objConfig = {
+ positions: positions,
+ };
+ // 插入数据
+ currentModel.xbsjFromJSON(objConfig);
+ console.log('currentModel', currentModel);
+ // 获取地图ui对象
+ const earthUI = window.$uia;
+ // 打开一个区域编辑ui窗体
+ earthUI.showPropertyWindow(currentModel);
+ nextTick(() => {
+ // 主要ui窗口
+ const mainUI = earthUI._vm.$refs.mainUI;
+ // 所有打开的ui窗口Ref值
+ const windowsAttrList = Object.keys(mainUI.$refs);
+ // 寻找当前窗体的工具对象
+ const modelToolKey = windowsAttrList.filter((f) => f.indexOf(currentModel.guid) > -1)[0];
+ const modelTool = mainUI.$refs[modelToolKey][0];
+ // 当前窗体的元素
+ const el = modelTool.$el;
+ //样式
+ el.children[2].style.padding = '0px';
+ el.children[2].style.transition = 'none';
+ // 取消按钮元素
+ const cancelBtn = el.children[3].children[0];
+ // 确认按钮元素
+ const okBtn = el.children[3].children[1];
+ // 设置确认按钮点击事件
+ okBtn.onclick = function () {
+ $mitt.emit('windowCancel');
+ // 提交对象
+ const submitData: any = {};
+ // 路径为空,无法提交
+ const poistions = currentModel.positions;
+ if (poistions.length <= 0) {
+ createMessage.warning('路径为空,无法创建', 2);
+ return;
+ }
+ // 模型名称
+ submitData.name = currentModel.name;
+ // 线段编码
+ submitData.lineCode = currentModel.guid;
+ // 首尾相连属性
+ submitData.isLoop = Number(currentModel.loop);
+ // 深度检查
+ submitData.isDepthCheck = Number(currentModel.depthTest);
+ // 宽度
+ submitData.width = currentModel.width;
+ // 插值方式
+ submitData.interpolation = currentModel.arcType;
+ // 路径数组
+ submitData.positions = JSON.stringify(poistions);
+ // 材质类型
+ switch (currentModel.material.type) {
+ // 实线
+ case 'XbsjColorMaterial':
+ // 实线材质0
+ submitData.materialType = 0;
+ // 线段颜色
+ submitData.color = JSON.stringify(currentModel.material.XbsjColorMaterial.color);
+ // 以下为没有属性,所以赋予默认值
+ submitData.intervalColor = null;
+ submitData.dashLength = 0;
+ submitData.dashStyle = 0;
+ break;
+ // 虚线
+ case 'XbsjPolylineDashMaterial':
+ // 虚线材质1
+ submitData.materialType = 1;
+ // 线段颜色
+ submitData.color = JSON.stringify(currentModel.material.XbsjPolylineDashMaterial.color);
+ // 间隔颜色
+ submitData.intervalColor = JSON.stringify(currentModel.material.XbsjPolylineDashMaterial.gapColor);
+ // 虚线长度
+ submitData.dashLength = currentModel.material.XbsjPolylineDashMaterial.dashLength;
+ // 虚线样式
+ submitData.dashStyle = currentModel.material.XbsjPolylineDashMaterial.dashPattern;
+ break;
+ // 箭头线
+ case 'XbsjPolylineArrowMaterial':
+ // 箭头线2
+ submitData.materialType = 2;
+ // 线段颜色
+ submitData.color = JSON.stringify(currentModel.material.XbsjPolylineArrowMaterial.color);
+ // 以下为没有的属性
+ submitData.intervalColor = null;
+ submitData.dashLength = 0;
+ submitData.dashStyle = 0;
+ break;
+ // 轨迹线
+ case 'XbsjODLineMaterial':
+ // 轨迹线
+ submitData.materialType = 3;
+ // 线段颜色
+ submitData.color = JSON.stringify(currentModel.material.XbsjODLineMaterial.color);
+ // 没有的属性
+ submitData.intervalColor = null;
+ submitData.dashLength = 0;
+ submitData.dashStyle = 0;
+ // 循环周期
+ submitData.cycleFrame = currentModel.material.XbsjODLineMaterial.totoalFrameCount;
+ break;
+ }
+ // 提交区域数据
+ defHttp
+ .post({ url: '/military/msMapLine/add', params: submitData }, { isTransformResponse: false })
+ .then((response) => {
+ // 成功后挂载节点到树中
+ if (response.success) {
+ // 生成叶子节点
+ const leaf = new window.XE.SceneTree.Leaf(currentModel);
+ // 设置叶子节点标识
+ leaf.ref = response.result;
+ // 挂载上树
+ window.$earth.sceneTree.root.children.push(leaf);
+ // 隐藏叶子节点的dom节点
+ nextTick(() => {
+ $('#earthContainer>div>div>div:nth-child(5)')
+ .children('div')
+ .eq(1)
+ .children()
+ .eq(0)
+ .children()
+ .eq(0)
+ .children()
+ .each((index, element) => {
+ if (index <= 1) {
+ return;
+ }
+ const paddingLeft = $(element).children().eq(0).css('padding-left');
+ if (paddingLeft === '10px') {
+ $(element).css('display', 'none');
+ }
+ });
+ });
+ // 生成显示在树上的节点,此为虚假的节点,关联关系为ref一个为 node_ref 一个为ref
+ const node = {
+ ref: 'node_' + response.result,
+ title: currentModel.name,
+ expand: false,
+ children: [
+ {
+ expand: false,
+ title: '监控点位',
+ ref: 'monitor_' + window.guid(),
+ children: [],
+ },
+ {
+ expand: false,
+ title: '雷达点位',
+ ref: 'ldList_' + window.guid(),
+ children: [],
+ },
+ {
+ expand: false,
+ title: '微波点位',
+ ref: 'wbList_' + window.guid(),
+ children: [],
+ },
+ ],
+ };
+ // 挂载并显示到树上
+ window.$earth.sceneTree.$refs.areas.children.push(node);
+ } else {
+ throw '新增区域数据出错';
+ }
+ })
+ .catch((e) => {
+ createMessage.error('新增区域数据出错', 2);
+ });
+ };
+ // 取消按钮
+ cancelBtn.onclick = function () {
+ $mitt.off('windowCancel');
+ // 消耗当前窗体的dom节点
+ el.remove();
+ // 消耗当前创建的对象
+ currentModel.destroy();
+ };
+ });
+ return currentModel;
+ }
+
onBeforeUnmount(() => {
// vue程序销毁时,需要清理相关资源
proxy._disposers.forEach((d) => d());
@@ -1061,7 +1324,6 @@
$mitt.off('warnInfoMan');
});
-
return {
show,
title,
@@ -1121,7 +1383,14 @@
openCreateModel,
drawShape,
drawShapeMilitary,
+ addMonitorPoint,
+ addWave,
+ addRadar,
+ addArea,
addModelWinShow,
+ addMonitorPointComShow,
+ addWaveComShow,
+ addRadarComShow,
roamPathListShow,
keyControlAreaListShow,
notificationModelShow,
diff --git a/src/components/earthMap/toolbar/AddModelWin.vue b/src/components/earthMap/toolbar/AddModelWin.vue
index 54c10f2..d74f4da 100644
--- a/src/components/earthMap/toolbar/AddModelWin.vue
+++ b/src/components/earthMap/toolbar/AddModelWin.vue
@@ -1,7 +1,19 @@
-
+
@@ -55,19 +72,28 @@
-
@@ -76,8 +102,7 @@
@@ -102,8 +127,7 @@
@@ -141,14 +165,20 @@
-
+
拾取
-
+
移动
@@ -157,8 +187,7 @@
@@ -183,8 +212,7 @@
@@ -198,14 +226,20 @@
-
+
拾取
-
+
移动
@@ -216,1419 +250,1419 @@
diff --git a/src/components/earthMap/toolbar/AddMonitorPointCom.vue b/src/components/earthMap/toolbar/AddMonitorPointCom.vue
new file mode 100644
index 0000000..c0a1014
--- /dev/null
+++ b/src/components/earthMap/toolbar/AddMonitorPointCom.vue
@@ -0,0 +1,521 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ 拾取
+
+
+ 移动
+
+
+ 旋转
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/earthMap/toolbar/AddRadarCom.vue b/src/components/earthMap/toolbar/AddRadarCom.vue
new file mode 100644
index 0000000..3311a50
--- /dev/null
+++ b/src/components/earthMap/toolbar/AddRadarCom.vue
@@ -0,0 +1,638 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 拾取
+
+
+ 移动
+
+
+
+
+
+
+
+
diff --git a/src/components/earthMap/toolbar/AddWaveCom.vue b/src/components/earthMap/toolbar/AddWaveCom.vue
new file mode 100644
index 0000000..b479e4a
--- /dev/null
+++ b/src/components/earthMap/toolbar/AddWaveCom.vue
@@ -0,0 +1,542 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 拾取
+
+
+ 移动
+
+
+
+
+
+
+
+
diff --git a/src/utils/earthMap/earthObj.ts b/src/utils/earthMap/earthObj.ts
index 18faf80..5f1b5d3 100644
--- a/src/utils/earthMap/earthObj.ts
+++ b/src/utils/earthMap/earthObj.ts
@@ -764,6 +764,7 @@ export const addPin = (name, url, options) => {
if (options.far) {
objConfig.far = options.far;
}
+
pin.xbsjFromJSON(objConfig);
return pin;
diff --git a/src/views/earthMap/edit/EarthComp.vue b/src/views/earthMap/edit/EarthComp.vue
index 83d302d..7029300 100644
--- a/src/views/earthMap/edit/EarthComp.vue
+++ b/src/views/earthMap/edit/EarthComp.vue
@@ -1979,7 +1979,7 @@
}
let pickedFeature = this._viewer.scene.pick(click.position);
- console.log('点击的船只:', pickedFeature);
+ // console.log('点击的船只:', pickedFeature);
if (pickedFeature && pickedFeature.id) {
// 三维模型
@@ -2052,16 +2052,19 @@
JSON.parse(pickedFeature.id._xbsjOwner.customProp).labelAttr == '4'
) {
let labelCode = JSON.parse(pickedFeature.id._xbsjOwner.customProp).labelCode;
- console.log(pickedFeature.id._xbsjOwner);
+ console.log('点击雷达:', pickedFeature.id._xbsjOwner);
if (pickedFeature.id._xbsjOwner.addViewShedReturn) {
//显示/不显示雷达扫码效果
// pickedFeature.id._xbsjOwner.addViewShedReturn.show = !pickedFeature.id._xbsjOwner.addViewShedReturn.show;
// console.log("pickedFeature.id._xbsjOwner.addViewShedReturn",pickedFeature.id._xbsjOwner.addViewShedReturn);
//清空当前雷达,并将该方法指向undefined(清空)
+ console.log('关闭扫描');
+
pickedFeature.id._xbsjOwner.addViewShedReturn.clear();
pickedFeature.id._xbsjOwner.addViewShedReturn = undefined;
} else {
+ console.log('打开扫描');
defHttp.get({ url: this.url.radarList, params: { radarCode: labelCode } }, { isTransformResponse: false }).then((res) => {
if (res.success) {
if (res.result.records.length > 0) {