Browse Source

完善设备管理

李富豪 1 year ago
parent
commit
1e570fd7bd

+ 1 - 0
Web/package.json

@@ -6,6 +6,7 @@
   "license": "ISC",
   "license": "ISC",
   "scripts": {
   "scripts": {
     "start": "vite --mode development",
     "start": "vite --mode development",
+    "start:build": "vite --mode production",
     "build": "vite build --mode production"
     "build": "vite build --mode production"
   },
   },
   "dependencies": {
   "dependencies": {

+ 12 - 13
Web/src/api/device-log/index.ts

@@ -2,7 +2,6 @@ import request, { IWorkspaceResponse, IListWorkspaceResponse } from '/@/api/http
 import { DeviceValue, DOMAIN } from '/@/types/device'
 import { DeviceValue, DOMAIN } from '/@/types/device'
 import { DeviceLogUploadStatusEnum } from '/@/types/device-log'
 import { DeviceLogUploadStatusEnum } from '/@/types/device-log'
 import { ELocalStorageKey } from '/@/types'
 import { ELocalStorageKey } from '/@/types'
-import { CURRENT_CONFIG } from '/@/api/http/config'
 
 
 const MNG_API_PREFIX = '/manage/api/v1'
 const MNG_API_PREFIX = '/manage/api/v1'
 
 
@@ -24,7 +23,7 @@ export interface BriefDeviceInfo {
   device_callsign: string
   device_callsign: string
 }
 }
 
 
-export interface DeviceLogProgressInfo{
+export interface DeviceLogProgressInfo {
   device_sn: string,
   device_sn: string,
   device_model_domain: DOMAIN,
   device_model_domain: DOMAIN,
   progress: number, // 进度
   progress: number, // 进度
@@ -59,8 +58,8 @@ export interface GetDeviceUploadLogListRsp {
   user_name: string, // 用户
   user_name: string, // 用户
   logs_information: string, // 异常描述
   logs_information: string, // 异常描述
   create_time: string, // 上传时间
   create_time: string, // 上传时间
-  status:DeviceLogUploadStatusEnum, // 日志上传状态
-  device_topo:{ // 设备topo
+  status: DeviceLogUploadStatusEnum, // 日志上传状态
+  device_topo: { // 设备topo
     hosts: BriefDeviceInfo[],
     hosts: BriefDeviceInfo[],
     parents: BriefDeviceInfo[]
     parents: BriefDeviceInfo[]
   },
   },
@@ -73,14 +72,14 @@ export interface GetDeviceUploadLogListRsp {
  * @param params
  * @param params
  * @returns
  * @returns
  */
  */
-export async function getDeviceUploadLogList (params: GetDeviceUploadLogListParams): Promise<IListWorkspaceResponse<GetDeviceUploadLogListRsp>> {
+export async function getDeviceUploadLogList(params: GetDeviceUploadLogListParams): Promise<IListWorkspaceResponse<GetDeviceUploadLogListRsp>> {
   const resp = await request.get(`${MNG_API_PREFIX}/workspaces/${workspaceId}/devices/${params.device_sn}/logs-uploaded`, {
   const resp = await request.get(`${MNG_API_PREFIX}/workspaces/${workspaceId}/devices/${params.device_sn}/logs-uploaded`, {
     params: params
     params: params
   })
   })
   return resp.data
   return resp.data
 }
 }
 
 
-export interface GetDeviceLogListParams{
+export interface GetDeviceLogListParams {
   device_sn: string,
   device_sn: string,
   domain: DOMAIN[]
   domain: DOMAIN[]
 }
 }
@@ -90,7 +89,7 @@ export interface GetDeviceLogListParams{
  * @param params
  * @param params
  * @returns
  * @returns
  */
  */
-export async function getDeviceLogList (params: GetDeviceLogListParams): Promise<IWorkspaceResponse<DeviceLogFileListInfo>> {
+export async function getDeviceLogList(params: GetDeviceLogListParams): Promise<IWorkspaceResponse<DeviceLogFileListInfo>> {
   const domain = params.domain ? params.domain : []
   const domain = params.domain ? params.domain : []
   const resp = await request.get(`${MNG_API_PREFIX}/workspaces/${workspaceId}/devices/${params.device_sn}/logs`, {
   const resp = await request.get(`${MNG_API_PREFIX}/workspaces/${workspaceId}/devices/${params.device_sn}/logs`, {
     params: {
     params: {
@@ -104,7 +103,7 @@ export interface UploadDeviceLogBody {
   device_sn: string
   device_sn: string
   happen_time: string // 发生时间
   happen_time: string // 发生时间
   logs_information: string // 异常描述
   logs_information: string // 异常描述
-  files:{
+  files: {
     list: DeviceLogItem[],
     list: DeviceLogItem[],
     device_sn: string,
     device_sn: string,
     module: DOMAIN
     module: DOMAIN
@@ -116,7 +115,7 @@ export interface UploadDeviceLogBody {
  * @param body
  * @param body
  * @returns
  * @returns
  */
  */
-export async function postDeviceUpgrade (body: UploadDeviceLogBody): Promise<IWorkspaceResponse<{}>> {
+export async function postDeviceUpgrade(body: UploadDeviceLogBody): Promise<IWorkspaceResponse<{}>> {
   const resp = await request.post(`${MNG_API_PREFIX}/workspaces/${workspaceId}/devices/${body.device_sn}/logs`, body)
   const resp = await request.post(`${MNG_API_PREFIX}/workspaces/${workspaceId}/devices/${body.device_sn}/logs`, body)
   return resp.data
   return resp.data
 }
 }
@@ -130,7 +129,7 @@ export interface CancelDeviceLogUploadBody {
 }
 }
 
 
 // 取消上传
 // 取消上传
-export async function cancelDeviceLogUpload (body: CancelDeviceLogUploadBody): Promise<IWorkspaceResponse<{}>> {
+export async function cancelDeviceLogUpload(body: CancelDeviceLogUploadBody): Promise<IWorkspaceResponse<{}>> {
   const url = `${MNG_API_PREFIX}/workspaces/${workspaceId}/devices/${body.device_sn}/logs`
   const url = `${MNG_API_PREFIX}/workspaces/${workspaceId}/devices/${body.device_sn}/logs`
   const result = await request.delete(url, {
   const result = await request.delete(url, {
     data: body
     data: body
@@ -144,7 +143,7 @@ export interface DeleteDeviceLogUploadBody {
 }
 }
 
 
 // 取消上传
 // 取消上传
-export async function deleteDeviceLogUpload (body: DeleteDeviceLogUploadBody): Promise<IWorkspaceResponse<{}>> {
+export async function deleteDeviceLogUpload(body: DeleteDeviceLogUploadBody): Promise<IWorkspaceResponse<{}>> {
   const url = `${MNG_API_PREFIX}/workspaces/${workspaceId}/devices/${body.device_sn}/logs/${body.logs_id}`
   const url = `${MNG_API_PREFIX}/workspaces/${workspaceId}/devices/${body.device_sn}/logs/${body.logs_id}`
   const result = await request.delete(url, {
   const result = await request.delete(url, {
     data: body
     data: body
@@ -152,7 +151,7 @@ export async function deleteDeviceLogUpload (body: DeleteDeviceLogUploadBody): P
   return result.data
   return result.data
 }
 }
 
 
-export interface GetUploadDeviceLogUrlParams{
+export interface GetUploadDeviceLogUrlParams {
   logs_id: string,
   logs_id: string,
   file_id: string,
   file_id: string,
 }
 }
@@ -166,7 +165,7 @@ export interface GetUploadDeviceLogUrlParams{
  * @param params
  * @param params
  * @returns
  * @returns
  */
  */
-export async function getUploadDeviceLogUrl (params: GetUploadDeviceLogUrlParams): Promise<IWorkspaceResponse<string>> {
+export async function getUploadDeviceLogUrl(params: GetUploadDeviceLogUrlParams): Promise<IWorkspaceResponse<string>> {
   const resp = await request.get(`${MNG_API_PREFIX}/workspaces/${workspaceId}/logs/${params.logs_id}/url/${params.file_id}`)
   const resp = await request.get(`${MNG_API_PREFIX}/workspaces/${workspaceId}/logs/${params.logs_id}/url/${params.file_id}`)
   return resp.data
   return resp.data
 }
 }

+ 8 - 8
Web/src/api/manage.ts

@@ -6,10 +6,10 @@ const HTTP_PREFIX = '/manage/api/v1'
 
 
 // login
 // login
 export interface LoginBody {
 export interface LoginBody {
- username: string,
- password: string,
- flag: number,
- gateway_sn?: string
+  username: string,
+  password: string,
+  flag: number,
+  gateway_sn?: string
 }
 }
 export interface BindBody {
 export interface BindBody {
   device_sn: string,
   device_sn: string,
@@ -30,7 +30,7 @@ export interface HmsQueryBody {
 }
 }
 
 
 export const login = async function (body: LoginBody): Promise<IWorkspaceResponse<any>> {
 export const login = async function (body: LoginBody): Promise<IWorkspaceResponse<any>> {
-  console.log("LoginBody",body)
+  console.log("LoginBody", body)
   const url = `${HTTP_PREFIX}/login`
   const url = `${HTTP_PREFIX}/login`
   const result = await request.post(url, body)
   const result = await request.post(url, body)
   return result.data
   return result.data
@@ -128,8 +128,8 @@ export const getDeviceBySn = async function (workspace_id: string, device_sn: st
  * @param domain
  * @param domain
  * @returns
  * @returns
  */
  */
-export const getBindingDevices = async function (workspace_id: string, body: IPage, domain: number): Promise<IListWorkspaceResponse<Device>> {
-  const url = `${HTTP_PREFIX}/devices/${workspace_id}/devices/bound?&page=${body.page}&page_size=${body.page_size}&domain=${domain}`
+export const getBindingDevices = async function (workspace_id: string, body: IPage): Promise<IListWorkspaceResponse<Device>> {
+  const url = `${HTTP_PREFIX}/devices/${workspace_id}/devices/bound?&page=${body.page}&page_size=${body.page_size}`
   const result = await request.get(url)
   const result = await request.get(url)
   return result.data
   return result.data
 }
 }
@@ -183,7 +183,7 @@ export const importFirmareFile = async function (workspaceId: string, param: For
   return result.data
   return result.data
 }
 }
 
 
-export const changeFirmareStatus = async function (workspaceId: string, firmwareId: string, param: {status: boolean}): Promise<IWorkspaceResponse<any>> {
+export const changeFirmareStatus = async function (workspaceId: string, firmwareId: string, param: { status: boolean }): Promise<IWorkspaceResponse<any>> {
   const url = `${HTTP_PREFIX}/workspaces/${workspaceId}/firmwares/${firmwareId}`
   const url = `${HTTP_PREFIX}/workspaces/${workspaceId}/firmwares/${firmwareId}`
   const result = await request.put(url, param)
   const result = await request.put(url, param)
   return result.data
   return result.data

+ 0 - 36
Web/src/components/devices/changeRecord/components/Drawer.vue

@@ -1,36 +0,0 @@
-<template>
-    <a-drawer :width="800" title="详情" placement="right" v-model:visible="visible" @close="onClose">
-        详情
-    </a-drawer>
-</template>
-
-<script lang="ts" setup>
-import { reactive, onMounted } from 'vue'
-import { apis } from '/@/api/custom/index'
-
-interface Props {
-    id: string,
-    visible: boolean,
-    onClose: () => void,
-};
-
-const props = withDefaults(defineProps<Props>(), {
-
-});
-
-interface State {
-    listLoading: boolean,
-    list: any[],
-};
-
-const state: State = reactive({
-    listLoading: false,
-    list: [],
-});
-
-onMounted(async () => {
-
-})
-</script>
-
-<style lang="scss" scoped></style>

+ 63 - 32
Web/src/components/devices/changeRecord/index.vue

@@ -2,20 +2,48 @@
   <div class="changeRecord">
   <div class="changeRecord">
     <Search :onClickSearch="async () => { }" :onClickReset="async () => { }" />
     <Search :onClickSearch="async () => { }" :onClickReset="async () => { }" />
     <div class="changeRecord-table">
     <div class="changeRecord-table">
-      <a-table :scroll="{ x: '100%', y: 600 }" rowKey="id" :loading="state.listLoading" :columns="columns"
-        :dataSource="state.list" :pagination="paginationConfig" />
+      <a-table :scroll="{ x: '100%', y: 500 }" :childrenColumnName="null" rowKey="device_sn"
+        :loading="state.listLoading" :columns="columns" @change="() => { }" :rowClassName="rowClassName"
+        :dataSource="state.list" :pagination="paginationConfig">
+        <!-- 设备型号 -->
+        <template #device_name="{ record }">
+          <div class="record">
+            {{ record.device_name }}
+          </div>
+          <div class="record" v-if="record.children">
+            <div class="mt-5 ml0"
+              style="border-left: 2px solid rgb(200,200,200); border-bottom: 2px solid rgb(200,200,200); height: 16px;width: 16px; float: left;">
+            </div>
+            {{ record.children.device_name }}
+          </div>
+        </template>
+        <!-- 设备SN -->
+        <template #device_sn="{ record }">
+          <div class="record">
+            {{ record.device_sn }}
+          </div>
+          <div class="record" v-if="record.children">
+            {{ record.children.device_sn }}
+          </div>
+        </template>
+        <!-- 设备名称 -->
+        <template #nick_name="{ record }">
+          <div class="record">
+            {{ record.nick_name }}
+          </div>
+          <div class="record" v-if="record.children">
+            {{ record.children.nick_name }}
+          </div>
+        </template>
+      </a-table>
     </div>
     </div>
   </div>
   </div>
 </template>
 </template>
 
 
 <script lang="ts" setup>
 <script lang="ts" setup>
 import { reactive, onMounted } from 'vue';
 import { reactive, onMounted } from 'vue';
-import { Modal } from 'ant-design-vue';
-import { DeleteOutlined, FileSearchOutlined } from '@ant-design/icons-vue';
 import Search from './components/Search.vue';
 import Search from './components/Search.vue';
-import Drawer from './components/Drawer.vue';
 import { apis } from '/@/api/custom/index';
 import { apis } from '/@/api/custom/index';
-import { IPage } from "/@/api/http/type";
 
 
 interface State {
 interface State {
   listLoading: boolean,
   listLoading: boolean,
@@ -35,17 +63,15 @@ const paginationConfig = reactive({
   pageSizeOptions: ['20', '50', '100'],
   pageSizeOptions: ['20', '50', '100'],
   showQuickJumper: true,
   showQuickJumper: true,
   showSizeChanger: true,
   showSizeChanger: true,
-  pageSize: 50,
+  pageSize: 20,
   current: 1,
   current: 1,
   total: 0
   total: 0
 })
 })
 
 
-
 onMounted(async () => {
 onMounted(async () => {
   state.listLoading = true;
   state.listLoading = true;
   try {
   try {
     const res = await apis.fetchChangeRecordList({ page: paginationConfig.current, page_size: paginationConfig.pageSize });
     const res = await apis.fetchChangeRecordList({ page: paginationConfig.current, page_size: paginationConfig.pageSize });
-    console.log(res, 'list');
     if (res.code === 0) {
     if (res.code === 0) {
       paginationConfig.total = res.data.pagination.total
       paginationConfig.total = res.data.pagination.total
       paginationConfig.current = res.data.pagination.page
       paginationConfig.current = res.data.pagination.page
@@ -63,60 +89,57 @@ const columns = [
   {
   {
     title: '时间',
     title: '时间',
     dataIndex: 'create_time',
     dataIndex: 'create_time',
-    sorter: (a: any, b: any) => a.create_time - b.create_time,
+    width: 200,
+    sorter: (a: any, b: any) => a.create_time.localeCompare(b.create_time),
   },
   },
   {
   {
     title: '操作用户',
     title: '操作用户',
     dataIndex: 'username',
     dataIndex: 'username',
+    width: 150,
   },
   },
   {
   {
     title: '绑定项目',
     title: '绑定项目',
     dataIndex: 'workspace_name',
     dataIndex: 'workspace_name',
+    width: 200,
   },
   },
   {
   {
     title: '绑定码',
     title: '绑定码',
     dataIndex: 'bind_code',
     dataIndex: 'bind_code',
+    width: 150,
   },
   },
   {
   {
     title: '变化描述',
     title: '变化描述',
     dataIndex: 'log_info',
     dataIndex: 'log_info',
-    sorter: (a: any, b: any) => a.log_info - b.log_info,
+    width: 150,
+    sorter: (a: any, b: any) => a.log_info.localeCompare(b.log_info),
   },
   },
   {
   {
     title: '设备型号',
     title: '设备型号',
     dataIndex: 'device_name',
     dataIndex: 'device_name',
-    sorter: (a: any, b: any) => a.device_name - b.device_name,
+    width: 150,
+    sorter: (a: any, b: any) => a.device_name.localeCompare(b.device_name),
+    slots: { customRender: 'device_name' }
   },
   },
   {
   {
     title: '设备SN',
     title: '设备SN',
     dataIndex: 'device_sn',
     dataIndex: 'device_sn',
+    width: 250,
+    slots: { customRender: 'device_sn' }
   },
   },
   {
   {
     title: '设备名称',
     title: '设备名称',
     dataIndex: 'nick_name',
     dataIndex: 'nick_name',
-    sorter: (a: any, b: any) => a.nick_name - b.nick_name,
+    width: 150,
+    slots: { customRender: 'nick_name' }
   }
   }
 ]
 ]
 
 
-// 点击编辑
-const onClickEdit = (id: string) => {
-  state.currentId = id;
-  state.drawerVisible = true;
-}
-
-const drawerOnClickClose = () => {
-  state.drawerVisible = false;
-}
-
-// 点击删除
-const onClickDelete = (id: number) => {
-  Modal.confirm({
-    title: '提示',
-    content: '确定删除吗?',
-    onOk: async () => {
-
-    },
-  });
+const rowClassName = (record: any, index: number) => {
+  const className = []
+  if ((index & 1) === 0) {
+    className.push('table-striped')
+  }
+  return className.toString().replaceAll(',', ' ')
 }
 }
 </script>
 </script>
 
 
@@ -125,6 +148,10 @@ const onClickDelete = (id: number) => {
   padding: 20px;
   padding: 20px;
 }
 }
 
 
+.record {
+  height: 30px;
+}
+
 .ant-table {
 .ant-table {
   border-top: 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);
   border-bottom: 1px solid rgb(0, 0, 0, 0.06);
@@ -133,4 +160,8 @@ const onClickDelete = (id: number) => {
 .ant-table-tbody tr td {
 .ant-table-tbody tr td {
   border: 0;
   border: 0;
 }
 }
+
+.table-striped {
+  background-color: #f7f9fa;
+}
 </style>
 </style>

+ 12 - 26
Web/src/components/devices/deviceList/index.vue

@@ -4,7 +4,7 @@
     <div class="deviceList-table">
     <div class="deviceList-table">
       <a-table :columns="columns" :data-source="data.device" :pagination="paginationProp" @change="refreshData"
       <a-table :columns="columns" :data-source="data.device" :pagination="paginationProp" @change="refreshData"
         row-key="device_sn" :expandedRowKeys="expandRows" :row-selection="rowSelection" :rowClassName="rowClassName"
         row-key="device_sn" :expandedRowKeys="expandRows" :row-selection="rowSelection" :rowClassName="rowClassName"
-        :scroll="{ x: '100%', y: 600 }" :expandIcon="expandIcon" :loading="loading">
+        :scroll="{ x: '100%', y: 500 }" :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]" />
             <a-input v-if="editableData[record.device_sn]" v-model:value="editableData[record.device_sn][col]" />
@@ -22,7 +22,7 @@
         </template>
         </template>
         <!-- 固件版本 -->
         <!-- 固件版本 -->
         <template #firmware_version="{ record }">
         <template #firmware_version="{ record }">
-          <span v-if="judgeCurrentType(EDeviceTypeName.Dock)">
+          <span v-if="record.domin === 3">
             <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>
@@ -62,10 +62,10 @@
           </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 title="设备日志">
               <CloudServerOutlined style="margin-right: 10px;" @click="showDeviceLogUploadRecord(record)" />
               <CloudServerOutlined style="margin-right: 10px;" @click="showDeviceLogUploadRecord(record)" />
             </a-tooltip>
             </a-tooltip>
-            <a-tooltip v-if="current.indexOf(EDeviceTypeName.Dock) !== -1" title="告警信息">
+            <a-tooltip title="告警信息">
               <FileSearchOutlined style="margin-right: 10px;" @click="showHms(record)" />
               <FileSearchOutlined style="margin-right: 10px;" @click="showHms(record)" />
             </a-tooltip>
             </a-tooltip>
             <a-tooltip title="编辑">
             <a-tooltip title="编辑">
@@ -113,7 +113,7 @@ const columns = [
     dataIndex: 'device_name',
     dataIndex: 'device_name',
     width: 150,
     width: 150,
     ellipsis: true,
     ellipsis: true,
-    sorter: (a: any, b: any) => a.nickname.localeCompare(b.nickname),
+    sorter: (a: any, b: any) => a.device_name.localeCompare(b.device_name),
   },
   },
   {
   {
     title: '设备SN',
     title: '设备SN',
@@ -187,9 +187,6 @@ const rowClassName = (record: any, index: number) => {
   if ((index & 1) === 0) {
   if ((index & 1) === 0) {
     className.push('table-striped')
     className.push('table-striped')
   }
   }
-  if (record.domain !== EDeviceTypeName.Dock) {
-    className.push('child-row')
-  }
   return className.toString().replaceAll(',', ' ')
   return className.toString().replaceAll(',', ' ')
 }
 }
 
 
@@ -229,8 +226,7 @@ const rowSelection = {
     console.log(selected, selectedRows, changeRows)
     console.log(selected, selectedRows, changeRows)
   },
   },
   getCheckboxProps: (record: any) => ({
   getCheckboxProps: (record: any) => ({
-    disabled: judgeCurrentType(EDeviceTypeName.Dock) && record.domain !== EDeviceTypeName.Dock,
-    style: judgeCurrentType(EDeviceTypeName.Dock) && record.domain !== EDeviceTypeName.Dock ? 'display: none' : ''
+    disabled: record.domain !== EDeviceTypeName.Dock,
   }),
   }),
 }
 }
 
 
@@ -238,12 +234,6 @@ 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.Dock])
-
-function judgeCurrentType(type: EDeviceTypeName): boolean {
-  return current.value.indexOf(type) !== -1
-}
-
 // 设备升级
 // 设备升级
 const {
 const {
   deviceFirmwareUpgradeModalVisible,
   deviceFirmwareUpgradeModalVisible,
@@ -277,7 +267,7 @@ function updateDevicesByWs(devices: Device[], payload: DeviceCmdExecuteInfo) {
           })
           })
         }
         }
         // 拉取列表
         // 拉取列表
-        getDevices(current.value[0], true)
+        getDevices(true)
       }
       }
       return
       return
     }
     }
@@ -290,11 +280,11 @@ function updateDevicesByWs(devices: Device[], payload: DeviceCmdExecuteInfo) {
 useDeviceUpgradeEvent(onDeviceUpgradeWs)
 useDeviceUpgradeEvent(onDeviceUpgradeWs)
 
 
 // 获取设备列表信息
 // 获取设备列表信息
-function getDevices(domain: number, closeLoading?: boolean) {
+function getDevices(closeLoading?: boolean) {
   if (!closeLoading) {
   if (!closeLoading) {
     loading.value = true
     loading.value = true
   }
   }
-  getBindingDevices(workspaceId, getPaginationBody(), domain).then(res => {
+  getBindingDevices(workspaceId, getPaginationBody()).then(res => {
     if (res.code !== 0) {
     if (res.code !== 0) {
       return
       return
     }
     }
@@ -317,7 +307,7 @@ function getDevices(domain: number, closeLoading?: boolean) {
 function refreshData(page: any) {
 function refreshData(page: any) {
   paginationProp.current = page?.current!
   paginationProp.current = page?.current!
   paginationProp.pageSize = page?.pageSize!
   paginationProp.pageSize = page?.pageSize!
-  getDevices(current.value[0])
+  getDevices()
 }
 }
 
 
 // 编辑
 // 编辑
@@ -341,7 +331,7 @@ const onClickDelete = (record: Device) => {
         if (res.code !== 0) {
         if (res.code !== 0) {
           return
           return
         }
         }
-        getDevices(current.value[0])
+        getDevices()
       })
       })
     },
     },
   });
   });
@@ -364,7 +354,7 @@ function showHms(dock: Device) {
 }
 }
 
 
 onMounted(() => {
 onMounted(() => {
-  getDevices(current.value[0])
+  getDevices()
 })
 })
 </script>
 </script>
 
 
@@ -385,8 +375,4 @@ onMounted(() => {
 .table-striped {
 .table-striped {
   background-color: #f7f9fa;
   background-color: #f7f9fa;
 }
 }
-
-.child-row {
-  height: 70px;
-}
 </style>
 </style>

+ 1 - 1
Web/src/components/devices/feedbackRecord/index.vue

@@ -2,7 +2,7 @@
   <div class="feedbackRecord">
   <div class="feedbackRecord">
     <Search :onClickSearch="async () => { }" :onClickReset="async () => { }" />
     <Search :onClickSearch="async () => { }" :onClickReset="async () => { }" />
     <div class="feedbackRecord-table">
     <div class="feedbackRecord-table">
-      <a-table :scroll="{ x: 'max-content', y: 600 }" rowKey="id" :loading="state.listLoading" :columns="columns"
+      <a-table :scroll="{ x: 'max-content', y: 500 }" rowKey="id" :loading="state.listLoading" :columns="columns"
         :dataSource="state.list" :pagination="paginationConfig">
         :dataSource="state.list" :pagination="paginationConfig">
         <!-- 操作 -->
         <!-- 操作 -->
         <template #operation="{ record }">
         <template #operation="{ record }">

+ 85 - 78
Web/src/pages/page-web/projects/wayline.vue

@@ -1,81 +1,87 @@
 <template>
 <template>
   <div class="project-wayline-wrapper height-100">
   <div class="project-wayline-wrapper height-100">
     <a-spin :spinning="loading" :delay="300" tip="downloading" size="large">
     <a-spin :spinning="loading" :delay="300" tip="downloading" size="large">
-    <div style="height: 50px; line-height: 50px; border-bottom: 1px solid #4f4f4f; font-weight: 450;">
-      <a-row>
-        <a-col :span="1"></a-col>
-        <a-col :span="15">Flight Route Library</a-col>
-        <a-col :span="8" v-if="importVisible" class="flex-row flex-justify-end flex-align-center">
-          <a-upload
-            name="file"
-            :multiple="false"
-            :before-upload="beforeUpload"
-            :show-upload-list="false"
-            :customRequest="uploadFile"
-          >
-            <a-button type="text" style="color: white;">
-              <SelectOutlined />
-            </a-button>
-          </a-upload>
-        </a-col>
-      </a-row>
-    </div>
-    <div :style="{ height : height + 'px'}" class="scrollbar">
-      <div id="data" class="height-100 uranus-scrollbar" v-if="waylinesData.data.length !== 0" @scroll="onScroll">
-        <div v-for="wayline in waylinesData.data" :key="wayline.id">
-          <div class="wayline-panel" style="padding-top: 5px;" @click="selectRoute(wayline)">
-            <div class="title">
-              <a-tooltip :title="wayline.name">
-                <div class="pr10" style="width: 120px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;">{{ wayline.name }}</div>
-              </a-tooltip>
-              <div class="ml10"><UserOutlined /></div>
-              <a-tooltip :title="wayline.user_name">
-                <div class="ml5 pr10" style="width: 80px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;">{{ wayline.user_name }}</div>
-              </a-tooltip>
-              <div class="fz20">
-                <a-dropdown>
-                  <a style="color: white;">
-                    <EllipsisOutlined />
-                  </a>
-                  <template #overlay>
-                    <a-menu theme="dark" class="more" style="background: #3c3c3c;">
-                      <a-menu-item @click="downloadWayline(wayline.id, wayline.name)">
-                        <span>Download</span>
-                      </a-menu-item>
-                      <a-menu-item @click="showWaylineTip(wayline.id)">
-                        <span>Delete</span>
-                      </a-menu-item>
-                    </a-menu>
-                  </template>
-                </a-dropdown>
+      <div style="height: 50px; line-height: 50px; border-bottom: 1px solid #4f4f4f; font-weight: 450;">
+        <a-row>
+          <a-col :span="1"></a-col>
+          <a-col :span="15">Flight Route Library</a-col>
+          <a-col :span="8" v-if="importVisible" class="flex-row flex-justify-end flex-align-center">
+            <a-upload name="file" :multiple="false" :before-upload="beforeUpload" :show-upload-list="false"
+              :customRequest="uploadFile">
+              <a-button type="text" style="color: white;">
+                <SelectOutlined />
+              </a-button>
+            </a-upload>
+          </a-col>
+        </a-row>
+      </div>
+      <div :style="{ height: height + 'px' }" class="scrollbar">
+        <div id="data" class="height-100 uranus-scrollbar" v-if="waylinesData.data.length !== 0" @scroll="onScroll">
+          <div v-for="wayline in waylinesData.data" :key="wayline.id">
+            <div class="wayline-panel" style="padding-top: 5px;" @click="selectRoute(wayline)">
+              <div class="title">
+                <a-tooltip :title="wayline.name">
+                  <div class="pr10"
+                    style="width: 120px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;">{{
+                      wayline.name }}</div>
+                </a-tooltip>
+                <div class="ml10">
+                  <UserOutlined />
+                </div>
+                <a-tooltip :title="wayline.user_name">
+                  <div class="ml5 pr10"
+                    style="width: 80px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;">{{
+                      wayline.user_name }}</div>
+                </a-tooltip>
+                <div class="fz20">
+                  <a-dropdown>
+                    <a style="color: white;">
+                      <EllipsisOutlined />
+                    </a>
+                    <template #overlay>
+                      <a-menu theme="dark" class="more" style="background: #3c3c3c;">
+                        <a-menu-item @click="downloadWayline(wayline.id, wayline.name)">
+                          <span>Download</span>
+                        </a-menu-item>
+                        <a-menu-item @click="showWaylineTip(wayline.id)">
+                          <span>Delete</span>
+                        </a-menu-item>
+                      </a-menu>
+                    </template>
+                  </a-dropdown>
+                </div>
+              </div>
+              <div class="ml10 mt5" style="color: hsla(0,0%,100%,0.65);">
+                <span>
+                  <RocketOutlined />
+                </span>
+                <span class="ml5">{{ DEVICE_NAME[wayline.drone_model_key] }}</span>
+                <span class="ml10">
+                  <CameraFilled style="border-top: 1px solid; padding-top: -3px;" />
+                </span>
+                <span class="ml5" v-for="payload in wayline.payload_model_keys" :key="payload.id">
+                  {{ DEVICE_NAME[payload] }}
+                </span>
+              </div>
+              <div class="mt5 ml10" style="color: hsla(0,0%,100%,0.35);">
+                <span class="mr10">Update at {{ new Date(wayline.update_time).toLocaleString() }}</span>
               </div>
               </div>
-            </div>
-            <div class="ml10 mt5" style="color: hsla(0,0%,100%,0.65);">
-              <span><RocketOutlined /></span>
-              <span class="ml5">{{ DEVICE_NAME[wayline.drone_model_key] }}</span>
-              <span class="ml10"><CameraFilled style="border-top: 1px solid; padding-top: -3px;" /></span>
-              <span class="ml5" v-for="payload in wayline.payload_model_keys" :key="payload.id">
-                {{ DEVICE_NAME[payload] }}
-              </span>
-            </div>
-            <div class="mt5 ml10" style="color: hsla(0,0%,100%,0.35);">
-              <span class="mr10">Update at {{ new Date(wayline.update_time).toLocaleString() }}</span>
             </div>
             </div>
           </div>
           </div>
         </div>
         </div>
-      </div>
-      <div v-else>
-        <a-empty :image-style="{ height: '60px', marginTop: '60px' }" />
-      </div>
-      <a-modal v-model:visible="deleteTip" width="450px" :closable="false" :maskClosable="false" centered :okButtonProps="{ danger: true }" @ok="deleteWayline">
+        <div v-else>
+          <a-empty :image-style="{ height: '60px', marginTop: '60px' }" />
+        </div>
+        <a-modal v-model:visible="deleteTip" width="450px" :closable="false" :maskClosable="false" centered
+          :okButtonProps="{ danger: true }" @ok="deleteWayline">
           <p class="pt10 pl20" style="height: 50px;">Wayline file is unrecoverable once deleted. Continue?</p>
           <p class="pt10 pl20" style="height: 50px;">Wayline file is unrecoverable once deleted. Continue?</p>
           <template #title>
           <template #title>
-              <div class="flex-row flex-justify-center">
-                  <span>Delete</span>
-              </div>
+            <div class="flex-row flex-justify-center">
+              <span>Delete</span>
+            </div>
           </template>
           </template>
-      </a-modal>
-    </div>
+        </a-modal>
+      </div>
     </a-spin>
     </a-spin>
   </div>
   </div>
 </template>
 </template>
@@ -91,13 +97,12 @@ import { useMyStore } from '/@/store'
 import { WaylineFile } from '/@/types/wayline'
 import { WaylineFile } from '/@/types/wayline'
 import { downloadFile } from '/@/utils/common'
 import { downloadFile } from '/@/utils/common'
 import { IPage } from '/@/api/http/type'
 import { IPage } from '/@/api/http/type'
-import { CURRENT_CONFIG } from '/@/api/http/config'
 import { load } from '@amap/amap-jsapi-loader'
 import { load } from '@amap/amap-jsapi-loader'
 import { getRoot } from '/@/root'
 import { getRoot } from '/@/root'
 
 
 const loading = ref(false)
 const loading = ref(false)
 const store = useMyStore()
 const store = useMyStore()
-const pagination :IPage = {
+const pagination: IPage = {
   page: 1,
   page: 1,
   total: -1,
   total: -1,
   page_size: 10
   page_size: 10
@@ -131,7 +136,7 @@ onMounted(() => {
   }, 1000)
   }, 1000)
 })
 })
 
 
-function getWaylines () {
+function getWaylines() {
   if (!canRefresh.value) {
   if (!canRefresh.value) {
     return
     return
   }
   }
@@ -152,12 +157,12 @@ function getWaylines () {
   })
   })
 }
 }
 
 
-function showWaylineTip (waylineId: string) {
+function showWaylineTip(waylineId: string) {
   deleteWaylineId.value = waylineId
   deleteWaylineId.value = waylineId
   deleteTip.value = true
   deleteTip.value = true
 }
 }
 
 
-function deleteWayline () {
+function deleteWayline() {
   deleteWaylineFile(workspaceId, deleteWaylineId.value).then(res => {
   deleteWaylineFile(workspaceId, deleteWaylineId.value).then(res => {
     if (res.code === 0) {
     if (res.code === 0) {
       message.success('Wayline file deleted')
       message.success('Wayline file deleted')
@@ -171,7 +176,7 @@ function deleteWayline () {
   })
   })
 }
 }
 
 
-function downloadWayline (waylineId: string, fileName: string) {
+function downloadWayline(waylineId: string, fileName: string) {
   loading.value = true
   loading.value = true
   downloadWaylineFile(workspaceId, waylineId).then(res => {
   downloadWaylineFile(workspaceId, waylineId).then(res => {
     if (!res) {
     if (!res) {
@@ -184,11 +189,11 @@ function downloadWayline (waylineId: string, fileName: string) {
   })
   })
 }
 }
 
 
-function selectRoute (wayline: WaylineFile) {
+function selectRoute(wayline: WaylineFile) {
   store.commit('SET_SELECT_WAYLINE_INFO', wayline)
   store.commit('SET_SELECT_WAYLINE_INFO', wayline)
 }
 }
 
 
-function onScroll (e: any) {
+function onScroll(e: any) {
   const element = e.srcElement
   const element = e.srcElement
   if (element.scrollTop + element.clientHeight >= element.scrollHeight - 5 && Math.ceil(pagination.total / pagination.page_size) > pagination.page && canRefresh.value) {
   if (element.scrollTop + element.clientHeight >= element.scrollHeight - 5 && Math.ceil(pagination.total / pagination.page_size) > pagination.page && canRefresh.value) {
     pagination.page++
     pagination.page++
@@ -210,7 +215,7 @@ interface FileInfo {
 }
 }
 const fileList = ref<FileItem[]>([])
 const fileList = ref<FileItem[]>([])
 
 
-function beforeUpload (file: FileItem) {
+function beforeUpload(file: FileItem) {
   fileList.value = [file]
   fileList.value = [file]
   loading.value = true
   loading.value = true
   return true
   return true
@@ -248,6 +253,7 @@ const uploadFile = async () => {
   font-size: 13px;
   font-size: 13px;
   border-radius: 2px;
   border-radius: 2px;
   cursor: pointer;
   cursor: pointer;
+
   .title {
   .title {
     display: flex;
     display: flex;
     flex-direction: row;
     flex-direction: row;
@@ -257,9 +263,10 @@ const uploadFile = async () => {
     margin: 0px 10px 0 10px;
     margin: 0px 10px 0 10px;
   }
   }
 }
 }
+
 .uranus-scrollbar {
 .uranus-scrollbar {
   overflow: auto;
   overflow: auto;
   scrollbar-width: thin;
   scrollbar-width: thin;
   scrollbar-color: #c5c8cc transparent;
   scrollbar-color: #c5c8cc transparent;
 }
 }
-</style>
+</style>

+ 0 - 1
Web/src/websocket/util/config.ts

@@ -1,5 +1,4 @@
 import { ELocalStorageKey } from '/@/types/enums'
 import { ELocalStorageKey } from '/@/types/enums'
-import { CURRENT_CONFIG } from '/@/api/http/config'
 
 
 export function getWebsocketUrl() {
 export function getWebsocketUrl() {
   const token: string = localStorage.getItem(ELocalStorageKey.Token) || '' as string
   const token: string = localStorage.getItem(ELocalStorageKey.Token) || '' as string