This commit is contained in:
2025-12-18 16:10:35 +08:00
24 changed files with 152 additions and 48 deletions

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 717 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 MiB

View File

@ -50,6 +50,7 @@ window.newFuzzySearch = function (
allNodes = res allNodes = res
return allNodes return allNodes
} }
/*let allNodes = zTreeObj.transformToArray(nodes); /*let allNodes = zTreeObj.transformToArray(nodes);
let nodeChildren = getCustomNodes(allNodes)*/ let nodeChildren = getCustomNodes(allNodes)*/
// console.log("nodeChildren", nodeChildren) // console.log("nodeChildren", nodeChildren)
@ -84,7 +85,7 @@ window.newFuzzySearch = function (
zTreeObj.updateNode(item) zTreeObj.updateNode(item)
} }
if (contrast) { if (contrast) {
if (((item.sourceName || '')+'').indexOf(contrast) > -1) { if (((item.sourceName || '') + '').indexOf(contrast) > -1) {
console.log('sourceName包含关键字') console.log('sourceName包含关键字')
console.log(item) console.log(item)
console.log(item.sourceName) console.log(item.sourceName)
@ -97,6 +98,7 @@ window.newFuzzySearch = function (
return str return str
}) })
item.title = item.oldname.replace(F, function (h) { item.title = item.oldname.replace(F, function (h) {
// console.log("h", F, h)
let str = h let str = h
return str return str
}) })

View File

@ -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 = {

View File

@ -100,7 +100,7 @@ const searchPlace = debounce(function () {
} }
// poiOptions.value = [] // poiOptions.value = []
// value.value = '' // value.value = ''
;(window as any).treeSearchCb(searchKey.value) (window as any).treeSearchCb(searchKey.value)
}, 500) }, 500)
const initTreeCallBack = () => { const initTreeCallBack = () => {
TsApi.queryTsSource(formData).then(async res => { TsApi.queryTsSource(formData).then(async res => {
@ -415,7 +415,8 @@ let rightClick = (event: MouseEvent, treeId: string, treeNode: any) => {
cusSelectNode(treeObj.value, treeNode) cusSelectNode(treeObj.value, treeNode)
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)
if (treeNode && canCheckType.includes(treeNode.sourceType) && treeNode.sourceType != 'directory') { // canCheckType.includes(treeNode.sourceType) 包含的类型才有视角
if (treeNode && treeNode.sourceType != 'directory') {
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)
@ -457,6 +458,7 @@ const setting = {
//zdatas数据中表示节点name的属性key //zdatas数据中表示节点name的属性key
name: "sourceName", name: "sourceName",
checked: "isShow", checked: "isShow",
title: "title"
}, },
simpleData: { simpleData: {
enable: true, enable: true,

View File

@ -99,6 +99,10 @@ const menus = ref([
window['_entityMap'].delete(entityId) window['_entityMap'].delete(entityId)
} }
break; break;
case 'flicker':
let entitys = window['_entityMap'].get(rightClickEvent.value.sourceId)
entitys && entitys.flicker(1, 1)
break
} }
ElMessage({message: "操作成功", type: "success"}) ElMessage({message: "操作成功", type: "success"})
rightClickEvent.value = null rightClickEvent.value = null
@ -195,6 +199,9 @@ eventBus.on('click-event-show-plane', (params) => {
eventBus.on("click-cancel-hide-plane", () => { eventBus.on("click-cancel-hide-plane", () => {
eventObj.value = null eventObj.value = null
}) })
eventBus.on("hide-right-menu", () => {
hideRightMenu({target: {innerHTML: "sss"}})
})
onMounted(() => { onMounted(() => {
/* let doms = document.getElementsByClassName("start_time") /* let doms = document.getElementsByClassName("start_time")
for (let i = 0; i < doms.length; i++) { for (let i = 0; i < doms.length; i++) {

View File

@ -269,8 +269,24 @@ export const useRightOperate = () => {
key: 'resetView', key: 'resetView',
icon: 'resetView', icon: 'resetView',
callback: resetView callback: resetView
},
'layerRaise': {
key: 'layerRaise',
icon: 'layerRaise',
},
'layerLower': {
key: 'layerLower',
icon: 'layerLower',
},
'layerToTop': {
key: 'layerToTop',
icon: 'layerToTop',
},
'layerToBottom': {
key: 'layerToBottom',
icon: 'layerToBottom',
} }
// {}
}) })
return { return {
rightMenus, delNode, addEvent rightMenus, delNode, addEvent

View File

@ -104,6 +104,7 @@ import {ElMessage, ElPopover} from 'element-plus'; // 确保导入ElPopover
// import {dragElement} from "./util/drag.js"; // import {dragElement} from "./util/drag.js";
import dragLeftRight from './util/dragLeftRight.js'; import dragLeftRight from './util/dragLeftRight.js';
import {TsApi} from "../../api/ts"; import {TsApi} from "../../api/ts";
import {$changeComponentShow} from "../../utils/communication";
const props = defineProps(['TSOBJ']) const props = defineProps(['TSOBJ'])
console.log(props.TSOBJ) console.log(props.TSOBJ)
@ -155,7 +156,7 @@ const propsMap = {
} }
// 更新数值触发视图更新 // 更新数值触发视图更新
window['updateProp'] = (key: string, val: any) => { window['updateProp'] = (key: string, val: any) => {
console.log("window['updateProp']", key, val) // console.log("window['updateProp']", key, val)
if (propsMap[key]) if (propsMap[key])
propsMap[key].value = val propsMap[key].value = val
if (key == 'currentStamp') { if (key == 'currentStamp') {
@ -190,13 +191,17 @@ let formatTime = (timeStamp) => {
return props.TSOBJ.parseTime(timeStamp) return props.TSOBJ.parseTime(timeStamp)
} }
let play = () => { let play = () => {
console.log("播放播放")
props.TSOBJ._Clock._status = "play" props.TSOBJ._Clock._status = "play"
console.log(props.TSOBJ._Clock._status)
// return
props.TSOBJ._Clock.animation(props.TSOBJ._Store, eventCallback) props.TSOBJ._Clock.animation(props.TSOBJ._Store, eventCallback)
pauseTrajectoryMotion() pauseTrajectoryMotion()
} }
let stopCallBack = (status) => { let stopCallBack = (status) => {
props.TSOBJ._Clock._status = status props.TSOBJ._Clock._status = status
console.log(status)
// return
props.TSOBJ._Clock.stopAnimation() props.TSOBJ._Clock.stopAnimation()
// 暂停机动事件 // 暂停机动事件
pauseTrajectoryMotion() pauseTrajectoryMotion()
@ -211,7 +216,6 @@ let stopCallBack = (status) => {
Revert() Revert()
}, 100) }, 100)
} }
} }
let Revert = () => { let Revert = () => {
props.TSOBJ._Store._tasks.forEach(task => { props.TSOBJ._Store._tasks.forEach(task => {
@ -241,20 +245,35 @@ let Revert = () => {
}) })
} }
let pauseTrajectoryMotion = () => { let pauseTrajectoryMotion = () => {
eventBus.emit('hide-right-menu',)
let currentTasks = props.TSOBJ._Store.getTaskInStamp() let currentTasks = props.TSOBJ._Store.getTaskInStamp()
console.log("currentTasks", currentTasks) console.log("currentTasks", currentTasks)
currentTasks.forEach(task => { currentTasks.forEach(task => {
if (task.callback == 'move') { switch (task.callback) {
case "move":
let TrajectoryMotionMapKey = task.id + task.callback + task.sourceId let TrajectoryMotionMapKey = task.id + task.callback + task.sourceId
let TrajectoryMotionObject = window['_entityMap'].get(TrajectoryMotionMapKey); let TrajectoryMotionObject = window['_entityMap'].get(TrajectoryMotionMapKey);
if (props.TSOBJ._Clock._status == 'play') { if (props.TSOBJ._Clock._status == 'play') {
TrajectoryMotionObject.resume() TrajectoryMotionObject.state = true
} else { } else {
TrajectoryMotionObject.pause() TrajectoryMotionObject.state = false
if (props.TSOBJ._Clock._status == 'stop') { if (props.TSOBJ._Clock._status == 'stop') {
TrajectoryMotionObject.setMovePositionByTime(0) 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)
}
} }
}) })

View File

@ -759,9 +759,8 @@ eventBus.on('destroyComponent', (id) => {
} }
&::-webkit-scrollbar-track { &::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.3); background-color: #f5f5f500;
border-radius: 10px; border: none;
background-color: #f5f5f5;
} }
} }
</style> </style>

View File

@ -382,9 +382,12 @@ let addMarker = (item, needSendEvent = true) => {
} }
// console.log("添加标注标会") // console.log("添加标注标会")
addMapSource(item.type, pId, obj) addMapSource(item.type, pId, obj)
if (item.type == "standText") {
item.source_name = "" item.source_name = ""
} }
}
}) })
} }

View File

@ -2016,9 +2016,8 @@ background-color: transparent;
} }
&::-webkit-scrollbar-track { &::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.3); background-color: #f5f5f500;
border-radius: 10px; border: none;
background-color: #f5f5f5;
} }
} }
</style> </style>

View File

@ -39,6 +39,7 @@ export class Clock {
store.setCursorLeft(store._currentTimestamp) store.setCursorLeft(store._currentTimestamp)
if (store._currentTimestamp >= store.getTotalTime()) { if (store._currentTimestamp >= store.getTotalTime()) {
this.stopAnimation() this.stopAnimation()
this._status = "stop"
} }
/*let now = Date.now() /*let now = Date.now()

View File

@ -50,7 +50,7 @@ export class Store {
this._tasks = option.tasks this._tasks = option.tasks
this._startTimestamp = option.startTimestamp this._startTimestamp = option.startTimestamp
this._currentTimestamp = option.currentTimestamp || 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")] // let num = this.getScale("distanceOfTicMain") / this.getScale("preMains")[this.getScale("preMainIndex")]
// console.log(num) // console.log(num)
// this._scales.preSecondPx = num // this._scales.preSecondPx = num

View File

@ -33,7 +33,7 @@ export class TS extends Tools {
for (let i = 0; i < all; i++) { for (let i = 0; i < all; i++) {
let timeOfMain = this._Store.getScale('preMains')[this._Store.getScale('preMainIndex') - 1] let timeOfMain = this._Store.getScale('preMains')[this._Store.getScale('preMainIndex') - 1]
// console.log("timeOfMain", this._Store.getScale('preMains')) // console.log("timeOfMain", this._Store.getScale('preMains'))
// console.log("timeOfMain", timeOfMain) console.log("timeOfMain", timeOfMain)
// console.log("timeOfMain", this._Store.getScale('preMainIndex')) // console.log("timeOfMain", this._Store.getScale('preMainIndex'))
// @ts-ignore // @ts-ignore
allTimeLabels.push(i * timeOfMain * 1000 + this._Store._startTimestamp) allTimeLabels.push(i * timeOfMain * 1000 + this._Store._startTimestamp)

View File

@ -54,5 +54,6 @@ export const showRightMenuTs = (event: any, treeObj: any, selectedNodes, nodeTyp
arr.splice(i, 1); // 从索引 i 开始删除 1 个元素 arr.splice(i, 1); // 从索引 i 开始删除 1 个元素
} }
} }
console.log("arr", arr)
return arr return arr
} }

View File

@ -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: '请先关闭二三维模式!',

View File

@ -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", () => {

View File

@ -476,7 +476,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')