|
|
@@ -2,21 +2,27 @@
|
|
|
<div class="flight-area-device-panel">
|
|
|
<Title title="Choose Synchronous Devices">
|
|
|
<div style="position: absolute; right: 10px;">
|
|
|
- <a style="color: white;" @click="closePanel"><CloseOutlined /></a>
|
|
|
+ <a style="color: white;" @click="closePanel">
|
|
|
+ <CloseOutlined />
|
|
|
+ </a>
|
|
|
</div>
|
|
|
</Title>
|
|
|
<div class="scrollbar">
|
|
|
<div id="data" v-if="data.length !== 0">
|
|
|
<div v-for="dock in data" :key="dock.device_sn">
|
|
|
- <div class="pt5 panel flex-row" @click="selectDock(dock)" :style="{opacity: selectedDocksMap[dock.device_sn] ? 1 : 0.5 }">
|
|
|
+ <div class="pt5 panel flex-row" @click="selectDock(dock)"
|
|
|
+ :style="{ opacity: selectedDocksMap[dock.device_sn] ? 1 : 0.5 }">
|
|
|
<div style="width: 88%">
|
|
|
<div class="title">
|
|
|
- <RobotFilled class="fz20"/>
|
|
|
+ <RobotFilled class="fz20" />
|
|
|
<a-tooltip :title="dock.nickname">
|
|
|
- <div class="pr10 ml5" style="width: 120px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;">{{ dock.nickname }}</div>
|
|
|
+ <div class="pr10 ml5"
|
|
|
+ style="width: 120px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;">{{
|
|
|
+ dock.nickname }}</div>
|
|
|
</a-tooltip>
|
|
|
</div>
|
|
|
- <div class="ml10 mr10 pr5 pl5 flex-align-center flex-row flex-justify-between" style="background: #595959;">
|
|
|
+ <div class="ml10 mr10 pr5 pl5 flex-align-center flex-row flex-justify-between"
|
|
|
+ style="background: #595959;">
|
|
|
<div>
|
|
|
Custom Flight Area
|
|
|
</div>
|
|
|
@@ -26,19 +32,21 @@
|
|
|
<ApiOutlined />
|
|
|
</a-tooltip>
|
|
|
</div>
|
|
|
- <div v-else-if="deviceStatusMap[dock.device_sn]?.flight_area_status?.sync_status === ESyncStatus.SYNCHRONIZED">
|
|
|
+ <div
|
|
|
+ v-else-if="deviceStatusMap[dock.device_sn]?.flight_area_status?.sync_status === ESyncStatus.SYNCHRONIZED">
|
|
|
<a-tooltip title="Data synced">
|
|
|
- <CheckCircleTwoTone twoToneColor="#28d445"/>
|
|
|
+ <CheckCircleTwoTone twoToneColor="#28d445" />
|
|
|
</a-tooltip>
|
|
|
</div>
|
|
|
<div v-else-if="deviceStatusMap[dock.device_sn]?.flight_area_status?.sync_status === ESyncStatus.SYNCHRONIZING
|
|
|
- || deviceStatusMap[dock.device_sn]?.flight_area_status?.sync_status === ESyncStatus.WAIT_SYNC">
|
|
|
+ || deviceStatusMap[dock.device_sn]?.flight_area_status?.sync_status === ESyncStatus.WAIT_SYNC">
|
|
|
<a-tooltip title="To be synced">
|
|
|
<SyncOutlined spin />
|
|
|
</a-tooltip>
|
|
|
</div>
|
|
|
<div v-else>
|
|
|
- <a-tooltip :title="deviceStatusMap[dock.device_sn]?.flight_area_status?.sync_msg || 'No synchronization'">
|
|
|
+ <a-tooltip
|
|
|
+ :title="deviceStatusMap[dock.device_sn]?.flight_area_status?.sync_msg || 'No synchronization'">
|
|
|
<ExclamationCircleTwoTone twoToneColor="#e70102" />
|
|
|
</a-tooltip>
|
|
|
</div>
|
|
|
@@ -67,22 +75,25 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
+import { defineEmits, onMounted, ref, defineProps, computed } from 'vue'
|
|
|
+import { message } from 'ant-design-vue'
|
|
|
import { CloseOutlined, RobotFilled, CheckOutlined, ApiOutlined, CheckCircleTwoTone, SyncOutlined, ExclamationCircleTwoTone } from '@ant-design/icons-vue'
|
|
|
import Title from '/@/components/workspace/Title.vue'
|
|
|
-import { defineEmits, onMounted, ref, defineProps, computed } from 'vue'
|
|
|
import { getBindingDevices } from '/@/api/manage'
|
|
|
-import { EDeviceTypeName, ELocalStorageKey } from '/@/types'
|
|
|
+import { EDeviceTypeName } from '/@/types'
|
|
|
import { IPage } from '/@/api/http/type'
|
|
|
import { Device } from '/@/types/device'
|
|
|
import DividerLine from '../workspace/DividerLine.vue'
|
|
|
-import { message } from 'ant-design-vue'
|
|
|
import { GetDeviceStatus, syncFlightArea } from '/@/api/flight-area'
|
|
|
import { ESyncStatus } from '/@/types/flight-area'
|
|
|
+import { getWorkspaceId } from '/@/utils/index'
|
|
|
|
|
|
const props = defineProps<{
|
|
|
data: GetDeviceStatus[]
|
|
|
}>()
|
|
|
+
|
|
|
const emit = defineEmits(['closePanel'])
|
|
|
+
|
|
|
const closePanel = () => {
|
|
|
emit('closePanel', false)
|
|
|
}
|
|
|
@@ -93,17 +104,19 @@ const deviceStatusMap = computed(() => props.data.reduce((obj: Record<string, Ge
|
|
|
obj[val.device_sn] = val
|
|
|
return obj
|
|
|
}, {} as Record<string, GetDeviceStatus>))
|
|
|
-const workspaceId = localStorage.getItem(ELocalStorageKey.WorkspaceId) || ''
|
|
|
+
|
|
|
const body: IPage = {
|
|
|
page: 1,
|
|
|
total: 0,
|
|
|
page_size: 10,
|
|
|
}
|
|
|
+
|
|
|
const data = ref<Device[]>([])
|
|
|
+
|
|
|
const selectedDocksMap = ref<Record<string, boolean>>({})
|
|
|
|
|
|
const getDocks = async () => {
|
|
|
- await getBindingDevices(workspaceId, body, EDeviceTypeName.Dock).then(res => {
|
|
|
+ await getBindingDevices(getWorkspaceId(), body, EDeviceTypeName.Dock).then(res => {
|
|
|
if (res.code !== 0) {
|
|
|
return
|
|
|
}
|
|
|
@@ -120,7 +133,7 @@ const selectDock = (dock: Device) => {
|
|
|
return
|
|
|
}
|
|
|
if (deviceStatusMap.value[dock.device_sn]?.flight_area_status?.sync_status === ESyncStatus.SYNCHRONIZING ||
|
|
|
- deviceStatusMap.value[dock.device_sn]?.flight_area_status?.sync_status === ESyncStatus.WAIT_SYNC) {
|
|
|
+ deviceStatusMap.value[dock.device_sn]?.flight_area_status?.sync_status === ESyncStatus.WAIT_SYNC) {
|
|
|
message.info('The dock is synchronizing.')
|
|
|
return
|
|
|
}
|
|
|
@@ -175,20 +188,24 @@ const syncDeviceFlightArea = () => {
|
|
|
z-index: 1000;
|
|
|
color: white;
|
|
|
background: #282828;
|
|
|
+
|
|
|
.footer {
|
|
|
position: absolute;
|
|
|
width: 100%;
|
|
|
bottom: 10px;
|
|
|
padding: 10px;
|
|
|
+
|
|
|
button {
|
|
|
width: 45%;
|
|
|
border: 0;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.scrollbar {
|
|
|
overflow-y: auto;
|
|
|
height: calc(100vh - 150px);
|
|
|
}
|
|
|
+
|
|
|
.box {
|
|
|
font-size: 22px;
|
|
|
line-height: 60px;
|