diff --git a/.gitignore b/.gitignore index 7fb9919..abd43a7 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ dist-ssr *.local node_modules/ +src/api/http/config + # Log files npm-debug.log* yarn-debug.log* diff --git a/.gitignore copy b/.gitignore copy deleted file mode 100644 index d451ff1..0000000 --- a/.gitignore copy +++ /dev/null @@ -1,5 +0,0 @@ -node_modules -.DS_Store -dist -dist-ssr -*.local diff --git a/index.html b/index.html index 26556ec..a41ba79 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - demo-web + web
diff --git a/package-lock.json b/package-lock.json index 9b0604c..9ebf33a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "demo-web", + "name": "web", "version": "0.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "demo-web", + "name": "web", "version": "0.0.1", "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 4a82dd0..87dabc0 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "demo-web", + "name": "web", "version": "0.0.1", "scripts": { "serve": "vite", diff --git a/src/api/http/config.ts b/src/api/http/config.ts index d124291..6f177d0 100644 --- a/src/api/http/config.ts +++ b/src/api/http/config.ts @@ -1,12 +1,12 @@ export const CURRENT_CONFIG = { // license - appId: 'Please enter the app id.', // You need to go to the development website to apply. - appKey: 'Please enter the app key.', // You need to go to the development website to apply. - appLicense: 'Please enter the app license.', // You need to go to the development website to apply. + appId: '146410', // You need to go to the development website to apply. + appKey: 'd422e7fa14c4e98ea2100736bea195e', // You need to go to the development website to apply. + appLicense: 'vNVYmp43PMf/a4Yb4nJ947S70mT8bZUnNILRZSLFLjLKaOUX58BgS3DKwgQQSsbDyOvTOSSAjrnoD5Xg/2eUXro2MxoxW3Yx55pVUDZ58I2FgHH3870I6fWw3BqWcF0W14lglfWFl5aMuvCsv84G3EnvjRfSGjklHrDiCNSf2Bo=', // You need to go to the development website to apply. // http - baseURL: 'Please enter the backend access address prefix.', // This url must end with "/". Example: 'http://192.168.1.1:6789/' + baseURL: 'http://192.168.2.239:6789/', // This url must end with "/". Example: 'http://192.168.1.1:6789/' websocketURL: 'Please enter the WebSocket access address.', // Example: 'ws://192.168.1.1:6789/api/v1/ws' // livestreaming @@ -31,6 +31,6 @@ export const CURRENT_CONFIG = { // map // You can apply on the AMap website. - amapKey: 'Please enter the amap key.', + amapKey: '6e948d848f069e3fbcae5a7634ae3f8f', } diff --git a/src/components/GMap.vue b/src/components/GMap.vue index 23755a4..19f59d5 100644 --- a/src/components/GMap.vue +++ b/src/components/GMap.vue @@ -3,425 +3,529 @@
-
-
+
+
-
- + -
- + - +
- + + +
-
+
{{ osdVisible.callsign }} - + + +
-
+
- + {{ osdVisible.model }}
- - {{ EModeCode[deviceInfo.device.mode_code] }} - - - - - HD - {{ deviceInfo.gateway?.transmission_signal_quality }} - - - - - - {{ deviceInfo.gateway && deviceInfo.gateway.capacity_percent !== str ? deviceInfo.gateway?.capacity_percent + ' %' : deviceInfo.gateway?.capacity_percent }} - - + + + {{ EModeCode[deviceInfo.device.mode_code] }} + + + + + HD + {{ deviceInfo.gateway?.transmission_signal_quality }} + + + + + + + + {{ deviceInfo.gateway && deviceInfo.gateway.capacity_percent !== str ? + deviceInfo.gateway?.capacity_percent + ' %' : deviceInfo.gateway?.capacity_percent }} + + - - - - {{ deviceInfo.device.battery.capacity_percent !== str ? deviceInfo.device.battery.capacity_percent + ' %' : deviceInfo.device.battery.capacity_percent }} - - - - - - - Fixed - - - - - - GPS - {{ deviceInfo.device.position_state.gps_number }} - - - - - - {{ deviceInfo.device.position_state.rtk_number }} - - - - - - - - {{ EGear[deviceInfo.device.gear] }} - - - - - ASL - {{ deviceInfo.device.height === str ? str : deviceInfo.device.height.toFixed(2) + ' m'}} - - - - - ALT - {{ deviceInfo.device.elevation === str ? str : deviceInfo.device.elevation.toFixed(2) + ' m' }} - - - - - H - {{ deviceInfo.device.home_distance === str ? str : deviceInfo.device.home_distance.toFixed(2) + ' m' }} - - - - - - - H.S - {{ deviceInfo.device.horizontal_speed === str ? str : deviceInfo.device.horizontal_speed.toFixed(2) + ' m/s'}} - - - - - V.S - {{ deviceInfo.device.vertical_speed === str ? str : deviceInfo.device.vertical_speed.toFixed(2) + ' m/s'}} - - - - - W.S - {{ deviceInfo.device.wind_speed === str ? str : (deviceInfo.device.wind_speed / 10).toFixed(2) + ' m/s'}} - + + + + + + {{ deviceInfo.device.battery.capacity_percent !== str ? + deviceInfo.device.battery.capacity_percent + ' %' : deviceInfo.device.battery.capacity_percent + }} + + + + + + + Fixed + - + + + + GPS + {{ deviceInfo.device.position_state.gps_number }} + + + + + + + + {{ deviceInfo.device.position_state.rtk_number }} + + + + + + + + + + {{ EGear[deviceInfo.device.gear] }} + + + + + ASL + + {{ deviceInfo.device.height === str ? str : Number(deviceInfo.device.height).toFixed(2) + 'm' }} + + + + + + ALT + + {{ deviceInfo.device.elevation === str ? str : Number(deviceInfo.device.elevation).toFixed(2) + ' m' + }} + + + + + H + {{ deviceInfo.device.home_distance === str ? + str : Number(deviceInfo.device.home_distance).toFixed(2) + ' m' }} + + + + + + + H.S + {{ deviceInfo.device.horizontal_speed === str ? + str : Number(deviceInfo.device.horizontal_speed).toFixed(2) + ' m/s' }} + + + + + V.S + {{ deviceInfo.device.vertical_speed === str ? str : + Number(deviceInfo.device.vertical_speed).toFixed(2) + ' m/s' }} + + + + + W.S + {{ deviceInfo.device.wind_speed === str ? str : + (Number(deviceInfo.device.wind_speed) / 10).toFixed(2) + ' m/s' }} + + +
-
-
-
-
+
+
+
+
{{ Math.floor(deviceInfo.device.battery.remain_flight_time / 60) }}: - {{ 10 > (deviceInfo.device.battery.remain_flight_time % 60) ? '0' : ''}}{{deviceInfo.device.battery.remain_flight_time % 60 }} + {{ 10 > (deviceInfo.device.battery.remain_flight_time % 60) ? '0' : + '' }}{{ deviceInfo.device.battery.remain_flight_time % 60 }}
-
-
+
+
{{ osdVisible.gateway_callsign }}
- - -
+ + + + +
- + + + Dock
- - - {{ EDockModeCode[deviceInfo.dock.basic_osd?.mode_code] }} - - - - - - - {{ Math.floor(deviceInfo.dock.work_osd?.acc_time / 2592000) }}m - {{ Math.floor((deviceInfo.dock.work_osd?.acc_time % 2592000) / 86400) }}d - {{ Math.floor((deviceInfo.dock.work_osd?.acc_time % 2592000 % 86400) / 3600) }}h - {{ Math.floor((deviceInfo.dock.work_osd?.acc_time % 2592000 % 86400 % 3600) / 60) }}min - {{ Math.floor(deviceInfo.dock.work_osd?.acc_time % 2592000 % 86400 % 3600 % 60) }} s - - - - - - - {{ new Date((deviceInfo.dock.work_osd?.activation_time ?? 0) * 1000).toLocaleString() }} - - - - - - - - - - + + + {{ EDockModeCode[deviceInfo.dock.basic_osd?.mode_code] }} + + + + + + + + + {{ + Math.floor(deviceInfo.dock.work_osd?.acc_time / 2592000) }}m + {{ + Math.floor((deviceInfo.dock.work_osd?.acc_time % 2592000) / 86400) }}d + {{ + Math.floor((deviceInfo.dock.work_osd?.acc_time % 2592000 % 86400) / 3600) }}h + {{ + Math.floor((deviceInfo.dock.work_osd?.acc_time % 2592000 % 86400 % 3600) / 60) }}min + {{ Math.floor(deviceInfo.dock.work_osd?.acc_time % 2592000 % 86400 % 3600 % 60) }} s + + + + + + + + + {{ new Date((deviceInfo.dock.work_osd?.activation_time ?? 0) * 1000).toLocaleString() + }} + + + + + + + + + + - {{ deviceInfo.dock.basic_osd?.network_state?.rate }} kb/s - - - - - - {{ deviceInfo.dock.work_osd?.job_number }} - - - - - - {{ deviceInfo.dock.link_osd?.media_file_detail?.remain_upload }} - - - - - - - - + + - - - - - - - W.S - {{ (deviceInfo.dock.basic_osd?.wind_speed ?? str) + ' m/s'}} - - - - - 🌧 - {{ RainfallEnum[deviceInfo.dock.basic_osd?.rainfall] }} - - - - - °C - {{ deviceInfo.dock.basic_osd?.environment_temperature }} - - - - - °C - {{ deviceInfo.dock.basic_osd?.temperature }} - - - - - - - 💦 - {{ deviceInfo.dock.basic_osd?.humidity }} - - - - - V - {{ (deviceInfo.dock.work_osd?.working_voltage ?? str) + ' mV' }} - - - - - A - {{ (deviceInfo.dock.work_osd?.working_current ?? str) + ' mA' }} - - - - - - {{ deviceInfo.dock.basic_osd?.drone_in_dock }} - - - - - - - Actions - - - - - - + + {{ deviceInfo.dock.basic_osd?.network_state?.rate }} kb/s + + + + + + + + {{ deviceInfo.dock.work_osd?.job_number }} + + + + + + + + {{ deviceInfo.dock.link_osd?.media_file_detail?.remain_upload }} + + + + + + + + + + + + + + + + + + W.S + {{ (deviceInfo.dock.basic_osd?.wind_speed ?? str) + ' m/s' }} + + + + + 🌧 + {{ RainfallEnum[deviceInfo.dock.basic_osd?.rainfall] }} + + + + + °C + {{ deviceInfo.dock.basic_osd?.environment_temperature }} + + + + + °C + {{ deviceInfo.dock.basic_osd?.temperature }} + + + + + + + 💦 + {{ deviceInfo.dock.basic_osd?.humidity }} + + + + + V + {{ (deviceInfo.dock.work_osd?.working_voltage ?? str) + ' mV' }} + + + + + A + {{ (deviceInfo.dock.work_osd?.working_current ?? str) + ' mA' }} + + + + + + + + {{ deviceInfo.dock.basic_osd?.drone_in_dock }} + + + + + + + Actions + + + + + +
-
+
- + M30
- - - {{ !deviceInfo.device ? EModeCode[EModeCode.Disconnected] : EModeCode[deviceInfo.device?.mode_code] }} - - - - - - {{ deviceInfo.dock.link_osd?.sdr?.up_quality }} - - - - - - {{ deviceInfo.dock.link_osd?.sdr?.down_quality }} - - - - - - {{ deviceInfo.device && deviceInfo.device.battery.capacity_percent !== str ? deviceInfo.device?.battery.capacity_percent + ' %' : str }} - - - - - - - - - - - - - - - - Fixed - - - - - - GPS - {{ deviceInfo.device ? deviceInfo.device.position_state.gps_number : str }} - - - - - - {{ deviceInfo.device ? deviceInfo.device.position_state.rtk_number : str }} - - - - - - - - {{ deviceInfo.device ? EGear[deviceInfo.device?.gear] : str }} - - - - - ASL - {{ !deviceInfo.device || deviceInfo.device.height === str ? str : deviceInfo.device?.height.toFixed(2) + ' m'}} - - - - - ALT - {{ !deviceInfo.device || deviceInfo.device.elevation === str ? str : deviceInfo.device?.elevation.toFixed(2) + ' m' }} - - - - - H - {{ !deviceInfo.device || deviceInfo.device.home_distance === str ? str : deviceInfo.device?.home_distance.toFixed(2) + ' m' }} - - - - - - - H.S - {{ !deviceInfo.device || deviceInfo.device?.horizontal_speed === str ? str : deviceInfo.device?.horizontal_speed.toFixed(2) + ' m/s'}} - - - - - V.S - {{ !deviceInfo.device || deviceInfo.device.vertical_speed === str ? str : deviceInfo.device?.vertical_speed.toFixed(2) + ' m/s'}} - - - - - W.S - {{ !deviceInfo.device || deviceInfo.device.wind_speed === str ? str : (deviceInfo.device?.wind_speed / 10).toFixed(2) + ' m/s'}} - + + + {{ !deviceInfo.device ? EModeCode[EModeCode.Disconnected] : EModeCode[deviceInfo.device?.mode_code] + }} + + + + + + + + + {{ deviceInfo.dock.link_osd?.sdr?.up_quality }} + + + + + + + + + {{ deviceInfo.dock.link_osd?.sdr?.down_quality }} + + + + + + + + {{ deviceInfo.device && deviceInfo.device.battery.capacity_percent !== str ? + deviceInfo.device?.battery.capacity_percent + ' %' : str }} + + + + + + + + + + + + + + + + + + Fixed + - + + + + GPS + {{ deviceInfo.device ? deviceInfo.device.position_state.gps_number : str }} + + + + + + + + {{ deviceInfo.device ? deviceInfo.device.position_state.rtk_number : str }} + + + + + + + + + + {{ deviceInfo.device ? EGear[deviceInfo.device?.gear] : str }} + + + + + ASL + {{ !deviceInfo.device || deviceInfo.device.height === str ? str : + Number(deviceInfo.device?.height).toFixed(2) + ' m' }} + + + + + ALT + {{ !deviceInfo.device || deviceInfo.device.elevation === str ? str : + Number(deviceInfo.device?.elevation).toFixed(2) + ' m' }} + + + + + H + {{ !deviceInfo.device || deviceInfo.device.home_distance === str ? str : + Number(deviceInfo.device?.home_distance).toFixed(2) + ' m' }} + + + + + + + H.S + {{ !deviceInfo.device || deviceInfo.device?.horizontal_speed === str ? str : + Number(deviceInfo.device?.horizontal_speed).toFixed(2) + ' m/s' }} + + + + + V.S + {{ !deviceInfo.device || deviceInfo.device.vertical_speed === str ? str : + Number(deviceInfo.device?.vertical_speed).toFixed(2) + ' m/s' }} + + + + + W.S + {{ !deviceInfo.device || deviceInfo.device.wind_speed === str ? str : + (Number(deviceInfo.device?.wind_speed) / 10).toFixed(2) + ' m/s' }} + + +
-
+
-
-
-
-
+
+
+
+
{{ Math.floor(deviceInfo.device.battery.remain_flight_time / 60) }}: - {{ 10 > (deviceInfo.device.battery.remain_flight_time % 60) ? '0' : ''}}{{deviceInfo.device.battery.remain_flight_time % 60 }} + {{ 10 > (deviceInfo.device.battery.remain_flight_time % 60) ? '0' : + '' }}{{ deviceInfo.device.battery.remain_flight_time % 60 }}
- + +
-
+
- + + +
-
+
- + + +
@@ -543,7 +647,7 @@ export default defineComponent({ return_home_power: str, }, latitude: 0, - longitude: 0, + longitude: 0 } as DeviceOsd }) const shareId = computed(() => { @@ -575,7 +679,7 @@ export default defineComponent({ return 'color: red' }) watch(() => store.state.deviceStatusEvent, - data => { + (data: any) => { if (Object.keys(data.deviceOnline).length !== 0) { deviceTsaUpdateHook.initMarker(data.deviceOnline.domain, data.deviceOnline.device_callsign, data.deviceOnline.sn) store.state.deviceStatusEvent.deviceOnline = {} as DeviceStatus @@ -629,9 +733,9 @@ export default defineComponent({ let exist = false if (Object.keys(event.mapElementCreat).length !== 0) { console.log(event.mapElementCreat) - const ele = event.mapElementCreat + const ele: any = event.mapElementCreat store.state.Layers.forEach(layer => { - layer.elements.forEach(e => { + layer.elements.forEach((e: any) => { if (e.id === ele.id) { exist = true console.log('true') @@ -716,7 +820,7 @@ export default defineComponent({ draw(isCircle ? MapDoodleEnum.CIRCLE : MapDoodleEnum.POLYGON, true, type) } - function getDrawCallback ({ obj }: { obj : any }) { + function getDrawCallback ({ obj }: { obj: any }) { if (state.isFlightArea) { getDrawFlightAreaCallback(obj) return @@ -735,7 +839,7 @@ export default defineComponent({ break } } - async function postPinPositionResource (obj) { + async function postPinPositionResource (obj: any) { const req = getPinPositionResource(obj) setLayers(req) const coordinates = req.resource.content.geometry.coordinates @@ -745,7 +849,7 @@ export default defineComponent({ obj.setExtData({ id: req.id, name: req.name }) store.state.coverMap[req.id] = [obj] } - async function postPolylineResource (obj) { + async function postPolylineResource (obj: any) { const req = getPolylineResource(obj) setLayers(req) updateCoordinates('gcj02-wgs84', req) @@ -753,7 +857,7 @@ export default defineComponent({ obj.setExtData({ id: req.id, name: req.name }) store.state.coverMap[req.id] = [obj] } - async function postPolygonResource (obj) { + async function postPolygonResource (obj: any) { const req = getPoygonResource(obj) setLayers(req) updateCoordinates('gcj02-wgs84', req) @@ -762,10 +866,10 @@ export default defineComponent({ store.state.coverMap[req.id] = [obj] } - function getPinPositionResource (obj) { + function getPinPositionResource (obj: any) { const position = obj.getPosition() const resource = generatePointContent(position) - const name = obj._originOpts.title + const name = obj._originOpts.title as string const id = uuidv4() return { id, @@ -773,7 +877,7 @@ export default defineComponent({ resource } } - function getPolylineResource (obj) { + function getPolylineResource (obj: any) { const path = obj.getPath() const resource = generateLineContent(path) const { name, id } = getBaseInfo(obj._opts) @@ -783,7 +887,7 @@ export default defineComponent({ resource } } - function getPoygonResource (obj) { + function getPoygonResource (obj: any) { const path = obj.getPath() const resource = generatePolyContent(path) const { name, id } = getBaseInfo(obj._opts) @@ -793,8 +897,8 @@ export default defineComponent({ resource } } - function getBaseInfo (obj) { - const name = obj.title + function getBaseInfo (obj: any) { + const name = obj.title as string const id = uuidv4() return { name, id } } @@ -804,7 +908,7 @@ export default defineComponent({ // layer.id = 'private_layer' + uuidv4() // layer?.elements.push(resource) if (layer?.elements) { - ;(layer?.elements as any[]).push(resource) + ; (layer?.elements as any[]).push(resource) } console.log('layers', layers) store.commit('SET_LAYER_INFO', layers) @@ -908,7 +1012,6 @@ export default defineComponent({ diff --git a/src/components/g-map/DroneControlPanel.vue b/src/components/g-map/DroneControlPanel.vue index 6aa8c16..8d549f4 100644 --- a/src/components/g-map/DroneControlPanel.vue +++ b/src/components/g-map/DroneControlPanel.vue @@ -4,145 +4,141 @@
-
+

-
- + - - - + -
@@ -151,115 +147,95 @@
- -
-
-
-
-