diff --git a/components.d.ts b/components.d.ts index 8b5ad70..cbb2008 100644 --- a/components.d.ts +++ b/components.d.ts @@ -26,6 +26,7 @@ declare module '@vue/runtime-core' { ElDropdown: typeof import('element-plus/es')['ElDropdown'] ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem'] ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu'] + ElEmpty: typeof import('element-plus/es')['ElEmpty'] ElForm: typeof import('element-plus/es')['ElForm'] ElFormItem: typeof import('element-plus/es')['ElFormItem'] ElIcon: typeof import('element-plus/es')['ElIcon'] diff --git a/src/api/index.d.ts b/src/api/index.d.ts index 6481ada..d50d4dd 100644 --- a/src/api/index.d.ts +++ b/src/api/index.d.ts @@ -26,13 +26,9 @@ export interface TbindWeb { devices: number[] accountId: number } - - -export interface TStatisticsDevice { - addCount: number - deviceTotal: number - onlineCount: number - warnCount: number +export interface TAccountSetStatus { + accountId: number + status: number } export interface TStatisticsCount { @@ -155,6 +151,7 @@ export namespace TAccount { id: number orgId: number roleId: number + status: number flag: boolean name: string username: string diff --git a/src/api/index.ts b/src/api/index.ts index 14b2751..8c39986 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,11 +1,18 @@ import request from '../utils/request'; -import { TLogin, TAccount, IpagingRes, TDevice, TOrg, TRoleList, TStatisticsDevice, statisticsContentReq, statisticsContentRes, TStatisticsCount, TWarnRecord, TWarningDetail, TWarningConfirm, TDeviceConfigModify, TDeviceConfig, THealthLatestData, TLocateRecord, TSetUseStatus, TRoleMenuList, TRoleModify, TbindWeb, TstatisticsUseCount } from "./index.d"; +import { TLogin, TAccount, IpagingRes, TDevice, TOrg, TRoleList, statisticsContentReq, statisticsContentRes, TStatisticsCount, TWarnRecord, TWarningDetail, TWarningConfirm, TDeviceConfigModify, TDeviceConfig, THealthLatestData, TLocateRecord, TSetUseStatus, TRoleMenuList, TRoleModify, TbindWeb, TstatisticsUseCount, TAccountSetStatus } from "./index.d"; export const fetchLogin = (p: TLogin.Ireq): Promise => { return request({ - url: '/v1/api/login', - method: 'post', - data: p + url: '/v1/api/web/login', + method: 'get', + params: p + }); +}; +// 登出 +export const fetchLogout = (): Promise => { + return request({ + url: '/v1/api/logout', + method: 'get', }); }; @@ -188,6 +195,14 @@ export const orgAllList = (): Promise => { method: 'get', }); }; +// 设置状态 +export const accountSetStatus = (p?: TAccountSetStatus): Promise => { + return request({ + url: '/v1/api/account/setStatus', + method: 'get', + params: p + }); +}; // 删除机构 export const orgDelete = (p?: TOrg.Idel): Promise => { @@ -233,14 +248,6 @@ export const roleAdd = (p: TRoleModify.Ireq): Promise => { }); }; -// 设备在线统计 -export const statisticsDevice = (): Promise => { - return request({ - url: '/v1/api/statistics/device', - method: 'get', - }); -}; - // 内容数据 export const statisticsContent = (p: statisticsContentReq): Promise => { return request({ diff --git a/src/components/header.vue b/src/components/header.vue index 24a2fc6..55636bd 100644 --- a/src/components/header.vue +++ b/src/components/header.vue @@ -57,6 +57,7 @@ import imgurl from "../assets/img/avatar.png"; import { useTabsStore } from "@/store/tabs"; import { routes } from "@/router/index"; import { format } from "@/utils"; +import { fetchLogout } from "@/api/index"; const ws: any = inject("ws"); const tab = useTabsStore(); @@ -77,11 +78,11 @@ const comm = useCommonStore(); const router = useRouter(); const handleCommand = (command: string) => { if (command == "loginout") { - comm.clearStore(); - router.push("/login"); - ws.close(); - } else if (command == "user") { - router.push("/ucenter"); + fetchLogout().then(() => { + comm.clearStore(); + router.push("/login"); + ws.close(); + }); } }; const toPage = (index: number) => { diff --git a/src/views/monitoringCenter/deviceInfo.vue b/src/views/monitoringCenter/deviceInfo.vue index f51b6e7..88cd761 100644 --- a/src/views/monitoringCenter/deviceInfo.vue +++ b/src/views/monitoringCenter/deviceInfo.vue @@ -9,54 +9,59 @@ -
- - +