Browse Source

compress a picture

pull/19/head
eden 2 years ago
parent
commit
23bada3977
  1. 2
      src/api/manage.ts
  2. BIN
      src/assets/icons/cloudapi.png
  3. BIN
      src/assets/icons/m30.png
  4. BIN
      src/assets/icons/no-data.png
  5. 20
      src/hooks/use-g-map-tsa.ts
  6. 2
      src/pages/page-web/projects/wayline.vue
  7. 1
      src/store/index.ts

2
src/api/manage.ts

@ -74,7 +74,7 @@ export const getLiveSnCapacity = async function (id:any): Promise<IWorkspaceResp
const url = `${HTTP_PREFIX}/live/capacity?sn=${id}` const url = `${HTTP_PREFIX}/live/capacity?sn=${id}`
const result = await request.get(url) const result = await request.get(url)
return result.data return result.data
} }
// Start Livestream // Start Livestream
export const startLivestream = async function (body: {}): Promise<IWorkspaceResponse<any>> { export const startLivestream = async function (body: {}): Promise<IWorkspaceResponse<any>> {

BIN
src/assets/icons/cloudapi.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
src/assets/icons/m30.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
src/assets/icons/no-data.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

20
src/hooks/use-g-map-tsa.ts

@ -6,6 +6,8 @@ import { message } from 'ant-design-vue'
import dockIcon from '/@/assets/icons/dock.png' import dockIcon from '/@/assets/icons/dock.png'
import rcIcon from '/@/assets/icons/rc.png' import rcIcon from '/@/assets/icons/rc.png'
import droneIcon from '/@/assets/icons/drone.png' import droneIcon from '/@/assets/icons/drone.png'
import { wgs84togcj02 } from '/@/vendors/coordtransform'
import { GeojsonCoordinate } from '../types/map'
export function deviceTsaUpdate () { export function deviceTsaUpdate () {
const root = getRoot() const root = getRoot()
@ -38,6 +40,14 @@ export function deviceTsaUpdate () {
}) })
} }
function wgs84togcj02Fn (lng?: number, lat?: number) {
if (lng !== undefined) {
return wgs84togcj02(lng, lat) as GeojsonCoordinate
} else {
return [121.376134, 31.084440]
}
}
function initMarker (type: number, name: string, sn: string, lng?: number, lat?: number) { function initMarker (type: number, name: string, sn: string, lng?: number, lat?: number) {
if (markers[sn]) { if (markers[sn]) {
return return
@ -45,14 +55,17 @@ export function deviceTsaUpdate () {
if (root.$aMap === undefined) { if (root.$aMap === undefined) {
return return
} }
// 121.376134, 31.084440
const transFn = wgs84togcj02Fn(lng, lat)
AMap = root.$aMap AMap = root.$aMap
markers[sn] = new AMap.Marker({ markers[sn] = new AMap.Marker({
position: new AMap.LngLat(lng || 113.943225499, lat || 22.577673716), position: new AMap.LngLat(transFn[0], transFn[1]),
icon: initIcon(type), icon: initIcon(type),
title: name, title: name,
anchor: 'top-center', anchor: 'top-center',
offset: [0, -20], offset: [0, -20],
}) })
console.log('initMarker', name)
root.$map.add(markers[sn]) root.$map.add(markers[sn])
// markers[sn].on('moving', function (e: any) { // markers[sn].on('moving', function (e: any) {
// let path = paths[sn] // let path = paths[sn]
@ -83,6 +96,7 @@ export function deviceTsaUpdate () {
message.error(data.message) message.error(data.message)
return return
} }
console.log('addMarker', data.data)
initMarker(data.data.domain, data.data.nickname, sn, lng, lat) initMarker(data.data.domain, data.data.nickname, sn, lng, lat)
}) })
} }
@ -94,7 +108,9 @@ export function deviceTsaUpdate () {
marker = markers[sn] marker = markers[sn]
return return
} }
marker.moveTo([lng, lat], {
const transFn = wgs84togcj02Fn(lng, lat)
marker.moveTo([transFn[0], transFn[1]], {
duration: 1800, duration: 1800,
autoRotation: true autoRotation: true
}) })

2
src/pages/page-web/projects/wayline.vue

@ -204,7 +204,7 @@ function selectRoute (wayline: WaylineFile, index:any) {
if (res.code === 0) { if (res.code === 0) {
const path = res.data?.geometry.coordinates const path = res.data?.geometry.coordinates
path.forEach((item:any, index:any) => { path.forEach((item:any, index:any) => {
item = wgs84togcj02( path[index] = wgs84togcj02(
item[0], item[0],
item[1] item[1]
) )

1
src/store/index.ts

@ -101,7 +101,6 @@ const getters: GetterTree<RootStateType, RootStateType> = {
} }
const mutations: MutationTree<RootStateType> = { const mutations: MutationTree<RootStateType> = {
SET_LAYER_ID (state, info) { SET_LAYER_ID (state, info) {
console.log(info)
state.layerId = info state.layerId = info
}, },
SET_LAYER_INFO (state, info) { SET_LAYER_INFO (state, info) {

Loading…
Cancel
Save