@@ -114,6 +118,7 @@ export default {
},
data() {
return {
+ initial: false,
ws: null,
roomInfo: {
remainTimeStr: '',
@@ -164,13 +169,30 @@ export default {
},
computed: {
zzbzllTreeData() {
- return []
+ const zzbzllTreeData = [
+ {
+ id: '0',
+ resourceName: '红方',
+ selectable: false,
+ children: [],
+ },
+ {
+ id: '1',
+ resourceName: '蓝方',
+ selectable: false,
+ children: [],
+ },
+ ]
+ this.roomInfo.roomData.forEach((item) => {
+ zzbzllTreeData[item.sdzy.type].children.push(item.sdzy)
+ })
+ return zzbzllTreeData
},
zzbzllSelectedFd() {
if (this.zzbzll.selectedKeys.length === 0) {
return null
}
- return null
+ return this.roomInfo.roomData.find((item) => item.sdzy.id === this.zzbzll.selectedKeys[0])
},
rightRows() {
switch (this.rightViewer) {
@@ -185,7 +207,7 @@ export default {
}
},
blbzShowKeys() {
- return []
+ return this.zzbzllSelectedFd?.orgPostList.map((item) => item.orgId) || []
},
showBlbzCheckedTreeData() {
const target = []
@@ -193,10 +215,10 @@ export default {
return target
},
jcsxModelData() {
- return {}
+ return this.zzbzllSelectedFd?.jbxx || {}
},
xdrwActionList() {
- return []
+ return this.zzbzllSelectedFd?.scenarioTasks || []
},
},
created() {
@@ -242,16 +264,26 @@ export default {
case 'path_update':
this.cesium.movePlotByCoordinates(response.data.resourceId, response.data.points)
break
- case 'scenarioInfo':
- this.roomInfo.roomData = response.data
- // this.initPlots()
+ case 'editScenarioInfo':
+ if (this.initial === false) {
+ this.roomInfo.roomData = JSON.parse(response.data)
+ this.initPlots()
+ this.initial = true
+ }
+ break
+ case 'updScenarioInfo':
+ {
+ const data = JSON.parse(response.data)
+ const targetIndex = this.roomInfo.roomData.findIndex((item) => item.sdzy.id === data.sdzy.id)
+ this.$set(this.roomInfo.roomData, targetIndex, data)
+ }
break
default:
- console.log(response.cmdType, JSON.parse(response.data))
+ console.log(response.cmdType, response.data)
break
}
})
- this.ws.send({ cmdType: 'scenarioInfo' })
+ this.ws.send({ cmdType: 'editScenarioInfo' })
},
closeWebsocket() {
this.ws && this.ws.close()
@@ -267,16 +299,19 @@ export default {
}
},
- initPlots(plots) {
- plots.forEach((item) => {
- if (item.lng && item.lat) {
- this.cesium.addPlotByLonLat(item.imgBase64, { lon: +item.lng, lat: +item.lat }, item.id)
+ initPlots() {
+ this.roomInfo.roomData.forEach((item) => {
+ if (item.sdzy.lng && item.sdzy.lat) {
+ this.cesium.addPlotByLonLat(item.imgBase64, { lon: +item.sdzy.lng, lat: +item.sdzy.lat }, item.sdzy.id)
}
})
},
handleSelectZzbzll(selectedKeys, { node }) {
- this.cesium.setClientByCenter({ longitude: +node.dataRef.lng, latitude: +node.dataRef.lat })
+ this.cesium.setClientByCenter({
+ longitude: +this.zzbzllSelectedFd.sdzy.lng,
+ latitude: +this.zzbzllSelectedFd.sdzy.lat,
+ })
},
},
}
@@ -301,6 +336,9 @@ export default {
background-color: #022234;
}
}
+.ant-menu-horizontal {
+ line-height: 30px;
+}
.model-cesium-container {
width: 100%;
height: 100%;
diff --git a/src/views/subsystem/scene/entry.vue b/src/views/subsystem/scene/entry.vue
index dcee9e4..96dad1e 100644
--- a/src/views/subsystem/scene/entry.vue
+++ b/src/views/subsystem/scene/entry.vue
@@ -12,6 +12,7 @@
剩余 {{ roomInfo.remainTimeStr }}
-
+
@@ -54,16 +58,16 @@
ref="jcsx"
v-if="zzbzllSelectedFd"
:scenarioId="scenarioId"
- :resourceId="zzbzllSelectedFd.id"
- :resourceName="zzbzllSelectedFd.title"
- :resourceType="zzbzllSelectedFd.resourceType"
- :type="zzbzllSelectedFd.type"
+ :resourceId="zzbzllSelectedFd.sdzy.id"
+ :resourceName="zzbzllSelectedFd.sdzy.resourceName"
+ :resourceType="zzbzllSelectedFd.sdzy.resourceType"
+ :type="zzbzllSelectedFd.sdzy.type"
:modelData="jcsxModelData"
:readonly="true"
/>
-
+
@@ -72,8 +76,8 @@
ref="xdrw"
v-if="zzbzllSelectedFd"
:scenarioId="scenarioId"
- :resourceId="zzbzllSelectedFd.id"
- :resourceType="zzbzllSelectedFd.resourceType"
+ :resourceId="zzbzllSelectedFd.sdzy.id"
+ :resourceType="zzbzllSelectedFd.sdzy.resourceType"
:actionList="xdrwActionList"
:readonly="true"
/>
@@ -99,6 +103,7 @@ export default {
},
data() {
return {
+ initial: false,
ws: null,
roomInfo: {
remainTimeStr: '',
@@ -128,13 +133,30 @@ export default {
},
computed: {
zzbzllTreeData() {
- return []
+ const zzbzllTreeData = [
+ {
+ id: '0',
+ resourceName: '红方',
+ selectable: false,
+ children: [],
+ },
+ {
+ id: '1',
+ resourceName: '蓝方',
+ selectable: false,
+ children: [],
+ },
+ ]
+ this.roomInfo.roomData.forEach((item) => {
+ zzbzllTreeData[item.sdzy.type].children.push(item.sdzy)
+ })
+ return zzbzllTreeData
},
zzbzllSelectedFd() {
if (this.zzbzll.selectedKeys.length === 0) {
return null
}
- return null
+ return this.roomInfo.roomData.find((item) => item.sdzy.id === this.zzbzll.selectedKeys[0])
},
rightRows() {
switch (this.rightViewer) {
@@ -149,7 +171,7 @@ export default {
}
},
blbzShowKeys() {
- return []
+ return this.zzbzllSelectedFd?.orgPostList.map((item) => item.orgId) || []
},
showBlbzCheckedTreeData() {
const target = []
@@ -157,10 +179,10 @@ export default {
return target
},
jcsxModelData() {
- return {}
+ return this.zzbzllSelectedFd?.jbxx || {}
},
xdrwActionList() {
- return []
+ return this.zzbzllSelectedFd?.scenarioTasks || []
},
},
created() {
@@ -206,16 +228,27 @@ export default {
case 'path_update':
this.cesium.movePlotByCoordinates(response.data.resourceId, response.data.points)
break
- case 'scenarioInfo':
- this.roomInfo.roomData = response.data
- // this.initPlots()
+ case 'editScenarioInfo':
+ if (this.initial === false) {
+ this.roomInfo.roomData = JSON.parse(response.data)
+ this.initPlots()
+ this.initial = true
+ }
+ break
+ case 'updScenarioInfo':
+ {
+ console.log(response.cmdType, response.data, typeof response.data)
+ const data = JSON.parse(response.data)
+ const targetIndex = this.roomInfo.roomData.findIndex((item) => item.sdzy.id === data.sdzy.id)
+ this.$set(this.roomInfo.roomData, targetIndex, data)
+ }
break
default:
- console.log(response.cmdType, JSON.parse(response.data))
+ // console.log(response.cmdType, response.data)
break
}
})
- this.ws.send({ cmdType: 'scenarioInfo' })
+ this.ws.send({ cmdType: 'editScenarioInfo' })
},
closeWebsocket() {
this.ws && this.ws.close()
@@ -231,16 +264,19 @@ export default {
}
},
- initPlots(plots) {
- plots.forEach((item) => {
- if (item.lng && item.lat) {
- this.cesium.addPlotByLonLat(item.imgBase64, { lon: +item.lng, lat: +item.lat }, item.id)
+ initPlots() {
+ this.roomInfo.roomData.forEach((item) => {
+ if (item.sdzy.lng && item.sdzy.lat) {
+ this.cesium.addPlotByLonLat(item.sdzy.imgBase64, { lon: +item.sdzy.lng, lat: +item.sdzy.lat }, item.sdzy.id)
}
})
},
handleSelectZzbzll(selectedKeys, { node }) {
- this.cesium.setClientByCenter({ longitude: +node.dataRef.lng, latitude: +node.dataRef.lat })
+ this.cesium.setClientByCenter({
+ longitude: +this.zzbzllSelectedFd.sdzy.lng,
+ latitude: +this.zzbzllSelectedFd.sdzy.lat,
+ })
},
},
}
@@ -265,6 +301,9 @@ export default {
background-color: #022234;
}
}
+.ant-menu-horizontal {
+ line-height: 30px;
+}
.scene-cesium-container {
width: 100%;
height: 100%;
diff --git a/src/views/subsystem/scene/presetting.vue b/src/views/subsystem/scene/presetting.vue
index a298e1e..f8a16c6 100644
--- a/src/views/subsystem/scene/presetting.vue
+++ b/src/views/subsystem/scene/presetting.vue
@@ -71,7 +71,7 @@
-
+
@@ -195,7 +195,7 @@ export default {
formData: {},
},
fd: {
- force: 0,
+ teamType: 0,
type: 5,
loading: false,
listData: [],
@@ -329,7 +329,7 @@ export default {
async getFdListData() {
try {
this.fd.loading = true
- const res = await getAction(`/baseData/scenario/resources/${this.fd.type}`)
+ const res = await getAction(`/baseData/scenario/resources/${this.fd.type}/${this.fd.teamType}`)
this.fd.listData = res.data
} catch (error) {
console.log(error)
@@ -359,14 +359,14 @@ export default {
const x = e.x - this.$refs['scene-presetting-cesium-container'].offsetLeft
const y = e.y - this.$refs['scene-presetting-cesium-container'].offsetTop
const { plotId, longitude, latitude } = this.cesium.addPlotByOffset(item.imgBase64, { x, y })
- this.savePlot(this.fd.force, item, { plotId, longitude, latitude })
+ this.savePlot(this.fd.teamType, item, { plotId, longitude, latitude })
},
- async savePlot(force, item, { plotId, longitude, latitude }) {
+ async savePlot(teamType, item, { plotId, longitude, latitude }) {
try {
await postAction('/scenario/resource/save', {
id: plotId,
scenarioId: this.scenarioId,
- type: force,
+ type: teamType,
resourceType: item.type,
resourceId: item.id,
lng: longitude,