|
|
@ -11,7 +11,8 @@ import { earthMapUrl } from '@/api/earth/earthMap' |
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'; |
|
|
|
import { handleNodeType } from '@/utils/earthMap/handleNodeType'; |
|
|
|
import setIconByRef from '@/utils/earthMap/setIconByRef'; |
|
|
|
import { nextTick } from 'vue'; |
|
|
|
import { createVNode, nextTick, render } from 'vue'; |
|
|
|
import seneIdTreeSelect from '/@/components/earthMap/components/seneIdTreeSelect.vue'; |
|
|
|
import _ from 'lodash'; |
|
|
|
import $mitt from '@/utils/earthMap/mitt'; |
|
|
|
import $ from 'jquery'; |
|
|
@ -156,7 +157,7 @@ export default function sceneTreePopContextMenu({ item, vueObject }, earthUI, th |
|
|
|
createMessage.error('克隆失败'); |
|
|
|
}); |
|
|
|
}) |
|
|
|
//区域回调
|
|
|
|
//防区回调
|
|
|
|
.polylineCallBack(() => { |
|
|
|
// debugger
|
|
|
|
const currentModel = new window.XE.Obj.Polyline(window.$earth); |
|
|
@ -172,6 +173,8 @@ export default function sceneTreePopContextMenu({ item, vueObject }, earthUI, th |
|
|
|
submitData.width = sn.czmObject.width; |
|
|
|
submitData.interpolation = sn.czmObject.arcType; |
|
|
|
submitData.positions = JSON.stringify(poistions); |
|
|
|
submitData.sceneId = sn.czmObject.sceneId; |
|
|
|
submitData.material = JSON.stringify(sn.czmObject.material); |
|
|
|
switch (sn.czmObject.material.type) { |
|
|
|
// 实线
|
|
|
|
case 'XbsjColorMaterial': |
|
|
@ -223,6 +226,8 @@ export default function sceneTreePopContextMenu({ item, vueObject }, earthUI, th |
|
|
|
currentModel.width = submitData.width; |
|
|
|
currentModel.arcType = submitData.interpolation; |
|
|
|
currentModel.positions = JSON.parse(submitData.positions); |
|
|
|
currentModel.sceneId = submitData.sceneId |
|
|
|
currentModel.material = JSON.stringify(submitData.material); |
|
|
|
switch (sn.czmObject.material.type) { |
|
|
|
// 实线
|
|
|
|
case 'XbsjColorMaterial': |
|
|
@ -253,12 +258,12 @@ export default function sceneTreePopContextMenu({ item, vueObject }, earthUI, th |
|
|
|
leaf.ref = response.result; |
|
|
|
sn.parent.children.push(leaf); |
|
|
|
} else { |
|
|
|
throw '克隆区域数据出错'; |
|
|
|
throw '克隆防区数据出错'; |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((e) => { |
|
|
|
currentModel.destroy(); |
|
|
|
createMessage.error('克隆区域数据出错', 3); |
|
|
|
createMessage.error('克隆防区数据出错', 3); |
|
|
|
}); |
|
|
|
}) |
|
|
|
//监控点
|
|
|
@ -390,7 +395,7 @@ export default function sceneTreePopContextMenu({ item, vueObject }, earthUI, th |
|
|
|
// {
|
|
|
|
// "regionIdList": [
|
|
|
|
// 2
|
|
|
|
// ], // 周界防区区域ID列表(雷达设备列表的ID)
|
|
|
|
// ], // 周界防区防区ID列表(雷达设备列表的ID)
|
|
|
|
// "regionStatus": 0, // 布防状态 0 - 未布防 1 - 布防
|
|
|
|
// "defenceRule": { // 布防规则
|
|
|
|
// "startTime": "yyyy-MM-dd HH:mm:ss", // 布防开始时间 每日循环情况下只包含时分秒,格式:"HH:mm:ss" 非每日循环情况下包含年月日、时分秒,格式:"yyyy-MM-dd HH:mm:ss"
|
|
|
@ -499,7 +504,7 @@ export default function sceneTreePopContextMenu({ item, vueObject }, earthUI, th |
|
|
|
sn.czmObject.distanceDisplayCondition = [1.0, 30000.0]; |
|
|
|
if (sn.czmObject.xbsjType == 'Model') { |
|
|
|
const lineId = item.parent.parent._inner.sn.ref.split('_')[1]; |
|
|
|
|
|
|
|
|
|
|
|
that.czmObject = sn.czmObject; |
|
|
|
that.node = item; |
|
|
|
that.type = 'jkd'; |
|
|
@ -541,6 +546,8 @@ export default function sceneTreePopContextMenu({ item, vueObject }, earthUI, th |
|
|
|
let tempData = sn.czmObject.toAllJSON(); |
|
|
|
// 设置属性面板的确定按钮方法
|
|
|
|
// 显示属性面板
|
|
|
|
console.log("sn", sn); |
|
|
|
|
|
|
|
earthUI.showPropertyWindow(sn.czmObject); |
|
|
|
nextTick(() => { |
|
|
|
// 模型窗口
|
|
|
@ -548,6 +555,8 @@ export default function sceneTreePopContextMenu({ item, vueObject }, earthUI, th |
|
|
|
// 找到该模型设置属性窗口
|
|
|
|
const modelToolKey = windowsAttrList.filter((f) => f.indexOf(sn.czmObject.guid || sn.guid) > -1)[0]; |
|
|
|
const modelTool = mainUI.$refs[modelToolKey][0]; |
|
|
|
console.log("modelTool",modelTool); |
|
|
|
|
|
|
|
// 对应处理方法
|
|
|
|
handleNodeType(sn) |
|
|
|
// 感应器
|
|
|
@ -558,11 +567,41 @@ export default function sceneTreePopContextMenu({ item, vueObject }, earthUI, th |
|
|
|
.default(() => { |
|
|
|
// 启用模型名称编辑
|
|
|
|
modelTool.$el.getElementsByClassName('xbsj-flatten')[0].children[0].children[1].removeAttribute('disabled'); |
|
|
|
}) |
|
|
|
.polylineCallBack(() => { |
|
|
|
// 防区编辑
|
|
|
|
// 加入区域场景选择器
|
|
|
|
// console.log("区域编辑", modelTool.$el);
|
|
|
|
let divCustom = document.createElement("div"); |
|
|
|
divCustom.setAttribute("data-v-74b863e5", ""); |
|
|
|
divCustom.setAttribute("class", "flatten"); |
|
|
|
divCustom.setAttribute("style", "display: flex; margin-bottom: 20px;"); |
|
|
|
// divCustom.setAttribute("style", "position: relative;");
|
|
|
|
divCustom.innerHTML = |
|
|
|
` |
|
|
|
<label data-v-74b863e5="">所属区域</label> |
|
|
|
` |
|
|
|
let instance: ReturnType<typeof createVNode> | null = null; |
|
|
|
// 创建虚拟节点,传入模型的数据
|
|
|
|
// let currentModel = window.$earth.getObject(sn.czmObject.xbsjGuid);
|
|
|
|
console.log("currentModel",sn.czmObject); |
|
|
|
instance = createVNode(seneIdTreeSelect, { currentModel: sn.czmObject}); |
|
|
|
// 渲染
|
|
|
|
render(instance, divCustom); |
|
|
|
// 父节点
|
|
|
|
let fatherNode = modelTool.$el.children[2].children[0].children[0] |
|
|
|
// 插入位置
|
|
|
|
let insertBeforeWhich = modelTool.$el.children[2].children[0].children[0].children[1]; |
|
|
|
fatherNode.insertBefore(divCustom, insertBeforeWhich); |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
.run(); |
|
|
|
|
|
|
|
// modelTool
|
|
|
|
modelTool.ok = () => { |
|
|
|
// 增加绑定--推测 非原生面板属性(区域选择器)改变 并不能触发 OK方法
|
|
|
|
modelTool.$el.children[3].children[1].onclick = modelTool.ok = () => { |
|
|
|
// console.log("modelTool.ok");
|
|
|
|
// 确定时清除这个事件
|
|
|
|
$mitt.off('windowCancel'); |
|
|
|
// 保存前端数据
|
|
|
@ -576,7 +615,7 @@ export default function sceneTreePopContextMenu({ item, vueObject }, earthUI, th |
|
|
|
const sceneObject = new XE.SceneTree.Leaf(modelToolObj); |
|
|
|
earthUI.addSceneObject(sceneObject); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 保存到数据库
|
|
|
|
propertiesWindowConfirm(modelTool, sn, index); |
|
|
|
// 关闭属性面板
|
|
|
@ -667,18 +706,18 @@ export const handleChangeTitle = _.debounce(function (options) { |
|
|
|
sitename: newTitle, |
|
|
|
}; |
|
|
|
defHttp.put( |
|
|
|
{ |
|
|
|
url: earthMapUrl.updateSite, |
|
|
|
params: editCameraSiteModelParameter, |
|
|
|
}, |
|
|
|
{ isTransformResponse: false } |
|
|
|
).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
createMessage.success('修改成功'); |
|
|
|
} else { |
|
|
|
createMessage.error('修改失败'); |
|
|
|
} |
|
|
|
}) |
|
|
|
{ |
|
|
|
url: earthMapUrl.updateSite, |
|
|
|
params: editCameraSiteModelParameter, |
|
|
|
}, |
|
|
|
{ isTransformResponse: false } |
|
|
|
).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
createMessage.success('修改成功'); |
|
|
|
} else { |
|
|
|
createMessage.error('修改失败'); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
createMessage.error('修改失败'); |
|
|
|
}); |
|
|
@ -849,6 +888,8 @@ export function propertiesWindowConfirm(propertiesWindow, sn, index) { |
|
|
|
submitData.width = modelData.width; |
|
|
|
submitData.interpolation = modelData.arcType; |
|
|
|
submitData.positions = JSON.stringify(poistions); |
|
|
|
submitData.material = JSON.stringify(modelData.material); |
|
|
|
submitData.sceneId = modelData.sceneId; |
|
|
|
switch (modelData.material.type) { |
|
|
|
// 实线
|
|
|
|
case 'XbsjColorMaterial': |
|
|
@ -893,26 +934,29 @@ export function propertiesWindowConfirm(propertiesWindow, sn, index) { |
|
|
|
// material.XbsjODLineMaterial.totoalFrameCount = data.cycleFrame
|
|
|
|
break; |
|
|
|
} |
|
|
|
defHttp |
|
|
|
.put( |
|
|
|
{ |
|
|
|
url: earthMapUrl.updateMapLine, |
|
|
|
params: submitData, |
|
|
|
}, |
|
|
|
{ isTransformResponse: false } |
|
|
|
) |
|
|
|
.then((res) => { |
|
|
|
if (res.success) { |
|
|
|
createMessage.success('修改成功!', 2); |
|
|
|
sn.title = submitData.name; |
|
|
|
window.$earth.sceneTree.$refs['node_' + sn.ref].title = submitData.name; |
|
|
|
} else { |
|
|
|
createMessage.error('修改失败', 2); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
createMessage.error('修改失败', 2); |
|
|
|
}); |
|
|
|
console.log("submitData",submitData); |
|
|
|
console.log("modelData",modelData); |
|
|
|
// defHttp
|
|
|
|
// .put(
|
|
|
|
// {
|
|
|
|
// url: earthMapUrl.updateMapLine,
|
|
|
|
// params: submitData,
|
|
|
|
// },
|
|
|
|
// { isTransformResponse: false }
|
|
|
|
// )
|
|
|
|
// .then((res) => {
|
|
|
|
// if (res.success) {
|
|
|
|
// createMessage.success('修改成功!', 2);
|
|
|
|
// sn.title = submitData.name;
|
|
|
|
// window.$earth.sceneTree.$refs['node_' + sn.ref].title = submitData.name;
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
// createMessage.error('修改失败', 2);
|
|
|
|
// }
|
|
|
|
// })
|
|
|
|
// .catch((error) => {
|
|
|
|
// createMessage.error('修改失败', 2);
|
|
|
|
// });
|
|
|
|
}) |
|
|
|
.run(); |
|
|
|
} |