修改
This commit is contained in:
@ -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({
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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',)
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user