flx:绑定总览大屏接口

This commit is contained in:
X_Rian 2024-06-14 15:23:11 +08:00
parent f899a097d6
commit f8296aa429
4 changed files with 164 additions and 33 deletions

View File

@ -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 } });
};

View File

@ -6,11 +6,11 @@
<div class="video-list"> <div class="video-list">
<div class="video-title"> <div class="video-title">
<div>监控点总数</div> <div>监控点总数</div>
<div>125</div> <div>{{ videoInfo.videoItemCountInfo.total }}</div>
</div> </div>
<div class="video-title"> <div class="video-title">
<div>在线监控点</div> <div>在线监控点</div>
<div>12</div> <div>{{ videoInfo.videoItemCountInfo.onlineNum }}</div>
</div> </div>
</div> </div>
<div class="video-eacher"> <div class="video-eacher">
@ -21,11 +21,11 @@
<div class="video-list"> <div class="video-list">
<div class="video-title"> <div class="video-title">
<div>离线监控点</div> <div>离线监控点</div>
<div>55</div> <div>{{ videoInfo.videoItemCountInfo.offlineNum }}</div>
</div> </div>
<div class="video-title"> <div class="video-title">
<div>监控点在线率</div> <div>监控点在线率</div>
<div>56%</div> <div>{{ videoInfo.videoItemCountInfo.onlineRatio }}%</div>
</div> </div>
</div> </div>
<div class="video-eacher"> <div class="video-eacher">
@ -42,6 +42,9 @@
import Card from "@/components/card.vue"; import Card from "@/components/card.vue";
import { onMounted, reactive } from "vue"; import { onMounted, reactive } from "vue";
import * as echarts from "echarts"; import * as echarts from "echarts";
import { videoItemCountStatusApi, videoHkVqdcountQualityApi, videoFullCountFullApi } from "@/api/modules/agjtOverviewApi";
import { GlobalStore } from "@/stores";
const store = GlobalStore();
const videoInfo = reactive({ const videoInfo = reactive({
dataList: [ dataList: [
{ {
@ -150,7 +153,10 @@ const videoInfo = reactive({
color: "#A2A4AF" color: "#A2A4AF"
} }
} }
] ],
normalNumRatio: 0,
fullRatio: 0,
videoItemCountInfo: {} as any
}); });
// //
function getImageNormalityEchart() { function getImageNormalityEchart() {
@ -163,7 +169,7 @@ function getImageNormalityEchart() {
trigger: "item" trigger: "item"
}, },
title: { title: {
text: "50%", text: `${videoInfo.normalNumRatio}%`,
subtext: "图像正常率", subtext: "图像正常率",
x: "29%", x: "29%",
y: "32%", y: "32%",
@ -272,8 +278,8 @@ function getImageNormalityEchart() {
} }
function getVideoNormalityEchart() { function getVideoNormalityEchart() {
console.log("我是图像正常率"); console.log("我是录像完整率");
const echartsTest = echarts.init(document.getElementById("eacherVideoNormality")); const echartsTest = echarts.init(document.getElementById("eacherVideoNormality") as any);
let option = { let option = {
color: ["#65D7F9", "#FFD15C", "#EA3941", "#A2A4AF", "#FDFDFC"], color: ["#65D7F9", "#FFD15C", "#EA3941", "#A2A4AF", "#FDFDFC"],
animation: false, // animation: false, //
@ -281,7 +287,7 @@ function getVideoNormalityEchart() {
trigger: "item" trigger: "item"
}, },
title: { title: {
text: "50%", text: `${videoInfo.fullRatio}%`,
subtext: "录像完整率", subtext: "录像完整率",
x: "29%", x: "29%",
y: "32%", y: "32%",
@ -388,12 +394,102 @@ function getVideoNormalityEchart() {
console.log(echartsTest); 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(); 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(); getVideoNormalityEchart();
}; };
const setIntervalFn = (showLoading: boolean) => {
videoHkVqdcountQuality(showLoading);
videoFullCountFull(showLoading);
videoItemCountStatus(showLoading);
};
onMounted(async () => { onMounted(async () => {
setIntervalFn(); setIntervalFn(false);
// //
// setInterval(() => { // setInterval(() => {
// setIntervalFn(true); // setIntervalFn(true);

View File

@ -3,7 +3,7 @@
<div class="left"> <div class="left">
<div class="line1" style="display: flex"> <div class="line1" style="display: flex">
<span style="margin-left: 15px">距离完工还有</span> <span style="margin-left: 15px">距离完工还有</span>
<div class="numberCard" v-for="(item, i) in '204'" :key="i">{{ item }}</div> <div class="numberCard" v-for="(item, i) in projectSurplusDayNum" :key="i">{{ item }}</div>
<span style="margin-left: 5px"></span> <span style="margin-left: 5px"></span>
</div> </div>
<!-- @openDialog="openPeopleCountDialog" --> <!-- @openDialog="openPeopleCountDialog" -->
@ -27,13 +27,14 @@ import leftBottom from "@/views/overviewScreen/commandCenter/leftBottom.vue";
import centerTop from "@/views/overviewScreen/commandCenter/centerTop.vue"; import centerTop from "@/views/overviewScreen/commandCenter/centerTop.vue";
import centerBottom from "@/views/overviewScreen/commandCenter/centerBottom.vue"; import centerBottom from "@/views/overviewScreen/commandCenter/centerBottom.vue";
import rightAll from "@/views/overviewScreen/commandCenter/rightAll.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 dataDialog from "../dialogCompnnents/data-dialog.vue";
// import * as mqtt from "mqtt/dist/mqtt.min"; // import * as mqtt from "mqtt/dist/mqtt.min";
// import { getWorkerStatisticsCountApi, getProjectDetail } from "@/api/modules/projectOverview"; // import { getWorkerStatisticsCountApi, getProjectDetail } from "@/api/modules/projectOverview";
import { onMounted } from "vue"; import { onMounted, ref } from "vue";
// const store = GlobalStore(); const store = GlobalStore();
// const statisticsCount = ref(null as any); // const statisticsCount = ref(null as any);
// const projectData = ref(null as any); // const projectData = ref(null as any);
@ -91,7 +92,23 @@ import { onMounted } from "vue";
// console.log(":", error); // 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(() => { onMounted(() => {
getCountTaskProgress(false);
// mqttMSG(); // mqttMSG();
// setTimeout(() => { // setTimeout(() => {
// openPeopleCountDialog({ // openPeopleCountDialog({

View File

@ -662,24 +662,24 @@ const queryCountEnterprise = async (showLoading: boolean) => {
if (res.result) { if (res.result) {
console.log("总包进度列表", res); console.log("总包进度列表", res);
processList.value = res.result; processList.value = res.result;
processList.value = [ // processList.value = [
{ // {
enterpriseName: "广东省某某科技有限公司(东北厂区)", // enterpriseName: "广()",
changeAfter: 70 // changeAfter: 70
}, // },
{ // {
enterpriseName: "广州市某公司名称(东北厂区)", // enterpriseName: "广()",
changeAfter: 65 // changeAfter: 65
}, // },
{ // {
enterpriseName: "企业名称(东北厂区)", // enterpriseName: "()",
changeAfter: 60 // changeAfter: 60
}, // },
{ // {
enterpriseName: "这里是第四名企业名称(东北厂区)", // enterpriseName: "()",
changeAfter: 55 // changeAfter: 55
} // }
]; // ];
} }
}; };
const setIntervalFn = (showLoading: boolean) => { const setIntervalFn = (showLoading: boolean) => {
@ -702,6 +702,7 @@ onMounted(async () => {
height: 79%; height: 79%;
padding: 10px 10px; padding: 10px 10px;
margin-top: 1%; margin-top: 1%;
overflow: hidden;
} }
.leftBottom { .leftBottom {
// background: url("@/assets/images/commandScreen/card-left-bottom.png") no-repeat; // background: url("@/assets/images/commandScreen/card-left-bottom.png") no-repeat;