|
@ -110,7 +110,7 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script lang="ts"> |
|
|
<script lang="ts"> |
|
|
import { computed, defineComponent, ref, onMounted, onBeforeMount, getCurrentInstance, onBeforeUnmount, nextTick, watch } from 'vue'; |
|
|
import { computed, defineComponent, ref, onMounted, onBeforeMount, getCurrentInstance, onBeforeUnmount, nextTick, watch, createVNode, render } from 'vue'; |
|
|
import Window from '@/components/earthMap/components/Window.vue'; |
|
|
import Window from '@/components/earthMap/components/Window.vue'; |
|
|
import AddModelWin from '@/components/earthMap/toolbar/AddModelWin.vue'; |
|
|
import AddModelWin from '@/components/earthMap/toolbar/AddModelWin.vue'; |
|
|
import RoamPathList from '@/components/earthMap/RoamPathList.vue'; |
|
|
import RoamPathList from '@/components/earthMap/RoamPathList.vue'; |
|
@ -138,7 +138,7 @@ |
|
|
import AddMonitorPointCom from '@/components/earthMap/toolbar/AddMonitorPointCom.vue'; |
|
|
import AddMonitorPointCom from '@/components/earthMap/toolbar/AddMonitorPointCom.vue'; |
|
|
import AddWaveCom from '@/components/earthMap/toolbar/AddWaveCom.vue'; |
|
|
import AddWaveCom from '@/components/earthMap/toolbar/AddWaveCom.vue'; |
|
|
import AddRadarCom from '@/components/earthMap/toolbar/AddRadarCom.vue'; |
|
|
import AddRadarCom from '@/components/earthMap/toolbar/AddRadarCom.vue'; |
|
|
// import mitt from '/@/utils/mitt'; |
|
|
import seneIdTreeSelect from '/@/components/earthMap/components/seneIdTreeSelect.vue'; |
|
|
import $mitt from '@/utils/earthMap/mitt'; |
|
|
import $mitt from '@/utils/earthMap/mitt'; |
|
|
import { defHttp } from '/@/utils/http/axios'; |
|
|
import { defHttp } from '/@/utils/http/axios'; |
|
|
import $ from 'jquery'; |
|
|
import $ from 'jquery'; |
|
@ -1207,6 +1207,27 @@ |
|
|
//样式 |
|
|
//样式 |
|
|
el.children[2].style.padding = '0px'; |
|
|
el.children[2].style.padding = '0px'; |
|
|
el.children[2].style.transition = 'none'; |
|
|
el.children[2].style.transition = 'none'; |
|
|
|
|
|
|
|
|
|
|
|
//加入区域场景选择器 |
|
|
|
|
|
let divCustom = document.createElement("div"); |
|
|
|
|
|
divCustom.setAttribute("data-v-74b863e5", ""); |
|
|
|
|
|
divCustom.setAttribute("class", "flatten"); |
|
|
|
|
|
divCustom.setAttribute("style", "display: flex; margin-bottom: 20px;"); |
|
|
|
|
|
divCustom.innerHTML = |
|
|
|
|
|
` |
|
|
|
|
|
<label data-v-74b863e5="">所属区域</label> |
|
|
|
|
|
` |
|
|
|
|
|
let instance: ReturnType<typeof createVNode> | null = null; |
|
|
|
|
|
// 创建虚拟节点,传入模型的数据 |
|
|
|
|
|
instance = createVNode(seneIdTreeSelect,{currentModel}); |
|
|
|
|
|
// 渲染 |
|
|
|
|
|
render(instance, divCustom); |
|
|
|
|
|
// 父节点 |
|
|
|
|
|
let fatherNode = el.children[2].children[0].children[0] |
|
|
|
|
|
// 插入位置 |
|
|
|
|
|
let insertBeforeWhich = el.children[2].children[0].children[0].children[1]; |
|
|
|
|
|
fatherNode.insertBefore(divCustom,insertBeforeWhich); |
|
|
|
|
|
|
|
|
// 取消按钮元素 |
|
|
// 取消按钮元素 |
|
|
const cancelBtn = el.children[3].children[0]; |
|
|
const cancelBtn = el.children[3].children[0]; |
|
|
// 确认按钮元素 |
|
|
// 确认按钮元素 |
|
@ -1215,6 +1236,13 @@ |
|
|
const xBtn = el.children[1].children[1]; |
|
|
const xBtn = el.children[1].children[1]; |
|
|
// 设置确认按钮点击事件 |
|
|
// 设置确认按钮点击事件 |
|
|
okBtn.onclick = function () { |
|
|
okBtn.onclick = function () { |
|
|
|
|
|
// console.log("currentModel",currentModel); |
|
|
|
|
|
// return |
|
|
|
|
|
// 判断所属区域 |
|
|
|
|
|
if (!currentModel.sceneId) { |
|
|
|
|
|
createMessage.warning('请选择所属区域', 2); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
$mitt.emit('windowCancel'); |
|
|
$mitt.emit('windowCancel'); |
|
|
// 提交对象 |
|
|
// 提交对象 |
|
|
const submitData: any = {}; |
|
|
const submitData: any = {}; |
|
@ -1226,6 +1254,8 @@ |
|
|
} |
|
|
} |
|
|
// 模型名称 |
|
|
// 模型名称 |
|
|
submitData.name = currentModel.name; |
|
|
submitData.name = currentModel.name; |
|
|
|
|
|
// 场景区域 |
|
|
|
|
|
submitData.sceneId = currentModel.sceneId; |
|
|
// 线段编码 |
|
|
// 线段编码 |
|
|
submitData.lineCode = currentModel.guid; |
|
|
submitData.lineCode = currentModel.guid; |
|
|
// 首尾相连属性 |
|
|
// 首尾相连属性 |
|
@ -1297,6 +1327,10 @@ |
|
|
.then((response) => { |
|
|
.then((response) => { |
|
|
// 成功后挂载节点到树中 |
|
|
// 成功后挂载节点到树中 |
|
|
if (response.success) { |
|
|
if (response.success) { |
|
|
|
|
|
// 记录id |
|
|
|
|
|
currentModel.id = response.result; |
|
|
|
|
|
// 设置父节点 |
|
|
|
|
|
const parent = window.$earth.sceneTree.$refs[currentModel.sceneId]; |
|
|
// 生成叶子节点 |
|
|
// 生成叶子节点 |
|
|
const leaf = new window.XE.SceneTree.Leaf(currentModel); |
|
|
const leaf = new window.XE.SceneTree.Leaf(currentModel); |
|
|
// 设置叶子节点标识 |
|
|
// 设置叶子节点标识 |
|
@ -1326,7 +1360,7 @@ |
|
|
// 生成显示在树上的节点,此为虚假的节点,关联关系为ref一个为 node_ref 一个为ref |
|
|
// 生成显示在树上的节点,此为虚假的节点,关联关系为ref一个为 node_ref 一个为ref |
|
|
const node = { |
|
|
const node = { |
|
|
ref: 'node_' + response.result, |
|
|
ref: 'node_' + response.result, |
|
|
title: currentModel.name, |
|
|
title:'<防区>'+ currentModel.name, |
|
|
expand: false, |
|
|
expand: false, |
|
|
children: [ |
|
|
children: [ |
|
|
{ |
|
|
{ |
|
@ -1350,7 +1384,10 @@ |
|
|
], |
|
|
], |
|
|
}; |
|
|
}; |
|
|
// 挂载并显示到树上 |
|
|
// 挂载并显示到树上 |
|
|
window.$earth.sceneTree.$refs.areas.children.push(node); |
|
|
// window.$earth.sceneTree.$refs.areas.children.push(node); |
|
|
|
|
|
parent.children.push(node); |
|
|
|
|
|
// 提示用户 |
|
|
|
|
|
createMessage.success('添加成功!', 2); |
|
|
} else { |
|
|
} else { |
|
|
throw '新增防区数据出错'; |
|
|
throw '新增防区数据出错'; |
|
|
} |
|
|
} |
|
|