feat:修改用户,设备保存问题,任务显示问题

This commit is contained in:
wangxueshen 2026-01-28 13:56:23 +08:00
parent b91d363b00
commit aeaab62a09
14 changed files with 424 additions and 116 deletions

View File

@ -1,8 +1,8 @@
window.config = { window.config = {
env: 'offline', //online env: 'offline', //online
//api: 'http://127.0.0.1:9116/', // 外网服务器, //api: 'http://127.0.0.1:9116/', // 外网服务器,
api: 'http://localhost:9116', api: 'http://192.168.43.127:9116',
socket: 'http://localhost:9116', //外网服务器, // socket: 'http://127.0.0.1:9116', 外网服务器,
imagePath: 'http://192.168.112.181:9000/files', imagePath: 'http://192.168.112.181:9000/files',
arithmeticPath: 'http://127.0.0.1:18090/ktkx/UavPlanning/SAR', arithmeticPath: 'http://127.0.0.1:18090/ktkx/UavPlanning/SAR',
tokenKey: 'accessToken', tokenKey: 'accessToken',
@ -12,6 +12,6 @@ window.config = {
arcgisUrl: 'http://61.48.133.44:14001/map/arcgisMap', arcgisUrl: 'http://61.48.133.44:14001/map/arcgisMap',
minMapLevel: 1, minMapLevel: 1,
maxMapLevel: 16, maxMapLevel: 16,
defaultLocation: [115.915465, 40.35857694], defaultLocation: [116.40531500114789, 39.86340233391189],
tdtToken: '316ac2812387c2cbff7a6f2f4e7f5bdc' tdtToken: '316ac2812387c2cbff7a6f2f4e7f5bdc'
} }

View File

@ -17,9 +17,6 @@ export const getUavCurrentHeight = params =>
// 获取任务列表 // 获取任务列表
export const getTaskListData = params => export const getTaskListData = params =>
req('post', '/sar/job/list', params) req('post', '/sar/job/list', params)
// 获取执行中的任务列表
export const getExecJobs = params =>
req('post', '/sar/job/execJobs', params)
// 新增任务 // 新增任务
export const addTaskFast = params => export const addTaskFast = params =>
req('post', '/sar/job/save', params) req('post', '/sar/job/save', params)
@ -29,6 +26,8 @@ export const previewTaskFast = params =>
// 编辑任务 // 编辑任务
export const editTaskFast = params => export const editTaskFast = params =>
req('post', '/sar/job/save', params) req('post', '/sar/job/save', params)
export const getExecJobs = params =>
req('post', '/sar/job/execJobs', params)
// 新增任务 // 新增任务
export const addTaskAirline = params => export const addTaskAirline = params =>
req('post', '/sar/job/save2', params) req('post', '/sar/job/save2', params)

View File

@ -9,30 +9,30 @@ const whiteList = ['/login'] // 本地测试保留login
router.beforeEach(async (to, from, next) => { router.beforeEach(async (to, from, next) => {
// 启动进度条 // 启动进度条
// NProgress.start() NProgress.start()
// 确定用户是否已登录 // 确定用户是否已登录
// const hasToken = getToken() const hasToken = getToken()
// if (hasToken) { if (hasToken) {
// if (to.path === '/login') { if (to.path === '/login') {
// // 如果已登录,则重定向到主页 // 如果已登录,则重定向到主页
// next({ path: '/' }) next({ path: '/' })
// NProgress.done() NProgress.done()
// } else { } else {
// NProgress.done() NProgress.done()
// next() next()
// } }
// } else { } else {
// /* 没有 token */ /* 没有 token */
// if (whiteList.indexOf(to.path) !== -1) { if (whiteList.indexOf(to.path) !== -1) {
// // 在免费登录白名单,直接去 // 在免费登录白名单,直接去
// next() next()
// } else { } else {
// // 没有访问权限的其他页面被重定向到登录页面。 // 没有访问权限的其他页面被重定向到登录页面。
// next(`/login?redirect=${to.path}`) next(`/login?redirect=${to.path}`)
// NProgress.done() NProgress.done()
// } }
// } }
next() // next()
// 跳转页面时,取消上一个页面的请求 // 跳转页面时,取消上一个页面的请求
if (window.__axiosCancelTokenArr) { if (window.__axiosCancelTokenArr) {

View File

@ -148,6 +148,21 @@ export default {
addDevice() { addDevice() {
this.device.visible = true this.device.visible = true
this.device.title = `新增${this.deviceMap[this.queryForm.type]}` 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) { editDevice(row) {
this.device.visible = true this.device.visible = true
@ -173,7 +188,7 @@ export default {
this.device.visible = false this.device.visible = false
}, },
async submitDevice() { async submitDevice() {
const valid = await this.$refs.form.validate(valid) const valid = await this.$refs.form.validate()
if (!valid) return if (!valid) return
const form = {} const form = {}
if (this.queryForm.type === 'uav') { if (this.queryForm.type === 'uav') {

View File

@ -15,12 +15,10 @@ import {
addTaskFast, addTaskFast,
deleteTaskItem, editTaskName, getLoaderEnabledList, getTaskEditItemDetail, deleteTaskItem, editTaskName, getLoaderEnabledList, getTaskEditItemDetail,
getTaskListData, getUavCurrentHeight, getUavEnabledListData, previewTaskFast, getTaskListData, getUavCurrentHeight, getUavEnabledListData, previewTaskFast,
reRunTask reRunTask, flyTaskUavCommand, stopTaskFly
} from '@/api/task' } from '@/api/task'
import LinePlot from './line-plot'
import LineTarget from './lineTarget' import LineTarget from './lineTarget'
import axios from 'axios' import UavTarget from '../twin-situation/uavTarget'
let theViewerTools = null let theViewerTools = null
let pickHandler = null let pickHandler = null
let startPoint = null let startPoint = null
@ -29,6 +27,9 @@ let linePlot = null
let airlineCollection = {} let airlineCollection = {}
let previewEntities = [] let previewEntities = []
let taskListResource = [] let taskListResource = []
let taskUavCollection = {}
let taskPlanAreaCollection = {}
let sceneEntity = {}
export default { export default {
name: 'TaskManage', name: 'TaskManage',
props: { props: {
@ -59,6 +60,8 @@ export default {
// executeName: '无人机1', // executeName: '无人机1',
// typeIcon: 'el-icon-camera', // typeIcon: 'el-icon-camera',
// name: '拍照任务', // name: '拍照任务',
// check: false,
// status: 0,
// uavCompletion: 30, // uavCompletion: 30,
// isFinish: false, // isFinish: false,
// taskProgressName: '30%', // taskProgressName: '30%',
@ -492,7 +495,7 @@ export default {
value: 1 value: 1
} }
], ],
emptyImg: require('@/assets/img/common/empty.svg') emptyImg: require('@/assets/img/common/empty.svg'),
} }
}, },
computed: { computed: {
@ -618,14 +621,249 @@ export default {
// lodLayer.removeAll() // lodLayer.removeAll()
// viewer.entities.removeAll() // viewer.entities.removeAll()
} }
viewer.entities.removeAll()
startPoint = null startPoint = null
endPoint = null endPoint = null
if (linePlot) { if (linePlot) {
linePlot.destroy() linePlot.destroy()
linePlot = null 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: { 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) { dealStatusColor(name) {
if (name === '执行中') { if (name === '执行中') {
return '#6ae965' return '#6ae965'
@ -701,7 +939,6 @@ export default {
getList() { getList() {
getTaskListData({ type: 2, orders: [{ column: 'begin_time', asc: false }] }).then(res => { getTaskListData({ type: 2, orders: [{ column: 'begin_time', asc: false }] }).then(res => {
if (res.data.code === 200) { if (res.data.code === 200) {
console.log('任务列表', res.data.data)
let data = res.data.data let data = res.data.data
let list = [] let list = []
data.forEach(item => { data.forEach(item => {
@ -983,7 +1220,6 @@ export default {
pointList.push(item.boundaryLonLat) pointList.push(item.boundaryLonLat)
} }
}) })
let info = { let info = {
info1: JSON.stringify(this.form), info1: JSON.stringify(this.form),
id: params.id, id: params.id,
@ -1042,7 +1278,7 @@ export default {
addTaskFast(info).then(res => { addTaskFast(info).then(res => {
if (res.data.code === 200) { if (res.data.code === 200) {
this.$message.success('新增任务任务成功') this.$message.success('新增任务任务成功')
// this.taskForm.visible = false this.taskForm.visible = false
this.resetForm() this.resetForm()
this.getList() this.getList()
} else { } else {
@ -1487,7 +1723,7 @@ export default {
} }
this.calculateLimit() this.calculateLimit()
}, },
getRatioDisabled(value, index) { getRatioDisabled(value) {
if (this.form.imageMode !== '4') { if (this.form.imageMode !== '4') {
return value.value === '10' return value.value === '10'
} else { } else {

View File

@ -125,7 +125,7 @@
.task-execute { .task-execute {
color: $--color-text-1; color: $--color-text-1;
font-size: 14px; font-size: 14px;
width: 90px; width: 85px;
margin-left: 5px; margin-left: 5px;
display: inline-block; display: inline-block;
overflow: hidden; overflow: hidden;

View File

@ -10,7 +10,7 @@
title="任务列表" title="任务列表"
:visible.sync="taskList.visible" :visible.sync="taskList.visible"
:scroll="false" :scroll="false"
:showClose="true" :showClose="false"
:showDivider="false" :showDivider="false"
> >
<template v-slot:header> <template v-slot:header>
@ -25,7 +25,11 @@
</el-tooltip> </el-tooltip>
</template> </template>
<div v-if="taskList.data.length" class="task-list__content"> <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="left-part">
<!-- <div class="task-progress-bar" :style="'width: ' + item.uavCompletion +'%;'"></div>--> <!-- <div class="task-progress-bar" :style="'width: ' + item.uavCompletion +'%;'"></div>-->
<div class="execute-info" @click="openTaskLineDetail(item)"> <div class="execute-info" @click="openTaskLineDetail(item)">
@ -59,7 +63,42 @@
<!-- <i class="ri-repeat-line" @click.stop="reRunTask(item)"></i>--> <!-- <i class="ri-repeat-line" @click.stop="reRunTask(item)"></i>-->
<!-- </el-tooltip>--> <!-- </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 <i
class="el-icon-edit-outline" class="el-icon-edit-outline"
@click.stop="editTaskName(item)" @click.stop="editTaskName(item)"
@ -73,7 +112,7 @@
class="el-icon-close delete-task" class="el-icon-close delete-task"
@click.stop="deleteTask(item)" @click.stop="deleteTask(item)"
></i> ></i>
</el-tooltip> </el-tooltip> -->
</div> </div>
</div> </div>
</div> </div>
@ -330,7 +369,7 @@
> >
<el-option <el-option
v-for="item in sarResolutionOptions" v-for="item in sarResolutionOptions"
:disabled="getRatioDisabled(item, index)" :disabled="getRatioDisabled(item)"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"

View File

@ -20,9 +20,8 @@ import {
getRadarListData, getRadarListData,
getTaskItemDetail, getTaskItemDetail,
getTaskListData, getTaskListData,
getExecJobs,
getUavListData, getUavListData,
reRunTask, stopTaskFly reRunTask, stopTaskFly, getExecJobs
} from '@/api/task' } from '@/api/task'
import UavTarget from './uavTarget' import UavTarget from './uavTarget'
import PicturesUpload from '../pictures-upload/index.vue' import PicturesUpload from '../pictures-upload/index.vue'
@ -74,15 +73,15 @@ export default {
visible: true, visible: true,
activeTabId: 1, activeTabId: 1,
data: [ data: [
{ // {
signal: 50, // signal: 50,
nickName: '无人机1', // nickName: '无人机1',
battery: 80, // battery: 80,
flyHeight: 80, // flyHeight: 80,
lon: 115.76, // lon: 115.76,
lat: 40.38, // lat: 40.38,
id: 2 // id: 2
} // }
], ],
typeDict: { typeDict: {
1: '无人机', 1: '无人机',
@ -93,13 +92,13 @@ export default {
taskList: { taskList: {
visible: true, visible: true,
data: [ data: [
//{ {
// status: 1, status: 1,
// name: '巡查任务', name: '巡查任务',
// statusName: '巡查中', statusName: '巡查中',
// beginTime: '2026-01-23 12:14:45' beginTime: '2026-01-23 12:14:45'
//} }
] ]
}, },
weatherInfo2: { weatherInfo2: {
visible: true, visible: true,
@ -534,6 +533,7 @@ export default {
socketInstance = null socketInstance = null
stompClientInstance = null stompClientInstance = null
} }
viewer.entities.removeAll()
// if (broadcastChannel) { // if (broadcastChannel) {
// this.closeBroadcastChannel() // this.closeBroadcastChannel()
// } // }
@ -1072,8 +1072,7 @@ export default {
}, },
getTaskList() { 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) { if (res.data.code === 200) {
console.log('任务列表', res.data.data) console.log('任务列表', res.data.data)
let data = res.data.data let data = res.data.data
@ -3045,6 +3044,8 @@ export default {
//#region 航线详情 //#region 航线详情
openTaskLineDetail(info) { openTaskLineDetail(info) {
this.taskLineDetail.visible = false this.taskLineDetail.visible = false
console.log(taskListResource, 555);
let find = taskListResource.find(item => item.id === info.id) let find = taskListResource.find(item => item.id === info.id)
console.log('信息', find) console.log('信息', find)

View File

@ -196,8 +196,8 @@
width: 40px; width: 40px;
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; justify-content: space-between;
justify-content: center; padding: 0 8px;
align-items: center; align-items: center;
>i { >i {

View File

@ -84,37 +84,40 @@
></span> ></span>
<span class="task-execute">{{ item.name }}</span> <span class="task-execute">{{ item.name }}</span>
</div> </div>
<div class="task-info" :style="{color:dealStatusColor(item.statusName)}"> <div
class="task-info"
:style="{ color: dealStatusColor(item.statusName) }"
>
{{ item.statusName }} {{ item.statusName }}
</div> </div>
<div class="task-time">{{ item.beginTime }}</div> <div class="task-time">{{ item.beginTime }}</div>
</div> </div>
<div class="right-part"> <div class="right-part" >
<el-tooltip <el-tooltip
effect="dark" effect="dark"
:content="item.check ? '隐藏' : '显示'" :content="item.check ? '隐藏' : '显示'"
placement="right" placement="top"
> >
<i <i
:class="item.check ? 'ri-eye-off-line' : 'ri-eye-line'" :class="item.check ? 'ri-eye-off-line' : 'ri-eye-line'"
@click.stop="toggleTaskSceneShow(item, index)" @click.stop="toggleTaskSceneShow(item, index)"
></i> ></i>
</el-tooltip> </el-tooltip>
<el-tooltip <!-- <el-tooltip
v-if="item.status === 0" v-if="item.status === 0"
effect="dark" effect="dark"
content="执行" content="执行"
placement="right" placement="top"
> >
<i <i
class="ri-flight-takeoff-line" class="ri-arrow-up-circle-line"
@click.stop="makeTaskUavFly(item, index)" @click.stop="makeTaskUavFly(item, index)"
></i> ></i>
</el-tooltip> </el-tooltip> -->
<el-tooltip <el-tooltip
effect="dark" effect="dark"
content="结束任务" content="结束任务"
placement="right" placement="top"
v-if="item.status === 1" v-if="item.status === 1"
> >
<i <i
@ -125,16 +128,14 @@
<el-tooltip <el-tooltip
effect="dark" effect="dark"
content="重新执行" content="重新执行"
placement="right" placement="top"
v-if="item.status === 2" v-if="item.status === 2"
> >
<i <i
class="ri-repeat-line" class="ri-restart-line"
@click.stop="reRunTask(item, index)" @click.stop="reRunTask(item, index)"
></i> ></i>
</el-tooltip> </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>
</div> </div>
</template> </template>

View File

@ -16,7 +16,7 @@ export default class UavTarget {
this.startAltitude = options.startAltitude this.startAltitude = options.startAltitude
this.addPlanLine(options.airlineList) this.addPlanLine(options.airlineList)
this.addUav(options) // this.addUav(options.airlineList)
this.addUavLoader(options.payloadList) this.addUavLoader(options.payloadList)
} }
addUav(info) { addUav(info) {
@ -32,37 +32,38 @@ export default class UavTarget {
} }
let currentPosition = this.positions[this.positions.length - 1].clone() let currentPosition = this.positions[this.positions.length - 1].clone()
let id = `${this.jobId}~${this.uavId}-uav` let id = `${this.jobId}~${this.uavId}-uav`
this.uavEntity = this.viewer.entities.add({ this.uavEntity = this.viewer.entities.add({
id, id,
position: currentPosition, position: currentPosition,
// label: { label: {
// text: info.uavName, text: info.uavName,
// font: '14px sans-serif', font: '14px sans-serif',
// fillColor: DT.Cesium.Color.WHITE, fillColor: DT.Cesium.Color.WHITE,
// horizontalOrigin: DT.Cesium.HorizontalOrigin.LEFT, horizontalOrigin: DT.Cesium.HorizontalOrigin.LEFT,
// verticalOrigin: DT.Cesium.VerticalOrigin.CENTER, verticalOrigin: DT.Cesium.VerticalOrigin.CENTER,
// disableDepthTestDistance: 10000, disableDepthTestDistance: 10000,
// pixelOffset: new DT.Cesium.Cartesian2(10, 0), pixelOffset: new DT.Cesium.Cartesian2(10, 0),
// showBackground: true, showBackground: true,
// scaleByDistance: new DT.Cesium.NearFarScalar(0, 1, 1, 0.8), scaleByDistance: new DT.Cesium.NearFarScalar(0, 1, 1, 0.8),
// distanceDisplayCondition: new DT.Cesium.DistanceDisplayCondition(0, 20000), distanceDisplayCondition: new DT.Cesium.DistanceDisplayCondition(0, 20000),
// backgroundColor: DT.Cesium.Color.fromCssColorString('rgba(0,0,0,0.7)'), backgroundColor: DT.Cesium.Color.fromCssColorString('rgba(0,0,0,0.7)'),
// style: DT.Cesium.LabelStyle.FILL_AND_OUTLINE, style: DT.Cesium.LabelStyle.FILL_AND_OUTLINE,
// }, },
// model: { model: {
// uri: process.env.BASE_URL + 'model/uav.gltf', uri: process.env.BASE_URL + 'model/uav.gltf',
// // scale: 1, // scale: 1,
// minimumPixelSize: 32, minimumPixelSize: 32,
// maximumScale: 128, maximumScale: 128,
// }, },
polyline: { polyline: {
positions: new DT.Cesium.CallbackProperty(function () { positions: new DT.Cesium.CallbackProperty(function () {
return that.positions return that.positions
}, false), }, false),
width: 2, width: 8,
zIndex: 6, zIndex: 600,
material: DT.Cesium.Color.CYAN, material: DT.Cesium.Color.BLACK,
depthFailMaterial: DT.Cesium.Color.CYAN, depthFailMaterial: DT.Cesium.Color.CYAN,
arcType: DT.Cesium.ArcType.NONE arcType: DT.Cesium.ArcType.NONE
} }
}) })
@ -75,8 +76,8 @@ export default class UavTarget {
let loaderPicture = {} let loaderPicture = {}
data.forEach(loader => { data.forEach(loader => {
loaderPicture[loader.payloadId] = [] loaderPicture[loader.payloadId] = []
let key = 'imageList' let key = 'imageList'
if (loader.imageHighList && loader.imageHighList.length > 0) { if (loader.imageHighList && loader.imageHighList.length > 0) {
key = 'imageHighList' key = 'imageHighList'
} }
if (loader[key] && loader[key].length > 0) { if (loader[key] && loader[key].length > 0) {
@ -120,12 +121,12 @@ export default class UavTarget {
url: window.config.imagePath + image.relativePath, url: window.config.imagePath + image.relativePath,
rectangle rectangle
}) })
let addLayer = this.viewer.cesiumViewer.imageryLayers.addImageryProvider(layer) let addLayer = this.viewer.cesiumViewer.imageryLayers.addImageryProvider(layer)
// 设置分屏显示 // 设置分屏显示
addLayer.splitDirection = DT.Cesium.ImagerySplitDirection.LEFT addLayer.splitDirection = DT.Cesium.ImagerySplitDirection.LEFT
obj.picture = addLayer obj.picture = addLayer
if (image.itemList) { 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 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 markPosition = DT.Cesium.Cartesian3.fromDegrees(mark.left1Lon, mark.left1Lat, 1)
let markArr = [ let markArr = [
@ -216,7 +217,7 @@ export default class UavTarget {
// console.log('添加的图片', obj.picture) // console.log('添加的图片', obj.picture)
if (image.itemList) { 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 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 markPosition = DT.Cesium.Cartesian3.fromDegrees(mark.left1Lon, mark.left1Lat, 1)
let markArr = [ let markArr = [
@ -258,7 +259,7 @@ export default class UavTarget {
console.log('删除旧的') console.log('删除旧的')
layer.readyPromise.then(res => { layer.readyPromise.then(res => {
console.log('回调执行') console.log('回调执行')
let addLayer = this.viewer.cesiumViewer.imageryLayers.addImageryProvider(layer) let addLayer = this.viewer.cesiumViewer.imageryLayers.addImageryProvider(layer)
// 设置分屏显示 // 设置分屏显示
addLayer.splitDirection = DT.Cesium.ImagerySplitDirection.LEFT addLayer.splitDirection = DT.Cesium.ImagerySplitDirection.LEFT
obj.picture = addLayer obj.picture = addLayer
@ -285,7 +286,7 @@ export default class UavTarget {
} }
} }
toggleLoaderPictureVisible(payloadId,fileId) { toggleLoaderPictureVisible(payloadId, fileId) {
console.log('切换显隐', payloadId, fileId) console.log('切换显隐', payloadId, fileId)
if (this.loaderPicture[payloadId]) { if (this.loaderPicture[payloadId]) {
let find = this.loaderPicture[payloadId].find(item => item.fileId + '' === fileId + '') 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]) { if (this.loaderPicture[payloadId]) {
let find = this.loaderPicture[payloadId].find(item => item.fileId + '' === fileId + '') let find = this.loaderPicture[payloadId].find(item => item.fileId + '' === fileId + '')
if (find) { if (find) {

View File

@ -41,7 +41,10 @@ export default {
user: { user: {
visible: false, visible: false,
form: { form: {
account: '' id: '',
account: '',
password: '',
confirmPassword: ''
}, },
rules: { rules: {
account: [ account: [
@ -90,18 +93,31 @@ export default {
}) })
}, },
addUser() { addUser() {
this.user.form = {
id: '',
account: '',
password: '',
confirmPassword: ''
}
this.user.visible = true this.user.visible = true
}, },
editUser(form) { editUser(form) {
this.user.visible = true this.user.visible = true
this.user.form.account = form.account this.user.form.account = form.account
this.user.form.id = form.id
}, },
close() { close() {
this.$refs.form.resetFields() this.$refs.form.resetFields()
this.user.visible = false this.user.visible = false
this.user.form = {
id: '',
account: '',
password: '',
confirmPassword: ''
}
}, },
async submitUser() { async submitUser() {
const valid = await this.$refs.form.validate(valid) const valid = await this.$refs.form.validate()
if (!valid) return if (!valid) return
delete this.user.form.confirmPassword delete this.user.form.confirmPassword
const form = { ...this.user.form } const form = { ...this.user.form }

View File

@ -58,7 +58,7 @@
</el-table> </el-table>
<dt-dialog <dt-dialog
class="dialog-light" class="dialog-light"
:title="user.form.userId ? '编辑用户' : '新增用户'" :title="user.form.id ? '编辑用户' : '新增用户'"
:visible.sync="user.visible" :visible.sync="user.visible"
top="20vh" top="20vh"
width="22%" width="22%"

View File

@ -682,7 +682,7 @@ export default {
this.sceneComplete = true this.sceneComplete = true
// this.addHandler() // this.addHandler()
// this.$refs.tools.handleMapChange('sat') // 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({ viewer.cesiumViewer.scene.camera.flyTo({
destination: position, destination: position,
duration: 1 duration: 1