Parcourir la source

Merge branch 'zhangtao' of gitadmin/tuoheng_pilot_web into develop

pull/67/head
zhangtao il y a 1 an
Parent
révision
4f888e4b6c
5 fichiers modifiés avec 57 ajouts et 53 suppressions
  1. +1
    -1
      .env.test
  2. +7
    -7
      README.md
  3. +1
    -1
      src/utils/map/GMap.js
  4. +46
    -44
      src/views/task-manage/components/MapComp.vue
  5. +2
    -0
      src/views/task-manage/components/UserModal.vue

+ 1
- 1
.env.test Voir le fichier

@@ -10,7 +10,7 @@ VITE_PROXY = [["","http://192.168.11.241:9089"]]
# base api
VITE_APP_GLOB_BASE_API = ''

VITE_AUTHORITY = 'https://oidc.test.t-aaron.com'
VITE_AUTHORITY = 'https://login-test.t-aaron.com'
VITE_CLIENT_ID = 'tuoheng-pilot-admin'
VITE_CLIENT_SECRET = 'WB0CZ1c6bZLiYP6jLtDFsA=='
VITE_REDIRECT_URI = 'http://192.168.11.241:9089/login'

+ 7
- 7
README.md Voir le fichier

@@ -1,7 +1,7 @@
# Vue 3 + Vite
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
## Recommended IDE Setup
- [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar)
### v1.0.0
* 拓恒飞手平台发布
* 创建飞行任务,包含分配任务,开始飞行,飞行完成,上传数据等功能
* 管理硬件设备,包含无人机,盒子等
* 新增平台用户,包含管理员与飞手人员,管理员包含飞手权限
* 管理小程序banner栏
* 对接河湖长创建的飞行任务

+ 1
- 1
src/utils/map/GMap.js Voir le fichier

@@ -2,7 +2,7 @@ import AMapLoader from '@amap/amap-jsapi-loader'

export default AMapLoader.load({
'key': '709c024e3faa4a92473b9d847ca87702',
'version': '2.0',
'version': '1.4.4',
'plugins': ['AMap.ToolBar', 'AMap.AutoComplete', 'AMap.PlaceSearch', 'AMap.Geocoder'],
AMapUI: {
version: '1.1',

+ 46
- 44
src/views/task-manage/components/MapComp.vue Voir le fichier

@@ -6,55 +6,57 @@

<script setup name="mapComp">
import GMap from '@/utils/map/GMap'
import redImg from '@/assets/red.png'
import { nextTick } from 'vue'

const emit = defineEmits(['mapEmit'])
let marker = null

GMap.then((AMap) => {
const map = new AMap.Map('mapComp', {
zoom: 13,
center: [118.773319, 31.828123]
})

// 添加缩放工具
const toolbar = new AMap.ToolBar()
map.addControl(toolbar)

// 搜索
AMapUI.loadUI(['misc/PoiPicker'], function(PoiPicker) {
const poiPicker = new PoiPicker({
input: 'pickerInput'
nextTick(() => {
GMap.then((AMap) => {
const map = new AMap.Map('mapComp', {
zoom: 13,
center: [118.773319, 31.828123]
})

poiPicker.on('poiPicked', ({ item }) => {
const inp = document.getElementById('pickerInput')
inp.value = item.name
// map.setCenter(item.location) // 移动到中心位置
if (marker) map.remove(marker)
marker = new AMap.Marker({
title: item.address,
icon: redImg
// 添加缩放工具
const toolbar = new AMap.ToolBar()
map.addControl(toolbar)

// 搜索
AMapUI.loadUI(['misc/PoiPicker'], function(PoiPicker) {
const poiPicker = new PoiPicker({
input: 'pickerInput'
})

marker.setMap(map)
marker.setPosition(item.location)
map.setCenter(item.location)
poiPicker.on('poiPicked', ({ item }) => {
const inp = document.getElementById('pickerInput')
inp.value = item.name
// map.setCenter(item.location) // 移动到中心位置
if (marker) map.remove(marker)
marker = new AMap.Marker({
title: item.address,
icon: '//vdata.amap.com/icons/b18/1/2.png'
})

marker.setMap(map)
marker.setPosition(item.location)
map.setCenter(item.location)

emit('mapEmit', item.location)
emit('mapEmit', item.location)
})
})
})
map.on('click', ({ lnglat }) => {
if (marker) map.remove(marker) // 只取一次maker点
marker = new AMap.Marker({
position: new AMap.LngLat(lnglat.lng, lnglat.lat),
offset: new AMap.Pixel(-10, -10),
icon: redImg
map.on('click', ({ lnglat }) => {
if (marker) map.remove(marker) // 只取一次maker点
marker = new AMap.Marker({
position: new AMap.LngLat(lnglat.lng, lnglat.lat),
offset: new AMap.Pixel(-10, -10),
icon: '//vdata.amap.com/icons/b18/1/2.png'
})
map.add(marker)
emit('mapEmit', lnglat)
})
map.add(marker)
emit('mapEmit', lnglat)
})
}).catch(e => console.log(e))
}).catch(e => console.log(e))
})

</script>

@@ -73,11 +75,11 @@ GMap.then((AMap) => {
padding: 5px 5px;
}

// .amap_lib_placeSearch .poibox.highlight {
// background-color: #CAE1FF;
// }
.amap_lib_placeSearch .poibox.highlight {
background-color: #CAE1FF;
}

// .amap_lib_placeSearch .poi-more {
// display: none !important;
// }
.amap_lib_placeSearch .poi-more {
display: none !important;
}
</style>

+ 2
- 0
src/views/task-manage/components/UserModal.vue Voir le fichier

@@ -69,6 +69,7 @@
</Modal>

<n-modal
v-if="showStart"
v-model:show="showStart"
:mask-closable="false"
preset="dialog"
@@ -81,6 +82,7 @@
</n-modal>

<n-modal
v-if="showEnd"
v-model:show="showEnd"
:mask-closable="false"
preset="dialog"

Chargement…
Annuler
Enregistrer