diff --git a/components.d.ts b/components.d.ts index 63dd579..8b5ad70 100644 --- a/components.d.ts +++ b/components.d.ts @@ -49,6 +49,7 @@ declare module '@vue/runtime-core' { ElTag: typeof import('element-plus/es')['ElTag'] ElUpload: typeof import('element-plus/es')['ElUpload'] Header: typeof import('./src/components/header.vue')['default'] + InfoWindow: typeof import('./src/components/InfoWindow.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] Sidebar: typeof import('./src/components/sidebar.vue')['default'] diff --git a/src/api/index.d.ts b/src/api/index.d.ts index 4dd83f4..993eea9 100644 --- a/src/api/index.d.ts +++ b/src/api/index.d.ts @@ -9,12 +9,19 @@ export interface IpagingRes { pages: number records: T[] } -export interface TRoleList { - id: number - name: string - createTime: string -} +interface TRoleMenu { + id?: number + type?: number + name?: string + createTime?: string +} +export interface TRoleList { + id?: number + name: string + createTime?: string + roleMenu: TRoleMenu[] +} export interface TStatisticsDevice { @@ -72,6 +79,14 @@ export interface TDeviceConfigModify { } +export namespace TRoleModify { + export interface Ireq { + id: number + name: string + roleMenu: TRoleMenu[] + } +} + export namespace TDeviceConfig { interface Treq { @@ -160,6 +175,7 @@ export namespace TDevice { accountId: number orgId: number status: number + useStatus: number deviceSwitch: number mode: number monitorMode: number @@ -345,4 +361,45 @@ export namespace THealthLatestData { tempArr: any[] } } +export namespace TLocateRecord { + + interface TReq { + deviceId: number | string + startDate: string + endDate: string + } + interface TRes { + id: number + deviceId: string + lat: number + lng: number + locationType: number + adCode: string + place: string + address: string + locationTime: string + createTime: string + } +} + +export namespace TSetUseStatus { + interface TReq { + status: number + deviceId: number + } +} +export namespace TRoleMenuList { + interface TMenus { + id: number + type: number + name: string + createTime: string + } + + interface TRes { + name: string + type: number + menus: TMenus[] + } +} diff --git a/src/api/index.ts b/src/api/index.ts index 9faf4ce..eaa6206 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,5 +1,5 @@ import request from '../utils/request'; -import { TLogin, TAccount, IpagingRes, TDevice, TOrg, TRoleList, TStatisticsDevice, statisticsContentReq, statisticsContentRes, TStatisticsCount, TWarnRecord, TWarningDetail, TWarningConfirm, TDeviceConfigModify, TDeviceConfig, THealthLatestData } from "./index.d"; +import { TLogin, TAccount, IpagingRes, TDevice, TOrg, TRoleList, TStatisticsDevice, statisticsContentReq, statisticsContentRes, TStatisticsCount, TWarnRecord, TWarningDetail, TWarningConfirm, TDeviceConfigModify, TDeviceConfig, THealthLatestData, TLocateRecord, TSetUseStatus, TRoleMenuList, TRoleModify } from "./index.d"; export const fetchLogin = (p: TLogin.Ireq): Promise => { return request({ @@ -191,6 +191,15 @@ export const roleList = (): Promise => { }); }; +// 修改角色信息 +export const roleModify = (p: TRoleModify.Ireq): Promise => { + return request({ + url: '/v1/web/role/modify', + method: 'post', + data: p + }); +}; + // 设备在线统计 export const statisticsDevice = (): Promise => { return request({ @@ -278,4 +287,39 @@ export const healthLatestData = (p: THealthLatestData.TReq): Promise => { + return request({ + url: '/v1/web/device/locate/record', + method: 'get', + params: p + }); +}; + +// 设置使用状态 +export const setUseStatus = (p: TSetUseStatus.TReq): Promise => { + return request({ + url: '/v1/web/device/set/useStatus', + method: 'post', + data: p + }); +}; + +// 设置禁用状态 +export const setStatus = (p: TSetUseStatus.TReq): Promise => { + return request({ + url: '/v1/web/device/set/status', + method: 'post', + data: p + }); +}; + +// 获取菜单列表 +export const roleMenuList = (): Promise => { + return request({ + url: '/v1/web/role/menu/list', + method: 'get', + }); +}; + diff --git a/src/components/deviceInfo.vue b/src/components/InfoWindow.vue similarity index 76% rename from src/components/deviceInfo.vue rename to src/components/InfoWindow.vue index 37d02e9..a7daafb 100644 --- a/src/components/deviceInfo.vue +++ b/src/components/InfoWindow.vue @@ -2,26 +2,28 @@
-
姓名:
-
{{ value.username }}
+
手铐:
+
{{ value.id }}
-
- +
+ + + +
- 2
IMEI号
{{ value.deviceId }}
-
-
定位方式
-
{{ locateEnum[value.locateType == -1 ? 3 : value.locateType] }}
-
定位时间
-
{{ value.locateTime }}
+
{{ value.locationTime }}
位置
@@ -40,6 +42,8 @@ defineProps({ }, }); +const emit = defineEmits(["close"]); + enum locateEnum { "WIFI" = 0, "LBS", @@ -48,7 +52,7 @@ enum locateEnum { } -