Compare commits
15 Commits
d2645081f4
...
zyl
| Author | SHA1 | Date | |
|---|---|---|---|
| 3695600c57 | |||
| b31d824f39 | |||
| 35181a65bc | |||
| a6aa260b9a | |||
| e69e43b27a | |||
| a95f79de92 | |||
| 2d4b4feadc | |||
| cf113a0137 | |||
| 969427af3a | |||
| 9ddceba80e | |||
| 51003a93bb | |||
| 8a9560bb17 | |||
| ea0d86b36c | |||
| 91eb42b353 | |||
| 92ab2b9a9e |
@ -1,6 +1,6 @@
|
|||||||
server:
|
server:
|
||||||
host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
port: 8859
|
port: 8848
|
||||||
path: C:\Users\Administrator\AppData\Roaming\dzsp_shijingjun_offline_Y_save
|
path: C:\Users\Administrator\AppData\Roaming\dzsp_shijingjun_offline_Y_save
|
||||||
poi:
|
poi:
|
||||||
global:
|
global:
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@ -23,6 +23,7 @@
|
|||||||
height: 100vh;
|
height: 100vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
/* height: 100vh; background-color: rgba(255, 255, 255, 0.014); */
|
/* height: 100vh; background-color: rgba(255, 255, 255, 0.014); */
|
||||||
/*color: red;*/
|
/*color: red;*/
|
||||||
}
|
}
|
||||||
@ -302,7 +303,19 @@
|
|||||||
if (this.activeItem.type === '全景图') {
|
if (this.activeItem.type === '全景图') {
|
||||||
getIframe(this.activeItem.url, '')
|
getIframe(this.activeItem.url, '')
|
||||||
} else {
|
} 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)) {
|
// if (!Boolean(this.info.panorama.length)) {
|
||||||
// console.log('图片渲染', 1232132);
|
// console.log('图片渲染', 1232132);
|
||||||
@ -313,6 +326,25 @@
|
|||||||
}, 0)
|
}, 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() {
|
mounted() {
|
||||||
window.ssssssssssssss = this.tabsData
|
window.ssssssssssssss = this.tabsData
|
||||||
@ -416,29 +448,29 @@
|
|||||||
if (hasVr) {
|
if (hasVr) {
|
||||||
this.info.vr.forEach(item => {
|
this.info.vr.forEach(item => {
|
||||||
if (fs.existsSync(item.url)) {
|
if (fs.existsSync(item.url)) {
|
||||||
let url = ""
|
let url = ""
|
||||||
if (item.url.startsWith("http"))
|
if (item.url.startsWith("http"))
|
||||||
url = item.url
|
url = item.url
|
||||||
else {
|
else {
|
||||||
//说明是本地的json,在磁盘中存在的
|
//说明是本地的json,在磁盘中存在的
|
||||||
if (item.url.includes(":")) {
|
if (item.url.includes(":")) {
|
||||||
url = obj.host + "/fileInfo/previewLocal?fileAbsolutePath=" + encodeURIComponent(item.url)
|
url = obj.host + "/fileInfo/previewLocal?fileAbsolutePath=" + encodeURIComponent(item.url)
|
||||||
} else {
|
} else {
|
||||||
if (obj.host) {
|
if (obj.host) {
|
||||||
let o = new URL(object.url, obj.host)
|
let o = new URL(object.url, obj.host)
|
||||||
url = o.href
|
url = o.href
|
||||||
} else
|
} else
|
||||||
url = item.url
|
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
|
this.tabsData.unshift({ name: item.name, type: '全景图', url: item.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.activeItem = this.tabsData[this.activeIndex]
|
this.activeItem = this.tabsData[this.activeIndex]
|
||||||
this.renderImgView()
|
this.renderImgView()
|
||||||
|
|||||||
12
src/renderer/public/sdk/YJEarth.min.js
vendored
12
src/renderer/public/sdk/YJEarth.min.js
vendored
File diff suppressed because one or more lines are too long
@ -52,7 +52,6 @@
|
|||||||
*::after {
|
*::after {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-weight: normal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
|
|||||||
19
src/renderer/src/assets/basis/basis_transcoder.js
Normal file
19
src/renderer/src/assets/basis/basis_transcoder.js
Normal file
File diff suppressed because one or more lines are too long
BIN
src/renderer/src/assets/basis/basis_transcoder.wasm
Normal file
BIN
src/renderer/src/assets/basis/basis_transcoder.wasm
Normal file
Binary file not shown.
@ -441,6 +441,9 @@ img {
|
|||||||
|
|
||||||
.ztree .checkbox_false_full + a,.ztree .checkbox_false_full_focus + a {
|
.ztree .checkbox_false_full + a,.ztree .checkbox_false_full_focus + a {
|
||||||
color: #d7d7d7;
|
color: #d7d7d7;
|
||||||
|
.svg-icon {
|
||||||
|
fill: #d7d7d7 !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.ztree li a.curSelectedNode {
|
.ztree li a.curSelectedNode {
|
||||||
background-color: #ffffff00;
|
background-color: #ffffff00;
|
||||||
@ -450,6 +453,8 @@ img {
|
|||||||
|
|
||||||
.svg-icon {
|
.svg-icon {
|
||||||
color: rgba(var(--color-base1), 1) !important;
|
color: rgba(var(--color-base1), 1) !important;
|
||||||
|
fill: rgba(var(--color-base1), 1) !important;
|
||||||
|
stroke: rgba(var(--color-base1), 1) !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="boxBody">
|
<div class="boxBody">
|
||||||
<el-form :model="form" :rules="rules" ref="ruleForm" label-width="80px"
|
<el-form :model="form" :rules="rules" ref="ruleForm" label-width="80px"
|
||||||
@keyup.enter.native="submitForm(ruleForm)" @submit.native.prevent>
|
@keyup.enter.native="submitForm(ruleForm)" @submit.native.prevent>
|
||||||
<el-form-item label="名称:" prop="sourceName">
|
<el-form-item label="名称:" prop="sourceName">
|
||||||
<!-- @input="removeSpaces" -->
|
<!-- @input="removeSpaces" -->
|
||||||
<el-input v-model.trim="form.sourceName" placeholder="节点名称"></el-input>
|
<el-input v-model.trim="form.sourceName" placeholder="节点名称"></el-input>
|
||||||
@ -29,12 +29,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { $changeComponentPop } from '@/utils/communication'
|
import {$changeComponentPop} from '@/utils/communication'
|
||||||
import { throttle } from '@/utils/index'
|
import {throttle} from '@/utils/index'
|
||||||
import { ElMessage, FormInstance } from 'element-plus'
|
import {ElMessage, FormInstance} from 'element-plus'
|
||||||
import { TreeApi } from '@/api/tree'
|
import {TreeApi} from '@/api/tree'
|
||||||
import { useTreeNode } from '@/views/components/tree/hooks/treeNode'
|
import {useTreeNode} from '@/views/components/tree/hooks/treeNode'
|
||||||
const { getKeyOfSelectedNode, getSelectedNode, cusUpdateNode, getSameLevel, getSelectedNodes } = useTreeNode()
|
|
||||||
|
const {getKeyOfSelectedNode, getSelectedNode, cusUpdateNode, getSameLevel, getSelectedNodes} = useTreeNode()
|
||||||
const title = ref('编辑节点')
|
const title = ref('编辑节点')
|
||||||
const sourceId = ref('')
|
const sourceId = ref('')
|
||||||
let form: any = reactive({
|
let form: any = reactive({
|
||||||
@ -42,7 +43,7 @@ let form: any = reactive({
|
|||||||
})
|
})
|
||||||
const ruleForm = ref()
|
const ruleForm = ref()
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
sourceName: [{ required: true, message: '请输入名称', trigger: 'blur' }]
|
sourceName: [{required: true, message: '请输入名称', trigger: 'blur'}]
|
||||||
})
|
})
|
||||||
const removeSpaces = (value: string) => {
|
const removeSpaces = (value: string) => {
|
||||||
form.sourceName = value.replace(/\s/g, '')
|
form.sourceName = value.replace(/\s/g, '')
|
||||||
@ -70,7 +71,7 @@ const add = throttle(async () => {
|
|||||||
id: sourceId.value,
|
id: sourceId.value,
|
||||||
sourceName: form.sourceName
|
sourceName: form.sourceName
|
||||||
})
|
})
|
||||||
cusUpdateNode({ id: sourceId.value, sourceName: form.sourceName, params: undefined })
|
cusUpdateNode({id: sourceId.value, sourceName: form.sourceName, params: undefined})
|
||||||
close()
|
close()
|
||||||
// console.log(res)
|
// console.log(res)
|
||||||
}, 3000)
|
}, 3000)
|
||||||
@ -117,6 +118,7 @@ defineExpose({
|
|||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.editdirectoryBox {
|
.editdirectoryBox {
|
||||||
|
|
||||||
user-select: none;
|
user-select: none;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 22 KiB |
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 22 KiB |
@ -106,6 +106,18 @@ const initTreeCallBack = () => {
|
|||||||
TsApi.queryTsSource(formData).then(async res => {
|
TsApi.queryTsSource(formData).then(async res => {
|
||||||
console.log('queryTsSource', res)
|
console.log('queryTsSource', res)
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
|
res.data.sort((a: any, b: any) => {
|
||||||
|
if ((a.treeIndex || a.treeIndex == 0) && (b.treeIndex || b.treeIndex == 0)) {
|
||||||
|
return a.treeIndex - b.treeIndex
|
||||||
|
}
|
||||||
|
if (a.treeIndex) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (b.treeIndex) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
for (let i = res.data.length - 1; i >= 0; i--) {
|
for (let i = res.data.length - 1; i >= 0; i--) {
|
||||||
res.data[i].svg = await cusNodeIcon(res.data[i]);
|
res.data[i].svg = await cusNodeIcon(res.data[i]);
|
||||||
|
|
||||||
@ -416,12 +428,12 @@ let rightClick = (event: MouseEvent, treeId: string, treeNode: any) => {
|
|||||||
let menus = showRightMenuTs(event, treeObj.value, getSelectedNodes(treeObj.value), nodeType)
|
let menus = showRightMenuTs(event, treeObj.value, getSelectedNodes(treeObj.value), nodeType)
|
||||||
// console.log("menus", menus)
|
// console.log("menus", menus)
|
||||||
// canCheckType.includes(treeNode.sourceType) 包含的类型才有视角
|
// canCheckType.includes(treeNode.sourceType) 包含的类型才有视角
|
||||||
if (treeNode && treeNode.sourceType != 'directory') {
|
if (treeNode && treeNode.sourceType != 'directory' && selectNodes.length == 1) {
|
||||||
let customView
|
let customView
|
||||||
let entity = window['_entityMap'].get(treeNode.id)
|
let entity = window['_entityMap'].get(treeNode.id)
|
||||||
customView = Boolean(entity.customView && entity.customView.orientation)
|
customView = Boolean(entity.customView && entity.customView.orientation)
|
||||||
|
// customView ? 'resetView' : 'setView'
|
||||||
menus = [...menus, customView ? 'resetView' : 'setView']
|
menus = [...menus, 'resetView', 'setView']
|
||||||
}
|
}
|
||||||
// console.log('menus', menus)
|
// console.log('menus', menus)
|
||||||
if (menus.length == 0) {
|
if (menus.length == 0) {
|
||||||
|
|||||||
@ -25,7 +25,11 @@ const eventBus: any = inject('bus')
|
|||||||
const props = defineProps(['eventList', 'hr', 'originHrOffset', 'scrollLeft'])
|
const props = defineProps(['eventList', 'hr', 'originHrOffset', 'scrollLeft'])
|
||||||
let clickEventBar = (event) => {
|
let clickEventBar = (event) => {
|
||||||
console.log("点击事件块", selectedEventId.value, event)
|
console.log("点击事件块", selectedEventId.value, event)
|
||||||
let entity = window['_entityMap'].get(event.sourceId)
|
let key = event.sourceId
|
||||||
|
/* if (event.callback == 'move')
|
||||||
|
key = event.id + "move" + event.sourceId*/
|
||||||
|
// console.log(key)
|
||||||
|
let entity = window['_entityMap'].get(key)
|
||||||
entity && entity.flyTo()
|
entity && entity.flyTo()
|
||||||
selectedEventId.value = (selectedEventId.value == null || selectedEventId.value != event.id) ? event.id : null
|
selectedEventId.value = (selectedEventId.value == null || selectedEventId.value != event.id) ? event.id : null
|
||||||
eventBus.emit('click-event-show-plane', selectedEventId.value ? event : null)
|
eventBus.emit('click-event-show-plane', selectedEventId.value ? event : null)
|
||||||
|
|||||||
@ -110,13 +110,27 @@ const updateEvent = () => {
|
|||||||
let durationS = eventObj.value.duration_time
|
let durationS = eventObj.value.duration_time
|
||||||
// console.log("eventObj.value", eventObj.value)
|
// console.log("eventObj.value", eventObj.value)
|
||||||
// console.log("eventObj.value", durationS)
|
// console.log("eventObj.value", durationS)
|
||||||
|
// 数据是否合法有效
|
||||||
|
let isRight = true
|
||||||
|
let errorFields:any = []//数据错误的字段
|
||||||
if (!durationS)
|
if (!durationS)
|
||||||
durationS = (eventObj.value.endTime - eventObj.value.startTime) / 1000
|
durationS = (eventObj.value.endTime - eventObj.value.startTime) / 1000
|
||||||
switch (eventObj.value.callback) {
|
switch (eventObj.value.callback) {
|
||||||
case "flicker":
|
case "flicker":
|
||||||
detail.value.times = Number((durationS / detail.value.numbers).toFixed(2))
|
if (Number(obj.numbers) == 0 || !Number(obj.numbers)) {
|
||||||
|
isRight = false
|
||||||
|
errorFields.push("闪烁次数")
|
||||||
|
}
|
||||||
|
if (isRight) {
|
||||||
|
detail.value.times = Number((durationS / detail.value.numbers).toFixed(2))
|
||||||
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
if (!isRight) {
|
||||||
|
let eventType = eventObj.value.name.split("-")[0] + "事件"
|
||||||
|
ElMessage({message: eventType + errorFields.join("、") + "数据不合法", type: "warning"})
|
||||||
|
return
|
||||||
|
}
|
||||||
obj.detail = JSON.stringify(detail.value)
|
obj.detail = JSON.stringify(detail.value)
|
||||||
console.log(obj)
|
console.log(obj)
|
||||||
delete obj.createdAt
|
delete obj.createdAt
|
||||||
@ -127,12 +141,13 @@ const updateEvent = () => {
|
|||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
eventBus.emit('update-event', obj)
|
eventBus.emit('update-event', obj)
|
||||||
ElMessage({type: "success", message: "操作成功"})
|
ElMessage({type: "success", message: "操作成功"})
|
||||||
cancel()
|
cancel(false)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const cancel = () => {
|
const cancel = (cancel = true) => {
|
||||||
|
if (cancel)
|
||||||
|
revert()
|
||||||
eventObj.value = null
|
eventObj.value = null
|
||||||
detail.value = {}
|
detail.value = {}
|
||||||
eventBus.emit('click-cancel-hide-plane',)
|
eventBus.emit('click-cancel-hide-plane',)
|
||||||
@ -140,6 +155,13 @@ const cancel = () => {
|
|||||||
eventBus.on('delete-event', () => {
|
eventBus.on('delete-event', () => {
|
||||||
cancel()
|
cancel()
|
||||||
})
|
})
|
||||||
|
const revert = () => {
|
||||||
|
let entity = window['_entityMap'].get(eventObj.value.id + "move" + eventObj.value.sourceId)
|
||||||
|
console.log(eventObj.value)
|
||||||
|
let detail = JSON.parse(eventObj.value.detail)
|
||||||
|
entity.lineShow = detail.line.show
|
||||||
|
entity.smooth = detail.line.smooth
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@ -32,7 +32,6 @@
|
|||||||
import {$changeComponentPop} from '@/utils/communication'
|
import {$changeComponentPop} from '@/utils/communication'
|
||||||
import {throttle} from '@/utils/index'
|
import {throttle} from '@/utils/index'
|
||||||
import {ElMessage, FormInstance} from 'element-plus'
|
import {ElMessage, FormInstance} from 'element-plus'
|
||||||
import {TreeApi} from '@/api/tree'
|
|
||||||
import {useTreeNode} from '@/views/components/tree/hooks/treeNode'
|
import {useTreeNode} from '@/views/components/tree/hooks/treeNode'
|
||||||
import {addMapSource} from "../entity";
|
import {addMapSource} from "../entity";
|
||||||
import {useI18n} from 'vue-i18n'
|
import {useI18n} from 'vue-i18n'
|
||||||
@ -51,7 +50,7 @@ const removeSpaces = (value: string) => {
|
|||||||
form.sourceName = value.replace(/\s/g, '')
|
form.sourceName = value.replace(/\s/g, '')
|
||||||
}
|
}
|
||||||
const close = () => {
|
const close = () => {
|
||||||
$changeComponentPop('.adddirectory', false)
|
$changeComponentPop('.tsdirectory', false)
|
||||||
}
|
}
|
||||||
const submitForm = async (formEl: FormInstance | undefined) => {
|
const submitForm = async (formEl: FormInstance | undefined) => {
|
||||||
if (!formEl) return
|
if (!formEl) return
|
||||||
@ -75,66 +74,8 @@ const add = throttle(async () => {
|
|||||||
cancel()
|
cancel()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
/* const res: any = await TreeApi.addDirectory({
|
|
||||||
id: new YJ.Tools().randomString(),
|
|
||||||
sourceName: form.sourceName,
|
|
||||||
parentId: parentId || undefined
|
|
||||||
})
|
|
||||||
console.log(res)
|
|
||||||
if (res.code == 0 || res.code == 200) {
|
|
||||||
const node = {
|
|
||||||
...res.data
|
|
||||||
}
|
|
||||||
let addNode = await cusAddNodes(window.treeObj, getSelectedNode(window.treeObj), [node], true) //添加节点
|
|
||||||
//获取该节点下的同级节点
|
|
||||||
const someNode: any = getSameLevel(window.treeObj, addNode[0])
|
|
||||||
console.log('someNode', someNode)
|
|
||||||
const newNode = someNode.map((item: any) => {
|
|
||||||
let index = item.getIndex()
|
|
||||||
item.treeIndex = index + 1
|
|
||||||
return {
|
|
||||||
...item,
|
|
||||||
treeIndex: item.getIndex()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
ElMessage({
|
|
||||||
message: '添加成功',
|
|
||||||
type: 'success'
|
|
||||||
})
|
|
||||||
cancel()
|
|
||||||
} else {
|
|
||||||
ElMessage({
|
|
||||||
message: '添加失败',
|
|
||||||
type: 'error'
|
|
||||||
})
|
|
||||||
}*/
|
|
||||||
// console.log(res)
|
|
||||||
}, 3000)
|
|
||||||
////上传或修改树的层级
|
|
||||||
// const updateTree = async (newNode: any) => {
|
|
||||||
// const list = newNode.map((item: any) => {
|
|
||||||
// return {
|
|
||||||
// id: item.id,
|
|
||||||
// treeIndex: item.treeIndex,
|
|
||||||
// parentId: item.parentId
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// console.log(list)
|
|
||||||
// const res = await TreeApi.updateTree({ list })
|
|
||||||
// if (res.code == 0) {
|
|
||||||
// ElMessage({
|
|
||||||
// message: '添加成功',
|
|
||||||
// type: 'success'
|
|
||||||
// })
|
|
||||||
|
|
||||||
// cancel()
|
}, 3000)
|
||||||
// } else {
|
|
||||||
// ElMessage({
|
|
||||||
// message: '添加失败',
|
|
||||||
// type: 'error'
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
const cancel = () => {
|
const cancel = () => {
|
||||||
$changeComponentPop('.tsdirectory', false)
|
$changeComponentPop('.tsdirectory', false)
|
||||||
|
|||||||
@ -191,6 +191,11 @@ let formatTime = (timeStamp) => {
|
|||||||
return props.TSOBJ.parseTime(timeStamp)
|
return props.TSOBJ.parseTime(timeStamp)
|
||||||
}
|
}
|
||||||
let play = () => {
|
let play = () => {
|
||||||
|
if (props.TSOBJ._Store._currentTimestamp >= props.TSOBJ._Store.getTotalTime()) {
|
||||||
|
ElMessage.warning("到达推演终点")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
props.TSOBJ._Clock._status = "play"
|
props.TSOBJ._Clock._status = "play"
|
||||||
console.log(props.TSOBJ._Clock._status)
|
console.log(props.TSOBJ._Clock._status)
|
||||||
// return
|
// return
|
||||||
|
|||||||
@ -171,6 +171,8 @@
|
|||||||
<deduction :TSOBJ="tsOBJ"></deduction>
|
<deduction :TSOBJ="tsOBJ"></deduction>
|
||||||
<newEvent></newEvent>
|
<newEvent></newEvent>
|
||||||
<addDirectory class="adddirectoryBox absolute zIndex999"></addDirectory>
|
<addDirectory class="adddirectoryBox absolute zIndex999"></addDirectory>
|
||||||
|
<directoryTs ref="editDirectoryTsBox" class="editDirectoryTsBox absolute zIndex999"></directoryTs>
|
||||||
|
|
||||||
<mouseRight></mouseRight>
|
<mouseRight></mouseRight>
|
||||||
<component :is="currentComponent" ref="dynamicComponentRef"/>
|
<component :is="currentComponent" ref="dynamicComponentRef"/>
|
||||||
<!-- 方案描述编辑框 -->
|
<!-- 方案描述编辑框 -->
|
||||||
@ -319,11 +321,13 @@ import {ElMessage} from "element-plus";
|
|||||||
import {addMapSource} from "../../common/addMapSource";
|
import {addMapSource} from "../../common/addMapSource";
|
||||||
import {$changeComponentShow} from "../../utils/communication";
|
import {$changeComponentShow} from "../../utils/communication";
|
||||||
import {useI18n} from "vue-i18n";
|
import {useI18n} from "vue-i18n";
|
||||||
|
import directoryTs from "./edit/directoryTs.vue";
|
||||||
import billboardObject from "./edit/billboardObjectTs.vue";
|
import billboardObject from "./edit/billboardObjectTs.vue";
|
||||||
import polylineObject from "./edit/polylineObjectTs.vue";
|
import polylineObject from "./edit/polylineObjectTs.vue";
|
||||||
import polygonObject from "./edit/polygonObjectTs.vue";
|
import polygonObject from "./edit/polygonObjectTs.vue";
|
||||||
|
|
||||||
const {t} = useI18n()
|
const {t} = useI18n()
|
||||||
|
let editDirectoryTsBox = ref()
|
||||||
const planInfo = ref({})
|
const planInfo = ref({})
|
||||||
const isShowPup = ref(false)
|
const isShowPup = ref(false)
|
||||||
const showStandText = ref(false)
|
const showStandText = ref(false)
|
||||||
@ -403,6 +407,10 @@ let submit = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
let submitStandText = (flag) => {
|
let submitStandText = (flag) => {
|
||||||
|
if (standText.value.trim() == '' && flag) {
|
||||||
|
ElMessage.warning("内容不能为空")
|
||||||
|
return
|
||||||
|
}
|
||||||
showStandText.value = false
|
showStandText.value = false
|
||||||
/* let res = {
|
/* let res = {
|
||||||
currentDrawItem: currentDrawItem.value,
|
currentDrawItem: currentDrawItem.value,
|
||||||
@ -565,6 +573,10 @@ eventBus.on('openDialog', async (sourceType: any, id: any) => {
|
|||||||
dynamicComponentRef.value.close()
|
dynamicComponentRef.value.close()
|
||||||
}
|
}
|
||||||
switch (sourceType) {
|
switch (sourceType) {
|
||||||
|
case 'directory':
|
||||||
|
console.log(editDirectoryTsBox.value)
|
||||||
|
editDirectoryTsBox.value.open()
|
||||||
|
break
|
||||||
case 'point':
|
case 'point':
|
||||||
currentComponent.value = billboardObject
|
currentComponent.value = billboardObject
|
||||||
await nextTick()
|
await nextTick()
|
||||||
@ -744,7 +756,7 @@ eventBus.on('destroyComponent', (id) => {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.adddirectoryBox {
|
.adddirectoryBox, .editDirectoryTsBox {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
228
src/renderer/src/views/TS/edit/directoryTs.vue
Normal file
228
src/renderer/src/views/TS/edit/directoryTs.vue
Normal file
@ -0,0 +1,228 @@
|
|||||||
|
<template>
|
||||||
|
<div class="directoryTs">
|
||||||
|
<div class="box">
|
||||||
|
<div class="boxHeader nav">
|
||||||
|
<!-- <span></span> -->
|
||||||
|
<span class="label">{{ title }}</span>
|
||||||
|
<div class="close-box" @click="close">
|
||||||
|
<span class="close"></span>
|
||||||
|
<i>x</i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="boxBody">
|
||||||
|
<el-form :model="form" :rules="rules" ref="ruleForm" label-width="80px"
|
||||||
|
@keyup.enter.native="submitForm(ruleForm)" @submit.native.prevent>
|
||||||
|
<el-form-item label="名称:" prop="sourceName">
|
||||||
|
<!-- @input="removeSpaces" -->
|
||||||
|
<el-input v-model.trim="form.sourceName" placeholder="节点名称"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<div class="btnOption">
|
||||||
|
<el-button type="primary" @click="submitForm(ruleForm)">确定</el-button>
|
||||||
|
<el-button @click="close">取消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import {inject, ref} from "vue";
|
||||||
|
import {$changeComponentPop} from "../../../utils/communication";
|
||||||
|
import {FormInstance} from "element-plus";
|
||||||
|
import {throttle} from '@/utils/index'
|
||||||
|
import {useTreeNode} from "../../components/tree/hooks/treeNode";
|
||||||
|
import {TsApi} from "../../../api/ts";
|
||||||
|
|
||||||
|
const {getSelectedNodes, cusSelectNode, getSameLevel, cusNodeIcon, nodeType, cusUpdateNode} = useTreeNode()
|
||||||
|
const title = ref('编辑节点')
|
||||||
|
const eventBus: any = inject('bus')
|
||||||
|
const baseDialog: any = ref(null)
|
||||||
|
const sourceId = ref('')
|
||||||
|
let form: any = reactive({
|
||||||
|
sourceName: ''
|
||||||
|
})
|
||||||
|
const ruleForm = ref()
|
||||||
|
const rules = reactive({
|
||||||
|
sourceName: [{required: true, message: '请输入名称', trigger: 'blur'}]
|
||||||
|
})
|
||||||
|
const close = () => {
|
||||||
|
$changeComponentPop('.editDirectoryTsBox', false)
|
||||||
|
setTimeout(() => {
|
||||||
|
sourceId.value = ''
|
||||||
|
form.sourceName = ''
|
||||||
|
ruleForm.value?.resetFields()
|
||||||
|
}, 200);
|
||||||
|
}
|
||||||
|
const submitForm = async (formEl: FormInstance | undefined) => {
|
||||||
|
if (!formEl) return
|
||||||
|
await formEl.validate((valid, fields) => {
|
||||||
|
if (valid) {
|
||||||
|
add()
|
||||||
|
} else {
|
||||||
|
console.log('error submit!', fields)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const add = throttle(async () => {
|
||||||
|
const res: any = await TsApi.updateTsSource({
|
||||||
|
id: sourceId.value,
|
||||||
|
sourceName: form.sourceName
|
||||||
|
})
|
||||||
|
cusUpdateNode({id: sourceId.value, sourceName: form.sourceName, params: undefined})
|
||||||
|
close()
|
||||||
|
console.log(res, form.sourceName)
|
||||||
|
}, 3000)
|
||||||
|
const open = () => {
|
||||||
|
console.log("文件夹编辑框")
|
||||||
|
let selectNodes = getSelectedNodes(window.treeObj);
|
||||||
|
if (selectNodes && selectNodes[selectNodes.length - 1]) {
|
||||||
|
sourceId.value = selectNodes[selectNodes.length - 1].id
|
||||||
|
form.sourceName = selectNodes[selectNodes.length - 1].sourceName
|
||||||
|
$changeComponentPop('.editDirectoryTsBox', true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const closeCallback = () => {
|
||||||
|
/* entityOptions.value.originalOptions = structuredClone(originalOptions)
|
||||||
|
that.positionEditing = false
|
||||||
|
that.reset()*/
|
||||||
|
eventBus?.emit('destroyComponent')
|
||||||
|
}
|
||||||
|
defineExpose({
|
||||||
|
open,
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.directoryTs {
|
||||||
|
|
||||||
|
user-select: none;
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
|
||||||
|
.box {
|
||||||
|
width: 20vw;
|
||||||
|
height: 10vw;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
top: 45%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
color: var(--color-sdk-auxiliary-public);
|
||||||
|
font-size: 14px;
|
||||||
|
// z-index: 999999;
|
||||||
|
background: linear-gradient(0deg, var(--color-sdk-bg-gradual)), rgba(0, 0, 0, 0.6);
|
||||||
|
border: 1.5px solid;
|
||||||
|
backdrop-filter: blur(2px);
|
||||||
|
border-image: linear-gradient(to bottom, var(--color-sdk-gradual)) 1;
|
||||||
|
text-align: left;
|
||||||
|
font-family: 'sy-boldface';
|
||||||
|
|
||||||
|
.boxHeader {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: 18px;
|
||||||
|
line-height: 46px;
|
||||||
|
padding: 5px 16px 5px 16px;
|
||||||
|
height: 46px;
|
||||||
|
|
||||||
|
.label {
|
||||||
|
font-family: 'Ali-mother-counts-bold';
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 400;
|
||||||
|
color: rgba(255, 255, 255, 1);
|
||||||
|
text-align: left;
|
||||||
|
text-shadow: 0px 0px 9px rgb(20 118 255);
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-box {
|
||||||
|
position: absolute;
|
||||||
|
top: -1px;
|
||||||
|
right: 0;
|
||||||
|
height: 30px;
|
||||||
|
cursor: pointer;
|
||||||
|
width: 30px;
|
||||||
|
border-radius: 0 0 0 90%;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.close {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: rgba(var(--color-base1), 1);
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
i {
|
||||||
|
font-style: normal;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 900;
|
||||||
|
position: absolute;
|
||||||
|
top: -13px;
|
||||||
|
left: 11px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.boxBody {
|
||||||
|
flex: auto;
|
||||||
|
flex-direction: column;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 20px;
|
||||||
|
|
||||||
|
.el-form--label-top .el-form-item__label {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-form-item__label) {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-input__wrapper {
|
||||||
|
background-color: rgba(0, 0, 0, 0.5);
|
||||||
|
border: 0.2px solid rgba(var(--color-base1), 0.5);
|
||||||
|
box-shadow: 0 0 0 0.2px rgba(var(--color-base1), 0.5) inset !important;
|
||||||
|
/* 新增此行 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-input__inner {
|
||||||
|
background-color: transparent;
|
||||||
|
color: #fff;
|
||||||
|
// border-color: rgba(var(--color-base1), 0.5) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btnOption {
|
||||||
|
margin-top: 5px;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-button {
|
||||||
|
background: rgba(var(--color-base1), 0.2);
|
||||||
|
border-color: rgba(var(--color-base1), 0.5) !important;
|
||||||
|
color: #ffffff;
|
||||||
|
padding: 8px 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-button:hover {
|
||||||
|
border-color: rgba(var(--color-base1), 1) !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -217,13 +217,23 @@ const lists = ref([])
|
|||||||
const elementList = ref([])
|
const elementList = ref([])
|
||||||
let input2 = ref('')
|
let input2 = ref('')
|
||||||
watch(input2, (val) => {
|
watch(input2, (val) => {
|
||||||
|
console.log("activIndex", activIndex.value)
|
||||||
console.log("input2", val)
|
console.log("input2", val)
|
||||||
console.log("lists", lists)
|
console.log("lists", lists)
|
||||||
console.log("lists", lists.value.filter(item => item.name.includes(val)))
|
console.log("lists", lists.value.filter(item => item.name.includes(val)))
|
||||||
if (val == '') {
|
|
||||||
handleTabClick(tabs[activIndex.value], activIndex.value)
|
if (dataType.value == 'tree') {
|
||||||
|
if (activIndex.value == 0) {
|
||||||
|
getModelTypeList(input2.value)
|
||||||
|
} else if (activIndex.value == 1) {
|
||||||
|
getGraphTypeList(input2.value)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
lists.value = lists.value.filter(item => item.name.includes(val))
|
if (val == '') {
|
||||||
|
handleTabClick(tabs[activIndex.value], activIndex.value)
|
||||||
|
} else {
|
||||||
|
lists.value = lists.value.filter(item => item.name.includes(val))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
treeRef.value && treeRef.value!.filter(val)
|
treeRef.value && treeRef.value!.filter(val)
|
||||||
})
|
})
|
||||||
@ -240,6 +250,7 @@ const filterNode = (value: string, data: Tree) => {
|
|||||||
const handleTabClick = (item, index) => {
|
const handleTabClick = (item, index) => {
|
||||||
activIndex.value = index
|
activIndex.value = index
|
||||||
currentTypeId.value = ""
|
currentTypeId.value = ""
|
||||||
|
input2.value = ""
|
||||||
elementList.value = []
|
elementList.value = []
|
||||||
|
|
||||||
console.log(item)
|
console.log(item)
|
||||||
@ -290,14 +301,21 @@ const getModelListByType = (id) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 获取模型类型列表
|
// 获取模型类型列表
|
||||||
let getModelTypeList = async () => {
|
let getModelTypeList = async (modelName = null) => {
|
||||||
let res = await ModelApi.modelTypeList()
|
let Obj = {modelName}
|
||||||
|
if (modelName == null)
|
||||||
|
delete Obj.modelName
|
||||||
|
let res = await ModelApi.modelTypeList(Obj)
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
modelTypes.value = res.data
|
modelTypes.value = res.data
|
||||||
|
treeData.value = modelTypes.value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let getGraphTypeList = async () => {
|
let getGraphTypeList = async (militaryName = null) => {
|
||||||
let res = await GraphApi.modelTypeList()
|
let Obj = {militaryName}
|
||||||
|
if (militaryName == null)
|
||||||
|
delete Obj.militaryName
|
||||||
|
let res = await GraphApi.modelTypeList(Obj)
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
graphTypes.value = res.data
|
graphTypes.value = res.data
|
||||||
}
|
}
|
||||||
@ -339,6 +357,13 @@ let addMarker = (item, needSendEvent = true) => {
|
|||||||
window.draw.start((a, position) => {
|
window.draw.start((a, position) => {
|
||||||
console.log(position)
|
console.log(position)
|
||||||
if (position != undefined) {
|
if (position != undefined) {
|
||||||
|
if (position.length == 0 && item.type == "standText") {
|
||||||
|
item.source_name = ""
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (position.length < 2 && item.type == "waterL") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
let obj = {id, name: item.source_name, position}
|
let obj = {id, name: item.source_name, position}
|
||||||
switch (item.type) {
|
switch (item.type) {
|
||||||
case 'model':
|
case 'model':
|
||||||
@ -385,10 +410,8 @@ let addMarker = (item, needSendEvent = true) => {
|
|||||||
if (item.type == "standText") {
|
if (item.type == "standText") {
|
||||||
item.source_name = ""
|
item.source_name = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -219,8 +219,12 @@ const handleNodeClick = (data: Tree, node, TreeNode, event) => {
|
|||||||
form.name = data.name + '-' + zNode.value.sourceName
|
form.name = data.name + '-' + zNode.value.sourceName
|
||||||
}
|
}
|
||||||
const drawLine = () => {
|
const drawLine = () => {
|
||||||
|
$(".newEvent")[0].style.display = "none"
|
||||||
let draw = new YJ.Draw.DrawPolyline(window['earth_ts'])
|
let draw = new YJ.Draw.DrawPolyline(window['earth_ts'])
|
||||||
draw.start((error, p) => {
|
draw.start((error, p) => {
|
||||||
|
if (p != undefined) {
|
||||||
|
$(".newEvent")[0].style.display = "block"
|
||||||
|
}
|
||||||
positions.value = p
|
positions.value = p
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -344,6 +348,7 @@ const reset = (changeEventType = false) => {
|
|||||||
numbers.value = 0
|
numbers.value = 0
|
||||||
times.value = 1
|
times.value = 1
|
||||||
form.name = '闪烁-'
|
form.name = '闪烁-'
|
||||||
|
positions.value = []
|
||||||
// datetime: '',
|
// datetime: '',
|
||||||
|
|
||||||
form['datetime'] = new Date(window['tsObj']._Store._currentTimestamp)
|
form['datetime'] = new Date(window['tsObj']._Store._currentTimestamp)
|
||||||
|
|||||||
@ -37,7 +37,8 @@ export class Clock {
|
|||||||
nowTime = now
|
nowTime = now
|
||||||
// 设置时间指示器位置
|
// 设置时间指示器位置
|
||||||
store.setCursorLeft(store._currentTimestamp)
|
store.setCursorLeft(store._currentTimestamp)
|
||||||
if (store._currentTimestamp >= store.getTotalTime()) {
|
if (store._currentTimestamp > store.getTotalTime()) {
|
||||||
|
eventCallback()
|
||||||
this.stopAnimation()
|
this.stopAnimation()
|
||||||
this._status = "stop"
|
this._status = "stop"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,6 +62,7 @@ export class TS extends Tools {
|
|||||||
const value = l.num
|
const value = l.num
|
||||||
// 第几个大格,小标-=1
|
// 第几个大格,小标-=1
|
||||||
this.setWheel(value)
|
this.setWheel(value)
|
||||||
|
this._Store.setCursorLeft(this._Store._currentTimestamp)
|
||||||
break;
|
break;
|
||||||
case "scroll-chart":
|
case "scroll-chart":
|
||||||
this._Store._scales.scrollTop = obj.top
|
this._Store._scales.scrollTop = obj.top
|
||||||
|
|||||||
@ -502,6 +502,7 @@ const addModelDB = (path) => {
|
|||||||
if (res.code == 0 || res.code == 200) {
|
if (res.code == 0 || res.code == 200) {
|
||||||
ElMessage.success('导入成功')
|
ElMessage.success('导入成功')
|
||||||
modelList.value = []
|
modelList.value = []
|
||||||
|
currModelList.value = []
|
||||||
getModelList()
|
getModelList()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -668,7 +669,9 @@ const toggleExpand = (row: any) => {
|
|||||||
// loadModelsByType(row.id)
|
// loadModelsByType(row.id)
|
||||||
contextMenu.visible && (contextMenu.visible = false)
|
contextMenu.visible && (contextMenu.visible = false)
|
||||||
}
|
}
|
||||||
|
let clickTypeId = null //存储点击数据,用来删除时更新右侧列表
|
||||||
const getModelListByType = (id) => {
|
const getModelListByType = (id) => {
|
||||||
|
clickTypeId = id
|
||||||
let formData = new FormData()
|
let formData = new FormData()
|
||||||
formData.append('militaryTypeId', id)
|
formData.append('militaryTypeId', id)
|
||||||
formData.append('name', photoName.value)
|
formData.append('name', photoName.value)
|
||||||
@ -835,6 +838,10 @@ const handleDeleteType = (row: TypeNode) => {
|
|||||||
if (res.code == 0 || res.code == 200) {
|
if (res.code == 0 || res.code == 200) {
|
||||||
ElMessage.success('删除成功')
|
ElMessage.success('删除成功')
|
||||||
getModelList()
|
getModelList()
|
||||||
|
if (row.id === clickTypeId) {
|
||||||
|
modelList.value = []
|
||||||
|
currModelList.value = []
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -183,6 +183,7 @@ import type { DragEvents } from 'element-plus/es/components/tree/src/model/useDr
|
|||||||
import type { AllowDropType, NodeDropType, RenderContentContext } from 'element-plus'
|
import type { AllowDropType, NodeDropType, RenderContentContext } from 'element-plus'
|
||||||
import { ModelApi } from '@/api/model/index'
|
import { ModelApi } from '@/api/model/index'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
$sendElectronChanel,
|
$sendElectronChanel,
|
||||||
$recvElectronChanel,
|
$recvElectronChanel,
|
||||||
@ -551,6 +552,7 @@ const addModelDB = (path) => {
|
|||||||
if (res.code == 0 || res.code == 200) {
|
if (res.code == 0 || res.code == 200) {
|
||||||
ElMessage.success('导入成功')
|
ElMessage.success('导入成功')
|
||||||
modelList.value = []
|
modelList.value = []
|
||||||
|
currModelList.value = []
|
||||||
getModelList()
|
getModelList()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -889,6 +891,7 @@ const handleDeleteType = (row: TypeNode) => {
|
|||||||
//如果删除当前选中数据 清空右侧列表
|
//如果删除当前选中数据 清空右侧列表
|
||||||
if (row.id === clickTypeId) {
|
if (row.id === clickTypeId) {
|
||||||
modelList.value = []
|
modelList.value = []
|
||||||
|
currModelList.value = []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -592,6 +592,8 @@ const addModelDB = (path) => {
|
|||||||
PhotoApi.importModelDB(formData).then((res) => {
|
PhotoApi.importModelDB(formData).then((res) => {
|
||||||
if (res.code == 0 || res.code == 200) {
|
if (res.code == 0 || res.code == 200) {
|
||||||
ElMessage.success('导入成功')
|
ElMessage.success('导入成功')
|
||||||
|
modelList.value = []
|
||||||
|
currModelList.value = []
|
||||||
getModelList()
|
getModelList()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -760,12 +762,14 @@ const toggleExpand = (row: any) => {
|
|||||||
// loadModelsByType(row.id)
|
// loadModelsByType(row.id)
|
||||||
contextMenu.visible && (contextMenu.visible = false)
|
contextMenu.visible && (contextMenu.visible = false)
|
||||||
}
|
}
|
||||||
|
let clickTypeId = null //存储点击数据,用来删除时更新右侧列表
|
||||||
const getModelListByType = async (id) => {
|
const getModelListByType = async (id) => {
|
||||||
if (activeIndex.value === 0) {
|
if (activeIndex.value === 0) {
|
||||||
modelList.value = threePhoto
|
modelList.value = threePhoto
|
||||||
} else if (activeIndex.value === 1) {
|
} else if (activeIndex.value === 1) {
|
||||||
modelList.value = ordinaryPhoto
|
modelList.value = ordinaryPhoto
|
||||||
} else {
|
} else {
|
||||||
|
clickTypeId = id
|
||||||
let formData = new FormData()
|
let formData = new FormData()
|
||||||
formData.append('iconTypeId', id)
|
formData.append('iconTypeId', id)
|
||||||
formData.append('name', photoName.value)
|
formData.append('name', photoName.value)
|
||||||
@ -924,6 +928,10 @@ const handleDeleteType = (row: TypeNode) => {
|
|||||||
PhotoApi.delModelType(formData).then((res) => {
|
PhotoApi.delModelType(formData).then((res) => {
|
||||||
if (res.code == 0 || res.code == 200) {
|
if (res.code == 0 || res.code == 200) {
|
||||||
ElMessage.success('删除成功')
|
ElMessage.success('删除成功')
|
||||||
|
if (row.id === clickTypeId) {
|
||||||
|
currModelList.value = []
|
||||||
|
modelList.value = []
|
||||||
|
}
|
||||||
getModelList()
|
getModelList()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<template>
|
<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>
|
<template #content>
|
||||||
<span class="custom-divider"></span>
|
<span class="custom-divider"></span>
|
||||||
<div class="div-item">
|
<div class="div-item">
|
||||||
@ -24,7 +25,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="div-item">
|
<div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<el-tabs v-model="activeName">
|
<el-tabs v-model="activeName">
|
||||||
<el-tab-pane label="属性信息" name="1">
|
<el-tab-pane label="属性信息" name="1">
|
||||||
@ -91,22 +92,24 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="面风格" name="3">
|
<el-tab-pane label="面风格" name="3">
|
||||||
<div class="row">
|
<div class="div-item">
|
||||||
<div class="col">
|
<div class="row">
|
||||||
<span class="label">面颜色</span>
|
<div class="col">
|
||||||
<div class="color" ref="colorRef"></div>
|
<span class="label">面颜色</span>
|
||||||
</div>
|
<div class="color" ref="colorRef"></div>
|
||||||
<div class="col">
|
</div>
|
||||||
<span class="label">描边颜色</span>
|
<div class="col">
|
||||||
<div class="lineColor" ref="lineColorRef"></div>
|
<span class="label">描边颜色</span>
|
||||||
</div>
|
<div class="lineColor" ref="lineColorRef"></div>
|
||||||
<div class="col">
|
</div>
|
||||||
<span class="label">描边宽度</span>
|
<div class="col">
|
||||||
<div class="input-number input-number-unit-2">
|
<span class="label">描边宽度</span>
|
||||||
<input class="input" type="number" title="" min="0" max="99" v-model="entityOptions.lineWidth"
|
<div class="input-number input-number-unit-2">
|
||||||
@input="$handleInputLimit">
|
<input class="input" type="number" title="" min="0" max="99" v-model="entityOptions.lineWidth"
|
||||||
<span class="unit">px</span>
|
@input="$handleInputLimit">
|
||||||
<span class="arrow"></span>
|
<span class="unit">px</span>
|
||||||
|
<span class="arrow"></span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</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(() => {
|
that.openPositionEditing(() => {
|
||||||
entityOptions.value.options.center = structuredClone(that.options.center)
|
entityOptions.value.options.center = structuredClone(that.options.center)
|
||||||
})
|
})
|
||||||
@ -397,4 +402,5 @@ defineExpose({
|
|||||||
flex: 0 0 76px !important;
|
flex: 0 0 76px !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}</style>
|
}
|
||||||
|
</style>
|
||||||
@ -1,13 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<Dialog
|
<Dialog ref="baseDialog" class="fly-roam" title="飞行漫游" width="460px" left="180px" top="100px"
|
||||||
ref="baseDialog"
|
:closeCallback="closeCallBack">
|
||||||
class="fly-roam"
|
|
||||||
title="飞行漫游"
|
|
||||||
width="460px"
|
|
||||||
left="180px"
|
|
||||||
top="100px"
|
|
||||||
:closeCallback="closeCallBack"
|
|
||||||
>
|
|
||||||
<template #content v-if="show">
|
<template #content v-if="show">
|
||||||
<span class="custom-divider"></span>
|
<span class="custom-divider"></span>
|
||||||
<div class="div-item">
|
<div class="div-item">
|
||||||
@ -113,16 +106,8 @@
|
|||||||
<div class="col" style="flex: 0 0 300px">
|
<div class="col" style="flex: 0 0 300px">
|
||||||
<span class="label">默认时长</span>
|
<span class="label">默认时长</span>
|
||||||
<div class="input-number input-number-unit-3">
|
<div class="input-number input-number-unit-3">
|
||||||
<input
|
<input class="input total-time" type="number" title="" min="0" max="999999.99" step="0.01"
|
||||||
class="input total-time"
|
name="defaultTime" value="5" />
|
||||||
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="unit" style="top: 6px">s</span>
|
||||||
<span class="arrow"></span>
|
<span class="arrow"></span>
|
||||||
</div>
|
</div>
|
||||||
@ -150,28 +135,15 @@
|
|||||||
/> -->
|
/> -->
|
||||||
<span class="label">设置总时长</span>
|
<span class="label">设置总时长</span>
|
||||||
<div class="input-number input-number-unit-3">
|
<div class="input-number input-number-unit-3">
|
||||||
<input
|
<input class="input total-time" type="number" title="" min="0" max="999999.99" step="0.01"
|
||||||
class="input total-time"
|
name="totalTime" value="0" />
|
||||||
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="unit" style="top: 6px">s</span>
|
||||||
<span class="arrow"></span>
|
<span class="arrow"></span>
|
||||||
</div>
|
</div>
|
||||||
<button class="isTotalTime" style="margin-left: 10px">应用</button>
|
<button class="isTotalTime" style="margin-left: 10px">应用</button>
|
||||||
<input
|
<input type="checkbox" name="repeat" class="YJ-custom-checkbox"
|
||||||
type="checkbox"
|
style="cursor: pointer; width: auto; margin-right: 5px; margin-left: 10px" />
|
||||||
name="repeat"
|
|
||||||
class="YJ-custom-checkbox"
|
|
||||||
style="cursor: pointer; width: auto; margin-right: 5px; margin-left: 10px"
|
|
||||||
/>
|
|
||||||
<span class="label">循环</span>
|
<span class="label">循环</span>
|
||||||
<!-- <button style="margin-left: 10px" @click="apply">应用</button> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="table">
|
<div class="table">
|
||||||
@ -236,39 +208,386 @@ let viewPointHeight: any = ref(0)
|
|||||||
|
|
||||||
var show: any = ref(false)
|
var show: any = ref(false)
|
||||||
var flyRoam: any = reactive([])
|
var flyRoam: any = reactive([])
|
||||||
eventBus.on('flyRoamDialog', () => {
|
let roamData: any = reactive({
|
||||||
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({
|
|
||||||
name: '',
|
name: '',
|
||||||
points: [],
|
points: [],
|
||||||
repeat: '',
|
repeat: '',
|
||||||
defaultTime: 5,
|
defaultTime: 5,
|
||||||
totalTime: 0
|
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 () => {
|
const save = async () => {
|
||||||
if (allData.points.length != 0) {
|
if (roamData.points.length != 0) {
|
||||||
let selectedNodes = window.treeObj.getSelectedNodes()
|
let selectedNodes = window.treeObj.getSelectedNodes()
|
||||||
let node = selectedNodes && selectedNodes[selectedNodes.length - 1]
|
let node = selectedNodes && selectedNodes[selectedNodes.length - 1]
|
||||||
let parentId
|
let parentId
|
||||||
@ -281,13 +600,12 @@ const save = async () => {
|
|||||||
}
|
}
|
||||||
let id = (beforeData && beforeData.id) || new YJ.Tools().randomString()
|
let id = (beforeData && beforeData.id) || new YJ.Tools().randomString()
|
||||||
let paramsData: any = {
|
let paramsData: any = {
|
||||||
params: allData,
|
params: roamData,
|
||||||
id,
|
id,
|
||||||
sourceName: allData.name || t(`default.roam`),
|
sourceName: roamData.name || t(`default.roam`),
|
||||||
sourceType: 'roam',
|
sourceType: 'roam',
|
||||||
parentId: parentId
|
parentId: parentId,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (beforeData && beforeData.id) {
|
if (beforeData && beforeData.id) {
|
||||||
// let params2 = {
|
// let params2 = {
|
||||||
// "id": params.id,
|
// "id": params.id,
|
||||||
@ -298,16 +616,22 @@ const save = async () => {
|
|||||||
// TreeApi.updateDirectoryInfo(params2)
|
// TreeApi.updateDirectoryInfo(params2)
|
||||||
delete paramsData.sourceType
|
delete paramsData.sourceType
|
||||||
delete paramsData.parentId
|
delete paramsData.parentId
|
||||||
paramsData.isShow = allData.isShow
|
paramsData.isShow = roamData.repeat == 'Infinity' ? 1 : 0
|
||||||
TreeApi.updateDirectoryInfo(paramsData)
|
TreeApi.updateDirectoryInfo(paramsData)
|
||||||
cusUpdateNode({
|
cusUpdateNode({
|
||||||
id: paramsData.id,
|
id: paramsData.id,
|
||||||
sourceName: paramsData.sourceName,
|
sourceName: paramsData.sourceName,
|
||||||
params: JSON.stringify(paramsData.params)
|
params: JSON.stringify(paramsData.params)
|
||||||
})
|
})
|
||||||
|
let node = window.treeObj.getNodeByParam(
|
||||||
|
"id",
|
||||||
|
paramsData.id,
|
||||||
|
null
|
||||||
|
);
|
||||||
|
window.treeObj.checkNode(node, paramsData.isShow, true);
|
||||||
} else {
|
} else {
|
||||||
let res = await TreeApi.addOtherSource(paramsData)
|
let res = await TreeApi.addOtherSource(paramsData)
|
||||||
if(![0, 200].includes(res.code)) {
|
if (![0, 200].includes(res.code)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ElMessage.closeAll()
|
ElMessage.closeAll()
|
||||||
@ -315,8 +639,17 @@ const save = async () => {
|
|||||||
message: '添加成功',
|
message: '添加成功',
|
||||||
type: 'success'
|
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.params = JSON.stringify(paramsData.params)
|
||||||
|
paramsData.sourceType = sourceType
|
||||||
|
paramsData.parentId = parentId
|
||||||
cusAddNodes(window.treeObj, paramsData.parentId, [paramsData])
|
cusAddNodes(window.treeObj, paramsData.parentId, [paramsData])
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -329,7 +662,7 @@ const save = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const draw = (data) => {
|
const draw = (data) => {
|
||||||
allData = data
|
roamData = data
|
||||||
}
|
}
|
||||||
|
|
||||||
const startVideo = () => {
|
const startVideo = () => {
|
||||||
@ -352,25 +685,20 @@ const startVideo = () => {
|
|||||||
window.addEventListener('keydown', handleKeyDown)
|
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) => {
|
const closeCallBack = (e) => {
|
||||||
YJ.Global.FlyRoam.cease(window.earth)
|
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(() => {
|
onBeforeUnmount(() => {
|
||||||
closeCallBack('')
|
closeCallBack('')
|
||||||
})
|
})
|
||||||
const apply = (e) => {
|
|
||||||
YJ.Global.FlyRoam.apply()
|
|
||||||
}
|
|
||||||
const close = (e) => {
|
const close = (e) => {
|
||||||
show.value = false
|
show.value = false
|
||||||
baseDialog.value?.close()
|
baseDialog.value?.close()
|
||||||
@ -405,12 +733,10 @@ defineExpose({
|
|||||||
}
|
}
|
||||||
|
|
||||||
.video {
|
.video {
|
||||||
background: linear-gradient(
|
background: linear-gradient(180deg,
|
||||||
180deg,
|
|
||||||
rgba(71, 27, 5, 0.3) 0%,
|
rgba(71, 27, 5, 0.3) 0%,
|
||||||
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;
|
rgba(0, 0, 0, 0.5) !important;
|
||||||
border: 1px solid rgba(255, 165, 92, 1) !important;
|
border: 1px solid rgba(255, 165, 92, 1) !important;
|
||||||
color: rgba(255, 165, 92, 1) !important;
|
color: rgba(255, 165, 92, 1) !important;
|
||||||
|
|||||||
@ -140,10 +140,10 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
//@ts-nocheck
|
//@ts-nocheck
|
||||||
import {ref, reactive, onBeforeUnmount} from 'vue'
|
import { ref, reactive, onBeforeUnmount } from 'vue'
|
||||||
import {inject} from 'vue'
|
import { inject } from 'vue'
|
||||||
import Dialog from '@/components/dialog/baseDialog.vue'
|
import Dialog from '@/components/dialog/baseDialog.vue'
|
||||||
import {RouteApi} from '@/api/route/index'
|
import { RouteApi } from '@/api/route/index'
|
||||||
|
|
||||||
const baseDialog: any = ref(null)
|
const baseDialog: any = ref(null)
|
||||||
const eventBus: any = inject('bus')
|
const eventBus: any = inject('bus')
|
||||||
@ -223,7 +223,7 @@ const open = () => {
|
|||||||
//加载路网数据
|
//加载路网数据
|
||||||
|
|
||||||
const addRoute = async (fileId) => {
|
const addRoute = async (fileId) => {
|
||||||
let res = await RouteApi.loadRoute({fileId})
|
let res = await RouteApi.loadRoute({ fileId })
|
||||||
}
|
}
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
let list = await RouteApi.getRouteList()
|
let list = await RouteApi.getRouteList()
|
||||||
@ -238,6 +238,7 @@ const closeCallBack = (e) => {
|
|||||||
startLat.value = null
|
startLat.value = null
|
||||||
endLng.value = null
|
endLng.value = null
|
||||||
endLat.value = null
|
endLat.value = null
|
||||||
|
routePlanning.destroyMouse()
|
||||||
}
|
}
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
closeCallBack('')
|
closeCallBack('')
|
||||||
@ -251,8 +252,7 @@ const routeQuery = async (e) => {
|
|||||||
waypoints: []
|
waypoints: []
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const clearRoute = (e) => {
|
const clearRoute = (e) => {}
|
||||||
}
|
|
||||||
const pickStartPos = () => {
|
const pickStartPos = () => {
|
||||||
routePlanning.pickStartPos((position) => {
|
routePlanning.pickStartPos((position) => {
|
||||||
startLng.value = position.lng
|
startLng.value = position.lng
|
||||||
|
|||||||
@ -45,6 +45,7 @@
|
|||||||
max="100"
|
max="100"
|
||||||
min="0"
|
min="0"
|
||||||
step="0.01"
|
step="0.01"
|
||||||
|
disabled
|
||||||
v-model="progressVal"
|
v-model="progressVal"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -101,6 +102,7 @@ const closeCallBack = (e) => {
|
|||||||
progressVal.value = 0
|
progressVal.value = 0
|
||||||
scale.value = 1
|
scale.value = 1
|
||||||
modify.value = false
|
modify.value = false
|
||||||
|
eventBus.emit('closeScreenShot', false)
|
||||||
}
|
}
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
closeCallBack('')
|
closeCallBack('')
|
||||||
@ -124,8 +126,10 @@ const getResultData = (data) => {
|
|||||||
// eventBus.emit('mapPrintDialog')
|
// eventBus.emit('mapPrintDialog')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const name = 'ScreenShotHD'
|
||||||
defineExpose({
|
defineExpose({
|
||||||
open
|
open,
|
||||||
|
name
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -2,9 +2,10 @@
|
|||||||
<Dialog ref="baseDialog" :title="t('bottomMenu.groundText')" left="calc(50% - 198px)" top="calc(50% - 120px)"
|
<Dialog ref="baseDialog" :title="t('bottomMenu.groundText')" left="calc(50% - 198px)" top="calc(50% - 120px)"
|
||||||
:closeCallback="closeCallBack">
|
:closeCallback="closeCallBack">
|
||||||
<template #content>
|
<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;">{{
|
<span style="position: absolute;bottom: 66px;right: 26px;font-size: 12px;color: #c5c5c5;font-family: Arial;">{{
|
||||||
text.length }}/80</span>
|
text.length }}/80</span>
|
||||||
|
<span v-if="error" style="top: unset;bottom: 72px;left: 26px;" class="el-form-item__error">内容不能为空!</span>
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<button @click="confirm">{{ t('btn.confirm') }}</button>
|
<button @click="confirm">{{ t('btn.confirm') }}</button>
|
||||||
@ -26,6 +27,7 @@ const { cusAddNodes } = useTreeNode()
|
|||||||
|
|
||||||
const baseDialog: any = ref(null)
|
const baseDialog: any = ref(null)
|
||||||
const eventBus: any = inject('bus')
|
const eventBus: any = inject('bus')
|
||||||
|
const error = ref(false)
|
||||||
const text = ref('')
|
const text = ref('')
|
||||||
eventBus.on('openStandTextAdd', () => {
|
eventBus.on('openStandTextAdd', () => {
|
||||||
baseDialog.value?.open()
|
baseDialog.value?.open()
|
||||||
@ -35,6 +37,7 @@ const open = () => {
|
|||||||
}
|
}
|
||||||
const confirm = () => {
|
const confirm = () => {
|
||||||
if (!text.value) {
|
if (!text.value) {
|
||||||
|
error.value = true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
text.value = text.value.trim()
|
text.value = text.value.trim()
|
||||||
@ -112,6 +115,7 @@ const confirm = () => {
|
|||||||
}
|
}
|
||||||
const closeCallBack = () => {
|
const closeCallBack = () => {
|
||||||
text.value = ''
|
text.value = ''
|
||||||
|
error.value = false
|
||||||
}
|
}
|
||||||
defineExpose({
|
defineExpose({
|
||||||
open
|
open
|
||||||
|
|||||||
@ -2,9 +2,10 @@
|
|||||||
<Dialog ref="baseDialog" :title="t('bottomMenu.standText')" left="calc(50% - 198px)" top="calc(50% - 120px)"
|
<Dialog ref="baseDialog" :title="t('bottomMenu.standText')" left="calc(50% - 198px)" top="calc(50% - 120px)"
|
||||||
:closeCallback="closeCallBack">
|
:closeCallback="closeCallBack">
|
||||||
<template #content>
|
<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;">{{
|
<span style="position: absolute;bottom: 66px;right: 26px;font-size: 12px;color: #c5c5c5;font-family: Arial;">{{
|
||||||
text.length }}/80</span>
|
text.length }}/80</span>
|
||||||
|
<span v-if="error" style="top: unset;bottom: 72px;left: 26px;" class="el-form-item__error">内容不能为空!</span>
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<button @click="confirm">{{ t('btn.confirm') }}</button>
|
<button @click="confirm">{{ t('btn.confirm') }}</button>
|
||||||
@ -26,6 +27,7 @@ const { cusAddNodes } = useTreeNode()
|
|||||||
|
|
||||||
const baseDialog: any = ref(null)
|
const baseDialog: any = ref(null)
|
||||||
const eventBus: any = inject('bus')
|
const eventBus: any = inject('bus')
|
||||||
|
const error = ref(false)
|
||||||
const text = ref('')
|
const text = ref('')
|
||||||
eventBus.on('openStandTextAdd', () => {
|
eventBus.on('openStandTextAdd', () => {
|
||||||
baseDialog.value?.open()
|
baseDialog.value?.open()
|
||||||
@ -34,11 +36,9 @@ const open = () => {
|
|||||||
baseDialog.value?.open()
|
baseDialog.value?.open()
|
||||||
}
|
}
|
||||||
const confirm = () => {
|
const confirm = () => {
|
||||||
if (!text.value) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
text.value = text.value.trim()
|
text.value = text.value.trim()
|
||||||
if (!text.value) {
|
if (!text.value) {
|
||||||
|
error.value = true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let name = text.value
|
let name = text.value
|
||||||
@ -107,6 +107,7 @@ const confirm = () => {
|
|||||||
}
|
}
|
||||||
const closeCallBack = () => {
|
const closeCallBack = () => {
|
||||||
text.value = ''
|
text.value = ''
|
||||||
|
error.value = false
|
||||||
}
|
}
|
||||||
defineExpose({
|
defineExpose({
|
||||||
open
|
open
|
||||||
|
|||||||
@ -28,7 +28,8 @@
|
|||||||
<div class="col">
|
<div class="col">
|
||||||
<span class="label">动画时长</span>
|
<span class="label">动画时长</span>
|
||||||
<div class="input-number input-number-unit-3">
|
<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="unit">ms</span>
|
||||||
<span class="arrow"></span>
|
<span class="arrow"></span>
|
||||||
</div>
|
</div>
|
||||||
@ -37,7 +38,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<span class="label">动画</span>
|
<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>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<span class="label">动画重复</span>
|
<span class="label">动画重复</span>
|
||||||
@ -47,61 +48,66 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="div-item">
|
<div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<el-tabs v-model="activeName">
|
<el-tabs v-model="activeName">
|
||||||
<el-tab-pane label="属性信息" name="1">
|
<el-tab-pane label="属性信息" name="1">
|
||||||
<attribute :entityOptions="entityOptions"></attribute>
|
<attribute :entityOptions="entityOptions"></attribute>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="空间信息" name="2">
|
<el-tab-pane label="空间信息" name="2">
|
||||||
<div class="row">
|
<div class="div-item">
|
||||||
<div class="col height-mode-box">
|
<div class="row">
|
||||||
<span class="label" style="flex: 0 0 56px;">高度模式</span>
|
<div class="col height-mode-box">
|
||||||
<el-select class="input input-select height-mode-scelect" style="width: 155px;margin-left: 20px"
|
<span class="label" style="flex: 0 0 56px;">高度模式</span>
|
||||||
v-model="heightMode" @change="heightModeChange" placeholder="请选择">
|
<el-select class="input input-select height-mode-scelect" style="width: 155px;margin-left: 20px"
|
||||||
<el-option v-for="item in heightModeData" :key="item.key" :label="item.name" :value="item.key">
|
v-model="heightMode" @change="heightModeChange" placeholder="请选择">
|
||||||
</el-option>
|
<el-option v-for="item in heightModeData" :key="item.key" :label="item.name" :value="item.key">
|
||||||
</el-select>
|
</el-option>
|
||||||
</div>
|
</el-select>
|
||||||
<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>
|
</div>
|
||||||
<button class="confirm height-confirm" style="margin-left: 5px;" @click="heightConfirm"
|
<div class="col">
|
||||||
:disabled="heightMode == 2">应用</button>
|
<span class="label">Z值统一增加</span>
|
||||||
</div>
|
<div class="input-number input-number-unit-1 height-box" :class="{ 'disabled': heightMode == 2 }">
|
||||||
</div>
|
<input class="input height" type="number" title="" min="-9999999" max="999999999" v-model="height"
|
||||||
<div class="row">
|
@input="$handleInputLimit">
|
||||||
<div class="table spatial-info-table">
|
<span class="unit">m</span>
|
||||||
<div class="table-head">
|
<span class="arrow"></span>
|
||||||
<div class="tr">
|
|
||||||
<div class="th"></div>
|
|
||||||
<div class="th">经度(X)</div>
|
|
||||||
<div class="th">纬度(Y)</div>
|
|
||||||
<div class="th">高度(Z)</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<button class="confirm height-confirm" style="margin-left: 5px;" @click="heightConfirm"
|
||||||
|
:disabled="heightMode == 2">应用</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-body">
|
</div>
|
||||||
<div class="tr" v-for="(item, i) in entityOptions.options.positions" :key="i">
|
<div class="row">
|
||||||
<div class="td">{{ i + 1 }}</div>
|
<div class="table spatial-info-table">
|
||||||
<div class="td lng align-center" @dblclick="inputDblclick($event, i, 'lng')">
|
<div class="table-head">
|
||||||
<input class="input" @blur="inputBlurCallBack($event, i, 'lng', 8)" type="number"
|
<div class="tr">
|
||||||
v-model="item.lng" min="-180" max="180" v-if="activeTd.index == i && activeTd.name == 'lng'" @input="$handleInputLimit">
|
<div class="th"></div>
|
||||||
<span style="pointer-events: none;" v-else>{{ (item.lng).toFixed(8) }}</span>
|
<div class="th">经度(X)</div>
|
||||||
|
<div class="th">纬度(Y)</div>
|
||||||
|
<div class="th">高度(Z)</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="td lat align-center" @dblclick="inputDblclick($event, i, 'lat')">
|
</div>
|
||||||
<input class="input" @blur="inputBlurCallBack($event, i, 'lat', 8)" type="number"
|
<div class="table-body">
|
||||||
v-model="item.lat" min="-180" max="180" v-if="activeTd.index == i && activeTd.name == 'lat'" @input="$handleInputLimit">
|
<div class="tr" v-for="(item, i) in entityOptions.options.positions" :key="i">
|
||||||
<span style="pointer-events: none;" v-else>{{ (item.lat).toFixed(8) }}</span>
|
<div class="td">{{ i + 1 }}</div>
|
||||||
</div>
|
<div class="td lng align-center" @dblclick="inputDblclick($event, i, 'lng')">
|
||||||
<div class="td alt align-center" @dblclick="inputDblclick($event, i, 'alt')">
|
<input class="input" @blur="inputBlurCallBack($event, i, 'lng', 8)" type="number"
|
||||||
<input class="input" @blur="inputBlurCallBack($event, i, 'alt', 2)" type="number"
|
v-model="item.lng" min="-180" max="180" v-if="activeTd.index == i && activeTd.name == 'lng'"
|
||||||
v-model="entityOptions.height" min="-9999999" max="999999999"
|
@input="$handleInputLimit">
|
||||||
v-if="activeTd.index == i && activeTd.name == 'alt'" @input="$handleInputLimit">
|
<span style="pointer-events: none;" v-else>{{ (item.lng).toFixed(8) }}</span>
|
||||||
<span style="pointer-events: none;" v-else>{{ (entityOptions.height).toFixed(2) }}</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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -109,21 +115,24 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="面风格" name="3">
|
<el-tab-pane label="面风格" name="3">
|
||||||
<div class="row">
|
<div class="div-item">
|
||||||
<div class="col">
|
<div class="row">
|
||||||
<span class="label">面颜色</span>
|
<div class="col">
|
||||||
<div class="color" ref="colorRef"></div>
|
<span class="label">面颜色</span>
|
||||||
</div>
|
<div class="color" ref="colorRef"></div>
|
||||||
<div class="col">
|
</div>
|
||||||
<span class="label">描边颜色</span>
|
<div class="col">
|
||||||
<div class="lineColor" ref="lineColorRef"></div>
|
<span class="label">描边颜色</span>
|
||||||
</div>
|
<div class="lineColor" ref="lineColorRef"></div>
|
||||||
<div class="col">
|
</div>
|
||||||
<span class="label">描边宽度</span>
|
<div class="col">
|
||||||
<div class="input-number input-number-unit-2">
|
<span class="label">描边宽度</span>
|
||||||
<input class="input" type="number" title="" min="0" max="99" v-model="entityOptions.lineWidth" @input="$handleInputLimit">
|
<div class="input-number input-number-unit-2">
|
||||||
<span class="unit">px</span>
|
<input class="input" type="number" title="" min="0" max="99" v-model="entityOptions.lineWidth"
|
||||||
<span class="arrow"></span>
|
@input="$handleInputLimit">
|
||||||
|
<span class="unit">px</span>
|
||||||
|
<span class="arrow"></span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -208,9 +217,12 @@ const heightMode = ref(0)
|
|||||||
const entityOptions: any = ref({});
|
const entityOptions: any = ref({});
|
||||||
let originalOptions: any
|
let originalOptions: any
|
||||||
let that: any
|
let that: any
|
||||||
|
const spreadState = ref(false)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const open = async (id: any, type: any) => {
|
const open = async (id: any, type: any) => {
|
||||||
if(type && type === 'pincerArrow') {
|
if (type && type === 'pincerArrow') {
|
||||||
title.value = '双箭头'
|
title.value = '双箭头'
|
||||||
}
|
}
|
||||||
that = window.earth.entityMap.get(id)
|
that = window.earth.entityMap.get(id)
|
||||||
@ -239,10 +251,10 @@ const open = async (id: any, type: any) => {
|
|||||||
area.value = entityOptions.value.areaByMeter
|
area.value = entityOptions.value.areaByMeter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let spreadState = entityOptions.value.spreadState
|
spreadState.value = entityOptions.value.spreadState
|
||||||
heightModeChange(heightMode.value)
|
that.heightMode = heightMode.value
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
entityOptions.value.spreadState = spreadState
|
that.spreadState = spreadState.value
|
||||||
}, 50);
|
}, 50);
|
||||||
baseDialog.value?.open()
|
baseDialog.value?.open()
|
||||||
|
|
||||||
@ -279,8 +291,14 @@ const open = async (id: any, type: any) => {
|
|||||||
|
|
||||||
const heightModeChange = (val) => {
|
const heightModeChange = (val) => {
|
||||||
that.heightMode = heightMode.value
|
that.heightMode = heightMode.value
|
||||||
entityOptions.value.spreadState = false
|
that.spreadState = false
|
||||||
|
spreadState.value = false
|
||||||
}
|
}
|
||||||
|
const spreadStateChange = (val) => {
|
||||||
|
that.spreadState = spreadState.value
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const heightConfirm = () => {
|
const heightConfirm = () => {
|
||||||
if (entityOptions.value.operate.positionEditing) {
|
if (entityOptions.value.operate.positionEditing) {
|
||||||
@ -316,8 +334,11 @@ const inputBlurCallBack = (event, i, name, digit = 2) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const translate = () => {
|
const translate = async () => {
|
||||||
entityOptions.value.spreadState = false
|
that.spreadState = false
|
||||||
|
spreadState.value = false
|
||||||
|
entityOptions.value.closeNodeEdit()
|
||||||
|
await nextTick()
|
||||||
that.openPositionEditing(() => {
|
that.openPositionEditing(() => {
|
||||||
entityOptions.value.options.positions = structuredClone(that.options.positions)
|
entityOptions.value.options.positions = structuredClone(that.options.positions)
|
||||||
})
|
})
|
||||||
@ -332,7 +353,8 @@ const closeCallback = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const nodeEdit = () => {
|
const nodeEdit = () => {
|
||||||
entityOptions.value.spreadState = false
|
that.spreadState = false
|
||||||
|
spreadState.value = false
|
||||||
that.nodeEdit((e, positions, areaByMeter) => {
|
that.nodeEdit((e, positions, areaByMeter) => {
|
||||||
entityOptions.value.options.positions = structuredClone(positions)
|
entityOptions.value.options.positions = structuredClone(positions)
|
||||||
})
|
})
|
||||||
@ -370,31 +392,31 @@ watch(
|
|||||||
const remove = () => {
|
const remove = () => {
|
||||||
close()
|
close()
|
||||||
ElMessageBox.confirm('此操作将永久删除节点及所有子节点, 是否继续?', '提示', {
|
ElMessageBox.confirm('此操作将永久删除节点及所有子节点, 是否继续?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
let node = window.treeObj.getNodeByParam('id', that.options.id, null)
|
let node = window.treeObj.getNodeByParam('id', that.options.id, null)
|
||||||
let source_ids = cusRemoveNode(window.treeObj, [node])
|
let source_ids = cusRemoveNode(window.treeObj, [node])
|
||||||
const res = await TreeApi.removeDirectory({ ids: source_ids })
|
const res = await TreeApi.removeDirectory({ ids: source_ids })
|
||||||
if (res.code == 0 || res.code == 200) {
|
if (res.code == 0 || res.code == 200) {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: '删除成功',
|
message: '删除成功',
|
||||||
type: 'success'
|
type: 'success'
|
||||||
})
|
})
|
||||||
that.remove()
|
that.remove()
|
||||||
(window as any)._entityMap.delete(source_ids[0])
|
(window as any)._entityMap.delete(source_ids[0])
|
||||||
} else {
|
} else {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: res.msg || '删除失败',
|
message: res.msg || '删除失败',
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
// 用户点击取消,不执行任何操作
|
// 用户点击取消,不执行任何操作
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
@ -406,6 +428,7 @@ defineExpose({
|
|||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.attackArrow.dialog-en {
|
.attackArrow.dialog-en {
|
||||||
::v-deep>.content {
|
::v-deep>.content {
|
||||||
|
|
||||||
.attribute-content-link .table .tr .td.operation button,
|
.attribute-content-link .table .tr .td.operation button,
|
||||||
.attribute-content-vr .table .tr .td.operation button,
|
.attribute-content-vr .table .tr .td.operation button,
|
||||||
.attribute-content-rtmp .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)
|
attribute.value.vr.content.splice(index, 1)
|
||||||
}
|
}
|
||||||
const vrConfirmEdit = (index: string | number) => {
|
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 = {}
|
vrEditActive.value = {}
|
||||||
}
|
}
|
||||||
const vrCancelEdit = () => {
|
const vrCancelEdit = () => {
|
||||||
@ -691,7 +694,12 @@ const changeAttributeGoods = (item) => {
|
|||||||
}
|
}
|
||||||
const changeAttributeCamera = (e) => {
|
const changeAttributeCamera = (e) => {
|
||||||
console.log(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++) {
|
for (let i = 0; i < cameraList.value.length; i++) {
|
||||||
if (cameraList.value[i].id !== e.id) {
|
if (cameraList.value[i].id !== e.id) {
|
||||||
cameraList.value[i].checked = false
|
cameraList.value[i].checked = false
|
||||||
|
|||||||
@ -59,13 +59,13 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<span class="label">线段缓冲</span>
|
<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>
|
||||||
<div class="col" style="flex: 0 0 33%">
|
<div class="col" style="flex: 0 0 33%">
|
||||||
<span class="label">缓冲宽度</span>
|
<span class="label">缓冲宽度</span>
|
||||||
<div class="input-number input-number-unit-1" style="width: 80px">
|
<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"
|
<input class="input" type="number" title="" min="0" data-min="0.01" max="999999"
|
||||||
v-model="entityOptions.extendWidth" />
|
@input="$handleInputLimit" v-model="extendWidth" @change="extendWidthchange" />
|
||||||
<span class="unit">m</span>
|
<span class="unit">m</span>
|
||||||
<span class="arrow"></span>
|
<span class="arrow"></span>
|
||||||
</div>
|
</div>
|
||||||
@ -113,59 +113,61 @@
|
|||||||
<attribute :entityOptions="entityOptions"></attribute>
|
<attribute :entityOptions="entityOptions"></attribute>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="空间信息" name="2">
|
<el-tab-pane label="空间信息" name="2">
|
||||||
<div class="row">
|
<div class="div-item">
|
||||||
<div class="col height-mode-box">
|
<div class="row">
|
||||||
<span class="label" style="flex: 0 0 56px">高度模式</span>
|
<div class="col height-mode-box">
|
||||||
<el-select class="input input-select height-mode-scelect" style="width: 155px; margin-left: 20px"
|
<span class="label" style="flex: 0 0 56px">高度模式</span>
|
||||||
v-model="heightMode" @change="heightModeChange" placeholder="请选择">
|
<el-select class="input input-select height-mode-scelect" style="width: 155px; margin-left: 20px"
|
||||||
<el-option v-for="item in heightModeData" :key="item.key" :label="item.name" :value="item.key">
|
v-model="heightMode" @change="heightModeChange" placeholder="请选择">
|
||||||
</el-option>
|
<el-option v-for="item in heightModeData" :key="item.key" :label="item.name" :value="item.key">
|
||||||
</el-select>
|
</el-option>
|
||||||
</div>
|
</el-select>
|
||||||
<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>
|
</div>
|
||||||
<button class="confirm height-confirm" style="margin-left: 5px" @click="heightConfirm"
|
<div class="col">
|
||||||
:disabled="heightMode == 2">
|
<span class="label">Z值统一增加</span>
|
||||||
应用
|
<div class="input-number input-number-unit-1 height-box" :class="{ disabled: heightMode == 2 }">
|
||||||
</button>
|
<input class="input height" type="number" title="" min="-9999999" max="999999999"
|
||||||
</div>
|
@input="$handleInputLimit" v-model="height" />
|
||||||
</div>
|
<span class="unit">m</span>
|
||||||
<div class="row">
|
<span class="arrow"></span>
|
||||||
<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>
|
||||||
|
<button class="confirm height-confirm" style="margin-left: 5px" @click="heightConfirm"
|
||||||
|
:disabled="heightMode == 2">
|
||||||
|
应用
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-body">
|
</div>
|
||||||
<div class="tr" v-for="(item, i) in entityOptions.options.positions" :key="i">
|
<div class="row">
|
||||||
<div class="td">{{ i + 1 }}</div>
|
<div class="table spatial-info-table">
|
||||||
<div class="td lng align-center" @dblclick="inputDblclick($event, i, 'lng')">
|
<div class="table-head">
|
||||||
<input class="input" @blur="inputBlurCallBack($event, i, 'lng', 8)" type="number"
|
<div class="tr">
|
||||||
v-model="item.lng" min="-180" max="180" @input="$handleInputLimit"
|
<div class="th"></div>
|
||||||
v-if="activeTd.index == i && activeTd.name == 'lng'" />
|
<div class="th">经度(X)</div>
|
||||||
<span style="pointer-events: none" v-else>{{ item.lng.toFixed(8) }}</span>
|
<div class="th">纬度(Y)</div>
|
||||||
|
<div class="th">高度(Z)</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="td lat align-center" @dblclick="inputDblclick($event, i, 'lat')">
|
</div>
|
||||||
<input class="input" @blur="inputBlurCallBack($event, i, 'lat', 8)" type="number"
|
<div class="table-body">
|
||||||
v-model="item.lat" min="-180" max="180" @input="$handleInputLimit"
|
<div class="tr" v-for="(item, i) in entityOptions.options.positions" :key="i">
|
||||||
v-if="activeTd.index == i && activeTd.name == 'lat'" />
|
<div class="td">{{ i + 1 }}</div>
|
||||||
<span style="pointer-events: none" v-else>{{ item.lat.toFixed(8) }}</span>
|
<div class="td lng align-center" @dblclick="inputDblclick($event, i, 'lng')">
|
||||||
</div>
|
<input class="input" @blur="inputBlurCallBack($event, i, 'lng', 8)" type="number"
|
||||||
<div class="td alt align-center" @dblclick="inputDblclick($event, i, 'alt')">
|
v-model="item.lng" min="-180" max="180" @input="$handleInputLimit"
|
||||||
<input class="input" @blur="inputBlurCallBack($event, i, 'alt', 2)" type="number"
|
v-if="activeTd.index == i && activeTd.name == 'lng'" />
|
||||||
v-model="item.alt" min="-9999999" max="999999999" @input="$handleInputLimit"
|
<span style="pointer-events: none" v-else>{{ item.lng.toFixed(8) }}</span>
|
||||||
v-if="activeTd.index == i && activeTd.name == 'alt'" />
|
</div>
|
||||||
<span style="pointer-events: none" v-else>{{ item.alt.toFixed(2) }}</span>
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -329,6 +331,8 @@ const colorRef = ref(null)
|
|||||||
const extendColorRef = ref(null)
|
const extendColorRef = ref(null)
|
||||||
const heightMode = ref(0)
|
const heightMode = ref(0)
|
||||||
const wordsName = ref(0)
|
const wordsName = ref(0)
|
||||||
|
const extend = ref(false)
|
||||||
|
const extendWidth = ref(0)
|
||||||
|
|
||||||
let originalOptions
|
let originalOptions
|
||||||
let that
|
let that
|
||||||
@ -338,6 +342,7 @@ const open = async (id, type) => {
|
|||||||
sourceType.value = type
|
sourceType.value = type
|
||||||
originalOptions = structuredClone(that.options)
|
originalOptions = structuredClone(that.options)
|
||||||
entityOptions.value = that
|
entityOptions.value = that
|
||||||
|
extendWidth.value = that.extendWidth
|
||||||
wordsName.value = Number(entityOptions.value.wordsName)
|
wordsName.value = Number(entityOptions.value.wordsName)
|
||||||
heightMode.value = entityOptions.value.heightMode
|
heightMode.value = entityOptions.value.heightMode
|
||||||
length.value = entityOptions.value.lengthByMeter
|
length.value = entityOptions.value.lengthByMeter
|
||||||
@ -350,6 +355,7 @@ const open = async (id, type) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
heightModeChange(heightMode.value)
|
heightModeChange(heightMode.value)
|
||||||
|
extend.value = that.extend
|
||||||
baseDialog.value?.open()
|
baseDialog.value?.open()
|
||||||
|
|
||||||
await nextTick()
|
await nextTick()
|
||||||
@ -382,8 +388,12 @@ const open = async (id, type) => {
|
|||||||
} //点击清空按钮事件回调
|
} //点击清空按钮事件回调
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const extendWidthchange = (val) => {
|
||||||
|
that.extendWidth = extendWidth.value
|
||||||
|
}
|
||||||
const heightModeChange = (val) => {
|
const heightModeChange = (val) => {
|
||||||
that.heightMode = heightMode.value
|
that.heightMode = heightMode.value
|
||||||
|
extend.value = false
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (heightMode.value === 0 || heightMode.value === '0' || heightMode.value === 1 || heightMode.value === '1') {
|
if (heightMode.value === 0 || heightMode.value === '0' || heightMode.value === 1 || heightMode.value === '1') {
|
||||||
entityOptions.value.extend = false
|
entityOptions.value.extend = false
|
||||||
@ -431,6 +441,7 @@ const lineExtendchange = (e) => {
|
|||||||
if (e.target.checked) {
|
if (e.target.checked) {
|
||||||
heightMode.value = 2
|
heightMode.value = 2
|
||||||
}
|
}
|
||||||
|
that.extend = extend.value
|
||||||
}
|
}
|
||||||
const nodeEdit = () => {
|
const nodeEdit = () => {
|
||||||
entityOptions.value.positionEditing = false
|
entityOptions.value.positionEditing = false
|
||||||
@ -446,7 +457,9 @@ const nodeEdit = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const translate = () => {
|
const translate = async () => {
|
||||||
|
entityOptions.value.closeNodeEdit()
|
||||||
|
await nextTick()
|
||||||
that.openPositionEditing(() => {
|
that.openPositionEditing(() => {
|
||||||
entityOptions.value.options.positions = structuredClone(that.options.positions)
|
entityOptions.value.options.positions = structuredClone(that.options.positions)
|
||||||
if (lengthUnit.value == 'km') {
|
if (lengthUnit.value == 'km') {
|
||||||
@ -556,8 +569,10 @@ defineExpose({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.polyline.dialog-en {
|
.polyline.dialog-en {
|
||||||
::v-deep>.content {
|
::v-deep>.content {
|
||||||
|
|
||||||
.attribute-content-link .table .tr .td.operation button,
|
.attribute-content-link .table .tr .td.operation button,
|
||||||
.attribute-content-vr .table .tr .td.operation button,
|
.attribute-content-vr .table .tr .td.operation button,
|
||||||
.attribute-content-rtmp .table .tr .td.operation button {
|
.attribute-content-rtmp .table .tr .td.operation button {
|
||||||
|
|||||||
@ -63,9 +63,12 @@ let func = (data) => {
|
|||||||
rowData.name = data.modelName
|
rowData.name = data.modelName
|
||||||
baseDialog.value?.open()
|
baseDialog.value?.open()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
initThreeJS()
|
// initThreeJS()
|
||||||
loadModel()
|
// loadModel()
|
||||||
animate()
|
// animate()
|
||||||
|
(window as any).viewGlb = new viewGlbByEarth('threeCanvas');
|
||||||
|
console.log(service.value + rowData.modelDataUrl, 'cccccc');
|
||||||
|
(window as any).viewGlb.addGltf(service.value + rowData.modelDataUrl);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
@ -197,7 +200,7 @@ const viewPointHeightInput = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const closeCallBack = (e) => {
|
const closeCallBack = (e) => {
|
||||||
renderer.domElement.remove() // 从DOM中移除渲染器。
|
renderer?.domElement.remove() // 从DOM中移除渲染器。
|
||||||
imageData.value = null
|
imageData.value = null
|
||||||
rowData = []
|
rowData = []
|
||||||
//打开系统设置弹框
|
//打开系统设置弹框
|
||||||
@ -206,25 +209,19 @@ const closeCallBack = (e) => {
|
|||||||
|
|
||||||
var posterLoading: any = ref(false)
|
var posterLoading: any = ref(false)
|
||||||
const setImage = (e) => {
|
const setImage = (e) => {
|
||||||
renderer.render(scene, camera) // 确保场景已渲染
|
(window as any).viewGlb.canvasToBase((file) => {
|
||||||
const canvas = renderer.domElement
|
console.log(file, 'file')
|
||||||
|
|
||||||
canvas.toBlob((blob) => {
|
|
||||||
const file = new File([blob], 'filename.png', { type: 'image/png' })
|
|
||||||
imageData.value = file
|
|
||||||
|
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
formData.append('modelId', rowData.id)
|
formData.append('modelId', rowData.id)
|
||||||
// rowData.name && formData.append('modelName', rowData.name)
|
file && formData.append('file', file)
|
||||||
imageData.value && formData.append('file', imageData.value)
|
|
||||||
ModelApi.updatePoster(formData).then((res) => {
|
ModelApi.updatePoster(formData).then((res) => {
|
||||||
if (res.code == 0 || res.code == 200) {
|
if (res.code == 0 || res.code == 200) {
|
||||||
ElMessage.success('设置成功')
|
ElMessage.success('设置成功')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
});
|
||||||
|
|
||||||
// ElMessage.warning('设置成功')
|
// })
|
||||||
}, 'image/png')
|
|
||||||
|
|
||||||
// const formData = new FormData()
|
// const formData = new FormData()
|
||||||
// formData.append('modelId', rowData.id)
|
// formData.append('modelId', rowData.id)
|
||||||
|
|||||||
@ -315,7 +315,6 @@ watch(modelName, (val) => {
|
|||||||
// treeRef.value!.filter(val)
|
// treeRef.value!.filter(val)
|
||||||
// }
|
// }
|
||||||
categories.value = []
|
categories.value = []
|
||||||
currModelList.value = []
|
|
||||||
getModelList()
|
getModelList()
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -510,10 +509,41 @@ const modelClick = (index, row) => {
|
|||||||
const renderModel = async (data, model) => {
|
const renderModel = async (data, model) => {
|
||||||
let selectedNode = window.treeObj.getSelectedNodes()[0]
|
let selectedNode = window.treeObj.getSelectedNodes()[0]
|
||||||
let z
|
let z
|
||||||
|
let index = 0
|
||||||
|
let ids:any = []
|
||||||
if (data.positions.length > 0) {
|
if (data.positions.length > 0) {
|
||||||
data.positions.forEach(async (position, index) => {
|
data.positions.forEach(async (position, i) => {
|
||||||
// let source_id = this.$md5(new Date().getTime() + model.model_name+index);
|
// let source_id = this.$md5(new Date().getTime() + model.model_name+i);
|
||||||
let id = new YJ.Tools().randomString()
|
let id = new YJ.Tools().randomString()
|
||||||
|
ids.push(id)
|
||||||
|
if (data.type == '面') {
|
||||||
|
z = data.rotate - 90
|
||||||
|
} else if (data.type == '线') {
|
||||||
|
z = data.rotate[i] - 90
|
||||||
|
}
|
||||||
|
|
||||||
|
let option = {
|
||||||
|
id: id,
|
||||||
|
position,
|
||||||
|
name: model.modelName + i,
|
||||||
|
show: true,
|
||||||
|
scale: { x: 1, y: 1, z: 1 },
|
||||||
|
url: service.value + model.modelDataUrl,
|
||||||
|
maximumScale: 1,
|
||||||
|
// host: 'http://127.0.0.1:8848',
|
||||||
|
rotate: {
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
z
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let Model = await new YJ.Obj.Model(window.earth, option);
|
||||||
|
// //鼠标右键点击事件
|
||||||
|
Model.onRightClick = () => {};
|
||||||
|
(window as any)._entityMap.set(id, Model)
|
||||||
|
})
|
||||||
|
for (let position of data.positions) {
|
||||||
|
let id = ids[index]
|
||||||
if (data.type == '面') {
|
if (data.type == '面') {
|
||||||
z = data.rotate - 90
|
z = data.rotate - 90
|
||||||
} else if (data.type == '线') {
|
} else if (data.type == '线') {
|
||||||
@ -535,9 +565,7 @@ const renderModel = async (data, model) => {
|
|||||||
z
|
z
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let Model = await new YJ.Obj.Model(window.earth, option)
|
await new Promise(resolve => setTimeout(resolve, 50))
|
||||||
;(window as any)._entityMap.set(id, Model)
|
|
||||||
|
|
||||||
let DbOption: any = {
|
let DbOption: any = {
|
||||||
params: option,
|
params: option,
|
||||||
id,
|
id,
|
||||||
@ -550,34 +578,21 @@ const renderModel = async (data, model) => {
|
|||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
let res = await TreeApi.addOtherSource(DbOption)
|
let res = await TreeApi.addOtherSource(DbOption)
|
||||||
if(![0, 200].includes(res.code)) {
|
if (![0, 200].includes(res.code)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ElMessage.closeAll()
|
|
||||||
ElMessage({
|
|
||||||
message: '添加成功',
|
|
||||||
type: 'success'
|
|
||||||
})
|
|
||||||
DbOption.isShow = true
|
DbOption.isShow = true
|
||||||
DbOption.params = JSON.stringify(DbOption.params)
|
DbOption.params = JSON.stringify(DbOption.params)
|
||||||
cusAddNodes(window.treeObj, DbOption.parentId, [DbOption])
|
cusAddNodes(window.treeObj, DbOption.parentId, [DbOption])
|
||||||
// //鼠标右键点击事件
|
index++
|
||||||
Model.onRightClick = () => {}
|
if (index >= data.positions.length - 1) {
|
||||||
|
ElMessage.closeAll()
|
||||||
// window._entityMap.set(option.id, Model);
|
ElMessage({
|
||||||
// Model.onClick = () => {
|
message: '添加成功',
|
||||||
// leftClick(node);
|
type: 'success'
|
||||||
// };
|
})
|
||||||
// let detailOption = JSON.parse(JSON.stringify(Model.options));
|
}
|
||||||
// detailOption.url = model.model_id + ".glb";
|
}
|
||||||
// let node = getNodeData(DbOption, detailOption);
|
|
||||||
// addSource(node).then((res) => {
|
|
||||||
// if ([0, 200].includes(res.code)) {
|
|
||||||
// // cusRenderNode(DbOption) DbOption.p_id
|
|
||||||
// cusAddNodes(this.treeObj, DbOption.p_id, [node]);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -270,6 +270,7 @@ const translate = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const confirm = () => {
|
const confirm = () => {
|
||||||
|
that.positionEditing && (that.positionEditing = false)
|
||||||
originalOptions = structuredClone(that.options)
|
originalOptions = structuredClone(that.options)
|
||||||
baseDialog.value?.close()
|
baseDialog.value?.close()
|
||||||
let params = structuredClone(that.options)
|
let params = structuredClone(that.options)
|
||||||
@ -350,10 +351,8 @@ const changeMaximumParticleLife = (event) => {
|
|||||||
|
|
||||||
const closeCallback = async () => {
|
const closeCallback = async () => {
|
||||||
entityOptions.value.originalOptions = structuredClone(originalOptions)
|
entityOptions.value.originalOptions = structuredClone(originalOptions)
|
||||||
that.positionEditing = false
|
that.positionEditing && (that.positionEditing = false)
|
||||||
that.reset()
|
that.reset()
|
||||||
await YJ.Global.multiViewportMode.syncData(window.earth, that.options.id)
|
|
||||||
await YJ.Global.splitScreen.syncData(window.earth, that.options.id)
|
|
||||||
eventBus?.emit("destroyComponent")
|
eventBus?.emit("destroyComponent")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -25,65 +25,67 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="div-item">
|
<div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<el-tabs v-model="activeName">
|
<el-tabs v-model="activeName">
|
||||||
<el-tab-pane label="属性信息" name="1">
|
<el-tab-pane label="属性信息" name="1">
|
||||||
<attribute :entityOptions="entityOptions"></attribute>
|
<attribute :entityOptions="entityOptions"></attribute>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="空间信息" name="2">
|
<el-tab-pane label="空间信息" name="2">
|
||||||
<div class="row">
|
<div class="div-item">
|
||||||
<div class="col height-mode-box">
|
<div class="row">
|
||||||
<span class="label" style="flex: 0 0 56px;">高度模式</span>
|
<div class="col height-mode-box">
|
||||||
<el-select class="input input-select height-mode-scelect" style="width: 155px;margin-left: 20px"
|
<span class="label" style="flex: 0 0 56px;">高度模式</span>
|
||||||
v-model="heightMode" @change="heightModeChange" placeholder="请选择">
|
<el-select class="input input-select height-mode-scelect" style="width: 155px;margin-left: 20px"
|
||||||
<el-option v-for="item in heightModeData" :key="item.key" :label="item.name" :value="item.key">
|
v-model="heightMode" @change="heightModeChange" placeholder="请选择">
|
||||||
</el-option>
|
<el-option v-for="item in heightModeData" :key="item.key" :label="item.name" :value="item.key">
|
||||||
</el-select>
|
</el-option>
|
||||||
</div>
|
</el-select>
|
||||||
<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>
|
</div>
|
||||||
<button class="confirm height-confirm" style="margin-left: 5px;" @click="heightConfirm"
|
<div class="col">
|
||||||
:disabled="heightMode == 2">应用</button>
|
<span class="label">Z值统一增加</span>
|
||||||
</div>
|
<div class="input-number input-number-unit-1 height-box" :class="{ 'disabled': heightMode == 2 }">
|
||||||
</div>
|
<input class="input height" type="number" title="" min="-9999999" max="999999999" v-model="height"
|
||||||
<div class="row">
|
@input="$handleInputLimit" />
|
||||||
<div class="table spatial-info-table">
|
<span class="unit">m</span>
|
||||||
<div class="table-head">
|
<span class="arrow"></span>
|
||||||
<div class="tr">
|
|
||||||
<div class="th"></div>
|
|
||||||
<div class="th">经度(X)</div>
|
|
||||||
<div class="th">纬度(Y)</div>
|
|
||||||
<div class="th">高度(Z)</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<button class="confirm height-confirm" style="margin-left: 5px;" @click="heightConfirm"
|
||||||
|
:disabled="heightMode == 2">应用</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-body">
|
</div>
|
||||||
<div class="tr" v-for="(item, i) in entityOptions.options.positions" :key="i">
|
<div class="row">
|
||||||
<div class="td">{{ i + 1 }}</div>
|
<div class="table spatial-info-table">
|
||||||
<div class="td lng align-center" @dblclick="inputDblclick($event, i, 'lng')">
|
<div class="table-head">
|
||||||
<input class="input" @blur="inputBlurCallBack($event, i, 'lng', 8)" type="number"
|
<div class="tr">
|
||||||
v-model="item.lng" min="-180" max="180" v-if="activeTd.index == i && activeTd.name == 'lng'"
|
<div class="th"></div>
|
||||||
@input="$handleInputLimit" />
|
<div class="th">经度(X)</div>
|
||||||
<span style="pointer-events: none;" v-else>{{ (item.lng).toFixed(8) }}</span>
|
<div class="th">纬度(Y)</div>
|
||||||
|
<div class="th">高度(Z)</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="td lat align-center" @dblclick="inputDblclick($event, i, 'lat')">
|
</div>
|
||||||
<input class="input" @blur="inputBlurCallBack($event, i, 'lat', 8)" type="number"
|
<div class="table-body">
|
||||||
v-model="item.lat" min="-180" max="180" v-if="activeTd.index == i && activeTd.name == 'lat'"
|
<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">
|
@input="$handleInputLimit">
|
||||||
<span style="pointer-events: none;" v-else>{{ (item.lat).toFixed(8) }}</span>
|
<input class="input" @blur="inputBlurCallBack($event, i, 'alt', 2)" type="number"
|
||||||
</div>
|
v-model="entityOptions.height" min="-9999999" max="999999999"
|
||||||
<div class="td alt align-center" @dblclick="inputDblclick($event, i, 'alt')"
|
v-if="activeTd.index == i && activeTd.name == 'alt'">
|
||||||
@input="$handleInputLimit">
|
<span style="pointer-events: none;" v-else>{{ (entityOptions.height).toFixed(2) }}</span>
|
||||||
<input class="input" @blur="inputBlurCallBack($event, i, 'alt', 2)" type="number"
|
</div>
|
||||||
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>
|
||||||
</div>
|
</div>
|
||||||
@ -91,22 +93,24 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="面风格" name="3">
|
<el-tab-pane label="面风格" name="3">
|
||||||
<div class="row">
|
<div class="div-item">
|
||||||
<div class="col">
|
<div class="row">
|
||||||
<span class="label">面颜色</span>
|
<div class="col">
|
||||||
<div class="color" ref="colorRef"></div>
|
<span class="label">面颜色</span>
|
||||||
</div>
|
<div class="color" ref="colorRef"></div>
|
||||||
<div class="col">
|
</div>
|
||||||
<span class="label">描边颜色</span>
|
<div class="col">
|
||||||
<div class="lineColor" ref="lineColorRef"></div>
|
<span class="label">描边颜色</span>
|
||||||
</div>
|
<div class="lineColor" ref="lineColorRef"></div>
|
||||||
<div class="col">
|
</div>
|
||||||
<span class="label">描边宽度</span>
|
<div class="col">
|
||||||
<div class="input-number input-number-unit-2">
|
<span class="label">描边宽度</span>
|
||||||
<input class="input" type="number" title="" min="0" max="99" v-model="entityOptions.lineWidth"
|
<div class="input-number input-number-unit-2">
|
||||||
@input="$handleInputLimit">
|
<input class="input" type="number" title="" min="0" max="99" v-model="entityOptions.lineWidth"
|
||||||
<span class="unit">px</span>
|
@input="$handleInputLimit">
|
||||||
<span class="arrow"></span>
|
<span class="unit">px</span>
|
||||||
|
<span class="arrow"></span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</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(() => {
|
that.openPositionEditing(() => {
|
||||||
entityOptions.value.options.positions = structuredClone(that.options.positions)
|
entityOptions.value.options.positions = structuredClone(that.options.positions)
|
||||||
})
|
})
|
||||||
@ -314,7 +320,7 @@ const closeCallback = () => {
|
|||||||
|
|
||||||
const nodeEdit = () => {
|
const nodeEdit = () => {
|
||||||
that.nodeEdit((e, positions, areaByMeter) => {
|
that.nodeEdit((e, positions, areaByMeter) => {
|
||||||
if(positions) {
|
if (positions) {
|
||||||
entityOptions.value.options.positions = structuredClone(positions)
|
entityOptions.value.options.positions = structuredClone(positions)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -70,13 +70,13 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<span class="label">线段缓冲</span>
|
<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>
|
||||||
<div class="col" style="flex: 0 0 33%">
|
<div class="col" style="flex: 0 0 33%">
|
||||||
<span class="label">缓冲宽度</span>
|
<span class="label">缓冲宽度</span>
|
||||||
<div class="input-number input-number-unit-1" style="width: 80px">
|
<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 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="unit">m</span>
|
||||||
<span class="arrow"></span>
|
<span class="arrow"></span>
|
||||||
</div>
|
</div>
|
||||||
@ -337,6 +337,8 @@ const colorRef = ref(null)
|
|||||||
const extendColorRef = ref(null)
|
const extendColorRef = ref(null)
|
||||||
const heightMode = ref(0)
|
const heightMode = ref(0)
|
||||||
const wordsName = ref(0)
|
const wordsName = ref(0)
|
||||||
|
const extend = ref(false)
|
||||||
|
const extendWidth = ref(0)
|
||||||
|
|
||||||
let originalOptions: any
|
let originalOptions: any
|
||||||
let that: any
|
let that: any
|
||||||
@ -346,6 +348,7 @@ const open = async (id: any, type) => {
|
|||||||
sourceType.value = type
|
sourceType.value = type
|
||||||
originalOptions = structuredClone(that.options)
|
originalOptions = structuredClone(that.options)
|
||||||
entityOptions.value = that
|
entityOptions.value = that
|
||||||
|
extendWidth.value = that.extendWidth
|
||||||
heightMode.value = entityOptions.value.heightMode
|
heightMode.value = entityOptions.value.heightMode
|
||||||
wordsName.value = Number(entityOptions.value.wordsName)
|
wordsName.value = Number(entityOptions.value.wordsName)
|
||||||
length.value = entityOptions.value.lengthByMeter
|
length.value = entityOptions.value.lengthByMeter
|
||||||
@ -358,6 +361,7 @@ const open = async (id: any, type) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
heightModeChange(heightMode.value)
|
heightModeChange(heightMode.value)
|
||||||
|
extend.value = that.extend
|
||||||
baseDialog.value?.open()
|
baseDialog.value?.open()
|
||||||
|
|
||||||
await nextTick()
|
await nextTick()
|
||||||
@ -390,8 +394,13 @@ const open = async (id: any, type) => {
|
|||||||
} //点击清空按钮事件回调
|
} //点击清空按钮事件回调
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const extendWidthchange = (val) => {
|
||||||
|
that.extendWidth = extendWidth.value
|
||||||
|
}
|
||||||
|
|
||||||
const heightModeChange = (val) => {
|
const heightModeChange = (val) => {
|
||||||
that.heightMode = heightMode.value
|
that.heightMode = heightMode.value
|
||||||
|
extend.value = false
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (heightMode.value === 0 || heightMode.value === '0' || heightMode.value === 1 || heightMode.value === '1') {
|
if (heightMode.value === 0 || heightMode.value === '0' || heightMode.value === 1 || heightMode.value === '1') {
|
||||||
entityOptions.value.extend = false
|
entityOptions.value.extend = false
|
||||||
@ -439,6 +448,7 @@ const lineExtendchange = (e) => {
|
|||||||
if (e.target.checked) {
|
if (e.target.checked) {
|
||||||
heightMode.value = 2
|
heightMode.value = 2
|
||||||
}
|
}
|
||||||
|
that.extend = extend.value
|
||||||
}
|
}
|
||||||
const nodeEdit = () => {
|
const nodeEdit = () => {
|
||||||
entityOptions.value.positionEditing = false
|
entityOptions.value.positionEditing = false
|
||||||
@ -454,7 +464,9 @@ const nodeEdit = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const translate = () => {
|
const translate = async () => {
|
||||||
|
entityOptions.value.closeNodeEdit()
|
||||||
|
await nextTick()
|
||||||
that.openPositionEditing(() => {
|
that.openPositionEditing(() => {
|
||||||
entityOptions.value.options.positions = structuredClone(that.options.positions)
|
entityOptions.value.options.positions = structuredClone(that.options.positions)
|
||||||
if (lengthUnit.value == 'km') {
|
if (lengthUnit.value == 'km') {
|
||||||
|
|||||||
@ -146,7 +146,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<span class="label">轨迹动画</span>
|
<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>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -156,7 +156,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col" style="margin-right: 33px;">
|
<div class="col" style="margin-right: 33px;">
|
||||||
<span class="label">视角跟随</span>
|
<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>
|
||||||
<div class="col" style="margin: 0px;">
|
<div class="col" style="margin: 0px;">
|
||||||
<span class="label">模型动画</span>
|
<span class="label">模型动画</span>
|
||||||
@ -411,6 +411,13 @@ const changeFirstPersonView = (state) => {
|
|||||||
entityOptions.value.firstPersonView = state
|
entityOptions.value.firstPersonView = state
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const changeState = () => {
|
||||||
|
modelRotateState.value && (modelRotateState.value = that.modelRotate())
|
||||||
|
}
|
||||||
|
const changeViewFollow = () => {
|
||||||
|
modelRotateState.value && (modelRotateState.value = that.modelRotate())
|
||||||
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
open,
|
open,
|
||||||
close
|
close
|
||||||
|
|||||||
@ -1,137 +1,132 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from 'three'
|
||||||
//导入轨道控制器
|
//导入轨道控制器
|
||||||
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls";
|
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'
|
||||||
//导入GLTF模型加载器
|
//导入GLTF模型加载器
|
||||||
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader";
|
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader'
|
||||||
|
|
||||||
class viewGlb {
|
class viewGlb {
|
||||||
constructor(selector) {
|
constructor(selector) {
|
||||||
this.canvasWidth = 900;
|
this.canvasWidth = 900
|
||||||
this.canvasHeight = 650;
|
this.canvasHeight = 650
|
||||||
this.container = document.querySelector(selector); //获取容器
|
this.container = document.querySelector(selector) //获取容器
|
||||||
this.modelInfo = {};
|
this.modelInfo = {}
|
||||||
this.scene = null;
|
this.scene = null
|
||||||
this.camera = null;
|
this.camera = null
|
||||||
this.renderer = null;
|
this.renderer = null
|
||||||
this.controls = null;
|
this.controls = null
|
||||||
this.init(); //初始化
|
this.init() //初始化
|
||||||
this.animate(); //循环函数
|
this.animate() //循环函数
|
||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
// 初始化场景
|
// 初始化场景
|
||||||
this.initScene();
|
this.initScene()
|
||||||
// 初始化辅助轴
|
// 初始化辅助轴
|
||||||
this.initAxesHelper();
|
this.initAxesHelper()
|
||||||
// 初始化灯光
|
// 初始化灯光
|
||||||
this.initLight();
|
this.initLight()
|
||||||
// 初始化相机
|
// 初始化相机
|
||||||
this.initCamera();
|
this.initCamera()
|
||||||
// 初始化渲染器
|
// 初始化渲染器
|
||||||
this.initRender();
|
this.initRender()
|
||||||
// 初始化轨道控制器
|
// 初始化轨道控制器
|
||||||
this.initControls();
|
this.initControls()
|
||||||
// 监听场景大小改变,重新渲染尺寸
|
// 监听场景大小改变,重新渲染尺寸
|
||||||
window.addEventListener("resize", this.onWindowResize.bind(this));
|
window.addEventListener('resize', this.onWindowResize.bind(this))
|
||||||
// this.addGLTFModel()
|
// this.addGLTFModel()
|
||||||
}
|
}
|
||||||
|
|
||||||
initScene() {
|
initScene() {
|
||||||
this.scene = new THREE.Scene();
|
this.scene = new THREE.Scene()
|
||||||
// this.scene.background = new THREE.Color(0xffffff)
|
// this.scene.background = new THREE.Color(0xffffff)
|
||||||
}
|
}
|
||||||
|
|
||||||
initAxesHelper() {
|
initAxesHelper() {
|
||||||
const axesHelper = new THREE.AxesHelper(5);
|
const axesHelper = new THREE.AxesHelper(5)
|
||||||
this.scene.add(axesHelper);
|
this.scene.add(axesHelper)
|
||||||
}
|
}
|
||||||
|
|
||||||
initLight() {
|
initLight() {
|
||||||
const hesLight = new THREE.HemisphereLight(0xffffff, 0x444444);
|
const hesLight = new THREE.HemisphereLight(0xffffff, 0x444444)
|
||||||
hesLight.intensity = 0.6;
|
hesLight.intensity = 0.6
|
||||||
this.scene.add(hesLight);
|
this.scene.add(hesLight)
|
||||||
|
|
||||||
const dirLight = new THREE.DirectionalLight();
|
const dirLight = new THREE.DirectionalLight()
|
||||||
dirLight.position.set(5, 5, 5);
|
dirLight.position.set(5, 5, 5)
|
||||||
this.scene.add(dirLight);
|
this.scene.add(dirLight)
|
||||||
}
|
}
|
||||||
|
|
||||||
initCamera() {
|
initCamera() {
|
||||||
this.camera = new THREE.PerspectiveCamera(
|
this.camera = new THREE.PerspectiveCamera(75, this.canvasWidth / this.canvasHeight, 0.1, 100)
|
||||||
75,
|
|
||||||
this.canvasWidth / this.canvasHeight,
|
|
||||||
0.1,
|
|
||||||
100
|
|
||||||
);
|
|
||||||
// this.camera.position.set(1.5, 1.5, 1.5)
|
// this.camera.position.set(1.5, 1.5, 1.5)
|
||||||
this.camera.position.set(2, 2, 2);
|
this.camera.position.set(2, 2, 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
initRender() {
|
initRender() {
|
||||||
this.renderer = new THREE.WebGLRenderer({
|
this.renderer = new THREE.WebGLRenderer({
|
||||||
antialias: true,
|
antialias: true,
|
||||||
alpha: true,
|
alpha: true
|
||||||
// preserveDrawingBuffer: true
|
// preserveDrawingBuffer: true
|
||||||
}); //设置抗锯齿
|
}) //设置抗锯齿
|
||||||
//设置屏幕像素比
|
//设置屏幕像素比
|
||||||
this.renderer.setPixelRatio(window.devicePixelRatio);
|
this.renderer.setPixelRatio(window.devicePixelRatio)
|
||||||
//渲染的尺寸大小
|
//渲染的尺寸大小
|
||||||
this.renderer.setSize(this.canvasWidth, this.canvasHeight);
|
this.renderer.setSize(this.canvasWidth, this.canvasHeight)
|
||||||
//gltf格式模型纹理贴图
|
//gltf格式模型纹理贴图
|
||||||
this.renderer.outputEncoding = THREE.sRGBEncoding;
|
this.renderer.outputEncoding = THREE.sRGBEncoding
|
||||||
// 设置背景颜色
|
// 设置背景颜色
|
||||||
this.renderer.setClearColor(0x000000, 0);
|
this.renderer.setClearColor(0x000000, 0)
|
||||||
// 添加到容器
|
// 添加到容器
|
||||||
this.container.appendChild(this.renderer.domElement);
|
this.container.appendChild(this.renderer.domElement)
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
this.renderer.render(this.scene, this.camera);
|
this.renderer.render(this.scene, this.camera)
|
||||||
}
|
}
|
||||||
|
|
||||||
animate() {
|
animate() {
|
||||||
this.renderer.setAnimationLoop(this.render.bind(this));
|
this.renderer.setAnimationLoop(this.render.bind(this))
|
||||||
}
|
}
|
||||||
|
|
||||||
initControls() {
|
initControls() {
|
||||||
this.controls = new OrbitControls(this.camera, this.renderer.domElement);
|
this.controls = new OrbitControls(this.camera, this.renderer.domElement)
|
||||||
}
|
}
|
||||||
|
|
||||||
onWindowResize() {
|
onWindowResize() {
|
||||||
this.camera.aspect = this.canvasWidth / this.canvasHeight;
|
this.camera.aspect = this.canvasWidth / this.canvasHeight
|
||||||
this.camera.updateProjectionMatrix(); //更新矩阵,将3d内容投射到2d画面上转换
|
this.camera.updateProjectionMatrix() //更新矩阵,将3d内容投射到2d画面上转换
|
||||||
this.renderer.setSize(this.canvasWidth, this.canvasHeight);
|
this.renderer.setSize(this.canvasWidth, this.canvasHeight)
|
||||||
}
|
}
|
||||||
|
|
||||||
addGLTFModel(obj) {
|
addGLTFModel(obj) {
|
||||||
this.modelInfo = obj;
|
this.modelInfo = obj
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const loader = new GLTFLoader(); //.setPath('3dModels/')
|
const loader = new GLTFLoader() //.setPath('3dModels/')
|
||||||
loader.load(obj.model_url, (gltf) => {
|
loader.load(obj.model_url, (gltf) => {
|
||||||
console.log(gltf);
|
console.log(gltf)
|
||||||
this.scene.add(gltf.scene);
|
this.scene.add(gltf.scene)
|
||||||
resolve("模型添加成功");
|
resolve('模型添加成功')
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
canvasToBase(cb) {
|
canvasToBase(cb) {
|
||||||
this.renderer.render(this.scene, this.camera);
|
this.renderer.render(this.scene, this.camera)
|
||||||
let imgData = this.renderer.domElement.toDataURL("image/png");
|
let imgData = this.renderer.domElement.toDataURL('image/png')
|
||||||
console.log(imgData);
|
console.log(imgData)
|
||||||
let base64 = imgData.replace(/^data:image\/\w+;base64,/, "");
|
let base64 = imgData.replace(/^data:image\/\w+;base64,/, '')
|
||||||
let dataBuffer = new Buffer(base64, "base64");
|
let dataBuffer = new Buffer(base64, 'base64')
|
||||||
base64ToFile(base64, "image/png", "poster.png");
|
base64ToFile(base64, 'image/png', 'poster.png')
|
||||||
console.log(process.cwd());
|
console.log(process.cwd())
|
||||||
$root_home_index.$sendElectronChanel("newDir", {
|
$root_home_index.$sendElectronChanel('newDir', {
|
||||||
name: this.modelInfo.model_name,
|
name: this.modelInfo.model_name,
|
||||||
paths: [process.cwd(), "model_thumb"],
|
paths: [process.cwd(), 'model_thumb'],
|
||||||
buffer: dataBuffer,
|
buffer: dataBuffer
|
||||||
});
|
})
|
||||||
$root_home_index.$recvElectronChanel("newDirRes", (e, res) => {
|
$root_home_index.$recvElectronChanel('newDirRes', (e, res) => {
|
||||||
// $root_home_index.$message.info(res)
|
// $root_home_index.$message.info(res)
|
||||||
cb(res);
|
cb(res)
|
||||||
});
|
})
|
||||||
|
|
||||||
/*;*/
|
/*;*/
|
||||||
}
|
}
|
||||||
@ -139,33 +134,33 @@ class viewGlb {
|
|||||||
clearScene() {
|
clearScene() {
|
||||||
this.scene.traverse((child) => {
|
this.scene.traverse((child) => {
|
||||||
if (child.material) {
|
if (child.material) {
|
||||||
child.material.dispose();
|
child.material.dispose()
|
||||||
}
|
}
|
||||||
if (child.geometry) {
|
if (child.geometry) {
|
||||||
child.geometry.dispose();
|
child.geometry.dispose()
|
||||||
}
|
}
|
||||||
child = null;
|
child = null
|
||||||
});
|
})
|
||||||
this.container.childNodes[1].remove();
|
this.container.childNodes[1].remove()
|
||||||
this.renderer.forceContextLoss();
|
this.renderer.forceContextLoss()
|
||||||
this.renderer.dispose();
|
this.renderer.dispose()
|
||||||
this.scene.clear();
|
this.scene.clear()
|
||||||
this.modelInfo = {};
|
this.modelInfo = {}
|
||||||
this.scene = null;
|
this.scene = null
|
||||||
this.camera = null;
|
this.camera = null
|
||||||
this.controls = null;
|
this.controls = null
|
||||||
this.renderer.domElement = null;
|
this.renderer.domElement = null
|
||||||
this.renderer = null;
|
this.renderer = null
|
||||||
this.container = null;
|
this.container = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class viewGlbByEarth {
|
class viewGlbByEarth {
|
||||||
constructor(selector) {
|
constructor(selector) {
|
||||||
this.viewer = null;
|
this.viewer = null
|
||||||
this.modelInfo = null;
|
this.modelInfo = null
|
||||||
this.selector = selector;
|
this.selector = selector
|
||||||
this.init(selector);
|
this.init(selector)
|
||||||
}
|
}
|
||||||
|
|
||||||
init(selector) {
|
init(selector) {
|
||||||
@ -177,22 +172,24 @@ class viewGlbByEarth {
|
|||||||
baseLayerPicker: false,
|
baseLayerPicker: false,
|
||||||
sceneModePicker: false,
|
sceneModePicker: false,
|
||||||
animation: false,
|
animation: false,
|
||||||
});
|
fullscreenButton: false, // 禁用全屏按钮
|
||||||
const scene = this.viewer.scene;
|
geocoder: false
|
||||||
|
})
|
||||||
|
const scene = this.viewer.scene
|
||||||
/*this.viewer.scene.screenSpaceCameraController.tiltEventTypes = [
|
/*this.viewer.scene.screenSpaceCameraController.tiltEventTypes = [
|
||||||
Cesium.CameraEventType.PINCH,
|
Cesium.CameraEventType.PINCH,
|
||||||
Cesium.CameraEventType.RIGHT_DRAG,
|
Cesium.CameraEventType.RIGHT_DRAG,
|
||||||
]*/
|
]*/
|
||||||
scene.screenSpaceCameraController.zoomEventTypes = [
|
scene.screenSpaceCameraController.zoomEventTypes = [
|
||||||
Cesium.CameraEventType.WHEEL,
|
Cesium.CameraEventType.WHEEL,
|
||||||
Cesium.CameraEventType.PINCH,
|
Cesium.CameraEventType.PINCH
|
||||||
];
|
]
|
||||||
scene.screenSpaceCameraController.tiltEventTypes = [
|
scene.screenSpaceCameraController.tiltEventTypes = [
|
||||||
Cesium.CameraEventType.PINCH,
|
Cesium.CameraEventType.PINCH,
|
||||||
Cesium.CameraEventType.RIGHT_DRAG,
|
Cesium.CameraEventType.RIGHT_DRAG
|
||||||
];
|
]
|
||||||
this.viewer._cesiumWidget._creditContainer.style.display = "none";
|
this.viewer._cesiumWidget._creditContainer.style.display = 'none'
|
||||||
scene.globe.depthTestAgainstTerrain = true;
|
scene.globe.depthTestAgainstTerrain = true
|
||||||
// scene.globe.show = false;
|
// scene.globe.show = false;
|
||||||
// scene.sun.show = false;
|
// scene.sun.show = false;
|
||||||
// scene.moon.show = false;
|
// scene.moon.show = false;
|
||||||
@ -201,46 +198,45 @@ class viewGlbByEarth {
|
|||||||
}
|
}
|
||||||
|
|
||||||
addGltf(obj) {
|
addGltf(obj) {
|
||||||
this.modelInfo = obj;
|
this.modelInfo = obj
|
||||||
|
|
||||||
const czml = [
|
const czml = [
|
||||||
{
|
{
|
||||||
id: "aircraft model",
|
id: 'aircraft model',
|
||||||
name: "Cesium Air",
|
name: 'Cesium Air',
|
||||||
position: {
|
position: {
|
||||||
cartographicDegrees: [-77, 37, 10000],
|
cartographicDegrees: [-77, 37, 10000]
|
||||||
},
|
},
|
||||||
model: {
|
model: {
|
||||||
gltf: obj.model_url,
|
// gltf: obj.model_url,
|
||||||
|
gltf: obj,
|
||||||
scale: 2.0,
|
scale: 2.0,
|
||||||
minimumPixelSize: 128,
|
minimumPixelSize: 128
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
];
|
]
|
||||||
|
|
||||||
let entity = this.viewer.entities.add({
|
let entity = this.viewer.entities.add({
|
||||||
position: Cesium.Cartesian3.fromRadians(
|
position: Cesium.Cartesian3.fromRadians(106.31593773128115, 29.625102082951624),
|
||||||
106.31593773128115,
|
|
||||||
29.625102082951624
|
|
||||||
),
|
|
||||||
model: {
|
model: {
|
||||||
uri: obj.model_url,
|
// uri: obj.model_url,
|
||||||
},
|
uri: obj
|
||||||
});
|
}
|
||||||
|
})
|
||||||
|
|
||||||
this.viewer.trackedEntity = entity;
|
this.viewer.trackedEntity = entity
|
||||||
}
|
}
|
||||||
|
|
||||||
canvasToBase(cb) {
|
canvasToBase(cb) {
|
||||||
// let imgData = $(`#${this.selector}`).find("canvas")[0].toDataURL("image/png");
|
// let imgData = $(`#${this.selector}`).find("canvas")[0].toDataURL("image/png");
|
||||||
// console.log(imgData)
|
// console.log(imgData)
|
||||||
this.viewer.render();
|
this.viewer.render()
|
||||||
let imgData = this.viewer.scene.canvas.toDataURL("image/png");
|
let imgData = this.viewer.scene.canvas.toDataURL('image/png')
|
||||||
let base64 = imgData.replace(/^data:image\/\w+;base64,/, "");
|
let base64 = imgData.replace(/^data:image\/\w+;base64,/, '')
|
||||||
let dataBuffer = new Buffer(base64, "base64");
|
let dataBuffer = new Buffer(base64, 'base64')
|
||||||
let file = this.base64ToFile(base64, "image/png", "poster.png");
|
let file = this.base64ToFile(base64, 'image/png', 'poster.png')
|
||||||
// console.log("ddddddddddddd", file);
|
// console.log("ddddddddddddd", file);
|
||||||
cb(file);
|
cb(file)
|
||||||
// $root_home_index.$sendElectronChanel("newDir", {
|
// $root_home_index.$sendElectronChanel("newDir", {
|
||||||
// name: this.modelInfo.model_name, //+ "_" + new Date().getTime(),
|
// name: this.modelInfo.model_name, //+ "_" + new Date().getTime(),
|
||||||
// paths: [process.cwd(), "model_thumb"],
|
// paths: [process.cwd(), "model_thumb"],
|
||||||
@ -255,25 +251,25 @@ class viewGlbByEarth {
|
|||||||
}
|
}
|
||||||
base64ToFile(base64, mime, filename) {
|
base64ToFile(base64, mime, filename) {
|
||||||
// let arr = base64.split(",");
|
// let arr = base64.split(",");
|
||||||
let type = mime || arr[0].match(/:(.*?);/)[1];
|
let type = mime || arr[0].match(/:(.*?);/)[1]
|
||||||
// let suffix = mine.split("/")[1];
|
// let suffix = mine.split("/")[1];
|
||||||
// let fileName = filename || `未命名.${suffix}`;
|
// let fileName = filename || `未命名.${suffix}`;
|
||||||
let fileName = filename || `未命名.png`;
|
let fileName = filename || `未命名.png`
|
||||||
let bstr = atob(base64);
|
let bstr = atob(base64)
|
||||||
let n = bstr.length;
|
let n = bstr.length
|
||||||
let u8arr = new Uint8Array(n);
|
let u8arr = new Uint8Array(n)
|
||||||
while (n--) {
|
while (n--) {
|
||||||
u8arr[n] = bstr.charCodeAt(n);
|
u8arr[n] = bstr.charCodeAt(n)
|
||||||
}
|
}
|
||||||
return new File([u8arr], fileName, { type });
|
return new File([u8arr], fileName, { type })
|
||||||
}
|
}
|
||||||
|
|
||||||
clearScene() {
|
clearScene() {
|
||||||
this.viewer.destroy();
|
this.viewer.destroy()
|
||||||
this.viewer = null;
|
this.viewer = null
|
||||||
this.modelInfo = null;
|
this.modelInfo = null
|
||||||
this.selector = "";
|
this.selector = ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export { viewGlb, viewGlbByEarth };
|
export { viewGlb, viewGlbByEarth }
|
||||||
|
|||||||
@ -203,6 +203,7 @@ const open = async (id: any) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
const confirm = () => {
|
const confirm = () => {
|
||||||
|
that.closeNodeEdit()
|
||||||
originalOptions = structuredClone(that.options)
|
originalOptions = structuredClone(that.options)
|
||||||
baseDialog.value?.close()
|
baseDialog.value?.close()
|
||||||
let params = structuredClone(that.options)
|
let params = structuredClone(that.options)
|
||||||
|
|||||||
@ -156,6 +156,7 @@ const open = async (id: any) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
const confirm = () => {
|
const confirm = () => {
|
||||||
|
that.closeNodeEdit()
|
||||||
originalOptions = structuredClone(that.options)
|
originalOptions = structuredClone(that.options)
|
||||||
baseDialog.value?.close()
|
baseDialog.value?.close()
|
||||||
let params = structuredClone(that.options)
|
let params = structuredClone(that.options)
|
||||||
|
|||||||
@ -367,6 +367,19 @@ export const useRightOperate = () => {
|
|||||||
entity.remove();
|
entity.remove();
|
||||||
(window as any)._entityMap.delete(entity.options.id)
|
(window as any)._entityMap.delete(entity.options.id)
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
let entity = (window as any).pressModelEntities.get(item)
|
||||||
|
if (entity) {
|
||||||
|
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);
|
// let node = window.treeObj.getNodeByParam("id", item, null);
|
||||||
eventBus.emit("destroyComponent", item);
|
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")) {
|
|| 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 (
|
if (
|
||||||
!options.richTextContent &&
|
!options.richTextContent &&
|
||||||
!info.hrefs.length &&
|
(!info.hrefs || !info.hrefs.length) &&
|
||||||
!info.vr.length &&
|
(!info.vr || !info.vr.length) &&
|
||||||
!info.rtmp.length &&
|
(!info.rtmp || !info.rtmp.length) &&
|
||||||
!info.goods.length &&
|
(!info.goods || !info.goods.length) &&
|
||||||
!info.camera.length
|
(!info.camera || !info.camera.length)
|
||||||
) {
|
) {
|
||||||
// $root_home.$message.info("该标注标绘无属性信息");
|
// $root_home.$message.info("该标注标绘无属性信息");
|
||||||
ElMessage({
|
ElMessage({
|
||||||
@ -295,6 +295,7 @@ const goodsSelect = async (goods) => {
|
|||||||
if ('id' in allGoodsList[m]) {
|
if ('id' in allGoodsList[m]) {
|
||||||
if (allGoodsList[m].id === goods[i].id) {
|
if (allGoodsList[m].id === goods[i].id) {
|
||||||
flag = true
|
flag = true
|
||||||
|
goods[i].name = allGoodsList[m].name
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
// @ts-nocheck
|
||||||
import {$changeComponentShow} from '@/utils/communication'
|
import {$changeComponentShow} from '@/utils/communication'
|
||||||
import {useTreeNode} from './treeNode'
|
import {useTreeNode} from './treeNode'
|
||||||
import {TreeApi} from '@/api/tree'
|
import {TreeApi} from '@/api/tree'
|
||||||
@ -106,6 +107,9 @@ export const useTree = () => {
|
|||||||
type: 'success'
|
type: 'success'
|
||||||
})
|
})
|
||||||
let params = JSON.parse(treeNode.params)
|
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);
|
YJ.Global.FlyRoam.flyTo((window as any).earth, params.points);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
@ -330,6 +334,7 @@ export const useTree = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
let params = JSON.parse(node.params)
|
||||||
if (node.sourceType === 'tileset') {
|
if (node.sourceType === 'tileset') {
|
||||||
if (node.children && node.children.length > 0) {
|
if (node.children && node.children.length > 0) {
|
||||||
node.children.forEach((item) => {
|
node.children.forEach((item) => {
|
||||||
@ -337,7 +342,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
|
let entityObject
|
||||||
if (node.sourceType == 'pressModel') {
|
if (node.sourceType == 'pressModel') {
|
||||||
let id = node.id + '_' + params.modelId
|
let id = node.id + '_' + params.modelId
|
||||||
@ -359,15 +374,9 @@ export const useTree = () => {
|
|||||||
}
|
}
|
||||||
if (entityObject) {
|
if (entityObject) {
|
||||||
entityObject.show = node.isShow;
|
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 +494,7 @@ export const useTree = () => {
|
|||||||
const onClick = (event: MouseEvent, treeId: string, treeNode: any) => {
|
const onClick = (event: MouseEvent, treeId: string, treeNode: any) => {
|
||||||
console.log('selectNode', treeNode)
|
console.log('selectNode', treeNode)
|
||||||
|
|
||||||
|
$changeComponentShow('.rightMenu', false)
|
||||||
let isShift = event.shiftKey
|
let isShift = event.shiftKey
|
||||||
let isCtrl = event.ctrlKey
|
let isCtrl = event.ctrlKey
|
||||||
if (!isCtrl || !isShift) {
|
if (!isCtrl || !isShift) {
|
||||||
@ -549,16 +559,7 @@ export const useTree = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 树的数据
|
// 树的数据
|
||||||
const zNodes = ref([
|
const zNodes = ref([])
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
parentId: 0,
|
|
||||||
sourceName: '111',
|
|
||||||
isShow: true,
|
|
||||||
sourceType: '',
|
|
||||||
params: ''
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
const getTime = () => {
|
const getTime = () => {
|
||||||
var now = new Date(),
|
var now = new Date(),
|
||||||
@ -692,6 +693,9 @@ export const useTree = () => {
|
|||||||
if ('show' in params) {
|
if ('show' in params) {
|
||||||
params.show = zNodes.value[i].isShow ? true : false
|
params.show = zNodes.value[i].isShow ? true : false
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
params.show = zNodes.value[i].isShow ? true : false
|
||||||
|
}
|
||||||
if (!params.id) {
|
if (!params.id) {
|
||||||
params.id = zNodes.value[i].id
|
params.id = zNodes.value[i].id
|
||||||
}
|
}
|
||||||
@ -706,7 +710,9 @@ export const useTree = () => {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
} else {
|
} 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) => {
|
layers.sort((obj1, obj2) => {
|
||||||
|
|||||||
@ -490,7 +490,7 @@ export const useTreeNode = () => {
|
|||||||
|
|
||||||
// return (type === 'directory' || type === 'FeatureCollection') ? undefined : `http://localhost:${availablePort}/icon/${name}.png`;
|
// return (type === 'directory' || type === 'FeatureCollection') ? undefined : `http://localhost:${availablePort}/icon/${name}.png`;
|
||||||
return (type === 'directory' || type === 'FeatureCollection' || type === 'folder') ? undefined : `
|
return (type === 'directory' || type === 'FeatureCollection' || type === 'folder') ? undefined : `
|
||||||
<svg class="svg-icon" style="color: rgba(var(--color-base2), 1);margin-top: 1px;width:100%;height:100%;fill: currentColor !important;stroke: currentColor !important;stroke-width: ${strokeWidth} !important;shape-rendering: geometricPrecision;">
|
<svg class="svg-icon" style="color: rgba(var(--color-base2), 1);margin-top: 1px;width:100%;height:100%;fill: #fff;stroke: #fff;stroke-width: ${strokeWidth} !important;shape-rendering: geometricPrecision;">
|
||||||
<use xlink:href="#icon-${name}" />
|
<use xlink:href="#icon-${name}" />
|
||||||
</svg>
|
</svg>
|
||||||
`;
|
`;
|
||||||
|
|||||||
@ -262,6 +262,8 @@ import { get } from 'jquery'
|
|||||||
|
|
||||||
const { initTree, rightMenuRef, initTreeCallBack } = useTree()
|
const { initTree, rightMenuRef, initTreeCallBack } = useTree()
|
||||||
|
|
||||||
|
const eventBus: any = inject('bus')
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const isShow = ref(false)
|
const isShow = ref(false)
|
||||||
const select = ref('poi')
|
const select = ref('poi')
|
||||||
@ -570,6 +572,7 @@ const locationChange = () => {
|
|||||||
window.searchPlaceMap.set(id, entity)
|
window.searchPlaceMap.set(id, entity)
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
eventBus?.emit("destroyComponent")
|
||||||
initTree()
|
initTree()
|
||||||
// ipcRenderer.on('renderNode-reply', (event: any, data: any) => {
|
// ipcRenderer.on('renderNode-reply', (event: any, data: any) => {
|
||||||
// initTree()
|
// initTree()
|
||||||
@ -836,7 +839,7 @@ defineExpose({
|
|||||||
// .custom-dropdown2 {
|
// .custom-dropdown2 {
|
||||||
// width: 380px !important;
|
// width: 380px !important;
|
||||||
// }
|
// }
|
||||||
.el-select-dropdown__empty,
|
.custom-dropdown .el-select-dropdown__empty,
|
||||||
.el-select-dropdown__loading {
|
.el-select-dropdown__loading {
|
||||||
margin-top: -150px !important;
|
margin-top: -150px !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -137,6 +137,7 @@ import { getdefaultLabelStyle } from '../components/propertyBox/defaultLabelStyl
|
|||||||
|
|
||||||
import { setEventBus } from './eventBus'
|
import { setEventBus } from './eventBus'
|
||||||
import router from '@renderer/router'
|
import router from '@renderer/router'
|
||||||
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
|
||||||
const { rightMenus } = useRightOperate()
|
const { rightMenus } = useRightOperate()
|
||||||
const firstMenuRef = ref(null)
|
const firstMenuRef = ref(null)
|
||||||
@ -162,8 +163,27 @@ if (!localStorage.getItem('defaultLabelStyle')) {
|
|||||||
}
|
}
|
||||||
//移除天气设置
|
//移除天气设置
|
||||||
localStorage.removeItem('weartherSetting')
|
localStorage.removeItem('weartherSetting')
|
||||||
|
eventBus.on('closeScreenShot', () => {
|
||||||
|
if (currentComponent.value?.__name == 'ScreenShot') {
|
||||||
|
currentComponent.value = undefined
|
||||||
|
}
|
||||||
|
})
|
||||||
eventBus.on('openDialog', async (sourceType: any, id: any) => {
|
eventBus.on('openDialog', async (sourceType: any, id: any) => {
|
||||||
|
if (dynamicComponentRef.value?.name == 'ScreenShotHD') {
|
||||||
|
ElMessageBox.confirm('此操作将会打开新弹窗关闭高清截图功能, 是否继续?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
openOtherDialog(sourceType, id)
|
||||||
|
})
|
||||||
|
.catch(() => {})
|
||||||
|
} else {
|
||||||
|
openOtherDialog(sourceType, id)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const openOtherDialog = async (sourceType: any, id: any) => {
|
||||||
if (dynamicComponentRef.value && dynamicComponentRef.value.close) {
|
if (dynamicComponentRef.value && dynamicComponentRef.value.close) {
|
||||||
dynamicComponentRef.value.close()
|
dynamicComponentRef.value.close()
|
||||||
}
|
}
|
||||||
@ -445,7 +465,7 @@ eventBus.on('openDialog', async (sourceType: any, id: any) => {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
id && dynamicComponentRef.value && (dynamicComponentRef.value.id = id)
|
id && dynamicComponentRef.value && (dynamicComponentRef.value.id = id)
|
||||||
})
|
}
|
||||||
eventBus.on('openSelectImg', (selected, entity) => {
|
eventBus.on('openSelectImg', (selected, entity) => {
|
||||||
// $sendElectronChanel("requireGEMarkerName", {
|
// $sendElectronChanel("requireGEMarkerName", {
|
||||||
// dirName: "GEMarker",
|
// dirName: "GEMarker",
|
||||||
|
|||||||
@ -708,18 +708,21 @@ function importAuth() {
|
|||||||
filters: [{ name: '授权文件', extensions: ['YJ'] }]
|
filters: [{ name: '授权文件', extensions: ['YJ'] }]
|
||||||
}
|
}
|
||||||
$sendElectronChanel('open-directory-dialog', option)
|
$sendElectronChanel('open-directory-dialog', option)
|
||||||
$recvElectronChanel('selectedItem', (e, paths) => {
|
$recvElectronChanel('selectedItem', async (e, paths) => {
|
||||||
console.log(e, paths, 'oopop')
|
let formdata = new FormData()
|
||||||
if (paths.length != 0) {
|
if(!paths[0]) {
|
||||||
let formdata = new FormData()
|
return
|
||||||
formdata.append('filePath', paths[0])
|
}
|
||||||
try {
|
formdata.append('filePath', paths[0])
|
||||||
let res = AuthApi.authImport(formdata)
|
try {
|
||||||
|
let res = await AuthApi.authImport(formdata)
|
||||||
|
if(res.code === 0 || res.code === 200) {
|
||||||
ElMessage.success('文件授权成功')
|
ElMessage.success('文件授权成功')
|
||||||
isAuth.value = false
|
isAuth.value = false
|
||||||
baseDialog.value?.close()
|
baseDialog.value?.close()
|
||||||
} catch (error) {}
|
} else {
|
||||||
}
|
}
|
||||||
|
} catch (error) {}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// setTimeout(() => {
|
// setTimeout(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user