bug修复
24
src/renderer/public/sdk/YJEarth.min.js
vendored
BIN
src/renderer/public/sdk/img/material/brick1.jpg
Normal file
|
After Width: | Height: | Size: 220 KiB |
|
Before Width: | Height: | Size: 7.6 MiB |
BIN
src/renderer/public/sdk/img/material/brick2.jpg
Normal file
|
After Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 1.7 MiB |
BIN
src/renderer/public/sdk/img/material/brick3.jpg
Normal file
|
After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 717 KiB |
|
Before Width: | Height: | Size: 5.2 MiB |
@ -1,6 +1,6 @@
|
||||
import theme from "@/utils/theme";
|
||||
import { set } from "date-fns";
|
||||
export const sysChange = async (eventBus, isFirst) => {
|
||||
export const sysChange = async (eventBus, isFirst=false) => {
|
||||
let systemSetting = JSON.parse(localStorage.getItem("systemSetting") || '{}')
|
||||
|
||||
const obj = {
|
||||
|
||||
@ -489,14 +489,14 @@ const flyto = async (e) => {
|
||||
})
|
||||
return
|
||||
}
|
||||
if (window.earthPlaceMap === undefined) {
|
||||
window.earthPlaceMap = new Map()
|
||||
if ((window as any).earthPlaceMap === undefined) {
|
||||
(window as any).earthPlaceMap = new Map()
|
||||
}
|
||||
if (window.earthPlaceMap.size) {
|
||||
window.earthPlaceMap.forEach((item) => {
|
||||
if ((window as any).earthPlaceMap.size) {
|
||||
(window as any).earthPlaceMap.forEach((item) => {
|
||||
item.remove()
|
||||
})
|
||||
window.earthPlaceMap.clear()
|
||||
(window as any).earthPlaceMap.clear()
|
||||
}
|
||||
new YJ.Global.flyTo(window.earth, {
|
||||
position: { lng: pointPosi.lng, lat: pointPosi.lat, alt: pointPosi.alt + 300 }
|
||||
|
||||
@ -90,9 +90,10 @@
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="label">模型方向</span>
|
||||
<button class="btn model-rotate-btn" style="margin-right: 12px;" @click="modelRotate">开始调整</button>
|
||||
<el-tooltip content="场景正东方向为轨迹前进正方向" effect="customized" placement="top"
|
||||
:hide-after="0">
|
||||
<button class="btn model-rotate-btn" style="margin-right: 12px;" @click="modelRotate">
|
||||
{{ modelRotateState ? '结束调整' : '开始调整' }}
|
||||
</button>
|
||||
<el-tooltip content="场景正东方向为轨迹前进正方向" effect="customized" placement="top" :hide-after="0">
|
||||
<svg class="icon-rubric">
|
||||
<use xlink:href="#yj-icon-rubric"></use>
|
||||
</svg>
|
||||
@ -160,15 +161,11 @@
|
||||
<div class="col" style="margin: 0px;">
|
||||
<span class="label">模型动画</span>
|
||||
<div class="input input-select model-animate-select"></div>
|
||||
<el-select class="model-animate-select" v-model="entityOptions.modelAnimate"
|
||||
v-if="entityOptions.model && entityOptions.model.loader && entityOptions.model.loader.components && entityOptions.model.loader.components.animations">
|
||||
<el-option label="无"></el-option>
|
||||
<el-option v-for="item in entityOptions.model.loader.components.animations" :label="item.name"
|
||||
<el-select class="model-animate-select" v-model="entityOptions.modelAnimate">
|
||||
<el-option label="无" value="无"></el-option>
|
||||
<el-option v-for="item in animationsList" :label="item.name"
|
||||
:value="item.name"></el-option>
|
||||
</el-select>
|
||||
<el-select class="model-animate-select" v-model="entityOptions.modelAnimate" v-else>
|
||||
<el-option label="无"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -257,6 +254,8 @@ const text = ref('')
|
||||
const activeName = ref('1')
|
||||
const fontList = ref(getFontList())
|
||||
const labelColorRef = ref(null)
|
||||
const animationsList:any = ref([])
|
||||
const modelRotateState = ref(false)
|
||||
eventBus.on('openStandTextAdd', () => {
|
||||
baseDialog.value?.open()
|
||||
})
|
||||
@ -273,6 +272,22 @@ const open = async (id: any) => {
|
||||
that = window.earth.entityMap.get(id)
|
||||
originalOptions = structuredClone(that.options)
|
||||
entityOptions.value = that
|
||||
if (Number(window.Cesium.VERSION.split('.')[1]) >= 107) {
|
||||
if (entityOptions.value.model.ready) {
|
||||
getAnimationsList()
|
||||
}
|
||||
else {
|
||||
entityOptions.value.model.readyEvent.addEventListener(() => {
|
||||
getAnimationsList()
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
entityOptions.value.model.readyPromise.then((entity) => {
|
||||
getAnimationsList()
|
||||
})
|
||||
}
|
||||
baseDialog.value?.open()
|
||||
await nextTick()
|
||||
let labelColorPicker = new (window as any).YJColorPicker({
|
||||
@ -341,19 +356,51 @@ const remove = () => {
|
||||
})
|
||||
}
|
||||
const clickChangeModel = () => {
|
||||
eventBus.emit('openModel', true, (url) => {
|
||||
that.changeModelUrl(url)
|
||||
eventBus.emit('openModel', true, async (url) => {
|
||||
await that.changeModelUrl(url)
|
||||
if (Number(window.Cesium.VERSION.split('.')[1]) >= 107) {
|
||||
if (entityOptions.value.model.ready) {
|
||||
getAnimationsList()
|
||||
}
|
||||
else {
|
||||
entityOptions.value.model.readyEvent.addEventListener(() => {
|
||||
getAnimationsList()
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
entityOptions.value.model.readyPromise.then((entity) => {
|
||||
getAnimationsList()
|
||||
})
|
||||
}
|
||||
if (Number(window.Cesium.VERSION.split('.')[1]) >= 107) {
|
||||
that.model.readyEvent.addEventListener(() => {
|
||||
getAnimationsList()
|
||||
})
|
||||
}
|
||||
else {
|
||||
that.model.readyPromise.then((entity) => {
|
||||
getAnimationsList()
|
||||
})
|
||||
}
|
||||
}, 'trajectoryMotion')
|
||||
}
|
||||
|
||||
const getAnimationsList = () => {
|
||||
entityOptions.value.modelAnimate = entityOptions.value.modelAnimate
|
||||
animationsList.value = entityOptions.value.model.loader.components.animations
|
||||
}
|
||||
const modelRotate = () => {
|
||||
entityOptions.value.viewFollow = false
|
||||
entityOptions.value.state = false
|
||||
that.modelRotate()
|
||||
modelRotateState.value = that.modelRotate()
|
||||
}
|
||||
const movementRotate = () => {
|
||||
that.reverse = !that.reverse
|
||||
}
|
||||
const changeFirstPersonView = (state) => {
|
||||
if(state && YJ.Global.multiViewportMode.get2DView()) {
|
||||
if (state && YJ.Global.multiViewportMode.get2DView()) {
|
||||
ElMessage.closeAll()
|
||||
ElMessage({
|
||||
message: '请先关闭二三维模式!',
|
||||
|
||||
@ -158,19 +158,19 @@ const material = ref([
|
||||
name: '红砖墙',
|
||||
value: '红砖墙',
|
||||
key: 1,
|
||||
icon: './sdk/img/material/brick1.png'
|
||||
icon: './sdk/img/material/brick1.jpg'
|
||||
},
|
||||
{
|
||||
name: '黄砖墙',
|
||||
value: '黄砖墙',
|
||||
key: 2,
|
||||
icon: './sdk/img/material/brick2.png'
|
||||
icon: './sdk/img/material/brick2.jpg'
|
||||
},
|
||||
{
|
||||
name: '灰瓷墙',
|
||||
value: '灰瓷墙',
|
||||
key: 3,
|
||||
icon: './sdk/img/material/brick3.png'
|
||||
icon: './sdk/img/material/brick3.jpg'
|
||||
}
|
||||
])
|
||||
eventBus.on("openStandTextAdd", () => {
|
||||
|
||||
@ -474,7 +474,7 @@ eventBus.on('destroyComponent', (id) => {
|
||||
}
|
||||
})
|
||||
|
||||
utilsSysChange(eventBus, 'first')
|
||||
utilsSysChange(eventBus, true)
|
||||
|
||||
const createEarth = async () => {
|
||||
window.earth = await new YJ.YJEarth('earthContainer')
|
||||
|
||||