Browse Source

一点bug

tags/v1.0.0
吴迪 2 years ago
parent
commit
b31e60c882
7 changed files with 45 additions and 18 deletions
  1. +20
    -2
      src/views/task-manage/components/DrawComp.vue
  2. +0
    -1
      src/views/task-manage/components/MapComp.vue
  3. +17
    -12
      src/views/task-manage/components/UserModal.vue
  4. +1
    -1
      src/views/task-manage/hook/equipment.js
  5. +5
    -0
      src/views/task-manage/hook/execution.js
  6. +1
    -1
      src/views/task-manage/tools/drawForm.js
  7. +1
    -1
      src/views/task-manage/tools/form.js

+ 20
- 2
src/views/task-manage/components/DrawComp.vue View File

<!-- 基本信息 --> <!-- 基本信息 -->
<div class="cont"> <div class="cont">
<n-descriptions label-placement="left" label-align="right" :column="4" title="任务基本信息"> <n-descriptions label-placement="left" label-align="right" :column="4" title="任务基本信息">
<n-descriptions-item v-for="(it, i) in basicInfo" :key="i + it.label" :label="it.label">
<n-descriptions-item v-for="(it, i) in (basicInfo.slice(0, -1))" :key="i + it.label" :label="it.label">
{{ it.value }} {{ it.value }}
</n-descriptions-item> </n-descriptions-item>
</n-descriptions> </n-descriptions>
<!-- 为了格式,折腾 -->
<n-descriptions label-placement="left" label-align="right" class="note">
<n-descriptions-item :key="basicInfo[basicInfo.length -1].label" :label="basicInfo[basicInfo.length -1].label">
{{ basicInfo[basicInfo.length -1].value }}
</n-descriptions-item>
</n-descriptions>
</div> </div>


<!-- 飞行信息 - 待分配飞手:状态为5 --> <!-- 飞行信息 - 待分配飞手:状态为5 -->
<div v-if="current === 3" class="cont"> <div v-if="current === 3" class="cont">
<n-descriptions label-placement="left" label-align="right" :column="4" title="设备/影像基本信息"> <n-descriptions label-placement="left" label-align="right" :column="4" title="设备/影像基本信息">
<template v-for="(it, i) in executionInfo" :key="i + it.label"> <template v-for="(it, i) in executionInfo" :key="i + it.label">
<n-descriptions-item :label="it.label">
<n-descriptions-item v-if="it?.isLive !== data.isLive" :label="it.label">
{{ it.value }} {{ it.value }}
</n-descriptions-item> </n-descriptions-item>
</template> </template>
width: 230px; width: 230px;
margin-right: 15px; margin-right: 15px;
} }

.note {
:deep(.n-descriptions-table-wrapper), :deep(.n-descriptions-table) {
margin-top: 0;
padding-bottom: 10px;
padding-top: 0;
}
:deep(.n-descriptions-table-content__content) {
padding-right: 10px;
text-indent: 2em;
}
}
</style> </style>

+ 0
- 1
src/views/task-manage/components/MapComp.vue View File

}) })
}) })
map.on('click', ({ lnglat }) => { map.on('click', ({ lnglat }) => {
console.log(lnglat)
if (marker) map.remove(marker) // 只取一次maker点 if (marker) map.remove(marker) // 只取一次maker点
marker = new AMap.Marker({ marker = new AMap.Marker({
position: new AMap.LngLat(lnglat.lng, lnglat.lat), position: new AMap.LngLat(lnglat.lng, lnglat.lat),

+ 17
- 12
src/views/task-manage/components/UserModal.vue View File

let Gmap = null let Gmap = null
let geocoder = null let geocoder = null
let AMaps = null let AMaps = null
let startMarker = null
let endMarker = null
// 地图 // 地图
GMap.then((AMap) => { GMap.then((AMap) => {
AMaps = AMap AMaps = AMap
center: [data.userForm.startLongitude, data.userForm.startLatitude] center: [data.userForm.startLongitude, data.userForm.startLatitude]
}) })


var marker = new AMap.Marker({
const marker = new AMap.Marker({
position: new AMap.LngLat(data.userForm.startLongitude, data.userForm.startLatitude), position: new AMap.LngLat(data.userForm.startLongitude, data.userForm.startLatitude),
icon: '//vdata.amap.com/icons/b18/1/2.png', icon: '//vdata.amap.com/icons/b18/1/2.png',
title: '起点' title: '起点'
data.userForm.startLatitude = String(lat) data.userForm.startLatitude = String(lat)
} }
}) })
mapHandle('起点', [lng, lat])
if (startMarker) Gmap.remove(startMarker)
startMarker = new AMaps.Marker({
title: '起点',
icon: '//vdata.amap.com/icons/b18/1/2.png'
})
startMarker.setMap(Gmap)
startMarker.setPosition([lng, lat])
Gmap.setCenter(startMarker.getPosition())
} }
// 终点地图 确定事件 // 终点地图 确定事件
const endHandle = ({ lng, lat }) => { const endHandle = ({ lng, lat }) => {
data.userForm.endLatitude = String(lat) data.userForm.endLatitude = String(lat)
} }
}) })
mapHandle('终点', [lng, lat])
}
// 地图marker点
const mapHandle = (type, arr) => {
const marker = new AMaps.Marker({
title: type,
if (endMarker) Gmap.remove(endMarker)
endMarker = new AMaps.Marker({
title: '终点',
icon: '//vdata.amap.com/icons/b18/1/2.png' icon: '//vdata.amap.com/icons/b18/1/2.png'
}) })

marker.setMap(Gmap)
marker.setPosition(arr)
Gmap.setCenter(marker.getPosition())
endMarker.setMap(Gmap)
endMarker.setPosition([lng, lat])
Gmap.setCenter(endMarker.getPosition())
} }


function handleConfirm() { function handleConfirm() {

+ 1
- 1
src/views/task-manage/hook/equipment.js View File

{ {
label: '盒子名称', label: '盒子名称',
value: data.cloudBoxName, value: data.cloudBoxName,
isLive: 1
isLive: 0
} }
] ]
return customRef((track, trigger) => { return customRef((track, trigger) => {

+ 5
- 0
src/views/task-manage/hook/execution.js View File

{ {
label: '挂载设备', label: '挂载设备',
value: data.equipmentMountName value: data.equipmentMountName
},
{
label: '盒子名称',
value: data.cloudBoxName,
isLive: 0
} }
] ]
return customRef((track, trigger) => { return customRef((track, trigger) => {

+ 1
- 1
src/views/task-manage/tools/drawForm.js View File

const { data } = await getTaskPilot() const { data } = await getTaskPilot()
pilotList.value = data.map(it => ({ pilotList.value = data.map(it => ({
...it, ...it,
label: it.username,
label: it.realname,
value: it.id value: it.id
})) }))
} }

+ 1
- 1
src/views/task-manage/tools/form.js View File

const { data } = await getTaskPilot() const { data } = await getTaskPilot()
pilotList.value = data.map(it => ({ pilotList.value = data.map(it => ({
...it, ...it,
label: it.username,
label: it.realname,
value: it.id value: it.id
})) }))
} }

Loading…
Cancel
Save