From 1e651700d4418248c6d58f339cba6fdc8e5fbbf4 Mon Sep 17 00:00:00 2001 From: kun <1422840143@qq.com> Date: Sat, 11 May 2024 21:26:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/agjtCommandApi.ts | 4 ++ .../dialogCompnnents/ai-alarm.vue | 51 ++++++++----------- 2 files changed, 26 insertions(+), 29 deletions(-) diff --git a/src/api/modules/agjtCommandApi.ts b/src/api/modules/agjtCommandApi.ts index e96d362..9623f90 100644 --- a/src/api/modules/agjtCommandApi.ts +++ b/src/api/modules/agjtCommandApi.ts @@ -75,3 +75,7 @@ export const getSystemUserApi = (params: {}) => { export const getAlarmRecordApi = (params: {}) => { return http.post(BASEURL + `/xmgl/aiAnalyseHardWareAlarmRecord/selectPageList`, params, { headers: { noLoading: true } }); }; +// 顶部数据接口 +export const getAlarmTypeCountApi = (params: {}) => { + return http.post(BASEURL + `/xmgl/aiStatistic/selectAiAnalyseHardWareAlarmTypeCount`, params, { headers: { noLoading: true } }); +}; \ No newline at end of file diff --git a/src/views/commandScreen/dialogCompnnents/ai-alarm.vue b/src/views/commandScreen/dialogCompnnents/ai-alarm.vue index f20431f..69cb597 100644 --- a/src/views/commandScreen/dialogCompnnents/ai-alarm.vue +++ b/src/views/commandScreen/dialogCompnnents/ai-alarm.vue @@ -2,13 +2,13 @@
-
- 区域入侵 - 今日报警次数:1 - 本月报警次数:1 - 历史报警次数:1 +
+ {{item.alarmTypeName}} + 今日报警次数:0 + 本月报警次数:0 + 历史报警次数:0
-
+
@@ -122,39 +122,31 @@ import { GlobalStore } from "@/stores"; import { getCompanyDataList, getMemberInfoList } from "@/api/modules/labor"; import type { TabsPaneContext } from 'element-plus' import { getAlarmTypeOption } from "@/api/modules/aIEarlyWarn"; -import { getAlarmRecordApi } from "@/api/modules/agjtCommandApi"; +import { getAlarmRecordApi, getAlarmTypeCountApi } from "@/api/modules/agjtCommandApi"; const store = GlobalStore(); const props = defineProps(["tip"]); const BASEURL = import.meta.env.VITE_API_URL; let showDialog = ref(false as any); -const activeName = ref('first') -const activeIndex = ref('1' as any) -const onlineWorkList = ref([ - { name: "在职", value: 1 }, - { name: "离职", value: 2 } -]) const enterpriseListData = ref([] as any); -const memberTypeList = ref([ - { name: "劳务人员", value: 1 }, - { name: "管理人员", value: 2 }, - { name: "临时人员", value: 3 } -]); -const alarmTypeList = ref(["报警", "预警"]); +const topDangerList = ref([] as any) let pageNo = ref(1 as any); let moreScroll = ref(true as any); const refScrollbar = ref(null as any); // 绑定到滚动的盒子上 -const deviceList = ref([] as any); // 设备列表 const detailData = ref({} as any); -const searchForm = ref({ - memberType: '', - belongCompany: '', - workState: '', - name: '', - idCard: '' -}); - const partyMemberList = ref({} as any); let aiAlarmTypeEnum = ref([] as any); +// 获取顶部数据 +const getQualityStatisticsNumDataFn = async () => { + let data = { + projectSn: store.sn, + isStatsByWeek: 1 + }; + const res: any = await getAlarmTypeCountApi(data); + if (res.code == 200) { + console.log("安全隐患顶部数据",res) + topDangerList.value = res.result.alarmList || [] + } +}; //获取告警类型枚举 const getWarnTypeOption = async () => { const res: any = await getAlarmTypeOption({ projectSn: store.sn }); @@ -230,6 +222,7 @@ const getMemberCountList = async (tip:any) => { onMounted(async () => { await getCompanyList(); await getMemberCountList('search'); + await getQualityStatisticsNumDataFn(); getWarnTypeOption(); refScrollbar.value.wrapRef.addEventListener("scroll", (e: any) => { // console.log("滚动容器", e);