diff --git a/components.d.ts b/components.d.ts index 65dc85f..864a1e1 100644 --- a/components.d.ts +++ b/components.d.ts @@ -55,4 +55,7 @@ declare module '@vue/runtime-core' { TableSearch: typeof import('./src/components/table-search.vue')['default'] UploadImg: typeof import('./src/components/upload-img.vue')['default'] } + export interface ComponentCustomProperties { + vInfiniteScroll: typeof import('element-plus/es')['ElInfiniteScroll'] + } } diff --git a/src/api/index.d.ts b/src/api/index.d.ts index 57ec275..67d213b 100644 --- a/src/api/index.d.ts +++ b/src/api/index.d.ts @@ -158,6 +158,8 @@ export namespace TDevice { + + export namespace TOrg { export interface IAdd { name: string; @@ -182,6 +184,38 @@ export namespace TOrg { } } +export namespace TWarnRecord { + + export interface IListReq extends Ipaging { + deviceId?: string; + warnType?: number; + status?: number; + } + + export interface IListRes { + id: number + userNumber: string + deviceId: string + warnType: number + type: number + address: string + lng: number + lat: number + status: number + updateUser: string + updateTime: string + creatUser: string + createTime: string + rimg: string + rname: string + rcontent: string + } +} + + + + + export interface TStatisticsDevice { addCount: number deviceTotal: number @@ -189,6 +223,13 @@ export interface TStatisticsDevice { warnCount: number } +export interface TStatisticsCount { + addCount: number + deviceTotal: number + onlineCount: number + warnCount: number +} + export interface statisticsContentReq { type: string startDate: string @@ -208,4 +249,5 @@ export interface statisticsContentRes { railArr: any[], destroyArr: any[], healthArr: any[], -} \ No newline at end of file +} + diff --git a/src/api/index.ts b/src/api/index.ts index af6d75f..41d4f4c 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 } from "./index.d"; +import { TLogin, TAccount, IpagingRes, TDevice, TOrg, TRoleList, TStatisticsDevice, statisticsContentReq, statisticsContentRes, TStatisticsCount, TWarnRecord } from "./index.d"; export const fetchLogin = (p: TLogin.Ireq): Promise => { return request({ @@ -207,3 +207,30 @@ export const statisticsContent = (p: statisticsContentReq): Promise => { + return request({ + url: '/v1/web/statistics/count', + method: 'get', + }); +}; + +// 告警统计 +export const statisticsWarningapi = (): Promise => { + return request({ + url: '/v1/web/statistics/warning', + method: 'get', + }); +}; + +// 预警记录 +export const warnRecord = (p: TWarnRecord.IListReq): Promise> => { + return request({ + url: '/v1/web/warn/record', + method: 'get', + params: p + }); +}; + + diff --git a/src/components/header.vue b/src/components/header.vue index 6e6d181..6612b6f 100644 --- a/src/components/header.vue +++ b/src/components/header.vue @@ -7,7 +7,7 @@ {{ item }}{{ index != tab.list.length - 1 ? " / " : "" }} -
{{ format(time) }}
+
{{ format(time) }} 更新
@@ -133,7 +133,7 @@ const setFullScreen = () => { height: 100%; .web-title { color: #838ca9; - font-size: 20px; + font-size: 18px; display: flex; align-items: center; &::before { diff --git a/src/components/sidebar.vue b/src/components/sidebar.vue index 8bcceed..23f0755 100644 --- a/src/components/sidebar.vue +++ b/src/components/sidebar.vue @@ -176,6 +176,7 @@ const collapseChage = () => { margin: 0 auto; display: flex; align-items: center; + // font-size: 18px; .icon { background-image: var(--icon); background-repeat: no-repeat; @@ -215,6 +216,9 @@ const collapseChage = () => { border-radius: 6px; width: 228px; margin: 0 auto; + // span { + // font-size: 18px; + // } .icon { background-image: var(--icon); background-repeat: no-repeat; diff --git a/src/utils/request.ts b/src/utils/request.ts index bf03df7..9c905f0 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -23,21 +23,19 @@ service.interceptors.request.use( service.interceptors.response.use( (response: AxiosResponse) => { const { data, headers } = response; - if (headers['content-type'] == 'application/json') { - if (data.code !== 200) { - ElMessage.error(data.msg) + if (data.code !== 200) { + ElMessage.error(data.msg) - if (data.code === 1003) { - const comm = useCommonStore(); - comm.clearStore() - router.replace('/login'); - } - return Promise.reject(data); - } else { - return data.data; + if (data.code === 1003) { + const comm = useCommonStore(); + comm.clearStore() + router.replace('/login'); } + return Promise.reject(data); + } else { + return data.data } - return data; + }, (error: AxiosError) => { console.log(error); diff --git a/src/views/alarmCenter/index.vue b/src/views/alarmCenter/index.vue index 3f8f738..42e58f3 100644 --- a/src/views/alarmCenter/index.vue +++ b/src/views/alarmCenter/index.vue @@ -2,18 +2,17 @@
- - - -