From 5f0cda3d45cd978c8ac75dda92d85108ade153e4 Mon Sep 17 00:00:00 2001 From: luojiayi <1712054227@qq.com> Date: Wed, 9 Apr 2025 18:45:44 +0800 Subject: [PATCH] =?UTF-8?q?2025=E5=B9=B404=E6=9C=8809=E6=97=A518:45:43?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 4 + src/api/index.d.ts | 150 ++++++++++++---- src/api/index.ts | 46 ++++- src/assets/img/location.png | Bin 0 -> 1573 bytes src/components/upload-img.vue | 69 +++++-- src/layout/index.vue | 9 - src/utils/mapCustom.js | 21 ++- src/utils/request.ts | 2 - src/views/alarmCenter/index.vue | 2 +- src/views/incidentDispose/index.vue | 170 ++++++++++++------ src/views/login.vue | 22 +-- .../synthesizeManage/deviceInfo/index.vue | 34 +++- .../deviceManage/deviceControl.vue | 2 +- .../synthesizeManage/deviceManage/index.vue | 83 ++++----- src/views/synthesizeManage/setting/index.vue | 168 ++++++++++------- 15 files changed, 519 insertions(+), 263 deletions(-) create mode 100644 src/assets/img/location.png diff --git a/components.d.ts b/components.d.ts index 864a1e1..7d0d6cb 100644 --- a/components.d.ts +++ b/components.d.ts @@ -9,7 +9,9 @@ declare module '@vue/runtime-core' { export interface GlobalComponents { Alarm: typeof import('./src/components/alarm.vue')['default'] BatchImp: typeof import('./src/components/batch-imp.vue')['default'] + copy: typeof import('./src/components/upload-img copy.vue')['default'] Countup: typeof import('./src/components/countup.vue')['default'] + CustomInput: typeof import('./src/components/CustomInput.vue')['default'] DeviceInfo: typeof import('./src/components/deviceInfo.vue')['default'] ElAvatar: typeof import('element-plus/es')['ElAvatar'] ElButton: typeof import('element-plus/es')['ElButton'] @@ -54,8 +56,10 @@ declare module '@vue/runtime-core' { TableEdit: typeof import('./src/components/table-edit.vue')['default'] TableSearch: typeof import('./src/components/table-search.vue')['default'] UploadImg: typeof import('./src/components/upload-img.vue')['default'] + UploadImgsa: typeof import('./src/components/upload-imgsa.vue')['default'] } export interface ComponentCustomProperties { vInfiniteScroll: typeof import('element-plus/es')['ElInfiniteScroll'] + vLoading: typeof import('element-plus/es')['ElLoadingDirective'] } } diff --git a/src/api/index.d.ts b/src/api/index.d.ts index 67d213b..20b1b6c 100644 --- a/src/api/index.d.ts +++ b/src/api/index.d.ts @@ -15,6 +15,86 @@ export interface TRoleList { createTime: string } + + +export interface TStatisticsDevice { + addCount: number + deviceTotal: number + onlineCount: number + warnCount: number +} + +export interface TStatisticsCount { + addCount: number + deviceTotal: number + onlineCount: number + warnCount: number +} + +export interface statisticsContentReq { + type: string + startDate: string + endDate: string +} + +export interface statisticsContentRes { + sosCount: number + railCount: number + destroyCount: number + batteryCount: number + heartRateCount: number + bloodOxygenCount: number + tempCount: number + times: any[], + sosArr: any[], + railArr: any[], + destroyArr: any[], + healthArr: any[], +} + +export interface TWarningConfirm { + id?: number | string + name: string + username: string + content: string + images: string[] +} + +export interface TDeviceConfigModify { + deviceId: string | string[] + userNumber: string + minHr: number + maxHr: number + minBo: number + minTemp: number + maxTemp: number + contacts: any[] +} + + +export namespace TDeviceConfig { + + interface Treq { + deviceId: string | string[] + } + interface Tcontacts { + name: string + phone: string + } + interface Tres { + deviceId: string | string[] + userNumber: string + minHr: number + minBo: number + minTemp: number + maxTemp: number + maxHr: number + name?: string + phone?: string + contacts: Tcontacts[] + } +} + export namespace TLogin { export interface Ireq { username: string; @@ -103,7 +183,7 @@ export namespace TDevice { } export interface IRecordReq extends Ipaging { - deviceId?: number; + deviceId?: string | string[]; } export interface IRecordRes { id: number @@ -212,42 +292,34 @@ export namespace TWarnRecord { } } - - - - -export interface TStatisticsDevice { - addCount: number - deviceTotal: number - onlineCount: number - warnCount: number +export namespace TWarningDetail { + interface TParams { + id: number | string + } + interface TRes { + address: string + adminName: string + adminPhone: string + creatUser: string + createTime: string + deviceId: string + healthData: string + id: number + lat: number + lng: number + maxValue: number + minValue: number + rcontent: string + rimg: any + rname: string + status: number + type: number + updateTime: string + updateUser: string + userNumber: string + username: string + value: string + orgName: string + warnType: number + } } - -export interface TStatisticsCount { - addCount: number - deviceTotal: number - onlineCount: number - warnCount: number -} - -export interface statisticsContentReq { - type: string - startDate: string - endDate: string -} - -export interface statisticsContentRes { - sosCount: number - railCount: number - destroyCount: number - batteryCount: number - heartRateCount: number - bloodOxygenCount: number - tempCount: number - times: any[], - sosArr: any[], - railArr: any[], - destroyArr: any[], - healthArr: any[], -} - diff --git a/src/api/index.ts b/src/api/index.ts index 41d4f4c..d8d30de 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 } from "./index.d"; +import { TLogin, TAccount, IpagingRes, TDevice, TOrg, TRoleList, TStatisticsDevice, statisticsContentReq, statisticsContentRes, TStatisticsCount, TWarnRecord, TWarningDetail, TWarningConfirm, TDeviceConfigModify, TDeviceConfig } from "./index.d"; export const fetchLogin = (p: TLogin.Ireq): Promise => { return request({ @@ -116,7 +116,7 @@ export const setMode = (p: TDevice.ISetMonitor): Promise => { // 获取定位 export const deviceGetLocation = (p: TDevice.ISetMonitor): Promise => { return request({ - url: '/v1/web/device/getLocation', + url: '/v1/web/device/getLocate', method: 'post', data: p }); @@ -143,7 +143,7 @@ export const deviceUseRecord = (p: TDevice.IRecordReq): Promise> => { return request({ - url: '/v1/web/device/warning/record', + url: '/v1/web/warning/record', method: 'get', params: p }); @@ -186,7 +186,7 @@ export const orgDelete = (p?: TOrg.Idel): Promise => { // 获取角色列表 export const roleList = (): Promise => { return request({ - url: '/v1/web/account/role/list', + url: '/v1/web/role/list', method: 'get', }); }; @@ -227,10 +227,46 @@ export const statisticsWarningapi = (): Promise => { // 预警记录 export const warnRecord = (p: TWarnRecord.IListReq): Promise> => { return request({ - url: '/v1/web/warn/record', + url: '/v1/web/warning/record', method: 'get', params: p }); }; +// 预警记录 +export const warningDetail = (p: TWarningDetail.TParams): Promise => { + return request({ + url: '/v1/web/warning/detail', + method: 'get', + params: p + }); +}; + +// 预警记录 +export const warningConfirm = (p: TWarningConfirm): Promise => { + return request({ + url: '/v1/web/warning/confirm', + method: 'post', + data: p + }); +}; + +// 获取专项配置 +export const deviceConfig = (p: TDeviceConfig.Treq): Promise => { + return request({ + url: '/v1/web/device/deviceConfig', + method: 'get', + params: p + }); +}; + +// 修改专项配置 +export const deviceConfigModify = (p: TDeviceConfigModify): Promise => { + return request({ + url: '/v1/web/device/deviceConfig/modify', + method: 'post', + data: p + }); +}; + diff --git a/src/assets/img/location.png b/src/assets/img/location.png new file mode 100644 index 0000000000000000000000000000000000000000..140fdbd7c40160f9a5af10b6daa1d53a00db6ee7 GIT binary patch literal 1573 zcmV+=2HN?FP)Px#1am@3R0s$N2z&@+hyVZu&q+iqjWeAseO?EhvRSxmk$0dhTs6#$+P!i#w5Mpy*(uH3R| zo$8+SOfsS}HzjJ{&pQBs0m4=|l6oRRgQBLoCp`eT@vucMPl_+gAj(5mloxj&u?3l; z#0NU2Q_CAsnL`Bcn)mD<@8YwhI&85~Qi@e^+mDL)ZmZq=@sCc4+D;Oxds2;}WxRY* z0D#UxR&&o!*PQy(nHHs4zAv7a~%?tVg@KxzOkC;jGpzyB9h7hfSGau>x)H>Ljpk7XniF}6=Zy_ z9G9;?D9V{~HgXt1cZm_A|50w} zxvrFQ6M^R;Y4zw(AFkPMLjl0KmP6sdkP zoXL7rpw5Zvv#4uHuLOUj6-8+=HzjJsIjvCZl7f0Bz2Ll)6h&0aS=Zy$bT=Q0qLUzL zb;0q7+(SkWU=Y;HMP6{;{8{00+~sG5u4tM1OB-L`>iS6AY#Z5xsMbU69u?yQvtAU1 z!f$t}l)EURasUe>P^Bd)4LN|NA-Zf!N=pu4aSStClG2m|SRUk!TT @@ -19,31 +24,57 @@ diff --git a/src/views/login.vue b/src/views/login.vue index e85e618..77a636b 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -54,20 +54,16 @@ const submitForm = async (formEl: FormInstance | undefined) => { await formEl.validate((valid, fields) => { if (valid) { - fetchLogin(ruleForm) - .then((res) => { - comm.setUser(res); - ElMessage({ - message: "登录成功", - type: "success", - }); - setTimeout(() => { - router.push("/"); - }, 1000); - }) - .catch((err) => { - console.log(err, "err"); + fetchLogin(ruleForm).then((res) => { + comm.setUser(res); + ElMessage({ + message: "登录成功", + type: "success", }); + setTimeout(() => { + router.push("/"); + }, 1000); + }); } }); }; diff --git a/src/views/synthesizeManage/deviceInfo/index.vue b/src/views/synthesizeManage/deviceInfo/index.vue index 721ee98..80f6e15 100644 --- a/src/views/synthesizeManage/deviceInfo/index.vue +++ b/src/views/synthesizeManage/deviceInfo/index.vue @@ -47,11 +47,15 @@ :currentPage="paging1.page" :changePage="changeWarningPage" > -