feat:修改用户,设备保存问题,任务显示问题
This commit is contained in:
parent
b91d363b00
commit
aeaab62a09
@ -1,8 +1,8 @@
|
||||
window.config = {
|
||||
env: 'offline', //online
|
||||
//api: 'http://127.0.0.1:9116/', // 外网服务器,
|
||||
api: 'http://localhost:9116',
|
||||
socket: 'http://localhost:9116', //外网服务器,
|
||||
api: 'http://192.168.43.127:9116',
|
||||
// socket: 'http://127.0.0.1:9116', 外网服务器,
|
||||
imagePath: 'http://192.168.112.181:9000/files',
|
||||
arithmeticPath: 'http://127.0.0.1:18090/ktkx/UavPlanning/SAR',
|
||||
tokenKey: 'accessToken',
|
||||
@ -12,6 +12,6 @@ window.config = {
|
||||
arcgisUrl: 'http://61.48.133.44:14001/map/arcgisMap',
|
||||
minMapLevel: 1,
|
||||
maxMapLevel: 16,
|
||||
defaultLocation: [115.915465, 40.35857694],
|
||||
defaultLocation: [116.40531500114789, 39.86340233391189],
|
||||
tdtToken: '316ac2812387c2cbff7a6f2f4e7f5bdc'
|
||||
}
|
||||
|
||||
@ -17,9 +17,6 @@ export const getUavCurrentHeight = params =>
|
||||
// 获取任务列表
|
||||
export const getTaskListData = params =>
|
||||
req('post', '/sar/job/list', params)
|
||||
// 获取执行中的任务列表
|
||||
export const getExecJobs = params =>
|
||||
req('post', '/sar/job/execJobs', params)
|
||||
// 新增任务
|
||||
export const addTaskFast = params =>
|
||||
req('post', '/sar/job/save', params)
|
||||
@ -29,6 +26,8 @@ export const previewTaskFast = params =>
|
||||
// 编辑任务
|
||||
export const editTaskFast = params =>
|
||||
req('post', '/sar/job/save', params)
|
||||
export const getExecJobs = params =>
|
||||
req('post', '/sar/job/execJobs', params)
|
||||
// 新增任务
|
||||
export const addTaskAirline = params =>
|
||||
req('post', '/sar/job/save2', params)
|
||||
|
||||
@ -9,30 +9,30 @@ const whiteList = ['/login'] // 本地测试保留login
|
||||
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
// 启动进度条
|
||||
// NProgress.start()
|
||||
NProgress.start()
|
||||
// 确定用户是否已登录
|
||||
// const hasToken = getToken()
|
||||
// if (hasToken) {
|
||||
// if (to.path === '/login') {
|
||||
// // 如果已登录,则重定向到主页
|
||||
// next({ path: '/' })
|
||||
// NProgress.done()
|
||||
// } else {
|
||||
// NProgress.done()
|
||||
// next()
|
||||
// }
|
||||
// } else {
|
||||
// /* 没有 token */
|
||||
// if (whiteList.indexOf(to.path) !== -1) {
|
||||
// // 在免费登录白名单,直接去
|
||||
// next()
|
||||
// } else {
|
||||
// // 没有访问权限的其他页面被重定向到登录页面。
|
||||
// next(`/login?redirect=${to.path}`)
|
||||
// NProgress.done()
|
||||
// }
|
||||
// }
|
||||
next()
|
||||
const hasToken = getToken()
|
||||
if (hasToken) {
|
||||
if (to.path === '/login') {
|
||||
// 如果已登录,则重定向到主页
|
||||
next({ path: '/' })
|
||||
NProgress.done()
|
||||
} else {
|
||||
NProgress.done()
|
||||
next()
|
||||
}
|
||||
} else {
|
||||
/* 没有 token */
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
// 在免费登录白名单,直接去
|
||||
next()
|
||||
} else {
|
||||
// 没有访问权限的其他页面被重定向到登录页面。
|
||||
next(`/login?redirect=${to.path}`)
|
||||
NProgress.done()
|
||||
}
|
||||
}
|
||||
// next()
|
||||
|
||||
// 跳转页面时,取消上一个页面的请求
|
||||
if (window.__axiosCancelTokenArr) {
|
||||
|
||||
@ -148,6 +148,21 @@ export default {
|
||||
addDevice() {
|
||||
this.device.visible = true
|
||||
this.device.title = `新增${this.deviceMap[this.queryForm.type]}`
|
||||
if (this.queryForm.type === 'uav') {
|
||||
this.device.form = {
|
||||
id: '',
|
||||
name1: '',
|
||||
code: '',
|
||||
ip1: ''
|
||||
}
|
||||
} else {
|
||||
this.device.form = {
|
||||
id: '',
|
||||
name2: '',
|
||||
type: '',
|
||||
ip2: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
editDevice(row) {
|
||||
this.device.visible = true
|
||||
@ -173,7 +188,7 @@ export default {
|
||||
this.device.visible = false
|
||||
},
|
||||
async submitDevice() {
|
||||
const valid = await this.$refs.form.validate(valid)
|
||||
const valid = await this.$refs.form.validate()
|
||||
if (!valid) return
|
||||
const form = {}
|
||||
if (this.queryForm.type === 'uav') {
|
||||
|
||||
@ -15,12 +15,10 @@ import {
|
||||
addTaskFast,
|
||||
deleteTaskItem, editTaskName, getLoaderEnabledList, getTaskEditItemDetail,
|
||||
getTaskListData, getUavCurrentHeight, getUavEnabledListData, previewTaskFast,
|
||||
reRunTask
|
||||
reRunTask, flyTaskUavCommand, stopTaskFly
|
||||
} from '@/api/task'
|
||||
import LinePlot from './line-plot'
|
||||
import LineTarget from './lineTarget'
|
||||
import axios from 'axios'
|
||||
|
||||
import UavTarget from '../twin-situation/uavTarget'
|
||||
let theViewerTools = null
|
||||
let pickHandler = null
|
||||
let startPoint = null
|
||||
@ -29,6 +27,9 @@ let linePlot = null
|
||||
let airlineCollection = {}
|
||||
let previewEntities = []
|
||||
let taskListResource = []
|
||||
let taskUavCollection = {}
|
||||
let taskPlanAreaCollection = {}
|
||||
let sceneEntity = {}
|
||||
export default {
|
||||
name: 'TaskManage',
|
||||
props: {
|
||||
@ -59,6 +60,8 @@ export default {
|
||||
// executeName: '无人机1',
|
||||
// typeIcon: 'el-icon-camera',
|
||||
// name: '拍照任务',
|
||||
// check: false,
|
||||
// status: 0,
|
||||
// uavCompletion: 30,
|
||||
// isFinish: false,
|
||||
// taskProgressName: '30%',
|
||||
@ -492,7 +495,7 @@ export default {
|
||||
value: 1
|
||||
}
|
||||
],
|
||||
emptyImg: require('@/assets/img/common/empty.svg')
|
||||
emptyImg: require('@/assets/img/common/empty.svg'),
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -618,14 +621,249 @@ export default {
|
||||
// lodLayer.removeAll()
|
||||
// viewer.entities.removeAll()
|
||||
}
|
||||
viewer.entities.removeAll()
|
||||
startPoint = null
|
||||
endPoint = null
|
||||
if (linePlot) {
|
||||
linePlot.destroy()
|
||||
linePlot = null
|
||||
}
|
||||
for (let key in taskPlanAreaCollection) {
|
||||
if (taskPlanAreaCollection[key]) {
|
||||
taskPlanAreaCollection[key].forEach(item => {
|
||||
viewer.entities.remove(item)
|
||||
})
|
||||
}
|
||||
}
|
||||
for (let key in taskUavCollection) {
|
||||
if (taskUavCollection[key]) {
|
||||
taskUavCollection[key].forEach(item => {
|
||||
item.destroy()
|
||||
})
|
||||
}
|
||||
}
|
||||
for (let key in sceneEntity) {
|
||||
if (sceneEntity[key]) {
|
||||
viewer.entities.remove(sceneEntity[key])
|
||||
}
|
||||
}
|
||||
sceneEntity = {}
|
||||
taskPlanAreaCollection = {}
|
||||
taskUavCollection = {}
|
||||
},
|
||||
methods: {
|
||||
// #region 任务启动部分代码迁移
|
||||
reRunTask(info) {
|
||||
if (info.status !== 2) return
|
||||
this.$confirm('确定重新执行吗', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(res => {
|
||||
reRunTask({ id: info.id }).then(res => {
|
||||
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.addTaskPlanArea(data.pointList, data.id, data.name)
|
||||
} else {
|
||||
this.$message.error(res.data.message)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
stopTask(info, index) {
|
||||
this.$confirm('确定结束任务吗', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(res => {
|
||||
stopTaskFly({ id: info.id }).then(res => {
|
||||
if (res.data.code === 200) {
|
||||
info.status = 2
|
||||
info.statusName = this.jobStatus[info.status + '']
|
||||
this.$message.success('任务已结束!')
|
||||
} else {
|
||||
this.$message.error(res.data.message)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
},
|
||||
makeTaskUavFly(info, index) {
|
||||
this.$confirm('确定执行吗', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).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)
|
||||
}
|
||||
})
|
||||
this.$message.success('起飞成功')
|
||||
} else {
|
||||
this.$message.error(res.data.message)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
toggleTaskSceneShow(info, index) {
|
||||
if (info.check) {
|
||||
info.check = false;
|
||||
taskListResource[index].check = false
|
||||
this.removeTaskTarget(info.id);
|
||||
} else {
|
||||
this.addUavToScene(taskListResource[index])
|
||||
this.addTaskPlanArea(taskListResource[index].pointList, info.id, info.name)
|
||||
info.check = true
|
||||
}
|
||||
},
|
||||
addTaskPlanArea(data, taskId, taskName) {
|
||||
taskPlanAreaCollection[taskId] = []
|
||||
let allPositions = []
|
||||
let centerLon = 0
|
||||
let centerLat = 0
|
||||
data.forEach((item, index) => {
|
||||
if (item.length > 1) {
|
||||
let positions = []
|
||||
item.forEach(child => {
|
||||
positions.push(DT.Cesium.Cartesian3.fromDegrees(child.longitude, child.latitude))
|
||||
})
|
||||
positions.push(DT.Cesium.Cartesian3.fromDegrees(item[0].longitude, item[0].latitude))
|
||||
allPositions = allPositions.concat(positions)
|
||||
let entity = viewer.entities.add({
|
||||
position: positions[0],
|
||||
label: {
|
||||
text: `${taskName}任务-规划区域${index + 1}`,
|
||||
disableDepthTestDistance: 10000,
|
||||
font: '14px sans-serif',
|
||||
fillColor: DT.Cesium.Color.RED,
|
||||
horizontalOrigin: DT.Cesium.HorizontalOrigin.LEFT,
|
||||
verticalOrigin: DT.Cesium.VerticalOrigin.BOTTOM,
|
||||
pixelOffset: new DT.Cesium.Cartesian2(0, -10),
|
||||
scaleByDistance: new DT.Cesium.NearFarScalar(0, 1, 1, 0.8),
|
||||
distanceDisplayCondition: new DT.Cesium.DistanceDisplayCondition(0, 10000),
|
||||
showBackground: true,
|
||||
backgroundColor: DT.Cesium.Color.fromCssColorString('rgba(255,255,255,0.6)')
|
||||
},
|
||||
polyline: {
|
||||
positions: positions,
|
||||
width: 2,
|
||||
arcType: DT.Cesium.ArcType.NONE,
|
||||
material: DT.Cesium.Color.RED,
|
||||
depthFailMaterial: DT.Cesium.Color.RED,
|
||||
disableDepthTestDistance: 10000,
|
||||
zIndex: -1
|
||||
}
|
||||
})
|
||||
taskPlanAreaCollection[taskId].push(entity)
|
||||
} else if (item.length === 1) {
|
||||
let position = DT.Cesium.Cartesian3.fromDegrees(item[0].longitude, item[0].latitude)
|
||||
allPositions.push(position)
|
||||
let entity = viewer.entities.add({
|
||||
position,
|
||||
label: {
|
||||
text: `${taskName}任务-规划区域${index + 1}`,
|
||||
disableDepthTestDistance: 10000,
|
||||
font: '14px sans-serif',
|
||||
fillColor: DT.Cesium.Color.RED,
|
||||
horizontalOrigin: DT.Cesium.HorizontalOrigin.LEFT,
|
||||
pixelOffset: new DT.Cesium.Cartesian2(10, 0),
|
||||
showBackground: true,
|
||||
backgroundColor: DT.Cesium.Color.fromCssColorString('rgba(255,255,255,0.6)')
|
||||
},
|
||||
point: {
|
||||
pixelSize: 4,
|
||||
color: DT.Cesium.Color.RED,
|
||||
disableDepthTestDistance: 10000
|
||||
}
|
||||
})
|
||||
taskPlanAreaCollection[taskId].push(entity)
|
||||
|
||||
}
|
||||
})
|
||||
if (allPositions.length > 0) {
|
||||
let cat = DT.Cesium.Cartographic.fromCartesian(allPositions[0])
|
||||
allPositions.push(DT.Cesium.Cartesian3.fromRadians(cat.longitude, cat.latitude, 2000))
|
||||
viewer.cesiumViewer.camera.flyToBoundingSphere(DT.Cesium.BoundingSphere.fromPoints(allPositions), {
|
||||
duration: 0.1,
|
||||
offset: new DT.Cesium.HeadingPitchRange(0, -Math.PI / 2, 0),
|
||||
})
|
||||
}
|
||||
},
|
||||
addUavToScene(info) {
|
||||
let arr = []
|
||||
info.uavList.forEach(item => {
|
||||
console.log(viewer, item, 8888);
|
||||
let uav = new UavTarget(viewer, item)
|
||||
arr.push(uav)
|
||||
})
|
||||
taskUavCollection[info.id] = arr
|
||||
},
|
||||
removeTaskTarget(taskId) {
|
||||
if (taskPlanAreaCollection[taskId]) {
|
||||
taskPlanAreaCollection[taskId].forEach(item => {
|
||||
viewer.entities.remove(item)
|
||||
})
|
||||
taskPlanAreaCollection[taskId] = null
|
||||
}
|
||||
if (taskUavCollection[taskId]) {
|
||||
taskUavCollection[taskId].forEach(item => {
|
||||
item.destroy()
|
||||
})
|
||||
taskUavCollection[taskId] = null
|
||||
}
|
||||
},
|
||||
toggleHistoryPicture(data) {
|
||||
if (taskUavCollection[data.jobId]) {
|
||||
let find = taskUavCollection[data.jobId].find(item => item.uavId + '' === data.uavId + '')
|
||||
if (find) {
|
||||
find.toggleLoaderPictureVisible(data.payloadId, data.fileId)
|
||||
}
|
||||
}
|
||||
},
|
||||
// #endregion
|
||||
handleCommand(command, item) {
|
||||
switch (command) {
|
||||
case 'edit':
|
||||
this.editTaskName(item)
|
||||
break;
|
||||
case 'copy':
|
||||
this.copyTask(item)
|
||||
break;
|
||||
case 'remove':
|
||||
this.deleteTask(item)
|
||||
break;
|
||||
|
||||
}
|
||||
},
|
||||
dealStatusColor(name) {
|
||||
if (name === '执行中') {
|
||||
return '#6ae965'
|
||||
@ -701,7 +939,6 @@ export default {
|
||||
getList() {
|
||||
getTaskListData({ type: 2, orders: [{ column: 'begin_time', asc: false }] }).then(res => {
|
||||
if (res.data.code === 200) {
|
||||
console.log('任务列表', res.data.data)
|
||||
let data = res.data.data
|
||||
let list = []
|
||||
data.forEach(item => {
|
||||
@ -983,7 +1220,6 @@ export default {
|
||||
pointList.push(item.boundaryLonLat)
|
||||
}
|
||||
})
|
||||
|
||||
let info = {
|
||||
info1: JSON.stringify(this.form),
|
||||
id: params.id,
|
||||
@ -1042,7 +1278,7 @@ export default {
|
||||
addTaskFast(info).then(res => {
|
||||
if (res.data.code === 200) {
|
||||
this.$message.success('新增任务任务成功')
|
||||
// this.taskForm.visible = false
|
||||
this.taskForm.visible = false
|
||||
this.resetForm()
|
||||
this.getList()
|
||||
} else {
|
||||
@ -1487,7 +1723,7 @@ export default {
|
||||
}
|
||||
this.calculateLimit()
|
||||
},
|
||||
getRatioDisabled(value, index) {
|
||||
getRatioDisabled(value) {
|
||||
if (this.form.imageMode !== '4') {
|
||||
return value.value === '10'
|
||||
} else {
|
||||
|
||||
@ -125,7 +125,7 @@
|
||||
.task-execute {
|
||||
color: $--color-text-1;
|
||||
font-size: 14px;
|
||||
width: 90px;
|
||||
width: 85px;
|
||||
margin-left: 5px;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
title="任务列表"
|
||||
:visible.sync="taskList.visible"
|
||||
:scroll="false"
|
||||
:showClose="true"
|
||||
:showClose="false"
|
||||
:showDivider="false"
|
||||
>
|
||||
<template v-slot:header>
|
||||
@ -25,7 +25,11 @@
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<div v-if="taskList.data.length" class="task-list__content">
|
||||
<div v-for="item in taskList.data" :key="item.id" class="task-item">
|
||||
<div
|
||||
v-for="(item, index) in taskList.data"
|
||||
:key="item.id"
|
||||
class="task-item"
|
||||
>
|
||||
<div class="left-part">
|
||||
<!-- <div class="task-progress-bar" :style="'width: ' + item.uavCompletion +'%;'"></div>-->
|
||||
<div class="execute-info" @click="openTaskLineDetail(item)">
|
||||
@ -59,7 +63,42 @@
|
||||
<!-- <i class="ri-repeat-line" @click.stop="reRunTask(item)"></i>-->
|
||||
|
||||
<!-- </el-tooltip>-->
|
||||
<el-tooltip effect="dark" content="修改名称" placement="top">
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
:content="item.check ? '隐藏' : '显示'"
|
||||
placement="top"
|
||||
>
|
||||
<i
|
||||
:class="item.check ? 'ri-eye-off-line' : 'ri-eye-line'"
|
||||
@click.stop="toggleTaskSceneShow(item, index)"
|
||||
></i>
|
||||
</el-tooltip>
|
||||
<el-tooltip
|
||||
v-if="item.status === 0"
|
||||
effect="dark"
|
||||
content="执行"
|
||||
placement="top"
|
||||
>
|
||||
<i
|
||||
class="ri-arrow-up-circle-line"
|
||||
@click.stop="makeTaskUavFly(item, index)"
|
||||
></i>
|
||||
</el-tooltip>
|
||||
<el-dropdown
|
||||
@command="handleCommand($event, item)"
|
||||
placement="bottom"
|
||||
size="small"
|
||||
>
|
||||
<span class="el-dropdown-link">
|
||||
<i class="ri-more-fill"></i>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="edit">修改名称</el-dropdown-item>
|
||||
<el-dropdown-item command="copy">复制</el-dropdown-item>
|
||||
<el-dropdown-item command="remove">删除</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<!-- <el-tooltip effect="dark" content="修改名称" placement="top">
|
||||
<i
|
||||
class="el-icon-edit-outline"
|
||||
@click.stop="editTaskName(item)"
|
||||
@ -73,7 +112,7 @@
|
||||
class="el-icon-close delete-task"
|
||||
@click.stop="deleteTask(item)"
|
||||
></i>
|
||||
</el-tooltip>
|
||||
</el-tooltip> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -330,7 +369,7 @@
|
||||
>
|
||||
<el-option
|
||||
v-for="item in sarResolutionOptions"
|
||||
:disabled="getRatioDisabled(item, index)"
|
||||
:disabled="getRatioDisabled(item)"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
|
||||
@ -20,9 +20,8 @@ import {
|
||||
getRadarListData,
|
||||
getTaskItemDetail,
|
||||
getTaskListData,
|
||||
getExecJobs,
|
||||
getUavListData,
|
||||
reRunTask, stopTaskFly
|
||||
reRunTask, stopTaskFly, getExecJobs
|
||||
} from '@/api/task'
|
||||
import UavTarget from './uavTarget'
|
||||
import PicturesUpload from '../pictures-upload/index.vue'
|
||||
@ -74,15 +73,15 @@ export default {
|
||||
visible: true,
|
||||
activeTabId: 1,
|
||||
data: [
|
||||
{
|
||||
signal: 50,
|
||||
nickName: '无人机1',
|
||||
battery: 80,
|
||||
flyHeight: 80,
|
||||
lon: 115.76,
|
||||
lat: 40.38,
|
||||
id: 2
|
||||
}
|
||||
// {
|
||||
// signal: 50,
|
||||
// nickName: '无人机1',
|
||||
// battery: 80,
|
||||
// flyHeight: 80,
|
||||
// lon: 115.76,
|
||||
// lat: 40.38,
|
||||
// id: 2
|
||||
// }
|
||||
],
|
||||
typeDict: {
|
||||
1: '无人机',
|
||||
@ -93,13 +92,13 @@ export default {
|
||||
taskList: {
|
||||
visible: true,
|
||||
data: [
|
||||
//{
|
||||
// status: 1,
|
||||
// name: '巡查任务',
|
||||
// statusName: '巡查中',
|
||||
// beginTime: '2026-01-23 12:14:45'
|
||||
//}
|
||||
]
|
||||
{
|
||||
status: 1,
|
||||
name: '巡查任务',
|
||||
statusName: '巡查中',
|
||||
beginTime: '2026-01-23 12:14:45'
|
||||
}
|
||||
]
|
||||
},
|
||||
weatherInfo2: {
|
||||
visible: true,
|
||||
@ -534,6 +533,7 @@ export default {
|
||||
socketInstance = null
|
||||
stompClientInstance = null
|
||||
}
|
||||
viewer.entities.removeAll()
|
||||
// if (broadcastChannel) {
|
||||
// this.closeBroadcastChannel()
|
||||
// }
|
||||
@ -1072,8 +1072,7 @@ export default {
|
||||
},
|
||||
|
||||
getTaskList() {
|
||||
// getTaskListData({ type: 2, orders: [{ column: 'begin_time', asc: false }] }).then(res => {
|
||||
getExecJobs({ type: 2, orders: [{ column: 'begin_time', asc: false }] }).then(res => {
|
||||
getExecJobs({ type: 2, orders: [{ column: 'begin_time', asc: false }] }).then(res => {
|
||||
if (res.data.code === 200) {
|
||||
console.log('任务列表', res.data.data)
|
||||
let data = res.data.data
|
||||
@ -3045,6 +3044,8 @@ export default {
|
||||
//#region 航线详情
|
||||
openTaskLineDetail(info) {
|
||||
this.taskLineDetail.visible = false
|
||||
console.log(taskListResource, 555);
|
||||
|
||||
let find = taskListResource.find(item => item.id === info.id)
|
||||
|
||||
console.log('信息', find)
|
||||
|
||||
@ -196,8 +196,8 @@
|
||||
width: 40px;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 8px;
|
||||
align-items: center;
|
||||
|
||||
>i {
|
||||
|
||||
@ -84,37 +84,40 @@
|
||||
></span>
|
||||
<span class="task-execute">{{ item.name }}</span>
|
||||
</div>
|
||||
<div class="task-info" :style="{color:dealStatusColor(item.statusName)}">
|
||||
<div
|
||||
class="task-info"
|
||||
:style="{ color: dealStatusColor(item.statusName) }"
|
||||
>
|
||||
{{ item.statusName }}
|
||||
</div>
|
||||
<div class="task-time">{{ item.beginTime }}</div>
|
||||
</div>
|
||||
<div class="right-part">
|
||||
<div class="right-part" >
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
:content="item.check ? '隐藏' : '显示'"
|
||||
placement="right"
|
||||
placement="top"
|
||||
>
|
||||
<i
|
||||
:class="item.check ? 'ri-eye-off-line' : 'ri-eye-line'"
|
||||
@click.stop="toggleTaskSceneShow(item, index)"
|
||||
></i>
|
||||
</el-tooltip>
|
||||
<el-tooltip
|
||||
<!-- <el-tooltip
|
||||
v-if="item.status === 0"
|
||||
effect="dark"
|
||||
content="执行"
|
||||
placement="right"
|
||||
placement="top"
|
||||
>
|
||||
<i
|
||||
class="ri-flight-takeoff-line"
|
||||
class="ri-arrow-up-circle-line"
|
||||
@click.stop="makeTaskUavFly(item, index)"
|
||||
></i>
|
||||
</el-tooltip>
|
||||
</el-tooltip> -->
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
content="结束任务"
|
||||
placement="right"
|
||||
placement="top"
|
||||
v-if="item.status === 1"
|
||||
>
|
||||
<i
|
||||
@ -125,16 +128,14 @@
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
content="重新执行"
|
||||
placement="right"
|
||||
placement="top"
|
||||
v-if="item.status === 2"
|
||||
>
|
||||
<i
|
||||
class="ri-repeat-line"
|
||||
class="ri-restart-line"
|
||||
@click.stop="reRunTask(item, index)"
|
||||
></i>
|
||||
</el-tooltip>
|
||||
<!-- <i class="el-icon-edit-outline edit-task" @click.stop="editTask(item)"></i>-->
|
||||
<!-- <i class="el-icon-close delete-task" @click.stop="deleteTask(item)"></i>-->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -16,7 +16,7 @@ export default class UavTarget {
|
||||
this.startAltitude = options.startAltitude
|
||||
|
||||
this.addPlanLine(options.airlineList)
|
||||
this.addUav(options)
|
||||
// this.addUav(options.airlineList)
|
||||
this.addUavLoader(options.payloadList)
|
||||
}
|
||||
addUav(info) {
|
||||
@ -32,37 +32,38 @@ export default class UavTarget {
|
||||
}
|
||||
let currentPosition = this.positions[this.positions.length - 1].clone()
|
||||
let id = `${this.jobId}~${this.uavId}-uav`
|
||||
|
||||
this.uavEntity = this.viewer.entities.add({
|
||||
id,
|
||||
position: currentPosition,
|
||||
// label: {
|
||||
// text: info.uavName,
|
||||
// font: '14px sans-serif',
|
||||
// fillColor: DT.Cesium.Color.WHITE,
|
||||
// horizontalOrigin: DT.Cesium.HorizontalOrigin.LEFT,
|
||||
// verticalOrigin: DT.Cesium.VerticalOrigin.CENTER,
|
||||
// disableDepthTestDistance: 10000,
|
||||
// pixelOffset: new DT.Cesium.Cartesian2(10, 0),
|
||||
// showBackground: true,
|
||||
// scaleByDistance: new DT.Cesium.NearFarScalar(0, 1, 1, 0.8),
|
||||
// distanceDisplayCondition: new DT.Cesium.DistanceDisplayCondition(0, 20000),
|
||||
// backgroundColor: DT.Cesium.Color.fromCssColorString('rgba(0,0,0,0.7)'),
|
||||
// style: DT.Cesium.LabelStyle.FILL_AND_OUTLINE,
|
||||
// },
|
||||
// model: {
|
||||
// uri: process.env.BASE_URL + 'model/uav.gltf',
|
||||
// // scale: 1,
|
||||
// minimumPixelSize: 32,
|
||||
// maximumScale: 128,
|
||||
// },
|
||||
label: {
|
||||
text: info.uavName,
|
||||
font: '14px sans-serif',
|
||||
fillColor: DT.Cesium.Color.WHITE,
|
||||
horizontalOrigin: DT.Cesium.HorizontalOrigin.LEFT,
|
||||
verticalOrigin: DT.Cesium.VerticalOrigin.CENTER,
|
||||
disableDepthTestDistance: 10000,
|
||||
pixelOffset: new DT.Cesium.Cartesian2(10, 0),
|
||||
showBackground: true,
|
||||
scaleByDistance: new DT.Cesium.NearFarScalar(0, 1, 1, 0.8),
|
||||
distanceDisplayCondition: new DT.Cesium.DistanceDisplayCondition(0, 20000),
|
||||
backgroundColor: DT.Cesium.Color.fromCssColorString('rgba(0,0,0,0.7)'),
|
||||
style: DT.Cesium.LabelStyle.FILL_AND_OUTLINE,
|
||||
},
|
||||
model: {
|
||||
uri: process.env.BASE_URL + 'model/uav.gltf',
|
||||
// scale: 1,
|
||||
minimumPixelSize: 32,
|
||||
maximumScale: 128,
|
||||
},
|
||||
polyline: {
|
||||
positions: new DT.Cesium.CallbackProperty(function () {
|
||||
return that.positions
|
||||
}, false),
|
||||
width: 2,
|
||||
zIndex: 6,
|
||||
material: DT.Cesium.Color.CYAN,
|
||||
depthFailMaterial: DT.Cesium.Color.CYAN,
|
||||
width: 8,
|
||||
zIndex: 600,
|
||||
material: DT.Cesium.Color.BLACK,
|
||||
depthFailMaterial: DT.Cesium.Color.CYAN,
|
||||
arcType: DT.Cesium.ArcType.NONE
|
||||
}
|
||||
})
|
||||
@ -75,8 +76,8 @@ export default class UavTarget {
|
||||
let loaderPicture = {}
|
||||
data.forEach(loader => {
|
||||
loaderPicture[loader.payloadId] = []
|
||||
let key = 'imageList'
|
||||
if (loader.imageHighList && loader.imageHighList.length > 0) {
|
||||
let key = 'imageList'
|
||||
if (loader.imageHighList && loader.imageHighList.length > 0) {
|
||||
key = 'imageHighList'
|
||||
}
|
||||
if (loader[key] && loader[key].length > 0) {
|
||||
@ -120,12 +121,12 @@ export default class UavTarget {
|
||||
url: window.config.imagePath + image.relativePath,
|
||||
rectangle
|
||||
})
|
||||
let addLayer = this.viewer.cesiumViewer.imageryLayers.addImageryProvider(layer)
|
||||
let addLayer = this.viewer.cesiumViewer.imageryLayers.addImageryProvider(layer)
|
||||
// 设置分屏显示
|
||||
addLayer.splitDirection = DT.Cesium.ImagerySplitDirection.LEFT
|
||||
obj.picture = addLayer
|
||||
if (image.itemList) {
|
||||
image.itemList.forEach( (mark, markIndex) => {
|
||||
image.itemList.forEach((mark, markIndex) => {
|
||||
let markId = `${this.jobId}~${this.uavId}~${loader.payloadId}~${image.fileId}~${mark.id}-mark${imageIndex}${markIndex}`
|
||||
let markPosition = DT.Cesium.Cartesian3.fromDegrees(mark.left1Lon, mark.left1Lat, 1)
|
||||
let markArr = [
|
||||
@ -216,7 +217,7 @@ export default class UavTarget {
|
||||
|
||||
// console.log('添加的图片', obj.picture)
|
||||
if (image.itemList) {
|
||||
image.itemList.forEach( (mark, markIndex) => {
|
||||
image.itemList.forEach((mark, markIndex) => {
|
||||
let markId = `${this.jobId}~${this.uavId}~${image.payloadId}~${image.fileId}~${mark.id}-mark${length}${markIndex}`
|
||||
let markPosition = DT.Cesium.Cartesian3.fromDegrees(mark.left1Lon, mark.left1Lat, 1)
|
||||
let markArr = [
|
||||
@ -258,7 +259,7 @@ export default class UavTarget {
|
||||
console.log('删除旧的')
|
||||
layer.readyPromise.then(res => {
|
||||
console.log('回调执行')
|
||||
let addLayer = this.viewer.cesiumViewer.imageryLayers.addImageryProvider(layer)
|
||||
let addLayer = this.viewer.cesiumViewer.imageryLayers.addImageryProvider(layer)
|
||||
// 设置分屏显示
|
||||
addLayer.splitDirection = DT.Cesium.ImagerySplitDirection.LEFT
|
||||
obj.picture = addLayer
|
||||
@ -285,7 +286,7 @@ export default class UavTarget {
|
||||
|
||||
}
|
||||
}
|
||||
toggleLoaderPictureVisible(payloadId,fileId) {
|
||||
toggleLoaderPictureVisible(payloadId, fileId) {
|
||||
console.log('切换显隐', payloadId, fileId)
|
||||
if (this.loaderPicture[payloadId]) {
|
||||
let find = this.loaderPicture[payloadId].find(item => item.fileId + '' === fileId + '')
|
||||
@ -300,7 +301,7 @@ export default class UavTarget {
|
||||
}
|
||||
}
|
||||
}
|
||||
toggleLoaderPictureActive(payloadId,fileId, active, visible = true) {
|
||||
toggleLoaderPictureActive(payloadId, fileId, active, visible = true) {
|
||||
if (this.loaderPicture[payloadId]) {
|
||||
let find = this.loaderPicture[payloadId].find(item => item.fileId + '' === fileId + '')
|
||||
if (find) {
|
||||
|
||||
@ -41,7 +41,10 @@ export default {
|
||||
user: {
|
||||
visible: false,
|
||||
form: {
|
||||
account: ''
|
||||
id: '',
|
||||
account: '',
|
||||
password: '',
|
||||
confirmPassword: ''
|
||||
},
|
||||
rules: {
|
||||
account: [
|
||||
@ -90,18 +93,31 @@ export default {
|
||||
})
|
||||
},
|
||||
addUser() {
|
||||
this.user.form = {
|
||||
id: '',
|
||||
account: '',
|
||||
password: '',
|
||||
confirmPassword: ''
|
||||
}
|
||||
this.user.visible = true
|
||||
},
|
||||
editUser(form) {
|
||||
this.user.visible = true
|
||||
this.user.form.account = form.account
|
||||
this.user.form.id = form.id
|
||||
},
|
||||
close() {
|
||||
this.$refs.form.resetFields()
|
||||
this.user.visible = false
|
||||
this.user.form = {
|
||||
id: '',
|
||||
account: '',
|
||||
password: '',
|
||||
confirmPassword: ''
|
||||
}
|
||||
},
|
||||
async submitUser() {
|
||||
const valid = await this.$refs.form.validate(valid)
|
||||
const valid = await this.$refs.form.validate()
|
||||
if (!valid) return
|
||||
delete this.user.form.confirmPassword
|
||||
const form = { ...this.user.form }
|
||||
|
||||
@ -58,7 +58,7 @@
|
||||
</el-table>
|
||||
<dt-dialog
|
||||
class="dialog-light"
|
||||
:title="user.form.userId ? '编辑用户' : '新增用户'"
|
||||
:title="user.form.id ? '编辑用户' : '新增用户'"
|
||||
:visible.sync="user.visible"
|
||||
top="20vh"
|
||||
width="22%"
|
||||
|
||||
@ -682,7 +682,7 @@ export default {
|
||||
this.sceneComplete = true
|
||||
// this.addHandler()
|
||||
// this.$refs.tools.handleMapChange('sat')
|
||||
let position = DT.Cesium.Cartesian3.fromDegrees(window.config.defaultLocation[0], window.config.defaultLocation[1], 1000)
|
||||
let position = DT.Cesium.Cartesian3.fromDegrees(window.config.defaultLocation[0], window.config.defaultLocation[1], 400000)
|
||||
viewer.cesiumViewer.scene.camera.flyTo({
|
||||
destination: position,
|
||||
duration: 1
|
||||
|
||||
Loading…
Reference in New Issue
Block a user