|
|
@@ -157,69 +157,11 @@
|
|
|
<div v-if="onlineDevices.data.length === 0" style="height: 100px; color: white;">
|
|
|
<a-empty :image="noData" :image-style="{ height: '60px' }" />
|
|
|
</div>
|
|
|
- <div v-else class="fz12" style="color: white;">
|
|
|
- <div :class="['device-item', (state.selectedDevice === device.gateway.sn && 'device-item-selected')]"
|
|
|
- v-for="device in onlineDevices.data" :key="device.sn" @click="onClickSelectedDevice(device)">
|
|
|
- <div class="battery-slide" v-if="deviceInfo[device.sn]">
|
|
|
- <div style="background: #535759; width: 100%;"></div>
|
|
|
- <div class="capacity-percent" :style="{ width: deviceInfo[device.sn].battery.capacity_percent + '%' }">
|
|
|
- </div>
|
|
|
- <div class="return-home" :style="{ width: deviceInfo[device.sn].battery.return_home_power + '%' }">
|
|
|
- </div>
|
|
|
- <div class="landing" :style="{ width: deviceInfo[device.sn].battery.landing_power + '%' }"></div>
|
|
|
- <div class="battery" :style="{ left: deviceInfo[device.sn].battery.capacity_percent + '%' }"></div>
|
|
|
- </div>
|
|
|
- <div style="border-bottom: 1px solid #515151; border-radius: 2px; height: 50px; width: 100%;"
|
|
|
- class="flex-row flex-justify-between flex-align-center">
|
|
|
- <div style="float: left; padding: 5px 5px 8px 8px; width: 88%">
|
|
|
- <div style="width: 100%; height: 100%;">
|
|
|
- <a-tooltip>
|
|
|
- <template #title>
|
|
|
- {{ device.model ? `${device.model} - ${device.callsign}` : 'NoDrone' }}</template>
|
|
|
- <span class="text-hidden" style="max-width: 200px; display: block; height: 20px;">
|
|
|
- {{ device.model ? `${device.model} - ${device.callsign}` : 'No Drone' }}
|
|
|
- </span>
|
|
|
- </a-tooltip>
|
|
|
- </div>
|
|
|
- <div class="mt5" style="background: #595959;">
|
|
|
- <span class="ml5 mr5">
|
|
|
- <RocketOutlined />
|
|
|
- </span>
|
|
|
- <span class="font-bold">
|
|
|
- {{
|
|
|
- getTextByModeCode(deviceInfo[device.sn] ? deviceInfo[device.sn].mode_code :
|
|
|
- EModeCode.Disconnected)
|
|
|
- }}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div style="float: right; background: #595959; height: 50px; width: 40px;"
|
|
|
- class="flex-row flex-justify-center flex-align-center">
|
|
|
- <div class="fz16"
|
|
|
- @click.stop="switchVisible($event, device, false, deviceInfo[device.sn] && deviceInfo[device.sn].mode_code !== EModeCode.Disconnected)">
|
|
|
- <a v-if="osdVisible.sn === device.sn && osdVisible.visible">
|
|
|
- <EyeOutlined />
|
|
|
- </a>
|
|
|
- <a v-else>
|
|
|
- <EyeInvisibleOutlined />
|
|
|
- </a>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="flex-row flex-justify-center flex-align-center" style="height: 40px;">
|
|
|
- <div class="flex-row" style="height: 20px; background: #595959; width: 94%;">
|
|
|
- <span class="mr5">
|
|
|
- <a-image :preview="false" style="margin-left: 2px; margin-top: -2px; height: 20px; width: 20px;"
|
|
|
- :src="rc" />
|
|
|
- </span>
|
|
|
- <a-tooltip>
|
|
|
- <template #title>{{ device.gateway.model }} - {{ device.gateway.callsign }} </template>
|
|
|
- <div class="text-hidden" style="max-width: 200px;">
|
|
|
- {{ device.gateway.model }} - {{ device.gateway.callsign }}
|
|
|
- </div>
|
|
|
- </a-tooltip>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <div v-else>
|
|
|
+ <div :style="{ 'margin-top': index === 0 ? '' : '10px' }" v-for="(device, index) in onlineDevices.data"
|
|
|
+ :key="device.sn">
|
|
|
+ <OnLineDevice :device="device"
|
|
|
+ :onClickLookInfo="() => switchVisible($event, device, false, deviceInfo[device.sn] && deviceInfo[device.sn].mode_code !== EModeCode.Disconnected)" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</a-collapse-panel>
|
|
|
@@ -229,11 +171,6 @@
|
|
|
</a-collapse-panel>
|
|
|
</a-collapse>
|
|
|
</div>
|
|
|
- <!-- <div style="width: 100%;padding-top: 10px; display: flex;justify-content: center;align-items: center;">
|
|
|
- <a-button style="margin-right: 10px;" type="primary" @click="onClickGoHome">
|
|
|
- 返回
|
|
|
- </a-button>
|
|
|
- </div> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -242,15 +179,12 @@ import { computed, onMounted, reactive, ref, watch } from 'vue'
|
|
|
import { RocketOutlined, EyeInvisibleOutlined, EyeOutlined, RobotOutlined, DoubleRightOutlined } from '@ant-design/icons-vue'
|
|
|
import Layer from './layer/index.vue'
|
|
|
import noData from '/@/assets/icons/no-data.png'
|
|
|
-import rc from '/@/assets/icons/rc.png'
|
|
|
import { useMyStore } from '/@/store'
|
|
|
import { getDeviceTopo, getUnreadDeviceHms, updateDeviceHms } from '/@/api/manage'
|
|
|
-import { EHmsLevel, ERouterName } from '/@/types/enums'
|
|
|
+import { EHmsLevel } from '/@/types/enums'
|
|
|
+import OnLineDevice from '/@/components/onLineDevice/index.vue'
|
|
|
import { OnlineDevice, EModeCode, EDockModeCode } from '/@/types/device'
|
|
|
import { EDeviceTypeName } from '/@/types'
|
|
|
-import { getRoot } from '/@/root'
|
|
|
-import { wgs84togcj02 } from '/@/vendors/coordtransform'
|
|
|
-import { getTextByModeCode } from '/@/utils/index'
|
|
|
import { getWorkspaceId } from '/@/utils/index'
|
|
|
|
|
|
const store = useMyStore()
|
|
|
@@ -258,7 +192,6 @@ const workspaceId = ref(getWorkspaceId())
|
|
|
const osdVisible = computed(() => store.state.osdVisible)
|
|
|
const hmsVisible = new Map<string, boolean>()
|
|
|
const scorllHeight = ref()
|
|
|
-const root = getRoot()
|
|
|
|
|
|
const onlineDevices = reactive({
|
|
|
data: [] as OnlineDevice[]
|
|
|
@@ -307,21 +240,6 @@ onMounted(() => {
|
|
|
scorllHeight.value = parent?.clientHeight - parent?.firstElementChild?.clientHeight
|
|
|
})
|
|
|
|
|
|
-// 点击选中设备
|
|
|
-const onClickSelectedDevice = (record: OnlineDevice) => {
|
|
|
- const sn = record.gateway.sn;
|
|
|
- if (state.selectedDevice === sn) {
|
|
|
- state.selectedDevice = '';
|
|
|
- } else {
|
|
|
- state.selectedDevice = sn;
|
|
|
- const gatewayInfo = store.state.deviceState.gatewayInfo[sn];
|
|
|
- if (gatewayInfo) {
|
|
|
- const coordinate = wgs84togcj02(gatewayInfo.longitude, gatewayInfo.latitude);
|
|
|
- root.$map.setCenter(coordinate)
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
function getOnlineTopo() {
|
|
|
getDeviceTopo(workspaceId.value).then((res) => {
|
|
|
if (res.code !== 0) {
|
|
|
@@ -421,18 +339,6 @@ function readHms(visiable: boolean, sn: string) {
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-const onClickGoHome = () => {
|
|
|
- root.$router.push('/' + ERouterName.DEVICES)
|
|
|
-}
|
|
|
-
|
|
|
-function openLivestreamOthers() {
|
|
|
- store.commit('SET_LIVESTREAM_OTHERS_VISIBLE', true)
|
|
|
-}
|
|
|
-
|
|
|
-function openLivestreamAgora() {
|
|
|
- store.commit('SET_LIVESTREAM_AGORA_VISIBLE', true)
|
|
|
-}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
@@ -448,22 +354,6 @@ function openLivestreamAgora() {
|
|
|
margin-top: 10px;
|
|
|
}
|
|
|
|
|
|
-.device-item {
|
|
|
- background: #3c3c3c;
|
|
|
- width: 100%;
|
|
|
- height: 100px;
|
|
|
- box-sizing: border-box;
|
|
|
- padding-top: 10px;
|
|
|
- border-radius: 2px;
|
|
|
- border: 2px solid transparent;
|
|
|
- cursor: pointer;
|
|
|
- margin-top: 10px;
|
|
|
-}
|
|
|
-
|
|
|
-.device-item-selected {
|
|
|
- border-color: #2d8cf0;
|
|
|
-}
|
|
|
-
|
|
|
.project-tsa-wrapper> :first-child {
|
|
|
height: 50px;
|
|
|
line-height: 50px;
|