From ae910a61203110b31003523142d6dec9e5033fb2 Mon Sep 17 00:00:00 2001 From: liaoboping <2824044657@qq.com> Date: Mon, 18 Aug 2025 17:19:38 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=8D=95=E5=85=83=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=8D=95=E5=85=83=E7=BB=8F?= =?UTF-8?q?=E7=BA=AC=E5=BA=A6=EF=BC=8C=E8=AE=BE=E7=BD=AE=E5=8D=95=E5=85=83?= =?UTF-8?q?=E9=AB=98=E5=BA=A6/=E6=B7=B1=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sceneEditing/components/LonLatInput.vue | 150 ++++++++++-- .../simulationScene/sceneEditing/index.vue | 224 ++++++++++++++---- 2 files changed, 303 insertions(+), 71 deletions(-) diff --git a/src/views/simulationScene/sceneEditing/components/LonLatInput.vue b/src/views/simulationScene/sceneEditing/components/LonLatInput.vue index c5c4006..43fe543 100644 --- a/src/views/simulationScene/sceneEditing/components/LonLatInput.vue +++ b/src/views/simulationScene/sceneEditing/components/LonLatInput.vue @@ -1,34 +1,34 @@ @@ -39,6 +39,104 @@ export default { lon: { type: Number, required: true }, lat: { type: Number, required: true }, }, + data() { + return { + EWSelect: 1, + NSSelect: 1, + } + }, + computed: { + lonSelect: { + get() { + return this.lon ? this.lon / this.lonNumber : this.EWSelect + }, + set(v) { + this.$emit('update:lon', this.lonNumber * v) + this.EWSelect = v + }, + }, + lonNumber: { + get() { + return Math.abs(this.lon) + }, + set(v) { + this.$emit('update:lon', Math.abs(v) * this.lonSelect) + }, + }, + lonDegree: { + get() { + return Math.floor(this.lonNumber) + }, + set(v) { + this.$emit('update:lon', Math.abs(v) * this.lonSelect + this.lonMinute / 60 + this.lonSecond / 3600) + }, + }, + lonMinute: { + get() { + return Math.floor(this.lonNumber * 60) % 60 + }, + set(v) { + this.$emit('update:lon', this.lonDegree * this.lonSelect + Math.abs(v) / 60 + this.lonSecond / 3600) + }, + }, + lonSecond: { + get() { + return Math.floor(this.lonNumber * 3600) % 60 + }, + set(v) { + this.$emit('update:lon', this.lonDegree * this.lonSelect + this.lonMinute / 60 + Math.abs(v) / 3600) + }, + }, + latSelect: { + get() { + return this.lat ? this.lat / this.latNumber : this.NSSelect + }, + set(v) { + this.$emit('update:lat', this.latNumber * v) + this.NSSelect = v + }, + }, + latNumber: { + get() { + return Math.abs(this.lat) + }, + set(v) { + this.$emit('update:lat', Math.abs(v) * this.latSelect) + }, + }, + latDegree: { + get() { + return Math.floor(this.latNumber) + }, + set(v) { + this.$emit('update:lat', Math.abs(v) * this.latSelect + this.latMinute / 60 + this.latSecond / 3600) + }, + }, + latMinute: { + get() { + return Math.floor(this.latNumber * 60) % 60 + }, + set(v) { + this.$emit('update:lat', this.latDegree * this.latSelect + Math.abs(v) / 60 + this.latSecond / 3600) + }, + }, + latSecond: { + get() { + return Math.floor(this.latNumber * 3600) % 60 + }, + set(v) { + this.$emit('update:lat', this.latDegree * this.latSelect + this.latMinute / 60 + Math.abs(v) / 3600) + }, + }, + }, + created() { + if (this.lon < 0) { + this.EWSelect = 'W' + } + if (this.lat < 0) { + this.NSSelect = 'S' + } + }, } diff --git a/src/views/simulationScene/sceneEditing/index.vue b/src/views/simulationScene/sceneEditing/index.vue index 3c403b4..e4b0804 100644 --- a/src/views/simulationScene/sceneEditing/index.vue +++ b/src/views/simulationScene/sceneEditing/index.vue @@ -45,8 +45,11 @@
- -
{{ right.jcsx.name }}
+ +
+ {{ right.detail.name }} + +
推演方:
速度: - {{ right.jcsx.position.speed }} 公里/时 + {{ right.detail.position.speed }} 公里/时
经度: - {{ right.jcsx.position.lng | lonFormat }} - + {{ right.detail.position.lng | lonFormat }} +
纬度: - {{ right.jcsx.position.lat | latFormat }} - + {{ right.detail.position.lat | latFormat }} +
高度/深度: - {{ right.jcsx.position.height | numberFormat }} 米(海拔) - + {{ right.detail.position.height | numberFormat }} 米(海拔) +
人员编制数: - {{ right.jcsx.personStatistic.total }} 人 + {{ right.detail.personStatistic.total }} 人
当前人数: - {{ right.jcsx.personStatistic.current }} 人 + {{ right.detail.personStatistic.current }} 人
死亡人数: - {{ right.jcsx.personStatistic.death }} 人 + {{ right.detail.personStatistic.death }} 人
受伤人数: - {{ right.jcsx.personStatistic.injured }} 人 + {{ right.detail.personStatistic.injured }} 人
野战食物初始量(份): - {{ right.jcsx.foodInfo.startNum }} + {{ right.detail.foodInfo.startNum }}
野战食物当前量(份): - {{ right.jcsx.foodInfo.currentNum }} + {{ right.detail.foodInfo.currentNum }}
用水初始量(吨): - {{ right.jcsx.waterInfo.startNum }} + {{ right.detail.waterInfo.startNum }}
用水当前量(吨): - {{ right.jcsx.waterInfo.currentNum }} + {{ right.detail.waterInfo.currentNum }}
油料初始量(份): - {{ right.jcsx.oilInfo.startNum }} + {{ right.detail.oilInfo.startNum }}
油料当前量(份): - {{ right.jcsx.oilInfo.currentNum }} + {{ right.detail.oilInfo.currentNum }}
药材初始量(份): - {{ right.jcsx.medicalInfo.startNum }} + {{ right.detail.medicalInfo.startNum }}
药材当前量(份): - {{ right.jcsx.medicalInfo.currentNum }} + {{ right.detail.medicalInfo.currentNum }}
轻武器弹药量(吨): - {{ right.jcsx.ammunition.lightArms }} + {{ right.detail.ammunition.lightArms }}
压制武器弹药量(吨): - {{ right.jcsx.ammunition.suppressing }} + {{ right.detail.ammunition.suppressing }}
反坦克武器弹药量(吨): - {{ right.jcsx.ammunition.antiTank }} + {{ right.detail.ammunition.antiTank }}
防空反导武器弹药量(吨): - {{ right.jcsx.ammunition.antiAircraft }} + {{ right.detail.ammunition.antiAircraft }}
布扫雷装备弹药量(吨): - {{ right.jcsx.ammunition.mineLaying }} + {{ right.detail.ammunition.mineLaying }}
爆破器材弹药量(吨): - {{ right.jcsx.ammunition.explosiveDevice }} + {{ right.detail.ammunition.explosiveDevice }}
烟火装备弹药量(吨): - {{ right.jcsx.ammunition.smokeDevice }} + {{ right.detail.ammunition.smokeDevice }}
防化消耗弹药量(吨): - {{ right.jcsx.ammunition.antiChemical }} + {{ right.detail.ammunition.antiChemical }}
@@ -210,14 +205,82 @@
-
作战行动
-
单装属性
+
+
+
+
作战行动
+
+ + + + +
+
+
+ + + +
+
+
+
+
+ + + + +
+ {{ label }}:{{ value }} +
+
+
+
+
+
+
- + + + + 名称 + + + + + + + + + + + 高度/深度 + + + + + + @@ -312,7 +375,7 @@ export default { }, right: { radioType: 'jcsx', - jcsx: { + detail: { position: {}, personStatistic: {}, foodInfo: {}, @@ -320,13 +383,23 @@ export default { oilInfo: {}, medicalInfo: {}, ammunition: {}, + actionList: [], + equipmentList: [], }, }, + mcModal: { + visible: false, + mc: '', + }, lonlatModal: { visible: false, lon: 0, lat: 0, }, + hdModal: { + visible: false, + hd: 0, + }, } }, mounted() { @@ -368,16 +441,77 @@ export default { } }, handleSelectTree(selectedKeys, { node }) { - this.right.jcsx = node.dataRef + this.right.detail = node.dataRef }, onSearch(e) { console.log('----', e, e.target.value) }, - handleOpenLonlatModal(lon, lat) { - this.lonlatModal.lon = lon - this.lonlatModal.lat = lat + + handleOpenMcModal() { + this.mcModal.mc = this.right.detail.name + this.mcModal.visible = true + }, + async handleSubmilMc() { + try { + this.$http({ + url: '/save', + method: 'post', + data: { + mc: this.mcModal.mc, + }, + }) + this.$message('编辑单元名称成功') + this.right.detail.name = this.mcModal.mc + this.mcModal.visible = false + } catch (error) { + console.log(error) + } + }, + + handleOpenLonlatModal() { + this.lonlatModal.lon = Number(this.right.detail.position.lng) || 0 + this.lonlatModal.lat = Number(this.right.detail.position.lat) || 0 this.lonlatModal.visible = true }, + async handleSubmilLonlat() { + try { + this.$http({ + url: '/save', + method: 'post', + data: { + lon: this.lonlatModal.lon, + lat: this.lonlatModal.lat, + }, + }) + this.$message('修改单元经纬度成功') + this.right.detail.position.lng = '' + this.lonlatModal.lon + this.right.detail.position.lat = '' + this.lonlatModal.lat + this.lonlatModal.visible = false + } catch (error) { + console.log(error) + } + }, + + handleOpenHdModal() { + this.hdModal.hd = Number(this.right.detail.position.height) || 0 + this.hdModal.visible = true + }, + async handleSubmilHd() { + try { + this.$http({ + url: '/save', + method: 'post', + data: { + hd: this.hdModal.hd, + }, + }) + this.$message('修改单元高度/深度成功') + this.right.detail.position.height = this.hdModal.hd + this.hdModal.visible = false + } catch (error) { + console.log(error) + } + }, }, }