This commit is contained in:
2025-12-16 18:00:33 +08:00
17 changed files with 129 additions and 39 deletions

File diff suppressed because one or more lines are too long

View File

@ -133,6 +133,7 @@ export const initMapData = async (type, data, cd) => {
}
}
entityObject = new YJ.Obj.TrajectoryMotion(window.earth, data)
delete entityObject.options.reverse
break
case 'wallStereoscopic':
entityObject = new YJ.Obj.WallStereoscopic(window.earth, data)

View File

@ -156,7 +156,7 @@ const initTreeCallBack = () => {
}
}
if (layerTypes.includes(arr[i].sourceType)) {
console.log(detail, params)
// console.log(detail, params)
if (!detail && !params) {
detail = {
id: arr[i].id,
@ -168,10 +168,10 @@ const initTreeCallBack = () => {
sourceType: arr[i].sourceType,
detail: {...detail, ...params, layerIndex: layers.length + 1}
}
console.log(layer)
// console.log(layer)
layers.push(layer)
} else {
console.log({...detail, ...params})
// console.log({...detail, ...params})
let details = {...detail, ...params}
details.show = Boolean(arr[i].isShow)
initMapData(arr[i].sourceType, details)
@ -188,6 +188,7 @@ const initTreeCallBack = () => {
let speed = (distance / duration_S) * window['tsObj']._Store._multiplier
detail.speed = speed
console.log("event的detail", detail)
// detail.viewFollow = true
initMapData("guiji", detail, (TrajectoryMotionObject) => {
TrajectoryMotionObject.state = false;
TrajectoryMotionObject.oldSpeed = distance / duration_S * multiplier;
@ -359,7 +360,7 @@ const onCheck = async (event: any, treeId: any, treeNode: any) => {
sourceStatus(treeNode)
console.log("ids", ids)
return
// return
const res = await TsApi.updateTreeShow(ids)
if (res.code == 0 || res.code == 200) {
ElMessage({

View File

@ -24,7 +24,7 @@ const selectedEventId = ref(null)
const eventBus: any = inject('bus')
const props = defineProps(['eventList', 'hr', 'originHrOffset', 'scrollLeft'])
let clickEventBar = (event) => {
console.log("点击事件块", selectedEventId.value, event.id)
console.log("点击事件块", selectedEventId.value, event)
let entity = window['_entityMap'].get(event.sourceId)
entity && entity.flyTo()
selectedEventId.value = (selectedEventId.value == null || selectedEventId.value != event.id) ? event.id : null
@ -90,6 +90,7 @@ let getWidth = (durationTime) => {
// 6. 让 progressStyle 间接依赖 refreshKey通过 getWidth
let progressStyle = (task) => {
let taskLeft = task.startTime - window['tsObj']._Store._startTimestamp;
console.log("taskLeft", task, taskLeft, getWidth(taskLeft))
let width = 1
if (!['display', 'hide'].includes(task.callback))
width = getWidth(task.duration_time) * 1000

View File

@ -4,6 +4,22 @@
<div class="eventPanel">
<span class="title">{{ eventObj.name }}</span>
<div class="eventDetail">
<template v-if="eventObj.callback&&eventObj.callback=='move'">
<div>
路径显隐
<el-switch size="small" v-model="detail.line.show" @change="(val)=>handleChange(val,'lineShow')"/>
</div>
<!-- <div>
实时路径
<el-switch size="small" v-model="detail.realTimeRoute"
@change="(val)=>handleChange(val,'realTimeRoute')"/>
</div>-->
<div>
是否圆滑
<el-switch size="small" v-model="detail.line.smooth"
@change="(val)=>handleChange(val,'smooth')"/>
</div>
</template>
<template v-if="eventObj.callback&&eventObj.callback=='flicker'">
<!-- <div>
闪烁间隔
@ -16,6 +32,7 @@
</div>
</template>
</div>
<div class="optBtn">
<el-button @click="updateEvent">{{ t('ts.confirm') }}</el-button>
@ -56,13 +73,37 @@ eventBus.on('click-event-show-plane', (params) => {
}
switch (params.callback) {
case 'flicker':
case 'move':
// times.value = detail.times
// numbers.value = detail.numbers
detail.value = details
break
}
}
console.log("detail.value", detail.value)
})
const handleChange = (val, key) => {
let entity = window['_entityMap'].get(eventObj.value.id + "move" + eventObj.value.sourceId)
console.log(eventObj.value.id + "move" + eventObj.value.sourceId)
console.log(entity)
if (entity) {
entity[key] = val
}
// 如果当前属性变为true那么其他的将变为false唯一真原则
if (val) {
switch (key) {
case 'lineShow':
detail.value.realTimeRoute = false
break
case 'realTimeRoute':
detail.value.line.show = false
break
}
}
console.log(val, key)
}
const updateEvent = () => {
// console.log(detail.value)
let obj = eventObj.value
@ -88,6 +129,7 @@ const updateEvent = () => {
})
}
const cancel = () => {
eventObj.value = null
detail.value = {}
eventBus.emit('click-cancel-hide-plane',)

View File

@ -105,6 +105,8 @@ import {ElMessage, ElPopover} from 'element-plus'; // 确保导入ElPopover
import dragLeftRight from './util/dragLeftRight.js';
import {TsApi} from "../../api/ts";
const props = defineProps(['TSOBJ'])
console.log(props.TSOBJ)
const eventBus: any = inject('bus')
const instance = getCurrentInstance();
@ -121,7 +123,7 @@ const multiplierPopover: any = ref(null);
const isPopoverShow = ref(false);
let multipliers = [16, 8, 4, 2, 1, 0.5, 0.25]
let currentStamp = ref(window['tsObj']._Store._startTimestamp)
let maxLevel = ref(24)
let maxLevel = ref(36)
let minLevel = ref(1)
let hr = ref(0)
let originHrOffset = ref(0)
@ -134,6 +136,8 @@ let distanceOfTicMain = ref(5)
let originOffset = ref(0)
let originMainOffset = ref(0)
let status = ref(false)
distanceOfTicTiny.value = props.TSOBJ._Store.getScale("distanceOfTicTiny")
distanceOfTicMain.value = window['tsObj']._Store.getScale('numOfMain') * distanceOfTicTiny.value
const propsMap = {
ticTiny,
@ -161,8 +165,7 @@ window['updateProp'] = (key: string, val: any) => {
const level = ref(20)
const props = defineProps(['TSOBJ'])
console.log(props.TSOBJ)
level.value = props.TSOBJ.wheel
let handleMultiplierChange = (multiplier) => {
props.TSOBJ._Store._multiplier = multiplier
@ -204,6 +207,9 @@ let stopCallBack = (status) => {
props.TSOBJ._Store.setScale('scrollLeft', 0)
props.TSOBJ._Store.setScale('cursorLeft', 0)
Revert()
setTimeout(() => {
Revert()
}, 100)
}
}
@ -345,6 +351,7 @@ const handleDrag = (newLeft: number) => {
let tsEntitys = window['_entityMap'].get(task.sourceId);
tsEntitys.show = true
// TrajectoryMotionObject.speed = TrajectoryMotionObject.oldSpeed
console.log(window['tsObj']._Store._currentTimestamp - task.startTime)
TrajectoryMotionObject.setMovePositionByTime((window['tsObj']._Store._currentTimestamp - task.startTime) / 1000)
break;
default:

View File

@ -99,8 +99,10 @@
oninput="value=value.replace(/[^0-9.]/g, '').replace(/^\./, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.')"/>{{
t('ts.minute')
}} </span>
<span><el-input v-model="second" :maxlength="2"
oninput="value=value.replace(/[^0-9.]/g, '').replace(/^\./, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.')"/>{{
<span>
<!--:maxlength="2"-->
<el-input v-model="second"
oninput="value=value.replace(/[^0-9.]/g, '').replace(/^\./, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.')"/>{{
t('ts.second')
}}</span>
</div>
@ -226,7 +228,7 @@ const addEvent = () => {
console.log(zNode.value)
let startTime = form.datetime.getTime()
let obj: any = {}
console.log("obj", obj)
let duration_S = Number(hour.value * 3600) + Number(minute.value * 60) + Number(second.value)
// 数据是否合法有效
let isRight = true
@ -234,12 +236,16 @@ const addEvent = () => {
let minPositionLength = 2
switch (currentKey.value) {
case 'flicker':
obj = {
numbers: numbers.value,
times: 0
}
if (duration_S == 0) {
isRight = false
errorFields.push("持续时间")
}
if (obj.numbers == 0) {
if (Number(obj.numbers) == 0 || !Number(obj.numbers)) {
isRight = false
errorFields.push("闪烁次数")
}
@ -266,7 +272,8 @@ const addEvent = () => {
show: false,
positions: positions.value,
},
isContainModelPosition: isContainModelPosition.value
isContainModelPosition: isContainModelPosition.value,
realTimeRoute: false
}
if (!obj.line['positions'] || (obj.line['positions'] && obj.line['positions'].length < minPositionLength)) {
// ElMessage({message: "机动事件的路径不合法", type: "warning"})
@ -300,8 +307,8 @@ const addEvent = () => {
endTime: startTime + duration_S * 1000,
"detail": JSON.stringify(obj)
}
console.log("dbParams", dbParams)
console.log("duration_S", duration_S)
// console.log("dbParams", dbParams)
// console.log("duration_S", duration_S)
// return;
TsApi.addTsEvent(dbParams).then(res => {
if (res.code == 200) {

View File

@ -38,8 +38,11 @@ export class Store {
let preMainIndex = Math.ceil(option.wheel / 3)
// 小格宽度的选值【3,5,8】
let index = option.wheel % 3
this._scales.preMainIndex = preMainIndex
this._scales.preMainIndex = preMainIndex - 1
this._scales.distanceOfTicTiny = this._scales.distanceOfTicTinyRange[index]
console.log("this._scales.preMainIndex", this._scales.preMainIndex)
console.log("this._scales.preMains", this._scales.preMains)
console.log("this._scales.preMains", this._scales.preMains[this._scales.preMainIndex])
this._scales.preSecondPx = this._scales.distanceOfTicMain / this._scales.preMains[this._scales.preMainIndex]
this._multiplier = option.multiplier || 1
@ -48,9 +51,9 @@ export class Store {
this._startTimestamp = option.startTimestamp
this._currentTimestamp = option.currentTimestamp || option.startTimestamp
this._scales = {...this._scales, ...option.scales}
let num = this.getScale("distanceOfTicMain") / this.getScale("preMains")[this.getScale("preMainIndex")]
console.log(num)
this._scales.preSecondPx = num
// let num = this.getScale("distanceOfTicMain") / this.getScale("preMains")[this.getScale("preMainIndex")]
// console.log(num)
// this._scales.preSecondPx = num
// this.setScale("preSecondPx", num)
}
@ -82,6 +85,7 @@ export class Store {
// 封装对_scales属性的修改器setter在此处触发监听 tsObj._Store.setScale('ticTiny', 10);
setScale(key: ScaleKey, value: any) {
// console.log(key, value)
const oldValue = this._scales[key];
if (oldValue === value) return; // 值未变化则不触发
this._scales[key] = value;
@ -139,7 +143,7 @@ export class Store {
let m = 60 * s//一分
let h = 60 * m//一小时
let d = 24 * h//一天
return [30 * s, 1 * m, 2 * m, 5 * m, 10 * m, 1 * h, 2 * h, 5 * h/*, 10 * h, 1 * d, 2 * d, 5 * d*/].reverse()
return [30 * s, 1 * m, 2 * m, 5 * m, 10 * m, 1 * h, 2 * h, 5 * h, 10 * h, 1 * d, 2 * d, 5 * d].reverse()
}
ceil(num) {
@ -188,11 +192,11 @@ export class Store {
}
getTaskInStamp() {
return this._tasks.filter(item => this._currentTimestamp > item.startTime && this._currentTimestamp <= item.endTime)
return this._tasks.filter(item => this._currentTimestamp >= item.startTime && this._currentTimestamp <= item.endTime)
}
set currentTimestamp(val) {
console.log("currentTimestamp", val)
// console.log("currentTimestamp", val)
this._currentTimestamp = val
window['updateProp']("currentStamp", val)
}

View File

@ -31,11 +31,15 @@ export class TS extends Tools {
// console.log("renderLabel", nums)
let allTimeLabels = []
for (let i = 0; i < all; i++) {
let timeOfMain = this._Store.getScale('preMains')[this._Store.getScale('preMainIndex')]
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", this._Store.getScale('preMainIndex'))
// @ts-ignore
allTimeLabels.push(i * timeOfMain * 1000 + this._Store._startTimestamp)
}
allTimeLabels.splice(0, nums)
// console.log("##########")
this._Store.setScale('timeLabels', allTimeLabels)
}

View File

@ -711,7 +711,8 @@ const intoBack = async () => {
contextIsolation: false,
// devTools: true,
// fullScreen: true,
devTools: true
devTools: true,
session: true // 自定义参数用于判断是否启用session
}
},
// `http://localhost:${availablePort}/backManage/index.html#/login?timestamp=${Date.now()}`,

View File

@ -2,7 +2,8 @@
<Dialog ref="baseDialog" :title="t('bottomMenu.groundText')" left="calc(50% - 198px)" top="calc(50% - 120px)"
:closeCallback="closeCallBack">
<template #content>
<textarea style="height: 40px; width: 348px;" maxlength="80" v-model="text"></textarea>
<textarea style="height: 40px; width: 348px;margin-bottom: 10px;" maxlength="80" v-model="text"></textarea>
<span style="position: absolute;bottom: 66px;right: 26px;font-size: 12px;color: #c5c5c5;font-family: Arial;">{{ text.length }}/80</span>
</template>
<template #footer>
<button @click="confirm">{{ t('btn.confirm') }}</button>

View File

@ -2,7 +2,8 @@
<Dialog ref="baseDialog" :title="t('bottomMenu.standText')" left="calc(50% - 198px)" top="calc(50% - 120px)"
:closeCallback="closeCallBack">
<template #content>
<textarea style="height: 40px; width: 348px;" maxlength="80" v-model="text"></textarea>
<textarea style="height: 40px; width: 348px;margin-bottom: 10px;" maxlength="80" v-model="text"></textarea>
<span style="position: absolute;bottom: 66px;right: 26px;font-size: 12px;color: #c5c5c5;font-family: Arial;">{{ text.length }}/80</span>
</template>
<template #footer>
<button @click="confirm">{{ t('btn.confirm') }}</button>

View File

@ -4,9 +4,10 @@
<span class="custom-divider"></span>
<div class="div-item">
<div class="row">
<div class="col">
<div class="col" style="position: relative;">
<span class="label">名称</span>
<textarea v-model="entityOptions.text"></textarea>
<textarea style="margin-bottom: 10px;" v-model="entityOptions.text"></textarea>
<span style="position: absolute;bottom: -10px;right: 2px;font-size: 12px;color: #c5c5c5;font-family: Arial;">{{ entityOptions.text.length || 0 }}/80</span>
</div>
<div class="col">
<span class="label">颜色</span>

View File

@ -265,7 +265,7 @@ const translate = () => {
}
else {
that.openPositionEditing(() => {
entityOptions.value.lng = structuredClone(that.options.lng)
entityOptions.value.lng = structuredClone(that.lng)
})
}
}
@ -348,10 +348,12 @@ const changeMaximumParticleLife = (event) => {
const closeCallback = () => {
const closeCallback = async () => {
entityOptions.value.originalOptions = structuredClone(originalOptions)
that.positionEditing = false
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")
}

View File

@ -5,9 +5,10 @@
<span class="custom-divider"></span>
<div class="div-item">
<div class="row">
<div class="col">
<div class="col" style="position: relative;">
<span class="label">名称</span>
<textarea v-model="entityOptions.text"></textarea>
<textarea style="margin-bottom: 10px;" maxlength="80" v-model="entityOptions.text"></textarea>
<span style="position: absolute;bottom: -10px;right: 2px;font-size: 12px;color: #c5c5c5;font-family: Arial;">{{ entityOptions.text.length || 0 }}/80</span>
</div>
<div class="col">
<span class="label">颜色</span>

View File

@ -152,25 +152,25 @@ const material = ref([
name: '纯色墙',
value: '纯色墙',
key: 0,
icon: '../sdk/custom/img/icon-wall.png'
icon: '../renderer/sdk/custom/img/icon-wall.png'
},
{
name: '红砖墙',
value: '红砖墙',
key: 1,
icon: '../sdk/img/material/brick1.png'
icon: '../renderer/sdk/img/material/brick1.png'
},
{
name: '黄砖墙',
value: '黄砖墙',
key: 2,
icon: '../sdk/img/material/brick2.png'
icon: '../renderer/sdk/img/material/brick2.png'
},
{
name: '灰瓷墙',
value: '灰瓷墙',
key: 3,
icon: '../sdk/img/material/brick3.png'
icon: '../renderer/sdk/img/material/brick3.png'
}
])
eventBus.on("openStandTextAdd", () => {