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