diff --git a/src/api/modules/agjtOverviewApi.ts b/src/api/modules/agjtOverviewApi.ts new file mode 100644 index 0000000..0d3554f --- /dev/null +++ b/src/api/modules/agjtOverviewApi.ts @@ -0,0 +1,17 @@ +// AI预警接口API +import http from "@/api"; +const BASEURL = import.meta.env.VITE_API_URL; + +// 视频情况分析 +export const videoItemCountStatusApi = (params: {}, showLoading: boolean) => { + return http.post(BASEURL + `/xmgl/videoItem/countStatus`, params, { headers: { noLoading: showLoading } }); +}; + +// 图像正常率 +export const videoHkVqdcountQualityApi = (params: {}, showLoading: boolean) => { + return http.post(BASEURL + `/xmgl/projectVideoHkVqd/countQuality`, params, { headers: { noLoading: showLoading } }); +}; +// 图像正常率 +export const videoFullCountFullApi = (params: {}, showLoading: boolean) => { + return http.post(BASEURL + `/xmgl/xzHikvisionVideoFull/countFull`, params, { headers: { noLoading: showLoading } }); +}; diff --git a/src/views/overviewScreen/commandCenter/centerBottom.vue b/src/views/overviewScreen/commandCenter/centerBottom.vue index 9994992..3ae5e6e 100644 --- a/src/views/overviewScreen/commandCenter/centerBottom.vue +++ b/src/views/overviewScreen/commandCenter/centerBottom.vue @@ -6,11 +6,11 @@
监控点总数
-
125
+
{{ videoInfo.videoItemCountInfo.total }}
在线监控点
-
12
+
{{ videoInfo.videoItemCountInfo.onlineNum }}
@@ -21,11 +21,11 @@
离线监控点
-
55
+
{{ videoInfo.videoItemCountInfo.offlineNum }}
监控点在线率
-
56%
+
{{ videoInfo.videoItemCountInfo.onlineRatio }}%
@@ -42,6 +42,9 @@ import Card from "@/components/card.vue"; import { onMounted, reactive } from "vue"; import * as echarts from "echarts"; +import { videoItemCountStatusApi, videoHkVqdcountQualityApi, videoFullCountFullApi } from "@/api/modules/agjtOverviewApi"; +import { GlobalStore } from "@/stores"; +const store = GlobalStore(); const videoInfo = reactive({ dataList: [ { @@ -150,7 +153,10 @@ const videoInfo = reactive({ color: "#A2A4AF" } } - ] + ], + normalNumRatio: 0, + fullRatio: 0, + videoItemCountInfo: {} as any }); // 视频情况分析 function getImageNormalityEchart() { @@ -163,7 +169,7 @@ function getImageNormalityEchart() { trigger: "item" }, title: { - text: "50%", + text: `${videoInfo.normalNumRatio}%`, subtext: "图像正常率", x: "29%", y: "32%", @@ -272,8 +278,8 @@ function getImageNormalityEchart() { } function getVideoNormalityEchart() { - console.log("我是图像正常率"); - const echartsTest = echarts.init(document.getElementById("eacherVideoNormality")); + console.log("我是录像完整率"); + const echartsTest = echarts.init(document.getElementById("eacherVideoNormality") as any); let option = { color: ["#65D7F9", "#FFD15C", "#EA3941", "#A2A4AF", "#FDFDFC"], animation: false, // 取消动画 @@ -281,7 +287,7 @@ function getVideoNormalityEchart() { trigger: "item" }, title: { - text: "50%", + text: `${videoInfo.fullRatio}%`, subtext: "录像完整率", x: "29%", y: "32%", @@ -388,12 +394,102 @@ function getVideoNormalityEchart() { console.log(echartsTest); } -const setIntervalFn = () => { +// 视频点数 +const videoItemCountStatus = async (showLoading: boolean) => { + const res: any = await videoItemCountStatusApi( + { + projectSn: store.sn + }, + showLoading + ); + if (res.result) { + videoInfo.videoItemCountInfo = res.result; + } +}; + +// 图像正常率 +const videoHkVqdcountQuality = async (showLoading: boolean) => { + const res: any = await videoHkVqdcountQualityApi( + { + projectSn: store.sn + }, + showLoading + ); + videoInfo.dataList = ["图像正常", "图像异常", "诊断失败", "未检测"].map((item, index) => { + const colorList = ["#65D7F9", "#FFD15C", "#EA3941", "#A2A4AF"]; + let value = 0; + if (index == 0) { + value = res.result.normalNum; + } else if (index == 1) { + value = res.result.exceptionNum; + } else if (index == 2) { + value = res.result.failNum; + } else if (index == 3) { + value = res.result.notDetectNum; + } + return { + enumType: "", + value: value, + show: true, + name: item, + greatFaultLevelNumJzrRate: "", + rectificationNum: "", + rectificationNumJzrRate: "", + rectificationName: "", + itemStyle: { + color: colorList[index] + } + }; + }); + videoInfo.normalNumRatio = res.result.normalNumRatio; getImageNormalityEchart(); +}; + +// 录像完整率 +const videoFullCountFull = async (showLoading: boolean) => { + const res: any = await videoFullCountFullApi( + { + projectSn: store.sn + }, + showLoading + ); + videoInfo.dataList2 = ["录像完整", "录像丢失", "诊断失败", "未检测"].map((item, index) => { + const colorList = ["#65D7F9", "#FFD15C", "#EA3941", "#A2A4AF"]; + let value = 0; + if (index == 0) { + value = res.result.fullNum; + } else if (index == 1) { + value = res.result.loseNum; + } else if (index == 2) { + value = res.result.failNum; + } else if (index == 3) { + value = res.result.notDetectNum; + } + return { + enumType: "", + value: value, + show: true, + name: item, + greatFaultLevelNumJzrRate: "", + rectificationNum: "", + rectificationNumJzrRate: "", + rectificationName: "", + itemStyle: { + color: colorList[index] + } + }; + }); + videoInfo.fullRatio = res.result.fullRatio; getVideoNormalityEchart(); }; + +const setIntervalFn = (showLoading: boolean) => { + videoHkVqdcountQuality(showLoading); + videoFullCountFull(showLoading); + videoItemCountStatus(showLoading); +}; onMounted(async () => { - setIntervalFn(); + setIntervalFn(false); // 定时三十秒刷新 // setInterval(() => { // setIntervalFn(true); diff --git a/src/views/overviewScreen/commandCenter/index.vue b/src/views/overviewScreen/commandCenter/index.vue index e5f38d7..8c19700 100644 --- a/src/views/overviewScreen/commandCenter/index.vue +++ b/src/views/overviewScreen/commandCenter/index.vue @@ -3,7 +3,7 @@
距离完工还有 -
{{ item }}
+
{{ item }}
@@ -27,13 +27,14 @@ import leftBottom from "@/views/overviewScreen/commandCenter/leftBottom.vue"; import centerTop from "@/views/overviewScreen/commandCenter/centerTop.vue"; import centerBottom from "@/views/overviewScreen/commandCenter/centerBottom.vue"; import rightAll from "@/views/overviewScreen/commandCenter/rightAll.vue"; -// import { GlobalStore } from "@/stores"; +import { GlobalStore } from "@/stores"; +import { getCountTaskProgressApi } from "@/api/modules/agjtCommandApi"; // import dataDialog from "../dialogCompnnents/data-dialog.vue"; // import * as mqtt from "mqtt/dist/mqtt.min"; // import { getWorkerStatisticsCountApi, getProjectDetail } from "@/api/modules/projectOverview"; -import { onMounted } from "vue"; -// const store = GlobalStore(); +import { onMounted, ref } from "vue"; +const store = GlobalStore(); // const statisticsCount = ref(null as any); // const projectData = ref(null as any); @@ -91,7 +92,23 @@ import { onMounted } from "vue"; // console.log("连接失败:", error); // }); // }; +// 项目剩余天数 +let projectSurplusDayNum = ref("" as any); +// 获取项目总进度/项目剩余天数 +const getCountTaskProgress = async (showLoading: boolean) => { + const res: any = await getCountTaskProgressApi( + { + projectSn: store.sn + }, + showLoading + ); + if (res.result) { + console.log("项目总进度/项目剩余天数", res); + projectSurplusDayNum.value = res.result.projectSurplusDayNum + ""; + } +}; onMounted(() => { + getCountTaskProgress(false); // mqttMSG(); // setTimeout(() => { // openPeopleCountDialog({ diff --git a/src/views/overviewScreen/commandCenter/leftBottom.vue b/src/views/overviewScreen/commandCenter/leftBottom.vue index 4d72141..f380ee1 100644 --- a/src/views/overviewScreen/commandCenter/leftBottom.vue +++ b/src/views/overviewScreen/commandCenter/leftBottom.vue @@ -662,24 +662,24 @@ const queryCountEnterprise = async (showLoading: boolean) => { if (res.result) { console.log("总包进度列表", res); processList.value = res.result; - processList.value = [ - { - enterpriseName: "广东省某某科技有限公司(东北厂区)", - changeAfter: 70 - }, - { - enterpriseName: "广州市某公司名称(东北厂区)", - changeAfter: 65 - }, - { - enterpriseName: "企业名称(东北厂区)", - changeAfter: 60 - }, - { - enterpriseName: "这里是第四名企业名称(东北厂区)", - changeAfter: 55 - } - ]; + // processList.value = [ + // { + // enterpriseName: "广东省某某科技有限公司(东北厂区)", + // changeAfter: 70 + // }, + // { + // enterpriseName: "广州市某公司名称(东北厂区)", + // changeAfter: 65 + // }, + // { + // enterpriseName: "企业名称(东北厂区)", + // changeAfter: 60 + // }, + // { + // enterpriseName: "这里是第四名企业名称(东北厂区)", + // changeAfter: 55 + // } + // ]; } }; const setIntervalFn = (showLoading: boolean) => { @@ -702,6 +702,7 @@ onMounted(async () => { height: 79%; padding: 10px 10px; margin-top: 1%; + overflow: hidden; } .leftBottom { // background: url("@/assets/images/commandScreen/card-left-bottom.png") no-repeat;