|
@@ -1,24 +1,23 @@
|
|
|
-
|
|
|
|
|
<template>
|
|
<template>
|
|
|
<a-menu v-model:selectedKeys="current" mode="horizontal" @select="select">
|
|
<a-menu v-model:selectedKeys="current" mode="horizontal" @select="select">
|
|
|
- <a-menu-item :key="EDeviceTypeName.Aircraft" class="ml20">
|
|
|
|
|
- Aircraft
|
|
|
|
|
|
|
+ <a-menu-item :key="3">
|
|
|
|
|
+ 设备列表
|
|
|
|
|
+ </a-menu-item>
|
|
|
|
|
+ <a-menu-item :key="0">
|
|
|
|
|
+ 机场异常反馈记录
|
|
|
</a-menu-item>
|
|
</a-menu-item>
|
|
|
- <a-menu-item :key="EDeviceTypeName.Dock">
|
|
|
|
|
- Dock
|
|
|
|
|
|
|
+ <a-menu-item :key="2">
|
|
|
|
|
+ 所有设备变化记录
|
|
|
</a-menu-item>
|
|
</a-menu-item>
|
|
|
</a-menu>
|
|
</a-menu>
|
|
|
<div class="device-table-wrap table flex-display flex-column">
|
|
<div class="device-table-wrap table flex-display flex-column">
|
|
|
- <a-table :columns="columns" :data-source="data.device" :pagination="paginationProp" @change="refreshData" row-key="device_sn" :expandedRowKeys="expandRows"
|
|
|
|
|
- :row-selection="rowSelection" :rowClassName="rowClassName" :scroll="{ x: '100%', y: 600 }"
|
|
|
|
|
- :expandIcon="expandIcon" :loading="loading">
|
|
|
|
|
|
|
+ <a-table :columns="columns" :data-source="data.device" :pagination="paginationProp" @change="refreshData"
|
|
|
|
|
+ row-key="device_sn" :expandedRowKeys="expandRows" :row-selection="rowSelection" :rowClassName="rowClassName"
|
|
|
|
|
+ :scroll="{ x: '100%', y: 600 }" :expandIcon="expandIcon" :loading="loading">
|
|
|
<template v-for="col in ['nickname']" #[col]="{ text, record }" :key="col">
|
|
<template v-for="col in ['nickname']" #[col]="{ text, record }" :key="col">
|
|
|
<div>
|
|
<div>
|
|
|
- <a-input
|
|
|
|
|
- v-if="editableData[record.device_sn]"
|
|
|
|
|
- v-model:value="editableData[record.device_sn][col]"
|
|
|
|
|
- style="margin: -5px 0"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <a-input v-if="editableData[record.device_sn]" v-model:value="editableData[record.device_sn][col]"
|
|
|
|
|
+ style="margin: -5px 0" />
|
|
|
<template v-else>
|
|
<template v-else>
|
|
|
<a-tooltip :title="text">
|
|
<a-tooltip :title="text">
|
|
|
{{ text }}
|
|
{{ text }}
|
|
@@ -28,30 +27,36 @@
|
|
|
</template>
|
|
</template>
|
|
|
<template v-for="col in ['sn', 'workspace']" #[col]="{ text }" :key="col">
|
|
<template v-for="col in ['sn', 'workspace']" #[col]="{ text }" :key="col">
|
|
|
<a-tooltip :title="text">
|
|
<a-tooltip :title="text">
|
|
|
- <span>{{ text }}</span>
|
|
|
|
|
|
|
+ <span>{{ text }}</span>
|
|
|
</a-tooltip>
|
|
</a-tooltip>
|
|
|
</template>
|
|
</template>
|
|
|
<!-- 固件版本 -->
|
|
<!-- 固件版本 -->
|
|
|
<template #firmware_version="{ record }">
|
|
<template #firmware_version="{ record }">
|
|
|
<span v-if="judgeCurrentType(EDeviceTypeName.Dock)">
|
|
<span v-if="judgeCurrentType(EDeviceTypeName.Dock)">
|
|
|
- <DeviceFirmwareUpgrade :device="record"
|
|
|
|
|
- class="table-flex-col"
|
|
|
|
|
- @device-upgrade="onDeviceUpgrade"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <DeviceFirmwareUpgrade :device="record" class="table-flex-col" @device-upgrade="onDeviceUpgrade" />
|
|
|
</span>
|
|
</span>
|
|
|
<span v-else>
|
|
<span v-else>
|
|
|
{{ record.firmware_version }}
|
|
{{ record.firmware_version }}
|
|
|
</span>
|
|
</span>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+ <!-- 固件升级 -->
|
|
|
|
|
+ <template #firmware_status="{ text }">
|
|
|
|
|
+ <div v-if="text === -1">
|
|
|
|
|
+ 不支持
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div v-else>
|
|
|
|
|
+ {{ DeviceFirmwareStatus[text] }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
<!-- 状态 -->
|
|
<!-- 状态 -->
|
|
|
<template #status="{ text }">
|
|
<template #status="{ text }">
|
|
|
<span v-if="text" class="flex-row flex-align-center">
|
|
<span v-if="text" class="flex-row flex-align-center">
|
|
|
- <span class="mr5" style="width: 12px; height: 12px; border-radius: 50%; background-color: green;" />
|
|
|
|
|
- <span>Online</span>
|
|
|
|
|
|
|
+ <span class="mr5" style="width: 12px; height: 12px; border-radius: 50%; background-color: green;" />
|
|
|
|
|
+ <span>在线</span>
|
|
|
</span>
|
|
</span>
|
|
|
<span class="flex-row flex-align-center" v-else>
|
|
<span class="flex-row flex-align-center" v-else>
|
|
|
- <span class="mr5" style="width: 12px; height: 12px; border-radius: 50%; background-color: red;" />
|
|
|
|
|
- <span>Offline</span>
|
|
|
|
|
|
|
+ <span class="mr5" style="width: 12px; height: 12px; border-radius: 50%; background-color: red;" />
|
|
|
|
|
+ <span>离线</span>
|
|
|
</span>
|
|
</span>
|
|
|
</template>
|
|
</template>
|
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
@@ -60,68 +65,64 @@
|
|
|
<!-- 编辑态操作 -->
|
|
<!-- 编辑态操作 -->
|
|
|
<div v-if="editableData[record.device_sn]">
|
|
<div v-if="editableData[record.device_sn]">
|
|
|
<a-tooltip title="Confirm changes">
|
|
<a-tooltip title="Confirm changes">
|
|
|
- <span @click="save(record)" style="color: #28d445;"><CheckOutlined /></span>
|
|
|
|
|
|
|
+ <span @click="save(record)" style="color: #28d445;">
|
|
|
|
|
+ <CheckOutlined />
|
|
|
|
|
+ </span>
|
|
|
</a-tooltip>
|
|
</a-tooltip>
|
|
|
<a-tooltip title="Modification canceled">
|
|
<a-tooltip title="Modification canceled">
|
|
|
- <span @click="() => delete editableData[record.device_sn]" style="color: #e70102;"><CloseOutlined /></span>
|
|
|
|
|
|
|
+ <span @click="() => delete editableData[record.device_sn]" style="color: #e70102;">
|
|
|
|
|
+ <CloseOutlined />
|
|
|
|
|
+ </span>
|
|
|
</a-tooltip>
|
|
</a-tooltip>
|
|
|
</div>
|
|
</div>
|
|
|
<!-- 非编辑态操作 -->
|
|
<!-- 非编辑态操作 -->
|
|
|
<div v-else class="flex-align-center flex-row" style="color: #2d8cf0">
|
|
<div v-else class="flex-align-center flex-row" style="color: #2d8cf0">
|
|
|
<a-tooltip v-if="current.indexOf(EDeviceTypeName.Dock) !== -1" title="设备日志">
|
|
<a-tooltip v-if="current.indexOf(EDeviceTypeName.Dock) !== -1" title="设备日志">
|
|
|
- <CloudServerOutlined @click="showDeviceLogUploadRecord(record)"/>
|
|
|
|
|
|
|
+ <CloudServerOutlined @click="showDeviceLogUploadRecord(record)" />
|
|
|
</a-tooltip>
|
|
</a-tooltip>
|
|
|
<a-tooltip v-if="current.indexOf(EDeviceTypeName.Dock) !== -1" title="Hms Info">
|
|
<a-tooltip v-if="current.indexOf(EDeviceTypeName.Dock) !== -1" title="Hms Info">
|
|
|
- <FileSearchOutlined @click="showHms(record)"/>
|
|
|
|
|
|
|
+ <FileSearchOutlined @click="showHms(record)" />
|
|
|
</a-tooltip>
|
|
</a-tooltip>
|
|
|
<a-tooltip title="Edit">
|
|
<a-tooltip title="Edit">
|
|
|
- <EditOutlined @click="edit(record)"/>
|
|
|
|
|
|
|
+ <EditOutlined @click="edit(record)" />
|
|
|
</a-tooltip>
|
|
</a-tooltip>
|
|
|
<a-tooltip title="Delete">
|
|
<a-tooltip title="Delete">
|
|
|
- <DeleteOutlined @click="() => { deleteTip = true, deleteSn = record.device_sn }"/>
|
|
|
|
|
|
|
+ <DeleteOutlined @click="() => { deleteTip = true, deleteSn = record.device_sn }" />
|
|
|
</a-tooltip>
|
|
</a-tooltip>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
</a-table>
|
|
</a-table>
|
|
|
- <a-modal v-model:visible="deleteTip" width="450px" :closable="false" centered :okButtonProps="{ danger: true }" @ok="unbind">
|
|
|
|
|
- <p class="pt10 pl20" style="height: 50px;">Delete device from workspace?</p>
|
|
|
|
|
- <template #title>
|
|
|
|
|
- <div class="flex-row flex-justify-center">
|
|
|
|
|
- <span>Delete devices</span>
|
|
|
|
|
- </div>
|
|
|
|
|
- </template>
|
|
|
|
|
|
|
+ <a-modal v-model:visible="deleteTip" width="450px" :closable="false" centered :okButtonProps="{ danger: true }"
|
|
|
|
|
+ @ok="unbind">
|
|
|
|
|
+ <p class="pt10 pl20" style="height: 50px;">Delete device from workspace?</p>
|
|
|
|
|
+ <template #title>
|
|
|
|
|
+ <div class="flex-row flex-justify-center">
|
|
|
|
|
+ <span>Delete devices</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
</a-modal>
|
|
</a-modal>
|
|
|
-
|
|
|
|
|
<!-- 设备升级 -->
|
|
<!-- 设备升级 -->
|
|
|
- <DeviceFirmwareUpgradeModal title="设备升级"
|
|
|
|
|
- v-model:visible="deviceFirmwareUpgradeModalVisible"
|
|
|
|
|
- :device="selectedDevice"
|
|
|
|
|
- @ok="onUpgradeDeviceOk"
|
|
|
|
|
- ></DeviceFirmwareUpgradeModal>
|
|
|
|
|
-
|
|
|
|
|
|
|
+ <DeviceFirmwareUpgradeModal title="设备升级" v-model:visible="deviceFirmwareUpgradeModalVisible"
|
|
|
|
|
+ :device="selectedDevice" @ok="onUpgradeDeviceOk"></DeviceFirmwareUpgradeModal>
|
|
|
<!-- 设备日志上传记录 -->
|
|
<!-- 设备日志上传记录 -->
|
|
|
- <DeviceLogUploadRecordDrawer
|
|
|
|
|
- v-model:visible="deviceLogUploadRecordVisible"
|
|
|
|
|
- :device="currentDevice"
|
|
|
|
|
- ></DeviceLogUploadRecordDrawer>
|
|
|
|
|
-
|
|
|
|
|
|
|
+ <DeviceLogUploadRecordDrawer v-model:visible="deviceLogUploadRecordVisible" :device="currentDevice">
|
|
|
|
|
+ </DeviceLogUploadRecordDrawer>
|
|
|
<!-- hms 信息 -->
|
|
<!-- hms 信息 -->
|
|
|
- <DeviceHmsDrawer
|
|
|
|
|
- v-model:visible="hmsVisible"
|
|
|
|
|
- :device="currentDevice">
|
|
|
|
|
|
|
+ <DeviceHmsDrawer v-model:visible="hmsVisible" :device="currentDevice">
|
|
|
</DeviceHmsDrawer>
|
|
</DeviceHmsDrawer>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
-import { ColumnProps, TableState } from 'ant-design-vue/lib/table/interface'
|
|
|
|
|
import { h, onMounted, reactive, ref, UnwrapRef } from 'vue'
|
|
import { h, onMounted, reactive, ref, UnwrapRef } from 'vue'
|
|
|
-import { IPage } from '/@/api/http/type'
|
|
|
|
|
-import { BindBody, bindDevice, getBindingDevices, unbindDevice, updateDevice } from '/@/api/manage'
|
|
|
|
|
|
|
+import { notification } from 'ant-design-vue'
|
|
|
|
|
+import { ColumnProps, TableState } from 'ant-design-vue/lib/table/interface'
|
|
|
|
|
+import { getBindingDevices, unbindDevice, updateDevice } from '/@/api/manage'
|
|
|
import { EDeviceTypeName, ELocalStorageKey } from '/@/types'
|
|
import { EDeviceTypeName, ELocalStorageKey } from '/@/types'
|
|
|
import { EditOutlined, CheckOutlined, CloseOutlined, DeleteOutlined, FileSearchOutlined, CloudServerOutlined } from '@ant-design/icons-vue'
|
|
import { EditOutlined, CheckOutlined, CloseOutlined, DeleteOutlined, FileSearchOutlined, CloudServerOutlined } from '@ant-design/icons-vue'
|
|
|
-import { Device, DeviceFirmwareStatusEnum } from '/@/types/device'
|
|
|
|
|
|
|
+import { Device, DeviceFirmwareStatus, DeviceFirmwareStatusEnum } from '/@/types/device'
|
|
|
import DeviceFirmwareUpgrade from '/@/components/devices/device-upgrade/DeviceFirmwareUpgrade.vue'
|
|
import DeviceFirmwareUpgrade from '/@/components/devices/device-upgrade/DeviceFirmwareUpgrade.vue'
|
|
|
import DeviceFirmwareUpgradeModal from '/@/components/devices/device-upgrade/DeviceFirmwareUpgradeModal.vue'
|
|
import DeviceFirmwareUpgradeModal from '/@/components/devices/device-upgrade/DeviceFirmwareUpgradeModal.vue'
|
|
|
import { useDeviceFirmwareUpgrade } from '/@/components/devices/device-upgrade/use-device-upgrade'
|
|
import { useDeviceFirmwareUpgrade } from '/@/components/devices/device-upgrade/use-device-upgrade'
|
|
@@ -129,7 +130,7 @@ import { useDeviceUpgradeEvent } from '/@/components/devices/device-upgrade/use-
|
|
|
import { DeviceCmdExecuteInfo, DeviceCmdExecuteStatus } from '/@/types/device-cmd'
|
|
import { DeviceCmdExecuteInfo, DeviceCmdExecuteStatus } from '/@/types/device-cmd'
|
|
|
import DeviceLogUploadRecordDrawer from '/@/components/devices/device-log/DeviceLogUploadRecordDrawer.vue'
|
|
import DeviceLogUploadRecordDrawer from '/@/components/devices/device-log/DeviceLogUploadRecordDrawer.vue'
|
|
|
import DeviceHmsDrawer from '/@/components/devices/device-hms/DeviceHmsDrawer.vue'
|
|
import DeviceHmsDrawer from '/@/components/devices/device-hms/DeviceHmsDrawer.vue'
|
|
|
-import { message, notification } from 'ant-design-vue'
|
|
|
|
|
|
|
+import { IPage } from '/@/api/http/type'
|
|
|
|
|
|
|
|
interface DeviceData {
|
|
interface DeviceData {
|
|
|
device: Device[]
|
|
device: Device[]
|
|
@@ -138,45 +139,32 @@ interface DeviceData {
|
|
|
const loading = ref(true)
|
|
const loading = ref(true)
|
|
|
const deleteTip = ref<boolean>(false)
|
|
const deleteTip = ref<boolean>(false)
|
|
|
const deleteSn = ref<string>()
|
|
const deleteSn = ref<string>()
|
|
|
|
|
+
|
|
|
const columns: ColumnProps[] = [
|
|
const columns: ColumnProps[] = [
|
|
|
- { title: 'Model', dataIndex: 'device_name', width: 100, className: 'titleStyle' },
|
|
|
|
|
- { title: 'SN', dataIndex: 'device_sn', width: 100, className: 'titleStyle', ellipsis: true, slots: { customRender: 'sn' } },
|
|
|
|
|
{
|
|
{
|
|
|
- title: 'Name',
|
|
|
|
|
- dataIndex: 'nickname',
|
|
|
|
|
- width: 100,
|
|
|
|
|
|
|
+ title: '设备型号', dataIndex: 'device_name', width: 150,
|
|
|
sorter: (a: Device, b: Device) => a.nickname.localeCompare(b.nickname),
|
|
sorter: (a: Device, b: Device) => a.nickname.localeCompare(b.nickname),
|
|
|
- className: 'titleStyle',
|
|
|
|
|
- ellipsis: true,
|
|
|
|
|
- slots: { customRender: 'nickname' }
|
|
|
|
|
|
|
+ className: 'titleStyle'
|
|
|
},
|
|
},
|
|
|
- { title: 'Firmware Version', dataIndex: 'firmware_version', width: 150, className: 'titleStyle', slots: { customRender: 'firmware_version' } },
|
|
|
|
|
- { title: 'Status', dataIndex: 'status', width: 100, className: 'titleStyle', slots: { customRender: 'status' } },
|
|
|
|
|
|
|
+ { title: '设备SN', dataIndex: 'device_sn', width: 100, className: 'titleStyle', ellipsis: true, slots: { customRender: 'sn' } },
|
|
|
{
|
|
{
|
|
|
- title: 'Workspace',
|
|
|
|
|
- dataIndex: 'workspace_name',
|
|
|
|
|
- width: 100,
|
|
|
|
|
|
|
+ title: '设备名称',
|
|
|
|
|
+ dataIndex: 'nickname',
|
|
|
|
|
+ width: 150,
|
|
|
|
|
+ sorter: (a: Device, b: Device) => a.nickname.localeCompare(b.nickname),
|
|
|
className: 'titleStyle',
|
|
className: 'titleStyle',
|
|
|
ellipsis: true,
|
|
ellipsis: true,
|
|
|
- slots: { customRender: 'workspace' },
|
|
|
|
|
- customRender: ({ text, record, index }) => {
|
|
|
|
|
- const obj = {
|
|
|
|
|
- children: text,
|
|
|
|
|
- props: {} as any,
|
|
|
|
|
- }
|
|
|
|
|
- if (current.value.indexOf(EDeviceTypeName.Dock) !== -1) {
|
|
|
|
|
- if (record.domain === EDeviceTypeName.Aircraft) {
|
|
|
|
|
- obj.children = ''
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- return obj
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ slots: { customRender: 'nickname' }
|
|
|
},
|
|
},
|
|
|
- { title: 'Joined', dataIndex: 'bound_time', width: 150, sorter: (a: Device, b: Device) => a.bound_time.localeCompare(b.bound_time), className: 'titleStyle' },
|
|
|
|
|
- { title: 'Last Online', dataIndex: 'login_time', width: 150, sorter: (a: Device, b: Device) => a.login_time.localeCompare(b.login_time), className: 'titleStyle' },
|
|
|
|
|
|
|
+ { title: '固件版本', dataIndex: 'firmware_version', width: 150, className: 'titleStyle', slots: { customRender: 'firmware_version' } },
|
|
|
|
|
+ { title: '固件升级', dataIndex: 'firmware_status', width: 150, className: 'titleStyle', slots: { customRender: 'firmware_status' } },
|
|
|
|
|
+ { title: '当前状态', dataIndex: 'status', width: 100, className: 'titleStyle', slots: { customRender: 'status' } },
|
|
|
|
|
+ { title: '加入项目时间', dataIndex: 'bound_time', width: 150, sorter: (a: Device, b: Device) => a.bound_time.localeCompare(b.bound_time), className: 'titleStyle' },
|
|
|
|
|
+ { title: '最后在线时间', dataIndex: 'login_time', width: 150, sorter: (a: Device, b: Device) => a.login_time.localeCompare(b.login_time), className: 'titleStyle' },
|
|
|
{
|
|
{
|
|
|
- title: 'Actions',
|
|
|
|
|
|
|
+ title: '操作',
|
|
|
dataIndex: 'actions',
|
|
dataIndex: 'actions',
|
|
|
|
|
+ fixed: 'right',
|
|
|
width: 100,
|
|
width: 100,
|
|
|
className: 'titleStyle',
|
|
className: 'titleStyle',
|
|
|
slots: { customRender: 'action' }
|
|
slots: { customRender: 'action' }
|
|
@@ -219,7 +207,7 @@ const paginationProp = reactive({
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// 获取分页信息
|
|
// 获取分页信息
|
|
|
-function getPaginationBody () {
|
|
|
|
|
|
|
+function getPaginationBody() {
|
|
|
return {
|
|
return {
|
|
|
page: paginationProp.current,
|
|
page: paginationProp.current,
|
|
|
page_size: paginationProp.pageSize
|
|
page_size: paginationProp.pageSize
|
|
@@ -245,9 +233,9 @@ type Pagination = TableState['pagination']
|
|
|
|
|
|
|
|
const workspaceId: string = localStorage.getItem(ELocalStorageKey.WorkspaceId) || ''
|
|
const workspaceId: string = localStorage.getItem(ELocalStorageKey.WorkspaceId) || ''
|
|
|
const editableData: UnwrapRef<Record<string, Device>> = reactive({})
|
|
const editableData: UnwrapRef<Record<string, Device>> = reactive({})
|
|
|
-const current = ref([EDeviceTypeName.Aircraft])
|
|
|
|
|
|
|
+const current = ref([EDeviceTypeName.Dock])
|
|
|
|
|
|
|
|
-function judgeCurrentType (type: EDeviceTypeName): boolean {
|
|
|
|
|
|
|
+function judgeCurrentType(type: EDeviceTypeName): boolean {
|
|
|
return current.value.indexOf(type) !== -1
|
|
return current.value.indexOf(type) !== -1
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -259,11 +247,11 @@ const {
|
|
|
onUpgradeDeviceOk
|
|
onUpgradeDeviceOk
|
|
|
} = useDeviceFirmwareUpgrade(workspaceId)
|
|
} = useDeviceFirmwareUpgrade(workspaceId)
|
|
|
|
|
|
|
|
-function onDeviceUpgradeWs (payload: DeviceCmdExecuteInfo) {
|
|
|
|
|
|
|
+function onDeviceUpgradeWs(payload: DeviceCmdExecuteInfo) {
|
|
|
updateDevicesByWs(data.device, payload)
|
|
updateDevicesByWs(data.device, payload)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-function updateDevicesByWs (devices: Device[], payload: DeviceCmdExecuteInfo) {
|
|
|
|
|
|
|
+function updateDevicesByWs(devices: Device[], payload: DeviceCmdExecuteInfo) {
|
|
|
if (!devices || devices.length <= 0) {
|
|
if (!devices || devices.length <= 0) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
@@ -297,7 +285,7 @@ function updateDevicesByWs (devices: Device[], payload: DeviceCmdExecuteInfo) {
|
|
|
useDeviceUpgradeEvent(onDeviceUpgradeWs)
|
|
useDeviceUpgradeEvent(onDeviceUpgradeWs)
|
|
|
|
|
|
|
|
// 获取设备列表信息
|
|
// 获取设备列表信息
|
|
|
-function getDevices (domain: number, closeLoading?: boolean) {
|
|
|
|
|
|
|
+function getDevices(domain: number, closeLoading?: boolean) {
|
|
|
if (!closeLoading) {
|
|
if (!closeLoading) {
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
}
|
|
}
|
|
@@ -323,30 +311,30 @@ function getDevices (domain: number, closeLoading?: boolean) {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-function refreshData (page: Pagination) {
|
|
|
|
|
|
|
+function refreshData(page: Pagination) {
|
|
|
paginationProp.current = page?.current!
|
|
paginationProp.current = page?.current!
|
|
|
paginationProp.pageSize = page?.pageSize!
|
|
paginationProp.pageSize = page?.pageSize!
|
|
|
getDevices(current.value[0])
|
|
getDevices(current.value[0])
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 编辑
|
|
// 编辑
|
|
|
-function edit (record: Device) {
|
|
|
|
|
|
|
+function edit(record: Device) {
|
|
|
editableData[record.device_sn] = record
|
|
editableData[record.device_sn] = record
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 保存
|
|
// 保存
|
|
|
-function save (record: Device) {
|
|
|
|
|
|
|
+function save(record: Device) {
|
|
|
delete editableData[record.device_sn]
|
|
delete editableData[record.device_sn]
|
|
|
updateDevice({ nickname: record.nickname }, workspaceId, record.device_sn)
|
|
updateDevice({ nickname: record.nickname }, workspaceId, record.device_sn)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 删除
|
|
// 删除
|
|
|
-function showDeleteTip (sn: any) {
|
|
|
|
|
|
|
+function showDeleteTip(sn: any) {
|
|
|
deleteTip.value = true
|
|
deleteTip.value = true
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 解绑
|
|
// 解绑
|
|
|
-function unbind () {
|
|
|
|
|
|
|
+function unbind() {
|
|
|
deleteTip.value = false
|
|
deleteTip.value = false
|
|
|
unbindDevice(deleteSn.value?.toString()!).then(res => {
|
|
unbindDevice(deleteSn.value?.toString()!).then(res => {
|
|
|
if (res.code !== 0) {
|
|
if (res.code !== 0) {
|
|
@@ -357,14 +345,14 @@ function unbind () {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 选择设备
|
|
// 选择设备
|
|
|
-function select (item: any) {
|
|
|
|
|
|
|
+function select(item: any) {
|
|
|
getDevices(item.key)
|
|
getDevices(item.key)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const currentDevice = ref({} as Device)
|
|
const currentDevice = ref({} as Device)
|
|
|
// 设备日志
|
|
// 设备日志
|
|
|
const deviceLogUploadRecordVisible = ref(false)
|
|
const deviceLogUploadRecordVisible = ref(false)
|
|
|
-function showDeviceLogUploadRecord (dock: Device) {
|
|
|
|
|
|
|
+function showDeviceLogUploadRecord(dock: Device) {
|
|
|
deviceLogUploadRecordVisible.value = true
|
|
deviceLogUploadRecordVisible.value = true
|
|
|
currentDevice.value = dock
|
|
currentDevice.value = dock
|
|
|
}
|
|
}
|
|
@@ -372,7 +360,7 @@ function showDeviceLogUploadRecord (dock: Device) {
|
|
|
// 健康状态
|
|
// 健康状态
|
|
|
const hmsVisible = ref<boolean>(false)
|
|
const hmsVisible = ref<boolean>(false)
|
|
|
|
|
|
|
|
-function showHms (dock: Device) {
|
|
|
|
|
|
|
+function showHms(dock: Device) {
|
|
|
hmsVisible.value = true
|
|
hmsVisible.value = true
|
|
|
currentDevice.value = dock
|
|
currentDevice.value = dock
|
|
|
}
|
|
}
|
|
@@ -383,9 +371,9 @@ onMounted(() => {
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
-.device-table-wrap{
|
|
|
|
|
- .editable-row-operations{
|
|
|
|
|
- div > span {
|
|
|
|
|
|
|
+.device-table-wrap {
|
|
|
|
|
+ .editable-row-operations {
|
|
|
|
|
+ div>span {
|
|
|
margin-right: 10px;
|
|
margin-right: 10px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -399,45 +387,56 @@ onMounted(() => {
|
|
|
padding: 20px;
|
|
padding: 20px;
|
|
|
height: 88vh;
|
|
height: 88vh;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.table-striped {
|
|
.table-striped {
|
|
|
background-color: #f7f9fa;
|
|
background-color: #f7f9fa;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.ant-table {
|
|
.ant-table {
|
|
|
- border-top: 1px solid rgb(0,0,0,0.06);
|
|
|
|
|
- border-bottom: 1px solid rgb(0,0,0,0.06);
|
|
|
|
|
|
|
+ border-top: 1px solid rgb(0, 0, 0, 0.06);
|
|
|
|
|
+ border-bottom: 1px solid rgb(0, 0, 0, 0.06);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.ant-table-tbody tr td {
|
|
.ant-table-tbody tr td {
|
|
|
border: 0;
|
|
border: 0;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.ant-table td {
|
|
.ant-table td {
|
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.ant-table-thead tr th {
|
|
.ant-table-thead tr th {
|
|
|
background: white !important;
|
|
background: white !important;
|
|
|
border: 0;
|
|
border: 0;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
th.ant-table-selection-column {
|
|
th.ant-table-selection-column {
|
|
|
background-color: white !important;
|
|
background-color: white !important;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.ant-table-header {
|
|
.ant-table-header {
|
|
|
background-color: white !important;
|
|
background-color: white !important;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.child-row {
|
|
.child-row {
|
|
|
height: 70px;
|
|
height: 70px;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.notice {
|
|
.notice {
|
|
|
background: $success;
|
|
background: $success;
|
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.caution {
|
|
.caution {
|
|
|
background: orange;
|
|
background: orange;
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.warn {
|
|
.warn {
|
|
|
background: red;
|
|
background: red;
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
|
}
|
|
}
|
|
|
-</style>
|
|
|
|
|
|
|
+</style>
|