修改bug

This commit is contained in:
zyl
2025-12-05 18:23:35 +08:00
parent 3ed4e992db
commit 8aea9d802d
15 changed files with 167 additions and 70 deletions

Binary file not shown.

View File

@ -366,7 +366,7 @@ export default {
operationalTime: "作战时间", operationalTime: "作战时间",
enterTuiyan: "进入推演页面", enterTuiyan: "进入推演页面",
ersanwei: "二三维模式", ersanwei: "二三维模式",
back: "返回", back: "返回到历史推演",
exitTs: "退出方案库", exitTs: "退出方案库",
save: "保存", save: "保存",
cancel: "取消", cancel: "取消",

View File

@ -48,10 +48,10 @@ export default {
firstMenu: { firstMenu: {
situation: '態勢推演', situation: '態勢推演',
measure: '測量庫', measure: '測量庫',
tool: '工具', tool: '工具',
effect: '工具庫', effect: '特效庫',
bigData: '大數據', bigData: '大數據',
modelLibrary: '模型', modelLibrary: '模型',
onlinePictureSource: '在線圖源', onlinePictureSource: '在線圖源',
analysis: '分析庫', analysis: '分析庫',
militaryMark: '軍標庫', militaryMark: '軍標庫',
@ -364,7 +364,7 @@ export default {
operationalTime: "作戰時間", operationalTime: "作戰時間",
enterTuiyan: "進入推演頁面", enterTuiyan: "進入推演頁面",
ersanwei: "二三維模式", ersanwei: "二三維模式",
back: "返回", back: "返回到曆史推演",
exitTs: "退出方案庫", exitTs: "退出方案庫",
save: "儲存", save: "儲存",
cancel: "取消", cancel: "取消",

View File

@ -46,6 +46,13 @@ export const TsApi = {
data data
}) })
}, },
//修改树层级
updateTreeIndex: async (data: any) => {
return await request.post({
url: `/tsSource/dragSource`,
data
})
},
//树的隐藏显示 //树的隐藏显示
updateTreeShow: async (data: any) => { updateTreeShow: async (data: any) => {
let datas = [] let datas = []

File diff suppressed because one or more lines are too long

View File

@ -156,22 +156,25 @@ const initTreeCallBack = () => {
} }
} }
if (layerTypes.includes(arr[i].sourceType)) { if (layerTypes.includes(arr[i].sourceType)) {
console.log(detail, params)
if (!detail && !params) { if (!detail && !params) {
detail = { detail = {
id: arr[i].id, id: arr[i].id,
name: arr[i].sourceName, name: arr[i].sourceName,
isShow: arr[i].isShow show: Boolean(arr[i].isShow)
} }
} }
layers.push( let layer = {
{ sourceType: arr[i].sourceType,
sourceType: arr[i].sourceType, detail: {...detail, ...params, layerIndex: layers.length + 1}
detail: {...detail, ...params} }
} console.log(layer)
) layers.push(layer)
} else { } else {
console.log({...detail, ...params}) console.log({...detail, ...params})
initMapData(arr[i].sourceType, {...detail, ...params},) let details = {...detail, ...params}
details.show = Boolean(arr[i].isShow)
initMapData(arr[i].sourceType, details)
} }
} }
@ -199,7 +202,7 @@ const initTreeCallBack = () => {
if ((window as any).earth_ts) { if ((window as any).earth_ts) {
for (let i = 0; i < layers.length; i++) { for (let i = 0; i < layers.length; i++) {
initMapData(layers[i].sourceType, layers[i].detail, (layer) => { initMapData(layers[i].sourceType, layers[i].detail, (layer) => {
layer.show = Boolean(layers[i].isShow) // layer.show = Boolean(layers[i].show)
}) })
} }
} }
@ -210,6 +213,48 @@ const onDblClick = (event: MouseEvent, treeId: string, treeNode: any) => {
entityObject = (window as any)._entityMap.get(treeNode.id) entityObject = (window as any)._entityMap.get(treeNode.id)
entityObject.flyTo() entityObject.flyTo()
} }
/**
* 用于捕获节点拖拽操作结束的事件回调函数
* @param event 事件对象
* @param treeId 树形结构id
* @param treeNodes 被拖拽的节点 JSON 数据集合
* @param targetNode 成为 treeNodes 拖拽结束的目标节点 JSON 数据对象
* @param moveType
*/
const onDrop = async (event: DragEvent,
treeId: any,
treeNodes: any,
targetNode: any,
moveType: any) => {
const someNode: any = getSameLevel(window['treeObj'], treeNodes[0])
const newNode = someNode.map((item: any) => {
let index = item.getIndex()
item.treeIndex = index
return {
...item,
treeIndex: item.getIndex() + 1
}
})
const list = newNode.map((item: any) => {
return {
id: item.id,
treeIndex: item.treeIndex,
parentId: item.parentId || ''
}
})
const res = await TsApi.updateTreeIndex(list)
if (res.code == 0 || res.code == 200) {
ElMessage({
message: '操作成功',
type: 'success'
})
} else {
ElMessage({
message: '操作失败',
type: 'error'
})
}
}
const onClick = (event: MouseEvent, treeId: string, treeNode: any) => { const onClick = (event: MouseEvent, treeId: string, treeNode: any) => {
console.log('selectNode', treeNode) console.log('selectNode', treeNode)
@ -422,7 +467,8 @@ const setting = {
onRightClick: rightClick, onRightClick: rightClick,
onClick: onClick, onClick: onClick,
onCheck: onCheck, onCheck: onCheck,
onDblClick: onDblClick onDblClick: onDblClick,
onDrop: onDrop,
/* /*
onClick: this.onClick, onClick: this.onClick,
onDblClick: this.onDblClick, onDblClick: this.onDblClick,

View File

@ -7,9 +7,9 @@
</template> </template>
<template v-for="(event,index) in eventList" :key="index"> <template v-for="(event,index) in eventList" :key="index">
<div class="row" :style="getStyle"> <div class="row" :style="getStyle">
<div class="bar" :style="progressStyle(event)" @dblclick="clickEventBar(event)"><!--{{ <div class="bar oneLine" :style="progressStyle(event)" @dblclick="clickEventBar(event)"
event.name + event.duration_time :title="event.name + event.duration_time ">
}}--> {{ event.name }}
</div> </div>
</div> </div>
</template> </template>

View File

@ -56,6 +56,7 @@ let ticLabel = (val) => {
<style scoped> <style scoped>
/* 样式不变 */ /* 样式不变 */
.timeScale { .timeScale {
width: 100%;
height: 30px; height: 30px;
position: relative; position: relative;
flex-shrink: 0; flex-shrink: 0;

View File

@ -145,6 +145,9 @@ 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') {
eventBus.emit("changeStamp", val)
}
} }

View File

@ -322,7 +322,12 @@ eventBus.on('add-event', (task) => {
// 新建态势推演对象 // 新建态势推演对象
let newTS = (params, events) => { let newTS = (params, events) => {
window['tsObj'] = new TS({name: params.name, tasks: events, startTimestamp: params.start_time}) window['tsObj'] = new TS({
name: params.name,
tasks: events,
startTimestamp: params.start_time,
wheel: params.wheel || 20
})
tsOBJ.value = window['tsObj'] tsOBJ.value = window['tsObj']
window['tsAction'] = window['tsObj'].initAction() window['tsAction'] = window['tsObj'].initAction()
@ -331,18 +336,33 @@ let newTS = (params, events) => {
// dom加载完成后通过宽度和间隔来计算出刻度线的数量 // dom加载完成后通过宽度和间隔来计算出刻度线的数量
window['tsObj']._Store.init() window['tsObj']._Store.init()
window['tsObj'].renderLabel({left: 0}) window['tsObj'].renderLabel({left: 0})
stamp.value = getFormatedDate(window['tsObj']._Store._currentTimestamp)
}) })
} }
getEventList() getEventList()
let getFormatedDate = (stamp = null) => {
const date = stamp ? new Date(stamp) : new Date();
const formattedDate = date.toLocaleString('zh-CN', {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
hour12: false // 禁用12小时制使用24小时制
}).replace(/\//g, '-');
return formattedDate
}
onMounted(async () => { onMounted(async () => {
let baseURL = localStorage.getItem('service') let baseURL = localStorage.getItem('service')
// getAuthInfo() // getAuthInfo()
await YJ.on({host: baseURL}) await YJ.on({host: baseURL})
createEarth() createEarth()
window.addEventListener('click', handleClick) window.addEventListener('click', handleClick)
window.addEventListener('resize', handleResize)
// window.addEventListener('contextmenu', handleClick) // window.addEventListener('contextmenu', handleClick)
}) })
const createEarth = async () => { const createEarth = async () => {
(window as any).earth_ts = await new YJ.YJEarth('earthContainer', {navigationHelpButton: false}) (window as any).earth_ts = await new YJ.YJEarth('earthContainer', {navigationHelpButton: false})
@ -379,27 +399,25 @@ const createEarth = async () => {
console.log("createEarth++++++++++++++++++++") console.log("createEarth++++++++++++++++++++")
cabin.value.initTreeCallBack() cabin.value.initTreeCallBack()
} }
/*
const timer = setInterval(() => { const timer = setInterval(() => {
const date = new Date(); stamp.value = getFormatedData()
// 配置年-月-日 时:分:秒 格式
const formattedDate = date.toLocaleString('zh-CN', {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
hour12: false // 禁用12小时制使用24小时制
}).replace(/\//g, '-');
stamp.value = formattedDate
}, 1000) }, 1000)
*/
eventBus.on("changeStamp", val => {
stamp.value = getFormatedDate(val)
})
onUnmounted(() => { onUnmounted(() => {
clearInterval(timer) // clearInterval(timer)
window.removeEventListener('click', handleClick) window.removeEventListener('click', handleClick)
window.removeEventListener('resize', handleResize)
// window.removeEventListener('contextmenu', handleClick) // window.removeEventListener('contextmenu', handleClick)
}) })
//
const handleResize = () => {
window['tsObj']._Store.init()
}
// 定义可复用的回调函数 // 定义可复用的回调函数
const handleClick = (e) => { const handleClick = (e) => {
// console.log('点击事件触发', e) // console.log('点击事件触发', e)

View File

@ -192,7 +192,10 @@ export function addMapSource(type, pId, option, cb: any = null) {
cb && cb(res) cb && cb(res)
// 上树 // 上树
let selectedNode = window.treeObj.getNodeByParam('id', pId) let selectedNode = window.treeObj.getNodeByParam('id', pId)
cusAddNodes(window.treeObj, selectedNode, [dbOption], true) cusAddNodes(window.treeObj, selectedNode, [dbOption], true).then((addNodes) => {
console.log("addNodes", addNodes)
addNodes.length && window['treeObj'].selectNode(addNodes[0])
})
}) })
} }

View File

@ -60,9 +60,10 @@
<div class="tableBox"> <div class="tableBox">
<el-table <el-table
:data="tableData" :data="tableData"
height="100%"
style="width: 100%" style="width: 100%"
> >
<el-table-column type="selection" width="55"/>
<el-table-column align="center" prop="name" :label="t('ts.deduceName')"/> <el-table-column align="center" prop="name" :label="t('ts.deduceName')"/>
<el-table-column align="center" :label="t('ts.deduceDesc')" :class-name="'ellipsis-column'"> <el-table-column align="center" :label="t('ts.deduceDesc')" :class-name="'ellipsis-column'">
<template #default="scope"> <template #default="scope">
@ -228,6 +229,10 @@ const getList = (params: any = null) => {
TsApi.planList(formData).then(res => { TsApi.planList(formData).then(res => {
console.log(res) console.log(res)
if (res.code == 200) { if (res.code == 200) {
/* let arr = []
for (let i = 0; i < 50; i++) {
arr.push(res.data.records[0])
}*/
tableData.value = res.data.records tableData.value = res.data.records
total.value = res.data.total total.value = res.data.total
} }
@ -438,6 +443,11 @@ onUnmounted(() => {
height: 26px; height: 26px;
right: 8px; right: 8px;
top: 8px; top: 8px;
fill: #fff;
&:hover {
fill: #0ff;
}
} }
.list-container { .list-container {
@ -494,7 +504,8 @@ onUnmounted(() => {
} }
.tableBox { .tableBox {
flex: auto; height: calc(72vh - 159px);
overflow-y: auto;
} }
.pageBox { .pageBox {

View File

@ -31,7 +31,7 @@ export class Store {
_currentTimestamp _currentTimestamp
_tasks _tasks
_multiplier _multiplier
private _panelWidth //面板宽度 _panelWidth //面板宽度
constructor(option) { constructor(option) {
this._multiplier = option.multiplier || 1 this._multiplier = option.multiplier || 1
@ -53,9 +53,9 @@ export class Store {
let panel = dom.getBoundingClientRect();// 安全调用 let panel = dom.getBoundingClientRect();// 安全调用
// console.log(dom.getBoundingClientRect()) // console.log(dom.getBoundingClientRect())
this._panelWidth = Math.floor(panel.width); this._panelWidth = Math.floor(panel.width);
dom['style'].width = this._panelWidth + "px" // dom['style'].width = this._panelWidth + "px"
this.setScale("ticTiny", this.ceil(this._panelWidth / this.getScale("distanceOfTicTiny"))) this.setScale("ticTiny", this.ceil(this._panelWidth / this.getScale("distanceOfTicTiny")))
this.setScale("ticMain", this.ceil(this._panelWidth / this.getScale("distanceOfTicMain")) + 1) this.setScale("ticMain", this.ceil(this._panelWidth / this.getScale("distanceOfTicMain")) + 2)
// this.getMinTimeOfPanel() // this.getMinTimeOfPanel()
@ -129,10 +129,10 @@ export class Store {
// 通过时间戳来设置位置 // 通过时间戳来设置位置
setCursorLeft(stamp) { setCursorLeft(stamp) {
let newLeft = ((stamp - this._startTimestamp) / 1000) * this._scales.preSecondPx - this._scales.scrollLeft let newLeft = ((stamp - this._startTimestamp) / 1000) * this._scales.preSecondPx - this._scales.scrollLeft
console.log("stamp", stamp) // console.log("stamp", stamp)
console.log("this._startTimestamp", this._startTimestamp) // console.log("this._startTimestamp", this._startTimestamp)
console.log("this._scales.preSecondPx", this._scales.preSecondPx) // console.log("this._scales.preSecondPx", this._scales.preSecondPx)
console.log("newLeft", newLeft) // console.log("newLeft", newLeft)
this.setScale('cursorLeft', newLeft) this.setScale('cursorLeft', newLeft)
} }
@ -177,4 +177,9 @@ export class Store {
window['updateProp']("currentStamp", val) window['updateProp']("currentStamp", val)
} }
set panelWidth(val) {
console.log("新的面板宽度", val)
this._panelWidth = val
this.init()
}
} }

View File

@ -14,7 +14,6 @@ export class TS extends Tools {
this._Clock = new Clock() this._Clock = new Clock()
this.name = option.name this.name = option.name
this._Store._scales.fullHeight = this._Store._tasks.length * this._Store._scales.cellHeight this._Store._scales.fullHeight = this._Store._tasks.length * this._Store._scales.cellHeight
} }
tuningLine() { tuningLine() {
@ -38,6 +37,15 @@ export class TS extends Tools {
this._Store.setScale('timeLabels', allTimeLabels) this._Store.setScale('timeLabels', allTimeLabels)
} }
setWheel(value) {
let num = Math.ceil(value / 3)
// 小格宽度的选值【3,5,8】
let index = value % 3
this._Store.setScale('preMainIndex', num - 1)
this._Store.setScale('distanceOfTicTiny', this._Store.getScale("distanceOfTicTinyRange")[index])
this._Store.setScale('preSecondPx', this._Store.getScale("distanceOfTicMain") / this._Store.getScale("preMains")[this._Store.getScale("preMainIndex")])
}
initAction() { initAction() {
return (l) => { return (l) => {
console.log("action的参数", l) console.log("action的参数", l)
@ -47,13 +55,7 @@ export class TS extends Tools {
case "wheel-timeLine": case "wheel-timeLine":
const value = l.num const value = l.num
// 第几个大格,小标-=1 // 第几个大格,小标-=1
let num = Math.ceil(value / 3) this.setWheel(value)
// 小格宽度的选值【3,5,8】
let index = value % 3
this._Store.setScale('preMainIndex', num - 1)
this._Store.setScale('distanceOfTicTiny', this._Store.getScale("distanceOfTicTinyRange")[index])
this._Store.setScale('preSecondPx', this._Store.getScale("distanceOfTicMain") / this._Store.getScale("preMains")[this._Store.getScale("preMainIndex")])
break; break;
case "scroll-chart": case "scroll-chart":
this._Store._scales.scrollTop = obj.top this._Store._scales.scrollTop = obj.top

View File

@ -322,7 +322,7 @@ export const useTree = () => {
}) })
} }
} else { } else {
if(node.sourceType === 'tileset') { if (node.sourceType === 'tileset') {
if (node.children && node.children.length > 0) { if (node.children && node.children.length > 0) {
node.children.forEach((item) => { node.children.forEach((item) => {
sourceStatus(item) sourceStatus(item)
@ -704,6 +704,7 @@ export const useTree = () => {
layers.sort((obj1, obj2) => { layers.sort((obj1, obj2) => {
return obj1.params.layerIndex - obj2.params.layerIndex; return obj1.params.layerIndex - obj2.params.layerIndex;
}); });
console.log("layers", layers)
for (let i = 0; i < layers.length; i++) { for (let i = 0; i < layers.length; i++) {
initMapData(layers[i].sourceType, layers[i].params, null) initMapData(layers[i].sourceType, layers[i].params, null)
} }