Merge branch 'zyl' of http://xny.yj-3d.com:3000/zhouyulong/electron-4 into zyl
8
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 |
@ -50,6 +50,7 @@ window.newFuzzySearch = function (
|
||||
allNodes = res
|
||||
return allNodes
|
||||
}
|
||||
|
||||
/*let allNodes = zTreeObj.transformToArray(nodes);
|
||||
let nodeChildren = getCustomNodes(allNodes)*/
|
||||
// console.log("nodeChildren", nodeChildren)
|
||||
@ -97,6 +98,7 @@ window.newFuzzySearch = function (
|
||||
return str
|
||||
})
|
||||
item.title = item.oldname.replace(F, function (h) {
|
||||
// console.log("h", F, h)
|
||||
let str = h
|
||||
return str
|
||||
})
|
||||
|
||||
@ -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 = {
|
||||
|
||||
@ -100,7 +100,7 @@ const searchPlace = debounce(function () {
|
||||
}
|
||||
// poiOptions.value = []
|
||||
// value.value = ''
|
||||
;(window as any).treeSearchCb(searchKey.value)
|
||||
(window as any).treeSearchCb(searchKey.value)
|
||||
}, 500)
|
||||
const initTreeCallBack = () => {
|
||||
TsApi.queryTsSource(formData).then(async res => {
|
||||
@ -415,7 +415,8 @@ let rightClick = (event: MouseEvent, treeId: string, treeNode: any) => {
|
||||
cusSelectNode(treeObj.value, treeNode)
|
||||
let menus = showRightMenuTs(event, treeObj.value, getSelectedNodes(treeObj.value), nodeType)
|
||||
// console.log("menus", menus)
|
||||
if (treeNode && canCheckType.includes(treeNode.sourceType) && treeNode.sourceType != 'directory') {
|
||||
// canCheckType.includes(treeNode.sourceType) 包含的类型才有视角
|
||||
if (treeNode && treeNode.sourceType != 'directory') {
|
||||
let customView
|
||||
let entity = window['_entityMap'].get(treeNode.id)
|
||||
customView = Boolean(entity.customView && entity.customView.orientation)
|
||||
@ -457,6 +458,7 @@ const setting = {
|
||||
//zdatas数据中表示节点name的属性key
|
||||
name: "sourceName",
|
||||
checked: "isShow",
|
||||
title: "title"
|
||||
},
|
||||
simpleData: {
|
||||
enable: true,
|
||||
|
||||
@ -99,6 +99,10 @@ const menus = ref([
|
||||
window['_entityMap'].delete(entityId)
|
||||
}
|
||||
break;
|
||||
case 'flicker':
|
||||
let entitys = window['_entityMap'].get(rightClickEvent.value.sourceId)
|
||||
entitys && entitys.flicker(1, 1)
|
||||
break
|
||||
}
|
||||
ElMessage({message: "操作成功", type: "success"})
|
||||
rightClickEvent.value = null
|
||||
@ -195,6 +199,9 @@ eventBus.on('click-event-show-plane', (params) => {
|
||||
eventBus.on("click-cancel-hide-plane", () => {
|
||||
eventObj.value = null
|
||||
})
|
||||
eventBus.on("hide-right-menu", () => {
|
||||
hideRightMenu({target: {innerHTML: "sss"}})
|
||||
})
|
||||
onMounted(() => {
|
||||
/* let doms = document.getElementsByClassName("start_time")
|
||||
for (let i = 0; i < doms.length; i++) {
|
||||
|
||||
@ -269,8 +269,24 @@ export const useRightOperate = () => {
|
||||
key: 'resetView',
|
||||
icon: 'resetView',
|
||||
callback: resetView
|
||||
},
|
||||
'layerRaise': {
|
||||
key: 'layerRaise',
|
||||
icon: 'layerRaise',
|
||||
},
|
||||
'layerLower': {
|
||||
key: 'layerLower',
|
||||
icon: 'layerLower',
|
||||
},
|
||||
'layerToTop': {
|
||||
key: 'layerToTop',
|
||||
icon: 'layerToTop',
|
||||
},
|
||||
'layerToBottom': {
|
||||
key: 'layerToBottom',
|
||||
icon: 'layerToBottom',
|
||||
}
|
||||
|
||||
// {}
|
||||
})
|
||||
return {
|
||||
rightMenus, delNode, addEvent
|
||||
|
||||
@ -104,6 +104,7 @@ import {ElMessage, ElPopover} from 'element-plus'; // 确保导入ElPopover(
|
||||
// import {dragElement} from "./util/drag.js";
|
||||
import dragLeftRight from './util/dragLeftRight.js';
|
||||
import {TsApi} from "../../api/ts";
|
||||
import {$changeComponentShow} from "../../utils/communication";
|
||||
|
||||
const props = defineProps(['TSOBJ'])
|
||||
console.log(props.TSOBJ)
|
||||
@ -155,7 +156,7 @@ const propsMap = {
|
||||
}
|
||||
// 更新数值触发视图更新
|
||||
window['updateProp'] = (key: string, val: any) => {
|
||||
console.log("window['updateProp']", key, val)
|
||||
// console.log("window['updateProp']", key, val)
|
||||
if (propsMap[key])
|
||||
propsMap[key].value = val
|
||||
if (key == 'currentStamp') {
|
||||
@ -190,13 +191,17 @@ let formatTime = (timeStamp) => {
|
||||
return props.TSOBJ.parseTime(timeStamp)
|
||||
}
|
||||
let play = () => {
|
||||
console.log("播放播放")
|
||||
props.TSOBJ._Clock._status = "play"
|
||||
console.log(props.TSOBJ._Clock._status)
|
||||
// return
|
||||
props.TSOBJ._Clock.animation(props.TSOBJ._Store, eventCallback)
|
||||
pauseTrajectoryMotion()
|
||||
}
|
||||
let stopCallBack = (status) => {
|
||||
|
||||
props.TSOBJ._Clock._status = status
|
||||
console.log(status)
|
||||
// return
|
||||
props.TSOBJ._Clock.stopAnimation()
|
||||
// 暂停机动事件
|
||||
pauseTrajectoryMotion()
|
||||
@ -211,7 +216,6 @@ let stopCallBack = (status) => {
|
||||
Revert()
|
||||
}, 100)
|
||||
}
|
||||
|
||||
}
|
||||
let Revert = () => {
|
||||
props.TSOBJ._Store._tasks.forEach(task => {
|
||||
@ -241,20 +245,35 @@ let Revert = () => {
|
||||
})
|
||||
}
|
||||
let pauseTrajectoryMotion = () => {
|
||||
eventBus.emit('hide-right-menu',)
|
||||
let currentTasks = props.TSOBJ._Store.getTaskInStamp()
|
||||
console.log("currentTasks", currentTasks)
|
||||
currentTasks.forEach(task => {
|
||||
if (task.callback == 'move') {
|
||||
switch (task.callback) {
|
||||
case "move":
|
||||
let TrajectoryMotionMapKey = task.id + task.callback + task.sourceId
|
||||
let TrajectoryMotionObject = window['_entityMap'].get(TrajectoryMotionMapKey);
|
||||
if (props.TSOBJ._Clock._status == 'play') {
|
||||
TrajectoryMotionObject.resume()
|
||||
TrajectoryMotionObject.state = true
|
||||
} else {
|
||||
TrajectoryMotionObject.pause()
|
||||
TrajectoryMotionObject.state = false
|
||||
if (props.TSOBJ._Clock._status == 'stop') {
|
||||
TrajectoryMotionObject.setMovePositionByTime(0)
|
||||
}
|
||||
}
|
||||
break
|
||||
case "flicker":
|
||||
let entity = window['_entityMap'].get(task.sourceId)
|
||||
if (props.TSOBJ._Clock._status == 'play') {
|
||||
// 通过当前时间戳和时间间隔计算出剩余间隔次数
|
||||
let offsetSecond = (props.TSOBJ._Store._currentTimestamp - task.startTime) / 1000
|
||||
console.log("通过当前时间戳和时间间隔计算出剩余间隔次数", offsetSecond)
|
||||
let nums = Math.ceil(offsetSecond / task.detail.times)
|
||||
let restNums = (task.detail.numbers - nums)
|
||||
entity.flicker(task.detail.times * 1000, restNums)
|
||||
} else {
|
||||
entity && entity.flicker(1, 1)
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
@ -759,9 +759,8 @@ eventBus.on('destroyComponent', (id) => {
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-track {
|
||||
-webkit-box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.3);
|
||||
border-radius: 10px;
|
||||
background-color: #f5f5f5;
|
||||
background-color: #f5f5f500;
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -382,9 +382,12 @@ let addMarker = (item, needSendEvent = true) => {
|
||||
}
|
||||
// console.log("添加标注标会")
|
||||
addMapSource(item.type, pId, obj)
|
||||
if (item.type == "standText") {
|
||||
item.source_name = ""
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
@ -2016,9 +2016,8 @@ background-color: transparent;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-track {
|
||||
-webkit-box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.3);
|
||||
border-radius: 10px;
|
||||
background-color: #f5f5f5;
|
||||
background-color: #f5f5f500;
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -39,6 +39,7 @@ export class Clock {
|
||||
store.setCursorLeft(store._currentTimestamp)
|
||||
if (store._currentTimestamp >= store.getTotalTime()) {
|
||||
this.stopAnimation()
|
||||
this._status = "stop"
|
||||
}
|
||||
|
||||
/*let now = Date.now()
|
||||
|
||||
@ -50,7 +50,7 @@ export class Store {
|
||||
this._tasks = option.tasks
|
||||
this._startTimestamp = option.startTimestamp
|
||||
this._currentTimestamp = option.currentTimestamp || option.startTimestamp
|
||||
this._scales = {...this._scales, ...option.scales}
|
||||
this._scales = {...option.scales, ...this._scales}
|
||||
// let num = this.getScale("distanceOfTicMain") / this.getScale("preMains")[this.getScale("preMainIndex")]
|
||||
// console.log(num)
|
||||
// this._scales.preSecondPx = num
|
||||
|
||||
@ -33,7 +33,7 @@ export class TS extends Tools {
|
||||
for (let i = 0; i < all; i++) {
|
||||
let timeOfMain = this._Store.getScale('preMains')[this._Store.getScale('preMainIndex') - 1]
|
||||
// console.log("timeOfMain", this._Store.getScale('preMains'))
|
||||
// console.log("timeOfMain", timeOfMain)
|
||||
console.log("timeOfMain", timeOfMain)
|
||||
// console.log("timeOfMain", this._Store.getScale('preMainIndex'))
|
||||
// @ts-ignore
|
||||
allTimeLabels.push(i * timeOfMain * 1000 + this._Store._startTimestamp)
|
||||
|
||||
@ -54,5 +54,6 @@ export const showRightMenuTs = (event: any, treeObj: any, selectedNodes, nodeTyp
|
||||
arr.splice(i, 1); // 从索引 i 开始删除 1 个元素
|
||||
}
|
||||
}
|
||||
console.log("arr", arr)
|
||||
return arr
|
||||
}
|
||||
|
||||
@ -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,13 +356,45 @@ 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
|
||||
|
||||
@ -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", () => {
|
||||
|
||||
@ -476,7 +476,7 @@ eventBus.on('destroyComponent', (id) => {
|
||||
}
|
||||
})
|
||||
|
||||
utilsSysChange(eventBus, 'first')
|
||||
utilsSysChange(eventBus, true)
|
||||
|
||||
const createEarth = async () => {
|
||||
window.earth = await new YJ.YJEarth('earthContainer')
|
||||
|
||||