12-23
This commit is contained in:
@ -23,6 +23,7 @@
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
/* height: 100vh; background-color: rgba(255, 255, 255, 0.014); */
|
||||
/*color: red;*/
|
||||
}
|
||||
@ -302,7 +303,19 @@
|
||||
if (this.activeItem.type === '全景图') {
|
||||
getIframe(this.activeItem.url, '')
|
||||
} else {
|
||||
getImg(this.activeItem.url)
|
||||
if (!this.isPicture) {
|
||||
this.checkImageUrlWithFetch(this.activeItem.url).then(res => {
|
||||
if (res) {
|
||||
this.isPicture = true
|
||||
setTimeout(() => {
|
||||
getImg(this.activeItem.url)
|
||||
}, 0);
|
||||
}
|
||||
})
|
||||
}
|
||||
else {
|
||||
getImg(this.activeItem.url)
|
||||
}
|
||||
}
|
||||
// if (!Boolean(this.info.panorama.length)) {
|
||||
// console.log('图片渲染', 1232132);
|
||||
@ -313,6 +326,25 @@
|
||||
}, 0)
|
||||
},
|
||||
|
||||
async checkImageUrlWithFetch(url) {
|
||||
try {
|
||||
// 发送HEAD请求(优先,减少数据传输),如果不支持则用GET
|
||||
const response = await fetch(url, { method: 'HEAD' });
|
||||
if (!response.ok) return false;
|
||||
|
||||
// 获取Content-Type
|
||||
const contentType = response.headers.get('content-type');
|
||||
// 判断是否为图片类型
|
||||
if (!contentType || !contentType.startsWith('image/')) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} catch (error) {
|
||||
// 网络错误、跨域等情况直接返回false
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
mounted() {
|
||||
window.ssssssssssssss = this.tabsData
|
||||
@ -416,29 +448,29 @@
|
||||
if (hasVr) {
|
||||
this.info.vr.forEach(item => {
|
||||
if (fs.existsSync(item.url)) {
|
||||
let url = ""
|
||||
if (item.url.startsWith("http"))
|
||||
url = item.url
|
||||
else {
|
||||
//说明是本地的json,在磁盘中存在的
|
||||
if (item.url.includes(":")) {
|
||||
url = obj.host + "/fileInfo/previewLocal?fileAbsolutePath=" + encodeURIComponent(item.url)
|
||||
} else {
|
||||
if (obj.host) {
|
||||
let o = new URL(object.url, obj.host)
|
||||
url = o.href
|
||||
} else
|
||||
url = item.url
|
||||
let url = ""
|
||||
if (item.url.startsWith("http"))
|
||||
url = item.url
|
||||
else {
|
||||
//说明是本地的json,在磁盘中存在的
|
||||
if (item.url.includes(":")) {
|
||||
url = obj.host + "/fileInfo/previewLocal?fileAbsolutePath=" + encodeURIComponent(item.url)
|
||||
} else {
|
||||
if (obj.host) {
|
||||
let o = new URL(object.url, obj.host)
|
||||
url = o.href
|
||||
} else
|
||||
url = item.url
|
||||
}
|
||||
}
|
||||
item.url = url
|
||||
} else {
|
||||
if (!item.url.startsWith('http')) {
|
||||
// item.url = this.info.env + "/" + item.url
|
||||
item.url = obj.host + item.url
|
||||
}
|
||||
}
|
||||
item.url = url
|
||||
} else {
|
||||
if (!item.url.startsWith('http')) {
|
||||
// item.url = this.info.env + "/" + item.url
|
||||
item.url = obj.host + item.url
|
||||
}
|
||||
}
|
||||
this.tabsData.unshift({ name: "全景图", type: '全景图', url: item.url })
|
||||
this.tabsData.unshift({ name: item.name, type: '全景图', url: item.url })
|
||||
})
|
||||
this.activeItem = this.tabsData[this.activeIndex]
|
||||
this.renderImgView()
|
||||
|
||||
3407
src/renderer/public/sdk/YJEarth.min.js
vendored
3407
src/renderer/public/sdk/YJEarth.min.js
vendored
File diff suppressed because one or more lines are too long
@ -52,7 +52,6 @@
|
||||
*::after {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
ul {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<Dialog ref="baseDialog" :title="title + '属性'" left="180px" top="100px" className="circle" :closeCallback="closeCallback">
|
||||
<Dialog ref="baseDialog" :title="title + '属性'" left="180px" top="100px" className="circle"
|
||||
:closeCallback="closeCallback">
|
||||
<template #content>
|
||||
<span class="custom-divider"></span>
|
||||
<div class="div-item">
|
||||
@ -24,7 +25,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="div-item">
|
||||
<div>
|
||||
<div class="row">
|
||||
<el-tabs v-model="activeName">
|
||||
<el-tab-pane label="属性信息" name="1">
|
||||
@ -91,22 +92,24 @@
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="面风格" name="3">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<span class="label">面颜色</span>
|
||||
<div class="color" ref="colorRef"></div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="label">描边颜色</span>
|
||||
<div class="lineColor" ref="lineColorRef"></div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="label">描边宽度</span>
|
||||
<div class="input-number input-number-unit-2">
|
||||
<input class="input" type="number" title="" min="0" max="99" v-model="entityOptions.lineWidth"
|
||||
@input="$handleInputLimit">
|
||||
<span class="unit">px</span>
|
||||
<span class="arrow"></span>
|
||||
<div class="div-item">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<span class="label">面颜色</span>
|
||||
<div class="color" ref="colorRef"></div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="label">描边颜色</span>
|
||||
<div class="lineColor" ref="lineColorRef"></div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="label">描边宽度</span>
|
||||
<div class="input-number input-number-unit-2">
|
||||
<input class="input" type="number" title="" min="0" max="99" v-model="entityOptions.lineWidth"
|
||||
@input="$handleInputLimit">
|
||||
<span class="unit">px</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -301,7 +304,9 @@ const inputBlurCallBack = (event, i, name, digit = 2) => {
|
||||
}
|
||||
}
|
||||
|
||||
const translate = () => {
|
||||
const translate = async () => {
|
||||
entityOptions.value.closeNodeEdit()
|
||||
await nextTick()
|
||||
that.openPositionEditing(() => {
|
||||
entityOptions.value.options.center = structuredClone(that.options.center)
|
||||
})
|
||||
@ -397,4 +402,5 @@ defineExpose({
|
||||
flex: 0 0 76px !important;
|
||||
}
|
||||
}
|
||||
}</style>
|
||||
}
|
||||
</style>
|
||||
@ -1,13 +1,6 @@
|
||||
<template>
|
||||
<Dialog
|
||||
ref="baseDialog"
|
||||
class="fly-roam"
|
||||
title="飞行漫游"
|
||||
width="460px"
|
||||
left="180px"
|
||||
top="100px"
|
||||
:closeCallback="closeCallBack"
|
||||
>
|
||||
<Dialog ref="baseDialog" class="fly-roam" title="飞行漫游" width="460px" left="180px" top="100px"
|
||||
:closeCallback="closeCallBack">
|
||||
<template #content v-if="show">
|
||||
<span class="custom-divider"></span>
|
||||
<div class="div-item">
|
||||
@ -113,16 +106,8 @@
|
||||
<div class="col" style="flex: 0 0 300px">
|
||||
<span class="label">默认时长</span>
|
||||
<div class="input-number input-number-unit-3">
|
||||
<input
|
||||
class="input total-time"
|
||||
type="number"
|
||||
title=""
|
||||
min="0"
|
||||
max="999999.99"
|
||||
step="0.01"
|
||||
name="defaultTime"
|
||||
value="5"
|
||||
/>
|
||||
<input class="input total-time" type="number" title="" min="0" max="999999.99" step="0.01"
|
||||
name="defaultTime" value="5" />
|
||||
<span class="unit" style="top: 6px">s</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
@ -150,28 +135,15 @@
|
||||
/> -->
|
||||
<span class="label">设置总时长</span>
|
||||
<div class="input-number input-number-unit-3">
|
||||
<input
|
||||
class="input total-time"
|
||||
type="number"
|
||||
title=""
|
||||
min="0"
|
||||
max="999999.99"
|
||||
step="0.01"
|
||||
name="totalTime"
|
||||
value="0"
|
||||
/>
|
||||
<input class="input total-time" type="number" title="" min="0" max="999999.99" step="0.01"
|
||||
name="totalTime" value="0" />
|
||||
<span class="unit" style="top: 6px">s</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
<button class="isTotalTime" style="margin-left: 10px">应用</button>
|
||||
<input
|
||||
type="checkbox"
|
||||
name="repeat"
|
||||
class="YJ-custom-checkbox"
|
||||
style="cursor: pointer; width: auto; margin-right: 5px; margin-left: 10px"
|
||||
/>
|
||||
<input type="checkbox" name="repeat" class="YJ-custom-checkbox"
|
||||
style="cursor: pointer; width: auto; margin-right: 5px; margin-left: 10px" />
|
||||
<span class="label">循环</span>
|
||||
<!-- <button style="margin-left: 10px" @click="apply">应用</button> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="table">
|
||||
@ -236,39 +208,386 @@ let viewPointHeight: any = ref(0)
|
||||
|
||||
var show: any = ref(false)
|
||||
var flyRoam: any = reactive([])
|
||||
eventBus.on('flyRoamDialog', () => {
|
||||
show.value = true
|
||||
baseDialog.value?.open()
|
||||
setTimeout(() => {
|
||||
flyRoam = YJ.Global.FlyRoam.open(window.earth, { repeat: Infinity }, {}, draw)
|
||||
}, 100)
|
||||
})
|
||||
let beforeData = []
|
||||
const open = (data) => {
|
||||
beforeData = data
|
||||
show.value = true
|
||||
baseDialog.value?.open()
|
||||
if (data) {
|
||||
let roamData = JSON.parse(data.params)
|
||||
setTimeout(() => {
|
||||
flyRoam = YJ.Global.FlyRoam.open(window.earth, roamData, {}, draw)
|
||||
}, 100)
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
flyRoam = YJ.Global.FlyRoam.open(window.earth, { repeat: Infinity }, {}, draw)
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
|
||||
let allData: any = reactive({
|
||||
let roamData: any = reactive({
|
||||
name: '',
|
||||
points: [],
|
||||
repeat: '',
|
||||
defaultTime: 5,
|
||||
totalTime: 0
|
||||
})
|
||||
|
||||
eventBus.on('closeFlyRoamDialogById', (id) => {
|
||||
if(id && id ===beforeData.id) {
|
||||
close()
|
||||
}
|
||||
})
|
||||
|
||||
let beforeData = {}
|
||||
const open = async (data) => {
|
||||
beforeData = data
|
||||
show.value = true
|
||||
baseDialog.value?.open()
|
||||
await nextTick()
|
||||
if (data) {
|
||||
roamData = JSON.parse(data.params)
|
||||
} else {
|
||||
roamData = {
|
||||
name: '',
|
||||
points: [],
|
||||
repeat: Infinity,
|
||||
defaultTime: 5,
|
||||
totalTime: 0
|
||||
}
|
||||
}
|
||||
let name = roamData.name || '漫游路径'
|
||||
roamData.points || (roamData.points = [])
|
||||
let repeat = 0
|
||||
if (roamData.repeat) {
|
||||
repeat = Number(roamData.repeat)
|
||||
}
|
||||
let contentElm = document.getElementsByClassName('fly-roam')[0]
|
||||
if (!contentElm) {
|
||||
return
|
||||
}
|
||||
if (roamData.defaultTime) {
|
||||
contentElm.querySelector("input[name='defaultTime']").value = roamData.defaultTime
|
||||
}
|
||||
if (roamData.totalTime) {
|
||||
contentElm.querySelector("input[name='totalTime']").value = roamData.totalTime
|
||||
}
|
||||
let viewer = window.earth.viewer
|
||||
let tools = new YJ.Tools(window.earth)
|
||||
let active = 0
|
||||
|
||||
let tableBody = contentElm.getElementsByClassName('table-body')[0];
|
||||
let tableEmpty = contentElm.getElementsByClassName('table-empty')[0]
|
||||
|
||||
let handler = {
|
||||
set: function (target, prop, value) {
|
||||
target[prop] = value;
|
||||
if (target.length > 0) {
|
||||
tableEmpty.style.display = 'none'
|
||||
}
|
||||
else {
|
||||
tableEmpty.style.display = 'flex'
|
||||
}
|
||||
return true;
|
||||
},
|
||||
};
|
||||
let i = 0
|
||||
let points = new Proxy([], handler);
|
||||
for (i = 0; i < roamData.points.length; i++) {
|
||||
points.push(roamData.points[i])
|
||||
addTrElm(roamData.points[i])
|
||||
}
|
||||
|
||||
let nameElm = contentElm.querySelector("input[name='name']")
|
||||
nameElm.value = name
|
||||
nameElm.addEventListener('input', () => {
|
||||
name = nameElm.value
|
||||
draw({
|
||||
name: name,
|
||||
points: points,
|
||||
repeat: repeat + '',
|
||||
defaultTime: defaultTimeDom.value,
|
||||
totalTime: totalTimeElm.value
|
||||
})
|
||||
})
|
||||
let defaultTimeDom = contentElm.querySelector("input[name='defaultTime']")
|
||||
nameElm.addEventListener('input', () => {
|
||||
draw({
|
||||
name: name,
|
||||
points: points,
|
||||
repeat: repeat + '',
|
||||
defaultTime: defaultTimeDom.value,
|
||||
totalTime: totalTimeElm.value
|
||||
})
|
||||
})
|
||||
|
||||
// let addListBtn = document.createElement('button');
|
||||
let addListBtn = document.getElementsByClassName('saveRoam')[0];
|
||||
// addListBtn.innerHTML = '保存'
|
||||
addListBtn.addEventListener('click', () => {
|
||||
if (!name) {
|
||||
name = '漫游路径'
|
||||
nameElm.value = name
|
||||
}
|
||||
let newPoints = []
|
||||
points.map((item) => {
|
||||
newPoints.push(item)
|
||||
})
|
||||
|
||||
draw({
|
||||
name: name,
|
||||
points: newPoints,
|
||||
repeat: repeat + '',
|
||||
defaultTime: defaultTimeDom.value,
|
||||
totalTime: totalTimeElm.value
|
||||
})
|
||||
// _Dialog.clickSavePath && _Dialog.clickSavePath(
|
||||
// {
|
||||
// name: name,
|
||||
// points: newPoints,
|
||||
// repeat: repeat + ''
|
||||
// }
|
||||
// )
|
||||
})
|
||||
|
||||
let endBtn = contentElm.getElementsByClassName('cease')[0]
|
||||
endBtn.addEventListener('click', () => {
|
||||
viewer.camera.cancelFlight()
|
||||
})
|
||||
|
||||
let flyBtn = contentElm.getElementsByClassName('afreshPlay')[0]
|
||||
flyBtn.addEventListener('click', () => {
|
||||
if (points.length > 0) {
|
||||
YJ.Global.FlyRoam.flyTo(window.earth, points, 0)
|
||||
}
|
||||
})
|
||||
|
||||
let addBtn = contentElm.getElementsByClassName('add-point')[0]
|
||||
addBtn.addEventListener('click', () => {
|
||||
let position = tools.cartesian3Towgs84(viewer.camera.position, viewer)
|
||||
let defaultTime = Number(contentElm.querySelector("input[name='defaultTime']").value)
|
||||
let time = points.length === active ? 0 : defaultTime
|
||||
let data = {
|
||||
duration: time,
|
||||
position: position,
|
||||
orientation: {
|
||||
heading: viewer.camera.heading,
|
||||
pitch: viewer.camera.pitch,
|
||||
roll: viewer.camera.roll
|
||||
}
|
||||
}
|
||||
if (points.length === active && active !== 0) {
|
||||
points[points.length - 1].duration = defaultTime
|
||||
|
||||
let trList = tableBody.getElementsByClassName('tr')
|
||||
trList[points.length - 1].querySelector("input[name='time']").value = defaultTime
|
||||
|
||||
}
|
||||
points.splice(active, 0, data)
|
||||
addTrElm(data)
|
||||
i++
|
||||
|
||||
draw({
|
||||
name: name,
|
||||
points: points,
|
||||
repeat: repeat + '',
|
||||
defaultTime: defaultTimeDom.value,
|
||||
totalTime: totalTimeElm.value
|
||||
})
|
||||
})
|
||||
|
||||
let totalTimeElm = contentElm.querySelector("input[name='totalTime']")
|
||||
// let isTotalTimeElm = contentElm.querySelector("input[name='isTotalTime']")
|
||||
let isTotalTimeElm = contentElm.getElementsByClassName('isTotalTime')[0]
|
||||
let repeatElm = contentElm.querySelector("input[name='repeat']")
|
||||
isTotalTimeElm.addEventListener('click', () => {
|
||||
let trList = tableBody.getElementsByClassName('tr')
|
||||
// if (isTotalTimeElm.checked && trList.length > 0) {
|
||||
if (trList.length > 0) {
|
||||
let time = Number((Number(totalTimeElm.value) / (trList.length - 1)).toFixed(2))
|
||||
for (let i = 0; i < trList.length - 1; i++) {
|
||||
points[i].duration = time
|
||||
trList[i].querySelector("input[name='time']").value = time
|
||||
}
|
||||
trList[trList.length - 1].querySelector("input[name='time']").value = 0
|
||||
|
||||
totalTimeElm.value = 0//点击应用后默认时间清零
|
||||
}
|
||||
})
|
||||
totalTimeElm.addEventListener('blur', () => {
|
||||
let trList = tableBody.getElementsByClassName('tr')
|
||||
totalTimeElm.value = Number(totalTimeElm.value)
|
||||
if (totalTimeElm.value < 0) {
|
||||
totalTimeElm.value = 0
|
||||
}
|
||||
if (isTotalTimeElm.checked && trList.length > 0) {
|
||||
let time = Number((Number(totalTimeElm.value) / (trList.length - 1)).toFixed(2))
|
||||
for (let i = 0; i < trList.length - 1; i++) {
|
||||
points[i].duration = time
|
||||
trList[i].querySelector("input[name='time']").value = time
|
||||
}
|
||||
trList[trList.length - 1].querySelector("input[name='time']").value = 0
|
||||
}
|
||||
draw({
|
||||
name: name,
|
||||
points: points,
|
||||
repeat: repeat + '',
|
||||
defaultTime: defaultTimeDom.value,
|
||||
totalTime: totalTimeElm.value
|
||||
})
|
||||
})
|
||||
repeatElm.checked = (repeat === Infinity ? true : false)
|
||||
repeatElm.addEventListener('change', () => {
|
||||
if (repeatElm.checked) {
|
||||
repeat = Infinity
|
||||
}
|
||||
else {
|
||||
repeat = 0
|
||||
}
|
||||
draw({
|
||||
name: name,
|
||||
points: points,
|
||||
repeat: repeat + '',
|
||||
defaultTime: defaultTimeDom.value,
|
||||
totalTime: totalTimeElm.value
|
||||
})
|
||||
})
|
||||
|
||||
function addTrElm(data) {
|
||||
let trList = tableBody.getElementsByClassName('tr')
|
||||
if (trList.length > 0) {
|
||||
trList[trList.length - 1].querySelector("input[name='time']").disabled = undefined
|
||||
}
|
||||
let tr_active = tableBody.getElementsByClassName('tr active')[0]
|
||||
tr_active && (tr_active.className = 'tr')
|
||||
let tr = document.createElement('div');
|
||||
tr.className = 'tr active'
|
||||
tr.innerHTML = `
|
||||
<div class="td" style="justify-content: center;">视点${i + 1}</div>
|
||||
<div class="td">
|
||||
<input class="input time" type="number" title="" min="0" max="999.99" step="0.01" name="time" value="${data.duration}">
|
||||
</div>
|
||||
<div class="td action">
|
||||
<button title="更新视角" class='iconBut'><svg class="icon-resetView modify-point" style='width:20px;height:20px;cursor: pointer;'><use xlink:href="#yj-icon-resetView"></use></svg></button>
|
||||
<button title="播放" class='iconBut'><svg class="icon-play play" style='width:15px;height:15px;cursor: pointer;margin-top: -4px;'><use xlink:href="#yj-icon-play"></use></svg></button>
|
||||
<button title="删除" class='iconBut'><svg class="icon-delete delete" style='width:20px;height:20px;cursor: pointer;'><use xlink:href="#yj-icon-delete"></use></svg></button>
|
||||
</div>
|
||||
`
|
||||
tr.addEventListener('click', (v) => {
|
||||
if (v.target.parentNode === tr) {
|
||||
let tr_active = tableBody.getElementsByClassName('tr active')[0]
|
||||
tr_active && (tr_active.className = 'tr')
|
||||
tr.className = 'tr active'
|
||||
for (let m = 0; m < trList.length; m++) {
|
||||
if (trList[m] === tr) {
|
||||
active = m + 1
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
tr.addEventListener('dblclick', (v) => {
|
||||
if (v.target.parentNode === tr) {
|
||||
for (let m = 0; m < trList.length; m++) {
|
||||
if (trList[m] === tr) {
|
||||
viewer.camera.flyTo({
|
||||
destination: Cesium.Cartesian3.fromDegrees(points[m].position.lng, points[m].position.lat, points[m].position.alt),
|
||||
orientation: points[m].orientation,
|
||||
duration: 1
|
||||
})
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
let e_play = tr.getElementsByClassName('play')[0]
|
||||
let e_delete = tr.getElementsByClassName('delete')[0]
|
||||
let e_time = tr.querySelector("input[name='time']")
|
||||
|
||||
let modifyBtn = tr.getElementsByClassName('modify-point')[0]
|
||||
modifyBtn.addEventListener('click', () => {
|
||||
for (let m = 0; m < trList.length; m++) {
|
||||
if (trList[m] === e_delete.parentNode.parentNode.parentNode) {
|
||||
let position = tools.cartesian3Towgs84(viewer.camera.position, viewer)
|
||||
points[m].position = position
|
||||
points[m].orientation = {
|
||||
heading: viewer.camera.heading,
|
||||
pitch: viewer.camera.pitch,
|
||||
roll: viewer.camera.roll
|
||||
}
|
||||
ElMessage({
|
||||
message: '更新视角成功',
|
||||
type: 'success'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
|
||||
e_play.addEventListener('click', () => {
|
||||
for (let m = 0; m < trList.length; m++) {
|
||||
if (trList[m] === e_play.parentNode.parentNode.parentNode) {
|
||||
if(beforeData.id) {
|
||||
window.earth.flyRoamId = beforeData.id
|
||||
}
|
||||
YJ.Global.FlyRoam.flyTo(window.earth, points, m)
|
||||
}
|
||||
}
|
||||
})
|
||||
e_delete.addEventListener("click", (v) => {
|
||||
for (let m = 0; m < trList.length; m++) {
|
||||
if (trList[m] === e_delete.parentNode.parentNode.parentNode) {
|
||||
points.splice(m, 1)
|
||||
points[points.length - 1] && (points[points.length - 1].duration = 0)
|
||||
tableBody.removeChild(tr)
|
||||
if (active > m + 1) {
|
||||
active--
|
||||
trList[active - 1].className = 'tr active'
|
||||
}
|
||||
else if (active == m + 1) {
|
||||
if (trList.length == m) {
|
||||
active -= 1
|
||||
}
|
||||
if (trList.length != 0) {
|
||||
trList[active - 1].className = 'tr active'
|
||||
}
|
||||
}
|
||||
// else if(active == m) {
|
||||
// console.log(trList.length-1, active)
|
||||
// if (trList.length == active-1) {
|
||||
// trList[active-2].className = 'tr active'
|
||||
// }
|
||||
// else {
|
||||
// trList[active-1].className = 'tr active'
|
||||
// }
|
||||
// }
|
||||
if (trList.length > 0) {
|
||||
let lastElm = trList[trList.length - 1].querySelector("input[name='time']")
|
||||
lastElm.disabled = 'disabled'
|
||||
lastElm.value = 0
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
// points.splice(i, 1)
|
||||
// tableBody.removeChild(tr)
|
||||
// if (trList.length > 0) {
|
||||
// trList[trList.length - 1].querySelector("input[name='time']").disabled = 'disabled'
|
||||
// }
|
||||
|
||||
draw({
|
||||
name: roamData.name,
|
||||
points: roamData.points,
|
||||
repeat: roamData.repeat + '',
|
||||
defaultTime: defaultTimeDom.value,
|
||||
totalTime: totalTimeElm.value
|
||||
})
|
||||
})
|
||||
e_time.addEventListener('input', (v) => {
|
||||
isTotalTimeElm.checked = false
|
||||
data.duration = Number(e_time.value)
|
||||
if (data.duration < 0) {
|
||||
data.duration = 0
|
||||
}
|
||||
})
|
||||
e_time.addEventListener('blur', () => {
|
||||
e_time.value = Number(Number(e_time.value).toFixed(2))
|
||||
if (e_time.value < 0) {
|
||||
e_time.value = 0
|
||||
}
|
||||
});
|
||||
tableBody.insertBefore(tr, trList[active])
|
||||
active++
|
||||
trList[trList.length - 1].querySelector("input[name='time']").disabled = 'disabled'
|
||||
}
|
||||
}
|
||||
|
||||
const save = async () => {
|
||||
if (allData.points.length != 0) {
|
||||
if (roamData.points.length != 0) {
|
||||
let selectedNodes = window.treeObj.getSelectedNodes()
|
||||
let node = selectedNodes && selectedNodes[selectedNodes.length - 1]
|
||||
let parentId
|
||||
@ -281,13 +600,12 @@ const save = async () => {
|
||||
}
|
||||
let id = (beforeData && beforeData.id) || new YJ.Tools().randomString()
|
||||
let paramsData: any = {
|
||||
params: allData,
|
||||
params: roamData,
|
||||
id,
|
||||
sourceName: allData.name || t(`default.roam`),
|
||||
sourceName: roamData.name || t(`default.roam`),
|
||||
sourceType: 'roam',
|
||||
parentId: parentId
|
||||
parentId: parentId,
|
||||
}
|
||||
|
||||
if (beforeData && beforeData.id) {
|
||||
// let params2 = {
|
||||
// "id": params.id,
|
||||
@ -298,16 +616,22 @@ const save = async () => {
|
||||
// TreeApi.updateDirectoryInfo(params2)
|
||||
delete paramsData.sourceType
|
||||
delete paramsData.parentId
|
||||
paramsData.isShow = allData.isShow
|
||||
paramsData.isShow = roamData.repeat == 'Infinity' ? 1 : 0
|
||||
TreeApi.updateDirectoryInfo(paramsData)
|
||||
cusUpdateNode({
|
||||
id: paramsData.id,
|
||||
sourceName: paramsData.sourceName,
|
||||
params: JSON.stringify(paramsData.params)
|
||||
})
|
||||
let node = window.treeObj.getNodeByParam(
|
||||
"id",
|
||||
paramsData.id,
|
||||
null
|
||||
);
|
||||
window.treeObj.checkNode(node, paramsData.isShow, true);
|
||||
} else {
|
||||
let res = await TreeApi.addOtherSource(paramsData)
|
||||
if(![0, 200].includes(res.code)) {
|
||||
if (![0, 200].includes(res.code)) {
|
||||
return
|
||||
}
|
||||
ElMessage.closeAll()
|
||||
@ -315,8 +639,17 @@ const save = async () => {
|
||||
message: '添加成功',
|
||||
type: 'success'
|
||||
})
|
||||
paramsData.isShow = true
|
||||
let sourceType = paramsData.sourceType
|
||||
let parentId = paramsData.parentId
|
||||
delete paramsData.sourceType
|
||||
delete paramsData.parentId
|
||||
paramsData.isShow = roamData.repeat == 'Infinity' ? 1 : 0
|
||||
if(!paramsData.isShow) {
|
||||
TreeApi.updateDirectoryInfo(paramsData)
|
||||
}
|
||||
paramsData.params = JSON.stringify(paramsData.params)
|
||||
paramsData.sourceType = sourceType
|
||||
paramsData.parentId = parentId
|
||||
cusAddNodes(window.treeObj, paramsData.parentId, [paramsData])
|
||||
}
|
||||
|
||||
@ -329,7 +662,7 @@ const save = async () => {
|
||||
}
|
||||
}
|
||||
const draw = (data) => {
|
||||
allData = data
|
||||
roamData = data
|
||||
}
|
||||
|
||||
const startVideo = () => {
|
||||
@ -352,25 +685,20 @@ const startVideo = () => {
|
||||
window.addEventListener('keydown', handleKeyDown)
|
||||
}
|
||||
|
||||
const clangeViewPointHeight = () => {}
|
||||
const viewPointHeightInput = () => {
|
||||
let dom: any = document.getElementById('viewPointHeight')
|
||||
if (viewPointHeight.value < dom.min * 1) {
|
||||
viewPointHeight.value = dom.min * 1
|
||||
} else if (viewPointHeight.value > dom.max * 1) {
|
||||
viewPointHeight.value = dom.max * 1
|
||||
}
|
||||
}
|
||||
const closeCallBack = (e) => {
|
||||
YJ.Global.FlyRoam.cease(window.earth)
|
||||
YJ.Global.FlyRoam.close()
|
||||
let contentElm = document.getElementsByClassName('fly-roam')[0]
|
||||
if (contentElm) {
|
||||
let tableBody = contentElm.getElementsByClassName('table-body')[0];
|
||||
let trList = tableBody.getElementsByClassName('tr')
|
||||
for (let i = trList.length - 1; i >= 0; i--) {
|
||||
tableBody.removeChild(trList[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
onBeforeUnmount(() => {
|
||||
closeCallBack('')
|
||||
})
|
||||
const apply = (e) => {
|
||||
YJ.Global.FlyRoam.apply()
|
||||
}
|
||||
const close = (e) => {
|
||||
show.value = false
|
||||
baseDialog.value?.close()
|
||||
@ -405,12 +733,10 @@ defineExpose({
|
||||
}
|
||||
|
||||
.video {
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
background: linear-gradient(180deg,
|
||||
rgba(71, 27, 5, 0.3) 0%,
|
||||
rgba(71, 27, 5, 0.3) 0%,
|
||||
rgba(255, 143, 87, 0) 100%
|
||||
),
|
||||
rgba(255, 143, 87, 0) 100%),
|
||||
rgba(0, 0, 0, 0.5) !important;
|
||||
border: 1px solid rgba(255, 165, 92, 1) !important;
|
||||
color: rgba(255, 165, 92, 1) !important;
|
||||
|
||||
@ -2,9 +2,10 @@
|
||||
<Dialog ref="baseDialog" :title="t('bottomMenu.groundText')" left="calc(50% - 198px)" top="calc(50% - 120px)"
|
||||
:closeCallback="closeCallBack">
|
||||
<template #content>
|
||||
<textarea style="height: 40px; width: 348px;margin-bottom: 10px;" maxlength="80" v-model="text"></textarea>
|
||||
<textarea style="height: 40px; width: 348px;margin-bottom: 10px;" maxlength="80" v-model="text" @focus="error = false"></textarea>
|
||||
<span style="position: absolute;bottom: 66px;right: 26px;font-size: 12px;color: #c5c5c5;font-family: Arial;">{{
|
||||
text.length }}/80</span>
|
||||
<span v-if="error" style="top: unset;bottom: 72px;left: 26px;" class="el-form-item__error">内容不能为空!</span>
|
||||
</template>
|
||||
<template #footer>
|
||||
<button @click="confirm">{{ t('btn.confirm') }}</button>
|
||||
@ -26,6 +27,7 @@ const { cusAddNodes } = useTreeNode()
|
||||
|
||||
const baseDialog: any = ref(null)
|
||||
const eventBus: any = inject('bus')
|
||||
const error = ref(false)
|
||||
const text = ref('')
|
||||
eventBus.on('openStandTextAdd', () => {
|
||||
baseDialog.value?.open()
|
||||
@ -35,6 +37,7 @@ const open = () => {
|
||||
}
|
||||
const confirm = () => {
|
||||
if (!text.value) {
|
||||
error.value = true
|
||||
return
|
||||
}
|
||||
text.value = text.value.trim()
|
||||
@ -112,6 +115,7 @@ const confirm = () => {
|
||||
}
|
||||
const closeCallBack = () => {
|
||||
text.value = ''
|
||||
error.value = false
|
||||
}
|
||||
defineExpose({
|
||||
open
|
||||
|
||||
@ -2,9 +2,10 @@
|
||||
<Dialog ref="baseDialog" :title="t('bottomMenu.standText')" left="calc(50% - 198px)" top="calc(50% - 120px)"
|
||||
:closeCallback="closeCallBack">
|
||||
<template #content>
|
||||
<textarea style="height: 40px; width: 348px;margin-bottom: 10px;" maxlength="80" v-model="text"></textarea>
|
||||
<textarea style="height: 40px; width: 348px;margin-bottom: 10px;" maxlength="80" v-model="text" @focus="error = false"></textarea>
|
||||
<span style="position: absolute;bottom: 66px;right: 26px;font-size: 12px;color: #c5c5c5;font-family: Arial;">{{
|
||||
text.length }}/80</span>
|
||||
<span v-if="error" style="top: unset;bottom: 72px;left: 26px;" class="el-form-item__error">内容不能为空!</span>
|
||||
</template>
|
||||
<template #footer>
|
||||
<button @click="confirm">{{ t('btn.confirm') }}</button>
|
||||
@ -26,6 +27,7 @@ const { cusAddNodes } = useTreeNode()
|
||||
|
||||
const baseDialog: any = ref(null)
|
||||
const eventBus: any = inject('bus')
|
||||
const error = ref(false)
|
||||
const text = ref('')
|
||||
eventBus.on('openStandTextAdd', () => {
|
||||
baseDialog.value?.open()
|
||||
@ -34,11 +36,9 @@ const open = () => {
|
||||
baseDialog.value?.open()
|
||||
}
|
||||
const confirm = () => {
|
||||
if (!text.value) {
|
||||
return
|
||||
}
|
||||
text.value = text.value.trim()
|
||||
if (!text.value) {
|
||||
error.value = true
|
||||
return
|
||||
}
|
||||
let name = text.value
|
||||
@ -107,6 +107,7 @@ const confirm = () => {
|
||||
}
|
||||
const closeCallBack = () => {
|
||||
text.value = ''
|
||||
error.value = false
|
||||
}
|
||||
defineExpose({
|
||||
open
|
||||
|
||||
@ -28,7 +28,8 @@
|
||||
<div class="col">
|
||||
<span class="label">动画时长</span>
|
||||
<div class="input-number input-number-unit-3">
|
||||
<input class="input blur" type="number" title="" min="500" max="9999999" v-model="entityOptions.spreadTime" @input="$handleInputLimit">
|
||||
<input class="input blur" type="number" title="" min="500" max="9999999"
|
||||
v-model="entityOptions.spreadTime" @input="$handleInputLimit">
|
||||
<span class="unit">ms</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
@ -37,7 +38,7 @@
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<span class="label">动画</span>
|
||||
<input class="btn-switch" type="checkbox" v-model="entityOptions.spreadState">
|
||||
<input class="btn-switch" type="checkbox" v-model="spreadState" @change="spreadStateChange">
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="label">动画重复</span>
|
||||
@ -47,61 +48,66 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="div-item">
|
||||
<div>
|
||||
<div class="row">
|
||||
<el-tabs v-model="activeName">
|
||||
<el-tab-pane label="属性信息" name="1">
|
||||
<attribute :entityOptions="entityOptions"></attribute>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="空间信息" name="2">
|
||||
<div class="row">
|
||||
<div class="col height-mode-box">
|
||||
<span class="label" style="flex: 0 0 56px;">高度模式</span>
|
||||
<el-select class="input input-select height-mode-scelect" style="width: 155px;margin-left: 20px"
|
||||
v-model="heightMode" @change="heightModeChange" placeholder="请选择">
|
||||
<el-option v-for="item in heightModeData" :key="item.key" :label="item.name" :value="item.key">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="label">Z值统一增加</span>
|
||||
<div class="input-number input-number-unit-1 height-box" :class="{ 'disabled': heightMode == 2 }">
|
||||
<input class="input height" type="number" title="" min="-9999999" max="999999999" v-model="height" @input="$handleInputLimit">
|
||||
<span class="unit">m</span>
|
||||
<span class="arrow"></span>
|
||||
<div class="div-item">
|
||||
<div class="row">
|
||||
<div class="col height-mode-box">
|
||||
<span class="label" style="flex: 0 0 56px;">高度模式</span>
|
||||
<el-select class="input input-select height-mode-scelect" style="width: 155px;margin-left: 20px"
|
||||
v-model="heightMode" @change="heightModeChange" placeholder="请选择">
|
||||
<el-option v-for="item in heightModeData" :key="item.key" :label="item.name" :value="item.key">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<button class="confirm height-confirm" style="margin-left: 5px;" @click="heightConfirm"
|
||||
:disabled="heightMode == 2">应用</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="table spatial-info-table">
|
||||
<div class="table-head">
|
||||
<div class="tr">
|
||||
<div class="th"></div>
|
||||
<div class="th">经度(X)</div>
|
||||
<div class="th">纬度(Y)</div>
|
||||
<div class="th">高度(Z)</div>
|
||||
<div class="col">
|
||||
<span class="label">Z值统一增加</span>
|
||||
<div class="input-number input-number-unit-1 height-box" :class="{ 'disabled': heightMode == 2 }">
|
||||
<input class="input height" type="number" title="" min="-9999999" max="999999999" v-model="height"
|
||||
@input="$handleInputLimit">
|
||||
<span class="unit">m</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
<button class="confirm height-confirm" style="margin-left: 5px;" @click="heightConfirm"
|
||||
:disabled="heightMode == 2">应用</button>
|
||||
</div>
|
||||
<div class="table-body">
|
||||
<div class="tr" v-for="(item, i) in entityOptions.options.positions" :key="i">
|
||||
<div class="td">{{ i + 1 }}</div>
|
||||
<div class="td lng align-center" @dblclick="inputDblclick($event, i, 'lng')">
|
||||
<input class="input" @blur="inputBlurCallBack($event, i, 'lng', 8)" type="number"
|
||||
v-model="item.lng" min="-180" max="180" v-if="activeTd.index == i && activeTd.name == 'lng'" @input="$handleInputLimit">
|
||||
<span style="pointer-events: none;" v-else>{{ (item.lng).toFixed(8) }}</span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="table spatial-info-table">
|
||||
<div class="table-head">
|
||||
<div class="tr">
|
||||
<div class="th"></div>
|
||||
<div class="th">经度(X)</div>
|
||||
<div class="th">纬度(Y)</div>
|
||||
<div class="th">高度(Z)</div>
|
||||
</div>
|
||||
<div class="td lat align-center" @dblclick="inputDblclick($event, i, 'lat')">
|
||||
<input class="input" @blur="inputBlurCallBack($event, i, 'lat', 8)" type="number"
|
||||
v-model="item.lat" min="-180" max="180" v-if="activeTd.index == i && activeTd.name == 'lat'" @input="$handleInputLimit">
|
||||
<span style="pointer-events: none;" v-else>{{ (item.lat).toFixed(8) }}</span>
|
||||
</div>
|
||||
<div class="td alt align-center" @dblclick="inputDblclick($event, i, 'alt')">
|
||||
<input class="input" @blur="inputBlurCallBack($event, i, 'alt', 2)" type="number"
|
||||
v-model="entityOptions.height" min="-9999999" max="999999999"
|
||||
v-if="activeTd.index == i && activeTd.name == 'alt'" @input="$handleInputLimit">
|
||||
<span style="pointer-events: none;" v-else>{{ (entityOptions.height).toFixed(2) }}</span>
|
||||
</div>
|
||||
<div class="table-body">
|
||||
<div class="tr" v-for="(item, i) in entityOptions.options.positions" :key="i">
|
||||
<div class="td">{{ i + 1 }}</div>
|
||||
<div class="td lng align-center" @dblclick="inputDblclick($event, i, 'lng')">
|
||||
<input class="input" @blur="inputBlurCallBack($event, i, 'lng', 8)" type="number"
|
||||
v-model="item.lng" min="-180" max="180" v-if="activeTd.index == i && activeTd.name == 'lng'"
|
||||
@input="$handleInputLimit">
|
||||
<span style="pointer-events: none;" v-else>{{ (item.lng).toFixed(8) }}</span>
|
||||
</div>
|
||||
<div class="td lat align-center" @dblclick="inputDblclick($event, i, 'lat')">
|
||||
<input class="input" @blur="inputBlurCallBack($event, i, 'lat', 8)" type="number"
|
||||
v-model="item.lat" min="-180" max="180" v-if="activeTd.index == i && activeTd.name == 'lat'"
|
||||
@input="$handleInputLimit">
|
||||
<span style="pointer-events: none;" v-else>{{ (item.lat).toFixed(8) }}</span>
|
||||
</div>
|
||||
<div class="td alt align-center" @dblclick="inputDblclick($event, i, 'alt')">
|
||||
<input class="input" @blur="inputBlurCallBack($event, i, 'alt', 2)" type="number"
|
||||
v-model="entityOptions.height" min="-9999999" max="999999999"
|
||||
v-if="activeTd.index == i && activeTd.name == 'alt'" @input="$handleInputLimit">
|
||||
<span style="pointer-events: none;" v-else>{{ (entityOptions.height).toFixed(2) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -109,21 +115,24 @@
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="面风格" name="3">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<span class="label">面颜色</span>
|
||||
<div class="color" ref="colorRef"></div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="label">描边颜色</span>
|
||||
<div class="lineColor" ref="lineColorRef"></div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="label">描边宽度</span>
|
||||
<div class="input-number input-number-unit-2">
|
||||
<input class="input" type="number" title="" min="0" max="99" v-model="entityOptions.lineWidth" @input="$handleInputLimit">
|
||||
<span class="unit">px</span>
|
||||
<span class="arrow"></span>
|
||||
<div class="div-item">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<span class="label">面颜色</span>
|
||||
<div class="color" ref="colorRef"></div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="label">描边颜色</span>
|
||||
<div class="lineColor" ref="lineColorRef"></div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="label">描边宽度</span>
|
||||
<div class="input-number input-number-unit-2">
|
||||
<input class="input" type="number" title="" min="0" max="99" v-model="entityOptions.lineWidth"
|
||||
@input="$handleInputLimit">
|
||||
<span class="unit">px</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -208,9 +217,12 @@ const heightMode = ref(0)
|
||||
const entityOptions: any = ref({});
|
||||
let originalOptions: any
|
||||
let that: any
|
||||
const spreadState = ref(false)
|
||||
|
||||
|
||||
|
||||
const open = async (id: any, type: any) => {
|
||||
if(type && type === 'pincerArrow') {
|
||||
if (type && type === 'pincerArrow') {
|
||||
title.value = '双箭头'
|
||||
}
|
||||
that = window.earth.entityMap.get(id)
|
||||
@ -239,10 +251,10 @@ const open = async (id: any, type: any) => {
|
||||
area.value = entityOptions.value.areaByMeter
|
||||
}
|
||||
}
|
||||
let spreadState = entityOptions.value.spreadState
|
||||
heightModeChange(heightMode.value)
|
||||
spreadState.value = entityOptions.value.spreadState
|
||||
that.heightMode = heightMode.value
|
||||
setTimeout(() => {
|
||||
entityOptions.value.spreadState = spreadState
|
||||
that.spreadState = spreadState.value
|
||||
}, 50);
|
||||
baseDialog.value?.open()
|
||||
|
||||
@ -279,8 +291,14 @@ const open = async (id: any, type: any) => {
|
||||
|
||||
const heightModeChange = (val) => {
|
||||
that.heightMode = heightMode.value
|
||||
entityOptions.value.spreadState = false
|
||||
that.spreadState = false
|
||||
spreadState.value = false
|
||||
}
|
||||
const spreadStateChange = (val) => {
|
||||
that.spreadState = spreadState.value
|
||||
}
|
||||
|
||||
|
||||
|
||||
const heightConfirm = () => {
|
||||
if (entityOptions.value.operate.positionEditing) {
|
||||
@ -316,8 +334,11 @@ const inputBlurCallBack = (event, i, name, digit = 2) => {
|
||||
}
|
||||
}
|
||||
|
||||
const translate = () => {
|
||||
entityOptions.value.spreadState = false
|
||||
const translate = async () => {
|
||||
that.spreadState = false
|
||||
spreadState.value = false
|
||||
entityOptions.value.closeNodeEdit()
|
||||
await nextTick()
|
||||
that.openPositionEditing(() => {
|
||||
entityOptions.value.options.positions = structuredClone(that.options.positions)
|
||||
})
|
||||
@ -332,7 +353,8 @@ const closeCallback = () => {
|
||||
}
|
||||
|
||||
const nodeEdit = () => {
|
||||
entityOptions.value.spreadState = false
|
||||
that.spreadState = false
|
||||
spreadState.value = false
|
||||
that.nodeEdit((e, positions, areaByMeter) => {
|
||||
entityOptions.value.options.positions = structuredClone(positions)
|
||||
})
|
||||
@ -370,31 +392,31 @@ watch(
|
||||
const remove = () => {
|
||||
close()
|
||||
ElMessageBox.confirm('此操作将永久删除节点及所有子节点, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(async () => {
|
||||
let node = window.treeObj.getNodeByParam('id', that.options.id, null)
|
||||
let source_ids = cusRemoveNode(window.treeObj, [node])
|
||||
const res = await TreeApi.removeDirectory({ ids: source_ids })
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
ElMessage({
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
})
|
||||
that.remove()
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(async () => {
|
||||
let node = window.treeObj.getNodeByParam('id', that.options.id, null)
|
||||
let source_ids = cusRemoveNode(window.treeObj, [node])
|
||||
const res = await TreeApi.removeDirectory({ ids: source_ids })
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
ElMessage({
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
})
|
||||
that.remove()
|
||||
(window as any)._entityMap.delete(source_ids[0])
|
||||
} else {
|
||||
ElMessage({
|
||||
message: res.msg || '删除失败',
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
// 用户点击取消,不执行任何操作
|
||||
})
|
||||
} else {
|
||||
ElMessage({
|
||||
message: res.msg || '删除失败',
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
// 用户点击取消,不执行任何操作
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
@ -406,6 +428,7 @@ defineExpose({
|
||||
<style scoped lang="scss">
|
||||
.attackArrow.dialog-en {
|
||||
::v-deep>.content {
|
||||
|
||||
.attribute-content-link .table .tr .td.operation button,
|
||||
.attribute-content-vr .table .tr .td.operation button,
|
||||
.attribute-content-rtmp .table .tr .td.operation button {
|
||||
|
||||
@ -620,7 +620,10 @@ const vrDelete = (index: any) => {
|
||||
attribute.value.vr.content.splice(index, 1)
|
||||
}
|
||||
const vrConfirmEdit = (index: string | number) => {
|
||||
attribute.value.vr.content[index] = vrEditActive.value
|
||||
attribute.value.vr.content[index] = {
|
||||
name: vrEditActive.value.name,
|
||||
url: vrEditActive.value.url
|
||||
}
|
||||
vrEditActive.value = {}
|
||||
}
|
||||
const vrCancelEdit = () => {
|
||||
@ -691,7 +694,12 @@ const changeAttributeGoods = (item) => {
|
||||
}
|
||||
const changeAttributeCamera = (e) => {
|
||||
console.log(e)
|
||||
props.entityOptions.attributeCamera = [{...e}]
|
||||
if(e.checked) {
|
||||
props.entityOptions.attributeCamera = [{...e}]
|
||||
}
|
||||
else {
|
||||
props.entityOptions.attributeCamera = []
|
||||
}
|
||||
for (let i = 0; i < cameraList.value.length; i++) {
|
||||
if (cameraList.value[i].id !== e.id) {
|
||||
cameraList.value[i].checked = false
|
||||
|
||||
@ -59,13 +59,13 @@
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<span class="label">线段缓冲</span>
|
||||
<input class="btn-switch" type="checkbox" v-model="entityOptions.extend" @change="lineExtendchange" />
|
||||
<input class="btn-switch" type="checkbox" v-model="extend" @change="lineExtendchange" />
|
||||
</div>
|
||||
<div class="col" style="flex: 0 0 33%">
|
||||
<span class="label">缓冲宽度</span>
|
||||
<div class="input-number input-number-unit-1" style="width: 80px">
|
||||
<input class="input" type="number" title="" min="0" data-min="0.01" max="999999" @input="$handleInputLimit"
|
||||
v-model="entityOptions.extendWidth" />
|
||||
<input class="input" type="number" title="" min="0" data-min="0.01" max="999999"
|
||||
@input="$handleInputLimit" v-model="extendWidth" @change="extendWidthchange" />
|
||||
<span class="unit">m</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
@ -113,59 +113,61 @@
|
||||
<attribute :entityOptions="entityOptions"></attribute>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="空间信息" name="2">
|
||||
<div class="row">
|
||||
<div class="col height-mode-box">
|
||||
<span class="label" style="flex: 0 0 56px">高度模式</span>
|
||||
<el-select class="input input-select height-mode-scelect" style="width: 155px; margin-left: 20px"
|
||||
v-model="heightMode" @change="heightModeChange" placeholder="请选择">
|
||||
<el-option v-for="item in heightModeData" :key="item.key" :label="item.name" :value="item.key">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="label">Z值统一增加</span>
|
||||
<div class="input-number input-number-unit-1 height-box" :class="{ disabled: heightMode == 2 }">
|
||||
<input class="input height" type="number" title="" min="-9999999" max="999999999"
|
||||
@input="$handleInputLimit" v-model="height" />
|
||||
<span class="unit">m</span>
|
||||
<span class="arrow"></span>
|
||||
<div class="div-item">
|
||||
<div class="row">
|
||||
<div class="col height-mode-box">
|
||||
<span class="label" style="flex: 0 0 56px">高度模式</span>
|
||||
<el-select class="input input-select height-mode-scelect" style="width: 155px; margin-left: 20px"
|
||||
v-model="heightMode" @change="heightModeChange" placeholder="请选择">
|
||||
<el-option v-for="item in heightModeData" :key="item.key" :label="item.name" :value="item.key">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<button class="confirm height-confirm" style="margin-left: 5px" @click="heightConfirm"
|
||||
:disabled="heightMode == 2">
|
||||
应用
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="table spatial-info-table">
|
||||
<div class="table-head">
|
||||
<div class="tr">
|
||||
<div class="th"></div>
|
||||
<div class="th">经度(X)</div>
|
||||
<div class="th">纬度(Y)</div>
|
||||
<div class="th">高度(Z)</div>
|
||||
<div class="col">
|
||||
<span class="label">Z值统一增加</span>
|
||||
<div class="input-number input-number-unit-1 height-box" :class="{ disabled: heightMode == 2 }">
|
||||
<input class="input height" type="number" title="" min="-9999999" max="999999999"
|
||||
@input="$handleInputLimit" v-model="height" />
|
||||
<span class="unit">m</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
<button class="confirm height-confirm" style="margin-left: 5px" @click="heightConfirm"
|
||||
:disabled="heightMode == 2">
|
||||
应用
|
||||
</button>
|
||||
</div>
|
||||
<div class="table-body">
|
||||
<div class="tr" v-for="(item, i) in entityOptions.options.positions" :key="i">
|
||||
<div class="td">{{ i + 1 }}</div>
|
||||
<div class="td lng align-center" @dblclick="inputDblclick($event, i, 'lng')">
|
||||
<input class="input" @blur="inputBlurCallBack($event, i, 'lng', 8)" type="number"
|
||||
v-model="item.lng" min="-180" max="180" @input="$handleInputLimit"
|
||||
v-if="activeTd.index == i && activeTd.name == 'lng'" />
|
||||
<span style="pointer-events: none" v-else>{{ item.lng.toFixed(8) }}</span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="table spatial-info-table">
|
||||
<div class="table-head">
|
||||
<div class="tr">
|
||||
<div class="th"></div>
|
||||
<div class="th">经度(X)</div>
|
||||
<div class="th">纬度(Y)</div>
|
||||
<div class="th">高度(Z)</div>
|
||||
</div>
|
||||
<div class="td lat align-center" @dblclick="inputDblclick($event, i, 'lat')">
|
||||
<input class="input" @blur="inputBlurCallBack($event, i, 'lat', 8)" type="number"
|
||||
v-model="item.lat" min="-180" max="180" @input="$handleInputLimit"
|
||||
v-if="activeTd.index == i && activeTd.name == 'lat'" />
|
||||
<span style="pointer-events: none" v-else>{{ item.lat.toFixed(8) }}</span>
|
||||
</div>
|
||||
<div class="td alt align-center" @dblclick="inputDblclick($event, i, 'alt')">
|
||||
<input class="input" @blur="inputBlurCallBack($event, i, 'alt', 2)" type="number"
|
||||
v-model="item.alt" min="-9999999" max="999999999" @input="$handleInputLimit"
|
||||
v-if="activeTd.index == i && activeTd.name == 'alt'" />
|
||||
<span style="pointer-events: none" v-else>{{ item.alt.toFixed(2) }}</span>
|
||||
</div>
|
||||
<div class="table-body">
|
||||
<div class="tr" v-for="(item, i) in entityOptions.options.positions" :key="i">
|
||||
<div class="td">{{ i + 1 }}</div>
|
||||
<div class="td lng align-center" @dblclick="inputDblclick($event, i, 'lng')">
|
||||
<input class="input" @blur="inputBlurCallBack($event, i, 'lng', 8)" type="number"
|
||||
v-model="item.lng" min="-180" max="180" @input="$handleInputLimit"
|
||||
v-if="activeTd.index == i && activeTd.name == 'lng'" />
|
||||
<span style="pointer-events: none" v-else>{{ item.lng.toFixed(8) }}</span>
|
||||
</div>
|
||||
<div class="td lat align-center" @dblclick="inputDblclick($event, i, 'lat')">
|
||||
<input class="input" @blur="inputBlurCallBack($event, i, 'lat', 8)" type="number"
|
||||
v-model="item.lat" min="-180" max="180" @input="$handleInputLimit"
|
||||
v-if="activeTd.index == i && activeTd.name == 'lat'" />
|
||||
<span style="pointer-events: none" v-else>{{ item.lat.toFixed(8) }}</span>
|
||||
</div>
|
||||
<div class="td alt align-center" @dblclick="inputDblclick($event, i, 'alt')">
|
||||
<input class="input" @blur="inputBlurCallBack($event, i, 'alt', 2)" type="number"
|
||||
v-model="item.alt" min="-9999999" max="999999999" @input="$handleInputLimit"
|
||||
v-if="activeTd.index == i && activeTd.name == 'alt'" />
|
||||
<span style="pointer-events: none" v-else>{{ item.alt.toFixed(2) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -329,6 +331,8 @@ const colorRef = ref(null)
|
||||
const extendColorRef = ref(null)
|
||||
const heightMode = ref(0)
|
||||
const wordsName = ref(0)
|
||||
const extend = ref(false)
|
||||
const extendWidth = ref(0)
|
||||
|
||||
let originalOptions
|
||||
let that
|
||||
@ -338,6 +342,7 @@ const open = async (id, type) => {
|
||||
sourceType.value = type
|
||||
originalOptions = structuredClone(that.options)
|
||||
entityOptions.value = that
|
||||
extendWidth.value = that.extendWidth
|
||||
wordsName.value = Number(entityOptions.value.wordsName)
|
||||
heightMode.value = entityOptions.value.heightMode
|
||||
length.value = entityOptions.value.lengthByMeter
|
||||
@ -350,6 +355,7 @@ const open = async (id, type) => {
|
||||
}
|
||||
}
|
||||
heightModeChange(heightMode.value)
|
||||
extend.value = that.extend
|
||||
baseDialog.value?.open()
|
||||
|
||||
await nextTick()
|
||||
@ -382,8 +388,12 @@ const open = async (id, type) => {
|
||||
} //点击清空按钮事件回调
|
||||
})
|
||||
}
|
||||
const extendWidthchange = (val) => {
|
||||
that.extendWidth = extendWidth.value
|
||||
}
|
||||
const heightModeChange = (val) => {
|
||||
that.heightMode = heightMode.value
|
||||
extend.value = false
|
||||
// @ts-ignore
|
||||
if (heightMode.value === 0 || heightMode.value === '0' || heightMode.value === 1 || heightMode.value === '1') {
|
||||
entityOptions.value.extend = false
|
||||
@ -431,6 +441,7 @@ const lineExtendchange = (e) => {
|
||||
if (e.target.checked) {
|
||||
heightMode.value = 2
|
||||
}
|
||||
that.extend = extend.value
|
||||
}
|
||||
const nodeEdit = () => {
|
||||
entityOptions.value.positionEditing = false
|
||||
@ -446,7 +457,9 @@ const nodeEdit = () => {
|
||||
}
|
||||
})
|
||||
}
|
||||
const translate = () => {
|
||||
const translate = async () => {
|
||||
entityOptions.value.closeNodeEdit()
|
||||
await nextTick()
|
||||
that.openPositionEditing(() => {
|
||||
entityOptions.value.options.positions = structuredClone(that.options.positions)
|
||||
if (lengthUnit.value == 'km') {
|
||||
@ -556,8 +569,10 @@ defineExpose({
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.polyline.dialog-en {
|
||||
::v-deep>.content {
|
||||
|
||||
.attribute-content-link .table .tr .td.operation button,
|
||||
.attribute-content-vr .table .tr .td.operation button,
|
||||
.attribute-content-rtmp .table .tr .td.operation button {
|
||||
|
||||
@ -25,65 +25,67 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="div-item">
|
||||
<div>
|
||||
<div class="row">
|
||||
<el-tabs v-model="activeName">
|
||||
<el-tab-pane label="属性信息" name="1">
|
||||
<attribute :entityOptions="entityOptions"></attribute>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="空间信息" name="2">
|
||||
<div class="row">
|
||||
<div class="col height-mode-box">
|
||||
<span class="label" style="flex: 0 0 56px;">高度模式</span>
|
||||
<el-select class="input input-select height-mode-scelect" style="width: 155px;margin-left: 20px"
|
||||
v-model="heightMode" @change="heightModeChange" placeholder="请选择">
|
||||
<el-option v-for="item in heightModeData" :key="item.key" :label="item.name" :value="item.key">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="label">Z值统一增加</span>
|
||||
<div class="input-number input-number-unit-1 height-box" :class="{ 'disabled': heightMode == 2 }">
|
||||
<input class="input height" type="number" title="" min="-9999999" max="999999999" v-model="height"
|
||||
@input="$handleInputLimit" />
|
||||
<span class="unit">m</span>
|
||||
<span class="arrow"></span>
|
||||
<div class="div-item">
|
||||
<div class="row">
|
||||
<div class="col height-mode-box">
|
||||
<span class="label" style="flex: 0 0 56px;">高度模式</span>
|
||||
<el-select class="input input-select height-mode-scelect" style="width: 155px;margin-left: 20px"
|
||||
v-model="heightMode" @change="heightModeChange" placeholder="请选择">
|
||||
<el-option v-for="item in heightModeData" :key="item.key" :label="item.name" :value="item.key">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<button class="confirm height-confirm" style="margin-left: 5px;" @click="heightConfirm"
|
||||
:disabled="heightMode == 2">应用</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="table spatial-info-table">
|
||||
<div class="table-head">
|
||||
<div class="tr">
|
||||
<div class="th"></div>
|
||||
<div class="th">经度(X)</div>
|
||||
<div class="th">纬度(Y)</div>
|
||||
<div class="th">高度(Z)</div>
|
||||
<div class="col">
|
||||
<span class="label">Z值统一增加</span>
|
||||
<div class="input-number input-number-unit-1 height-box" :class="{ 'disabled': heightMode == 2 }">
|
||||
<input class="input height" type="number" title="" min="-9999999" max="999999999" v-model="height"
|
||||
@input="$handleInputLimit" />
|
||||
<span class="unit">m</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
<button class="confirm height-confirm" style="margin-left: 5px;" @click="heightConfirm"
|
||||
:disabled="heightMode == 2">应用</button>
|
||||
</div>
|
||||
<div class="table-body">
|
||||
<div class="tr" v-for="(item, i) in entityOptions.options.positions" :key="i">
|
||||
<div class="td">{{ i + 1 }}</div>
|
||||
<div class="td lng align-center" @dblclick="inputDblclick($event, i, 'lng')">
|
||||
<input class="input" @blur="inputBlurCallBack($event, i, 'lng', 8)" type="number"
|
||||
v-model="item.lng" min="-180" max="180" v-if="activeTd.index == i && activeTd.name == 'lng'"
|
||||
@input="$handleInputLimit" />
|
||||
<span style="pointer-events: none;" v-else>{{ (item.lng).toFixed(8) }}</span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="table spatial-info-table">
|
||||
<div class="table-head">
|
||||
<div class="tr">
|
||||
<div class="th"></div>
|
||||
<div class="th">经度(X)</div>
|
||||
<div class="th">纬度(Y)</div>
|
||||
<div class="th">高度(Z)</div>
|
||||
</div>
|
||||
<div class="td lat align-center" @dblclick="inputDblclick($event, i, 'lat')">
|
||||
<input class="input" @blur="inputBlurCallBack($event, i, 'lat', 8)" type="number"
|
||||
v-model="item.lat" min="-180" max="180" v-if="activeTd.index == i && activeTd.name == 'lat'"
|
||||
</div>
|
||||
<div class="table-body">
|
||||
<div class="tr" v-for="(item, i) in entityOptions.options.positions" :key="i">
|
||||
<div class="td">{{ i + 1 }}</div>
|
||||
<div class="td lng align-center" @dblclick="inputDblclick($event, i, 'lng')">
|
||||
<input class="input" @blur="inputBlurCallBack($event, i, 'lng', 8)" type="number"
|
||||
v-model="item.lng" min="-180" max="180" v-if="activeTd.index == i && activeTd.name == 'lng'"
|
||||
@input="$handleInputLimit" />
|
||||
<span style="pointer-events: none;" v-else>{{ (item.lng).toFixed(8) }}</span>
|
||||
</div>
|
||||
<div class="td lat align-center" @dblclick="inputDblclick($event, i, 'lat')">
|
||||
<input class="input" @blur="inputBlurCallBack($event, i, 'lat', 8)" type="number"
|
||||
v-model="item.lat" min="-180" max="180" v-if="activeTd.index == i && activeTd.name == 'lat'"
|
||||
@input="$handleInputLimit">
|
||||
<span style="pointer-events: none;" v-else>{{ (item.lat).toFixed(8) }}</span>
|
||||
</div>
|
||||
<div class="td alt align-center" @dblclick="inputDblclick($event, i, 'alt')"
|
||||
@input="$handleInputLimit">
|
||||
<span style="pointer-events: none;" v-else>{{ (item.lat).toFixed(8) }}</span>
|
||||
</div>
|
||||
<div class="td alt align-center" @dblclick="inputDblclick($event, i, 'alt')"
|
||||
@input="$handleInputLimit">
|
||||
<input class="input" @blur="inputBlurCallBack($event, i, 'alt', 2)" type="number"
|
||||
v-model="entityOptions.height" min="-9999999" max="999999999"
|
||||
v-if="activeTd.index == i && activeTd.name == 'alt'">
|
||||
<span style="pointer-events: none;" v-else>{{ (entityOptions.height).toFixed(2) }}</span>
|
||||
<input class="input" @blur="inputBlurCallBack($event, i, 'alt', 2)" type="number"
|
||||
v-model="entityOptions.height" min="-9999999" max="999999999"
|
||||
v-if="activeTd.index == i && activeTd.name == 'alt'">
|
||||
<span style="pointer-events: none;" v-else>{{ (entityOptions.height).toFixed(2) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -91,22 +93,24 @@
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="面风格" name="3">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<span class="label">面颜色</span>
|
||||
<div class="color" ref="colorRef"></div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="label">描边颜色</span>
|
||||
<div class="lineColor" ref="lineColorRef"></div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="label">描边宽度</span>
|
||||
<div class="input-number input-number-unit-2">
|
||||
<input class="input" type="number" title="" min="0" max="99" v-model="entityOptions.lineWidth"
|
||||
@input="$handleInputLimit">
|
||||
<span class="unit">px</span>
|
||||
<span class="arrow"></span>
|
||||
<div class="div-item">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<span class="label">面颜色</span>
|
||||
<div class="color" ref="colorRef"></div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="label">描边颜色</span>
|
||||
<div class="lineColor" ref="lineColorRef"></div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="label">描边宽度</span>
|
||||
<div class="input-number input-number-unit-2">
|
||||
<input class="input" type="number" title="" min="0" max="99" v-model="entityOptions.lineWidth"
|
||||
@input="$handleInputLimit">
|
||||
<span class="unit">px</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -298,7 +302,9 @@ const inputBlurCallBack = (event, i, name, digit = 2) => {
|
||||
}
|
||||
}
|
||||
|
||||
const translate = () => {
|
||||
const translate = async () => {
|
||||
entityOptions.value.closeNodeEdit()
|
||||
await nextTick()
|
||||
that.openPositionEditing(() => {
|
||||
entityOptions.value.options.positions = structuredClone(that.options.positions)
|
||||
})
|
||||
@ -314,7 +320,7 @@ const closeCallback = () => {
|
||||
|
||||
const nodeEdit = () => {
|
||||
that.nodeEdit((e, positions, areaByMeter) => {
|
||||
if(positions) {
|
||||
if (positions) {
|
||||
entityOptions.value.options.positions = structuredClone(positions)
|
||||
}
|
||||
})
|
||||
|
||||
@ -70,13 +70,13 @@
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<span class="label">线段缓冲</span>
|
||||
<input class="btn-switch" type="checkbox" v-model="entityOptions.extend" @change="lineExtendchange" />
|
||||
<input class="btn-switch" type="checkbox" v-model="extend" @change="lineExtendchange" />
|
||||
</div>
|
||||
<div class="col" style="flex: 0 0 33%">
|
||||
<span class="label">缓冲宽度</span>
|
||||
<div class="input-number input-number-unit-1" style="width: 80px">
|
||||
<input class="input" type="number" title="" min="0" data-min="0.01" max="999999"
|
||||
@input="$handleInputLimit" v-model="entityOptions.extendWidth" />
|
||||
@input="$handleInputLimit" v-model="extendWidth" @change="extendWidthchange" />
|
||||
<span class="unit">m</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
@ -337,6 +337,8 @@ const colorRef = ref(null)
|
||||
const extendColorRef = ref(null)
|
||||
const heightMode = ref(0)
|
||||
const wordsName = ref(0)
|
||||
const extend = ref(false)
|
||||
const extendWidth = ref(0)
|
||||
|
||||
let originalOptions: any
|
||||
let that: any
|
||||
@ -346,6 +348,7 @@ const open = async (id: any, type) => {
|
||||
sourceType.value = type
|
||||
originalOptions = structuredClone(that.options)
|
||||
entityOptions.value = that
|
||||
extendWidth.value = that.extendWidth
|
||||
heightMode.value = entityOptions.value.heightMode
|
||||
wordsName.value = Number(entityOptions.value.wordsName)
|
||||
length.value = entityOptions.value.lengthByMeter
|
||||
@ -358,6 +361,7 @@ const open = async (id: any, type) => {
|
||||
}
|
||||
}
|
||||
heightModeChange(heightMode.value)
|
||||
extend.value = that.extend
|
||||
baseDialog.value?.open()
|
||||
|
||||
await nextTick()
|
||||
@ -390,8 +394,13 @@ const open = async (id: any, type) => {
|
||||
} //点击清空按钮事件回调
|
||||
})
|
||||
}
|
||||
const extendWidthchange = (val) => {
|
||||
that.extendWidth = extendWidth.value
|
||||
}
|
||||
|
||||
const heightModeChange = (val) => {
|
||||
that.heightMode = heightMode.value
|
||||
extend.value = false
|
||||
// @ts-ignore
|
||||
if (heightMode.value === 0 || heightMode.value === '0' || heightMode.value === 1 || heightMode.value === '1') {
|
||||
entityOptions.value.extend = false
|
||||
@ -439,6 +448,7 @@ const lineExtendchange = (e) => {
|
||||
if (e.target.checked) {
|
||||
heightMode.value = 2
|
||||
}
|
||||
that.extend = extend.value
|
||||
}
|
||||
const nodeEdit = () => {
|
||||
entityOptions.value.positionEditing = false
|
||||
@ -454,7 +464,9 @@ const nodeEdit = () => {
|
||||
}
|
||||
})
|
||||
}
|
||||
const translate = () => {
|
||||
const translate = async () => {
|
||||
entityOptions.value.closeNodeEdit()
|
||||
await nextTick()
|
||||
that.openPositionEditing(() => {
|
||||
entityOptions.value.options.positions = structuredClone(that.options.positions)
|
||||
if (lengthUnit.value == 'km') {
|
||||
|
||||
@ -146,7 +146,7 @@
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="label">轨迹动画</span>
|
||||
<input class="btn-switch" type="checkbox" v-model="entityOptions.state">
|
||||
<input class="btn-switch" type="checkbox" v-model="entityOptions.state" @click="changeState">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@ -156,7 +156,7 @@
|
||||
</div>
|
||||
<div class="col" style="margin-right: 33px;">
|
||||
<span class="label">视角跟随</span>
|
||||
<input class="btn-switch" type="checkbox" v-model="entityOptions.viewFollow">
|
||||
<input class="btn-switch" type="checkbox" v-model="entityOptions.viewFollow" @click="changeViewFollow">
|
||||
</div>
|
||||
<div class="col" style="margin: 0px;">
|
||||
<span class="label">模型动画</span>
|
||||
@ -411,6 +411,13 @@ const changeFirstPersonView = (state) => {
|
||||
entityOptions.value.firstPersonView = state
|
||||
}
|
||||
|
||||
const changeState = () => {
|
||||
modelRotateState.value && (modelRotateState.value = that.modelRotate())
|
||||
}
|
||||
const changeViewFollow = () => {
|
||||
modelRotateState.value && (modelRotateState.value = that.modelRotate())
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
close
|
||||
|
||||
@ -373,6 +373,12 @@ export const useRightOperate = () => {
|
||||
entity.remove();
|
||||
(window as any).pressModelEntities.delete(entity.options.id)
|
||||
}
|
||||
else {
|
||||
if (window.earth.flyRoamId === item) {
|
||||
YJ.Global.FlyRoam.cease(window.earth)
|
||||
}
|
||||
eventBus.emit('closeFlyRoamDialogById', item)
|
||||
}
|
||||
}
|
||||
// let node = window.treeObj.getNodeByParam("id", item, null);
|
||||
eventBus.emit("destroyComponent", item);
|
||||
|
||||
@ -85,11 +85,11 @@ async function leftClick(options) {
|
||||
|| node.sourceType === "model" || node.sourceType === "military" || node.sourceType === "wallStereoscopic" || node.sourceType === "entityWall" || node.sourceType === "diffuseScan" || node.sourceType === "radarScan" || node.sourceType === "scanStereoscopic" || node.sourceType === "polyhedronObject")) {
|
||||
if (
|
||||
!options.richTextContent &&
|
||||
!info.hrefs.length &&
|
||||
!info.vr.length &&
|
||||
!info.rtmp.length &&
|
||||
!info.goods.length &&
|
||||
!info.camera.length
|
||||
(!info.hrefs || !info.hrefs.length) &&
|
||||
(!info.vr || !info.vr.length) &&
|
||||
(!info.rtmp || !info.rtmp.length) &&
|
||||
(!info.goods || !info.goods.length) &&
|
||||
(!info.camera || !info.camera.length)
|
||||
) {
|
||||
// $root_home.$message.info("该标注标绘无属性信息");
|
||||
ElMessage({
|
||||
@ -295,6 +295,7 @@ const goodsSelect = async (goods) => {
|
||||
if ('id' in allGoodsList[m]) {
|
||||
if (allGoodsList[m].id === goods[i].id) {
|
||||
flag = true
|
||||
goods[i].name = allGoodsList[m].name
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,6 +106,9 @@ export const useTree = () => {
|
||||
type: 'success'
|
||||
})
|
||||
let params = JSON.parse(treeNode.params)
|
||||
window.earth.flyRoamId = treeNode.id
|
||||
console.log('params.repeat', params.repeat)
|
||||
YJ.Global.FlyRoam.setRepeat(params.repeat)
|
||||
YJ.Global.FlyRoam.flyTo((window as any).earth, params.points);
|
||||
return;
|
||||
} else {
|
||||
@ -330,6 +333,7 @@ export const useTree = () => {
|
||||
})
|
||||
}
|
||||
} else {
|
||||
let params = JSON.parse(node.params)
|
||||
if (node.sourceType === 'tileset') {
|
||||
if (node.children && node.children.length > 0) {
|
||||
node.children.forEach((item) => {
|
||||
@ -337,7 +341,17 @@ export const useTree = () => {
|
||||
})
|
||||
}
|
||||
}
|
||||
let params = JSON.parse(node.params)
|
||||
else if (node.sourceType == 'roam') {
|
||||
YJ.Global.FlyRoam.setRepeat(node.isShow ? Infinity : 0)
|
||||
params.repeat = node.isShow ? 'Infinity' : 0
|
||||
let paramsData: any = {
|
||||
params: params,
|
||||
id: node.id,
|
||||
sourceName: node.sourceName,
|
||||
parentId: node.parentId,
|
||||
}
|
||||
TreeApi.updateDirectoryInfo(paramsData)
|
||||
}
|
||||
let entityObject
|
||||
if (node.sourceType == 'pressModel') {
|
||||
let id = node.id + '_' + params.modelId
|
||||
@ -359,15 +373,9 @@ export const useTree = () => {
|
||||
}
|
||||
if (entityObject) {
|
||||
entityObject.show = node.isShow;
|
||||
params.show = node.isShow
|
||||
let params2 = {
|
||||
"id": node.id,
|
||||
"params": params,
|
||||
"sourceName": node.sourceName,
|
||||
"isShow": node.isShow ? 1 : 0,
|
||||
}
|
||||
cusUpdateNode({id: node.id, sourceName: node.sourceName, params: JSON.stringify(params)})
|
||||
}
|
||||
params.show = node.isShow
|
||||
cusUpdateNode({id: node.id, sourceName: node.sourceName, params: JSON.stringify(params)})
|
||||
}
|
||||
}
|
||||
|
||||
@ -485,6 +493,7 @@ export const useTree = () => {
|
||||
const onClick = (event: MouseEvent, treeId: string, treeNode: any) => {
|
||||
console.log('selectNode', treeNode)
|
||||
|
||||
$changeComponentShow('.rightMenu', false)
|
||||
let isShift = event.shiftKey
|
||||
let isCtrl = event.ctrlKey
|
||||
if (!isCtrl || !isShift) {
|
||||
@ -549,16 +558,7 @@ export const useTree = () => {
|
||||
}
|
||||
|
||||
// 树的数据
|
||||
const zNodes = ref([
|
||||
{
|
||||
id: 1,
|
||||
parentId: 0,
|
||||
sourceName: '111',
|
||||
isShow: true,
|
||||
sourceType: '',
|
||||
params: ''
|
||||
}
|
||||
])
|
||||
const zNodes = ref([])
|
||||
|
||||
const getTime = () => {
|
||||
var now = new Date(),
|
||||
@ -692,6 +692,9 @@ export const useTree = () => {
|
||||
if ('show' in params) {
|
||||
params.show = zNodes.value[i].isShow ? true : false
|
||||
}
|
||||
else {
|
||||
params.show = zNodes.value[i].isShow ? true : false
|
||||
}
|
||||
if (!params.id) {
|
||||
params.id = zNodes.value[i].id
|
||||
}
|
||||
@ -706,7 +709,9 @@ export const useTree = () => {
|
||||
}
|
||||
)
|
||||
} else {
|
||||
initMapData(zNodes.value[i].sourceType, {...detail, ...params}, null)
|
||||
window.earth.readyPromise().then(()=>{
|
||||
initMapData(zNodes.value[i].sourceType, {...detail, ...params}, null)
|
||||
})
|
||||
}
|
||||
}
|
||||
layers.sort((obj1, obj2) => {
|
||||
|
||||
@ -262,6 +262,8 @@ import { get } from 'jquery'
|
||||
|
||||
const { initTree, rightMenuRef, initTreeCallBack } = useTree()
|
||||
|
||||
const eventBus: any = inject('bus')
|
||||
|
||||
const { t } = useI18n()
|
||||
const isShow = ref(false)
|
||||
const select = ref('poi')
|
||||
@ -570,6 +572,7 @@ const locationChange = () => {
|
||||
window.searchPlaceMap.set(id, entity)
|
||||
}
|
||||
onMounted(() => {
|
||||
eventBus?.emit("destroyComponent")
|
||||
initTree()
|
||||
// ipcRenderer.on('renderNode-reply', (event: any, data: any) => {
|
||||
// initTree()
|
||||
|
||||
Reference in New Issue
Block a user