diff --git a/frontend/Skyeye-sys-ui/public/config.js b/frontend/Skyeye-sys-ui/public/config.js index 27b7977..d829b2d 100644 --- a/frontend/Skyeye-sys-ui/public/config.js +++ b/frontend/Skyeye-sys-ui/public/config.js @@ -2,7 +2,7 @@ window.config = { env: 'offline', //online //api: 'http://127.0.0.1:9116/', // 外网服务器, api: 'http://192.168.43.127:9116', - // socket: 'http://127.0.0.1:9116', 外网服务器, + socket: 'http://192.168.43.127:9116', //外网服务器, imagePath: 'http://192.168.112.181:9000/files', arithmeticPath: 'http://127.0.0.1:18090/ktkx/UavPlanning/SAR', tokenKey: 'accessToken', diff --git a/frontend/Skyeye-sys-ui/src/views/home/components/task-manage/index.js b/frontend/Skyeye-sys-ui/src/views/home/components/task-manage/index.js index 6794e81..4c6b2bb 100644 --- a/frontend/Skyeye-sys-ui/src/views/home/components/task-manage/index.js +++ b/frontend/Skyeye-sys-ui/src/views/home/components/task-manage/index.js @@ -5,7 +5,7 @@ import { lodLayer, viewer } from '@/components/dt-scene/index.vue' import SceneInfo from '@/mixin/scene-info' import LeftSlide from '@/components/LeftSlide.vue' -import { mapGetters } from 'vuex' +import { mapGetters, mapMutations } from 'vuex' import * as DT from 'dt-sdk' import { ICON_MODE } from '@/enum' @@ -652,6 +652,7 @@ export default { taskUavCollection = {} }, methods: { + ...mapMutations('app', ['SET_MENUS_CHOSE']), // #region 任务启动部分代码迁移 reRunTask(info) { if (info.status !== 2) return @@ -664,27 +665,29 @@ export default { if (res.data.code === 200) { console.log('重新运行结果', res) this.$message.success('任务重新执行成功') - let data = res.data.data - data.check = data.status === 1 - data.statusName = this.jobStatus[data.status + ''] - data.uavList.forEach(child => { - if (!child.trailList) { - child.trailList = [] - } - child.jobName = data.name - }) - this.taskList.data.unshift({ - id: data.id, - beginTime: data.beginTime, - check: data.check, - endTime: data.endTime, - mode: data.mode, - name: data.name, - status: data.status, - statusName: data.statusName, - }) - taskListResource.unshift(data) - this.addUavToScene(data) + this.getList() + this.SET_MENUS_CHOSE('1') + // let data = res.data.data + // data.check = data.status === 1 + // data.statusName = this.jobStatus[data.status + ''] + // data.uavList.forEach(child => { + // if (!child.trailList) { + // child.trailList = [] + // } + // child.jobName = data.name + // }) + // this.taskList.data.unshift({ + // id: data.id, + // beginTime: data.beginTime, + // check: data.check, + // endTime: data.endTime, + // mode: data.mode, + // name: data.name, + // status: data.status, + // statusName: data.statusName, + // }) + // taskListResource.unshift(data) + // this.addUavToScene(data) // this.addTaskPlanArea(data.pointList, data.id, data.name) } else { this.$message.error(res.data.message) @@ -700,8 +703,9 @@ export default { }).then(res => { stopTaskFly({ id: info.id }).then(res => { if (res.data.code === 200) { - info.status = 2 - info.statusName = this.jobStatus[info.status + ''] + // info.status = 2 + this.getList() + // info.statusName = this.jobStatus[info.status + ''] this.$message.success('任务已结束!') } else { this.$message.error(res.data.message) @@ -718,16 +722,17 @@ export default { }).then(res => { flyTaskUavCommand({ id: info.id }).then(res => { if (res.data.code === 200) { - info.status = 1 - info.check = false - info.statusName = this.jobStatus[info.status + ''] - this.toggleTaskSceneShow(info, index) - this.taskList.data.forEach((child, childIndex) => { - if (child.check && child.status === 2) { - this.toggleTaskSceneShow(child, childIndex) - } - }) + // info.status = 1 + // info.check = false + // info.statusName = this.jobStatus[info.status + ''] + // this.toggleTaskSceneShow(info, index) + // this.taskList.data.forEach((child, childIndex) => { + // if (child.check && child.status === 2) { + // this.toggleTaskSceneShow(child, childIndex) + // } + // }) this.$message.success('起飞成功') + this.SET_MENUS_CHOSE('1') } else { this.$message.error(res.data.message) } @@ -735,6 +740,8 @@ export default { }) }, toggleTaskSceneShow(info, index) { + console.log(5555555555); + if (info.check) { info.check = false; taskListResource[index].check = false @@ -953,6 +960,7 @@ export default { status: item.status, statusName: item.statusName, }) + this.removeTaskTarget(item.id) }) taskListResource = data this.taskList.data = list diff --git a/frontend/Skyeye-sys-ui/src/views/home/components/twin-situation/index.js b/frontend/Skyeye-sys-ui/src/views/home/components/twin-situation/index.js index 29013de..37cfd9a 100644 --- a/frontend/Skyeye-sys-ui/src/views/home/components/twin-situation/index.js +++ b/frontend/Skyeye-sys-ui/src/views/home/components/twin-situation/index.js @@ -425,6 +425,7 @@ export default { 'taskFlightMode', 'detectType', 'jobStatus', + 'menusChose' ]), isIconModeLarge() { return this.iconMode === ICON_MODE.LARGE @@ -442,6 +443,8 @@ export default { visibleLocale(nv) { if (!nv) { this.$emit('update:visible', false) + alert(7777777) + } }, sceneComplete: { @@ -528,11 +531,7 @@ export default { if (handler) { handler.removeInputAction(DT.Cesium.ScreenSpaceEventType.LEFT_CLICK) } - if (stompClientInstance) { - disconnectWebSocket(stompClientInstance) - socketInstance = null - stompClientInstance = null - } + viewer.entities.removeAll() // if (broadcastChannel) { // this.closeBroadcastChannel() @@ -546,6 +545,11 @@ export default { radarSceneEntity = {} sceneEntity = {} taskListResource = [] + if (stompClientInstance) { + disconnectWebSocket(stompClientInstance) + socketInstance = null + stompClientInstance = null + } }, methods: { ...mapMutations('scene-control', [ @@ -1055,7 +1059,7 @@ export default { }) // this.startWebSocket() - // this.createWebsocket() + this.createWebsocket() }, toggleRightShow() { @@ -1110,6 +1114,11 @@ export default { }) taskListResource = data this.taskList.data = list + this.taskList.data[0].check = true + if (this.menusChose === '1') { + this.addUavToScene(data[0]) + this.addTaskPlanArea(data[0].pointList, data[0].id, data[0].name) + } } else { this.$message.error(res.data.message) } @@ -1547,7 +1556,7 @@ export default { stopTaskFly({ id: info.id }).then(res => { if (res.data.code === 200) { info.status = 2 - info.statusName = this.jobStatus[info.status + ''] + this.getTaskList() this.$message.success('任务已结束!') } else { this.$message.error(res.data.message) diff --git a/frontend/Skyeye-sys-ui/src/views/home/index.js b/frontend/Skyeye-sys-ui/src/views/home/index.js index 1203ad5..5e8c34e 100644 --- a/frontend/Skyeye-sys-ui/src/views/home/index.js +++ b/frontend/Skyeye-sys-ui/src/views/home/index.js @@ -604,6 +604,7 @@ export default { linePicture = {} currentPicture = null aisCollection = [] + }, methods: { ...mapMutations('scene-control', [