This commit is contained in:
takeshita
2025-12-02 14:35:14 +08:00
9 changed files with 168 additions and 16 deletions

View File

@ -1,7 +1,7 @@
server: server:
host: 127.0.0.1 host: 127.0.0.1
port: 8848 port: 8848
path: C:\Users\takeshita\AppData\Roaming\dzsp_shijingjun_offline_Y_save path: C:\Users\Administrator\AppData\Roaming\dzsp_shijingjun_offline_Y_save
poi: poi:
global: global:
enabled: false enabled: false

View File

@ -44,7 +44,7 @@ export const GraphApi = {
}) })
}, },
//军标类型列表 //军标类型列表
modelTypeList: async (data: any) => { modelTypeList: async (data: any = {}) => {
return await request.get({ return await request.get({
url: `/militaryLibrary/militaryTypeTree`, url: `/militaryLibrary/militaryTypeTree`,
params: data, params: data,

View File

@ -44,7 +44,7 @@ export const ModelApi = {
}) })
}, },
//模型类型列表 //模型类型列表
modelTypeList: async (data: any) => { modelTypeList: async (data: any = {}) => {
return await request.get({ return await request.get({
url: `/modelLibrary/modelTypeList`, url: `/modelLibrary/modelTypeList`,

View File

@ -1,6 +1,6 @@
<!--:style="'left:'+(index*Store.scales.distanceOfTicTiny+Store.scales.originOffset)+'px'"--> <!--:style="'left:'+(index*Store.scales.distanceOfTicTiny+Store.scales.originOffset)+'px'"-->
<template> <template>
<div class="timeScale" @click="clickTime"> <div class="timeScale" @click="clickTime" @wheel="wheel">
<!-- 循环数组确保key唯一 --> <!-- 循环数组确保key唯一 -->
<template v-for="(_, index) in ticTiny" :key="index"> <template v-for="(_, index) in ticTiny" :key="index">
<span <span
@ -23,13 +23,19 @@
import {ref, watchEffect} from 'vue' import {ref, watchEffect} from 'vue'
const props = defineProps(['ticTiny', 'ticMain', 'distanceOfTicTiny', 'distanceOfTicMain', 'originOffset', 'originMainOffset']) const props = defineProps(['ticTiny', 'ticMain', 'distanceOfTicTiny', 'distanceOfTicMain', 'originOffset', 'originMainOffset'])
const eventBus: any = inject('bus')
const clickTime = (e) => { const clickTime = (e) => {
console.log("点击时间轴", e) console.log("点击时间轴", e)
let offset = window['tsObj']._Store._scales.scrollLeft + (e.screenX - 400) let offset = window['tsObj']._Store._scales.scrollLeft + (e.screenX - 400)
window['tsObj']._Store.currentTimestamp = window['tsObj']._Store._startTimestamp + (offset / window['tsObj']._Store._scales.preSecondPx) * 1000 window['tsObj']._Store.currentTimestamp = window['tsObj']._Store._startTimestamp + (offset / window['tsObj']._Store._scales.preSecondPx) * 1000
window['tsObj']._Store.setCursorLeft(window['tsObj']._Store._currentTimestamp) window['tsObj']._Store.setCursorLeft(window['tsObj']._Store._currentTimestamp)
} }
const wheel = (event) => {
let num = event.wheelDelta > 0 ? 1 : -1;
eventBus.emit('wheel-time', num)
}
let ticLabel = (val) => { let ticLabel = (val) => {
let timeLabels = [] let timeLabels = []
/* console.log("timeLabels", this.Store.scales.ticMain) /* console.log("timeLabels", this.Store.scales.ticMain)

View File

@ -358,6 +358,12 @@ const handleDrag = (newLeft: number) => {
}*/ }*/
}; };
let add = (num) => { let add = (num) => {
// 不存在事件时,缩放无效
if (window['tsObj']._Store._tasks.length == 0) {
ElMessage({type: "warning", message: "不存在事件时,禁止操作"})
return;
}
// 大格12个取值小格间距3个取值level8-1 // 大格12个取值小格间距3个取值level8-1
if (window['tsObj']._Clock._status == 'play') { if (window['tsObj']._Clock._status == 'play') {
ElMessage({message: "态势推演中,暂停或停止后再试"}) ElMessage({message: "态势推演中,暂停或停止后再试"})
@ -377,7 +383,10 @@ let add = (num) => {
onBeforeUnmount(() => { onBeforeUnmount(() => {
// props.TSOBJ._Clock.stopAnimation() // props.TSOBJ._Clock.stopAnimation()
}) })
eventBus.on('wheel-time', (num) => {
console.log("wheel", num)
add(num)
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -42,7 +42,6 @@
<mouseRight></mouseRight> <mouseRight></mouseRight>
<!-- 方案描述编辑框 --> <!-- 方案描述编辑框 -->
<!--<div class="dialogBox">-->
<el-dialog width="20vw" v-model="isShowPup" :modal="false" draggable> <el-dialog width="20vw" v-model="isShowPup" :modal="false" draggable>
<template #header> <template #header>
<div class="set_pup_header"> <div class="set_pup_header">
@ -100,12 +99,74 @@
<div class="set_detail"> <div class="set_detail">
<el-input type="textarea" :rows="7" v-model="des_detail"></el-input> <el-input type="textarea" :rows="7" v-model="des_detail"></el-input>
</div> </div>
<div style="text-align: right;"> <div style="text-align: right;margin-top: 15px">
<el-button @click="submit">保存</el-button> <el-button @click="submit">保存</el-button>
<el-button @click="isShowPup=false">取消</el-button> <el-button @click="isShowPup=false">取消</el-button>
</div> </div>
</el-dialog> </el-dialog>
<!--</div>--> <!-- 立体文字内容 -->
<el-dialog width="30vw" v-model="showStandText" :modal="false" draggable>
<template #header>
<div class="set_pup_header">
<div class="system_title">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="229" height="35"
viewBox="0 0 229 35" fill="none" preserveAspectRatio="none">
<path
d="M74 34L85 34L99.5 6L88.5 6L74 34ZM92 34L103 34L117.5 6L106.5 6L92 34ZM111 34L122 34L136.5 6L125.5 6L111 34ZM140 34L129 34L143.5 6L154.5 6L140 34ZM148 34L159 34L173.5 6L162.5 6L148 34ZM177 34L166 34L180.5 6L191.5 6L177 34ZM185 34L196 34L210.5 6L199.5 6L185 34ZM214 34L203 34L217.5 6L228.5 6L214 34ZM0 34L11 34L25.5 6.5L14.5 6.5L0 34ZM18 34L29 34L43.5 6.5L32.5 6.5L18 34ZM37 34L48 34L62.5 6.5L51.5 6.5L37 34ZM66 34L55 34L69.5 6.5L80.5 6.5L66 34Z"
fill-rule="evenodd" fill="url(#linear_fill_2442_1053)"/>
<rect x="0" y="0" width="229" height="34" fill="url(#linear_fill_2442_1054)"/>
<g clip-path="url(#clip-path-2442_1055)">
<path
d="M10.3993 32.7333L10.666 33L10.666 21L9.33267 22.3333L4.66602 27L5.66602 28L10.3993 32.7333ZM9.33267 29.6667L6.73267 27L9.33267 24.3333L9.33267 29.6667Z"
fill="rgb(var(--color-base1))"/>
<g opacity="0.5">
<path
d="M7.39934 32.7333L7.66602 33L7.66602 21L6.33267 22.3333L1.66602 27L2.66602 28L7.39934 32.7333ZM6.33267 29.6667L3.73267 27L6.33267 24.3333L6.33267 29.6667Z"
fill="rgb(var(--color-base1))"/>
</g>
</g>
<g clip-path="url(#clip-path-2442_1059)">
<path
d="M218.601 32.7333L218.334 33L218.334 21L219.667 22.3333L224.334 27L223.334 28L218.601 32.7333ZM219.667 29.6667L222.267 27L219.667 24.3333L219.667 29.6667Z"
fill="rgb(var(--color-base1))"/>
<g opacity="0.5">
<path
d="M221.601 32.7333L221.334 33L221.334 21L222.667 22.3333L227.334 27L226.334 28L221.601 32.7333ZM222.667 29.6667L225.267 27L222.667 24.3333L222.667 29.6667Z"
fill="rgb(var(--color-base1))"/>
</g>
</g>
<defs>
<linearGradient id="linear_fill_2442_1053" x1="119.1239013671875" y1="33.99998474121094"
x2="119.1231689453125" y2="6" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="rgb(var(--color-base1))" stop-opacity="0.2"/>
<stop offset="1" stop-color="rgb(var(--color-base1))" stop-opacity="0"/>
</linearGradient>
<linearGradient id="linear_fill_2442_1054" x1="0" y1="17" x2="229" y2="17"
gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="rgb(var(--color-base1))" stop-opacity="0"/>
<stop offset="0.4891" stop-color="rgb(var(--color-base1))" stop-opacity="0.4"/>
<stop offset="1" stop-color="rgb(var(--color-base1))" stop-opacity="0"/>
</linearGradient>
<clipPath id="clip-path-2442_1055">
<path d="M0 19L0 35L16 35L16 19L0 19Z" fill="white"/>
</clipPath>
<clipPath id="clip-path-2442_1059">
<path d="M229 19L229 35L213 35L213 19L229 19Z" fill="white"/>
</clipPath>
</defs>
</svg>
立体文字
</div>
</div>
</template>
<div class="set_detail">
<el-input type="textarea" v-model="standText"></el-input>
</div>
<div style="text-align: right;margin-top: 15px">
<el-button @click="()=>{submitStandText(true)}">保存</el-button>
<el-button @click="()=>{submitStandText(false)}">取消</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
@ -128,7 +189,10 @@ import {$changeComponentShow} from "../../utils/communication";
const planInfo = ref({}) const planInfo = ref({})
const isShowPup = ref(false) const isShowPup = ref(false)
const showStandText = ref(false)
const currentDrawItem = ref({})
const des_detail = ref("") const des_detail = ref("")
const standText = ref("")
const stamp = ref("") const stamp = ref("")
const rightMenus = ref([ const rightMenus = ref([
@ -200,6 +264,16 @@ let submit = () => {
isShowPup.value = false isShowPup.value = false
}) })
} }
let submitStandText = (flag) => {
showStandText.value = false
/* let res = {
currentDrawItem: currentDrawItem.value,
source_name: flag ? standText.value : ""
}*/
currentDrawItem.value.source_name = flag ? standText.value : ""
eventBus.emit('standText-value', currentDrawItem.value)
}
// 通过planID获取方案包含的所有事件 // 通过planID获取方案包含的所有事件
let getEventList = () => { let getEventList = () => {
let events: any = [] let events: any = []
@ -226,10 +300,14 @@ let getEventList = () => {
newTS(params, events) newTS(params, events)
} }
eventBus.on('delete-event', (ids) => { eventBus.on('delete-event', (ids) => {
console.log(ids)
tsOBJ.value._Store._tasks = tsOBJ.value._Store._tasks.filter(item => !ids.includes(item.id)) tsOBJ.value._Store._tasks = tsOBJ.value._Store._tasks.filter(item => !ids.includes(item.id))
}) })
eventBus.on('open-standText', (currentDrawItemres) => {
standText.value = ""
showStandText.value = true
currentDrawItem.value = currentDrawItemres
})
eventBus.on('add-event', (task) => { eventBus.on('add-event', (task) => {
tsOBJ.value._Store._tasks = [...tsOBJ.value._Store._tasks, task] tsOBJ.value._Store._tasks = [...tsOBJ.value._Store._tasks, task]
}) })

View File

@ -85,6 +85,7 @@ interface Tree {
children?: Tree[] children?: Tree[]
} }
const eventBus: any = inject('bus')
const treeRef = ref<TreeInstance>() const treeRef = ref<TreeInstance>()
const defaultProps = { const defaultProps = {
children: 'children', children: 'children',
@ -106,7 +107,13 @@ const tabs = [
{name: "钳形箭头", source_name: "钳形箭头", funName: 'DrawPincerArrow', type: "pincerArrow", positionLength: 5} {name: "钳形箭头", source_name: "钳形箭头", funName: 'DrawPincerArrow', type: "pincerArrow", positionLength: 5}
] ]
}, },
{name: "特效", dataType: 'list', children: [/*{name: "火焰"}*/]}, {
name: "特效", dataType: 'list', children: [
{name: "火焰", source_name: "火焰", funName: 'DrawPoint', type: "fire"},
{name: "喷射水柱", source_name: "喷射水柱", funName: 'DrawPolyline', type: "waterL", option: {number: 2}},
{name: "立体文字", source_name: "", funName: 'DrawPolyline', type: "standText", positionLength: 2}
]
},
] ]
let treeData = ref<Tree[]>([]) let treeData = ref<Tree[]>([])
// 模型类型 // 模型类型
@ -203,22 +210,40 @@ let getGraphTypeList = async () => {
graphTypes.value = res.data graphTypes.value = res.data
} }
} }
eventBus.on('standText-value', obj => {
console.log("obj", obj)
addMarker(obj, false)
})
// 添加标绘 // 添加标绘
let addMarker = (item) => { let addMarker = (item, needSendEvent = true) => {
if (window['tsObj']._Clock._status == 'play') { if (window['tsObj']._Clock._status == 'play') {
ElMessage({message: "态势推演中,暂停或停止后再试"}) ElMessage({message: "态势推演中,暂停或停止后再试"})
return; return;
} }
let nodes = getSelectedNodes(window['treeObj'])
console.log("绘制", item) console.log("绘制", item)
console.log("获取选中的节点", nodes) // 立体文字的节点名称需要先弹框输入文本内容
if (item.type == 'standText' && item.source_name == '') {
if (needSendEvent)
eventBus.emit('open-standText', item)
return;
}
let nodes = getSelectedNodes(window['treeObj'])
// console.log("获取选中的节点", nodes)
let id = new YJ.Tools().randomString() let id = new YJ.Tools().randomString()
let pId = -1 let pId = -1
if (nodes.length) { if (nodes.length) {
pId = nodes[0].sourceType == 'directory' ? nodes[0].id : nodes[0].parentId pId = nodes[0].sourceType == 'directory' ? nodes[0].id : nodes[0].parentId
} }
// let pId = nodes.length >= 1 ? nodes[0].id : -1 // let pId = nodes.length >= 1 ? nodes[0].id : -1
window.draw = new YJ.Draw[item.funName](earth_ts)
console.log("立体文字有效,准备绘制")
// 模拟后续步骤完成后将默认值设回“”
/* setTimeout(() => {
item.source_name = ""
}, 100)*/
// return;
window.draw = new YJ.Draw[item.funName](window['earth_ts'], item.option ? item.option : "")
window.draw.start((a, position) => { window.draw.start((a, position) => {
console.log(position) console.log(position)
if (position != undefined) { if (position != undefined) {
@ -245,9 +270,27 @@ let addMarker = (item) => {
obj.center = position.center obj.center = position.center
obj.radius = position.radius obj.radius = position.radius
break break
case "fire":
obj.lng = position.lng
obj.lat = position.lat
obj.alt = position.alt
delete obj.position
break
case "waterL":
obj.start = position[0]
obj.end = position[1]
delete obj.position
break
case "standText":
obj.positions = position
obj.text = item.source_name
delete obj.position
if (position.length < item.positionLength) return
break
} }
// console.log("添加标注标会") // console.log("添加标注标会")
addMapSource(item.type, pId, obj) addMapSource(item.type, pId, obj)
item.source_name = ""
} }

View File

@ -85,6 +85,15 @@ export function initMapData(type, data, cb: any = null) {
if (cb) if (cb)
cb(entityObject) cb(entityObject)
break break
case "fire":
entityObject = new YJ.Obj.Flame(window['earth_ts'], data)
break;
case 'waterL':
entityObject = new YJ.Obj.Spout(window['earth_ts'], data)
break
case 'standText':
entityObject = new YJ.Obj.StandText(window['earth_ts'], data)
break
} }
if (entityObject) { if (entityObject) {
function getOptions() { function getOptions() {
@ -177,6 +186,7 @@ export function addMapSource(type, pId, option, cb: any = null) {
"planId": window['planId'] "planId": window['planId']
} }
console.log('dbOption', dbOption) console.log('dbOption', dbOption)
// return
TsApi.addTsSource(dbOption).then(res => { TsApi.addTsSource(dbOption).then(res => {
console.log("addTsSource", res) console.log("addTsSource", res)
cb && cb(res) cb && cb(res)

View File

@ -236,7 +236,13 @@ const toTSEdit = (row) => {
console.log("当前推演方案", row) console.log("当前推演方案", row)
router.push({ router.push({
name: 'tsEdit', // 必须用 name 匹配路由,不能用 path name: 'tsEdit', // 必须用 name 匹配路由,不能用 path
query: {id: row.id, name: row.name, desc: row.desc, start_time: new Date(row.simulationStartTime).getTime(),} query: {
id: row.id,
name: row.name,
desc: row.desc,
wheel: row.wheel,
start_time: new Date(row.simulationStartTime).getTime(),
}
}) })
} }