From 1e0d3bfa3aa651e81ea810b2defcf8d93d92c47d Mon Sep 17 00:00:00 2001 From: Vce Date: Sat, 11 May 2024 11:10:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=B3=E4=BE=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/projectOverview.ts | 10 + .../commandScreen/commandCenter/index.vue | 2 +- .../commandScreen/commandCenter/rightAll.vue | 82 +- .../dialogCompnnents/data-dialog.vue | 5 + .../dialogCompnnents/major-hidder.vue | 1248 +++++++++++++++++ 5 files changed, 1332 insertions(+), 15 deletions(-) create mode 100644 src/views/commandScreen/dialogCompnnents/major-hidder.vue diff --git a/src/api/modules/projectOverview.ts b/src/api/modules/projectOverview.ts index f142953..9a4a0f5 100644 --- a/src/api/modules/projectOverview.ts +++ b/src/api/modules/projectOverview.ts @@ -51,3 +51,13 @@ export const getStageOption = (params: {}) => { export const getParentChildTaskListApi = (params: {}) => { return http.post(BASEURL + `/xmgl/taskProgress/getParentChildList`, params); }; + + +// 隐患统计智能分析 +export const getSelectQualityStatisticsNumApi = (params: {}) => { + return http.post(BASEURL + `/xmgl/xzSecurityQualityInspectionRecord/selectQualityStatisticsNum`, params); +}; + +export const getCountDangerLevelApi = (params: {}) => { + return http.post(BASEURL + `/xmgl/xzSecurityQualityInspectionRecord/countDangerLevel`, params); +}; diff --git a/src/views/commandScreen/commandCenter/index.vue b/src/views/commandScreen/commandCenter/index.vue index 2b9fbb3..58f43cf 100644 --- a/src/views/commandScreen/commandCenter/index.vue +++ b/src/views/commandScreen/commandCenter/index.vue @@ -9,7 +9,7 @@
- +
diff --git a/src/views/commandScreen/commandCenter/rightAll.vue b/src/views/commandScreen/commandCenter/rightAll.vue index cce56b1..233a186 100644 --- a/src/views/commandScreen/commandCenter/rightAll.vue +++ b/src/views/commandScreen/commandCenter/rightAll.vue @@ -61,12 +61,14 @@ import Card from "@/components/card.vue"; import { onMounted, ref } from "vue"; import { GlobalStore } from "@/stores"; const store = GlobalStore(); -import { getProjectInspectRecordCountApi } from "@/api/modules/projectOverview"; +import { getProjectInspectRecordCountApi, getSelectQualityStatisticsNumApi, getCountDangerLevelApi } from "@/api/modules/projectOverview"; import { selectQualityStatisticsApi } from "@/api/modules/projectOverview"; import * as echarts from "echarts"; const echartsTest = ref(); let questionTotal = ref(0 as any); +const emits = defineEmits(["openDialog"]) + let dateRange = ref([] as any); let majorDangerCount = ref(20 as any); @@ -150,6 +152,7 @@ function Pie() { function drawEchart() { echartsTest.value = echarts.init(document.getElementById("echartsSafe")); let option = { + animation: false, // 取消动画 tooltip: { trigger: "item" }, @@ -366,24 +369,47 @@ function drawEchart() { }) console.log(echartsTest.value); - // let chart = echarts.init(document.getElementById('main'), null) - // //图例点击事件 - // echartsTest.value.on('legendselectchanged', params => { - // console.log(echartsTest); + //图例点击事件 + echartsTest.value.on('legendselectchanged', (params:any) => { + console.log(emits); + echartsTest.value.setOption({ + legend:{selected:{[params.name]: true}} + }) - // }) + emits("openDialog",{ + index:7, + title:params.name, + }) + }) } const getSafeInfo = async () => { - const res: any = await getProjectInspectRecordCountApi({ projectSn: store.sn }); + // const res: any = await getProjectInspectRecordCountApi({ projectSn: store.sn }); // console.log("获取安全管理", res); // safeData.value = res.result; - dataList.value[0].value = res.result.rectificationNum; - dataList.value[1].value = res.result.totalNum - res.result.rectificationNum; - questionTotal.value = res.result.totalNum; + // dataList.value[0].value = res.result.rectificationNum; + // dataList.value[1].value = res.result.totalNum - res.result.rectificationNum; + + + const res: any = await getCountDangerLevelApi({ projectSn: store.sn,isOverdueRectification:true, }); + dataList.value = res.result.data.map((item:any,index:number) => { + return { + ...item, + value: item.count, + show: true, + itemStyle: { + normal: { + color: index == 0 ? "#EC6266" : '#6375C7', + borderWidth: 20 + } + } + }; + }); + questionTotal.value = res.result.count; drawEchart(); }; + let dataList2 = ref([ { value: 30, @@ -632,16 +658,44 @@ function drawEchart2() { } const qualityInfo = async () => { - const res: any = await selectQualityStatisticsApi({ projectSn: store.sn }); - dataList2.value[0].value = res.result.total.rectificationNum; - dataList2.value[1].value = res.result.total.totalNum - res.result.total.rectificationNum; - questionTotal.value = res.result.total.totalNum; + // const res: any = await selectQualityStatisticsApi({ projectSn: store.sn }); + // dataList2.value[0].value = res.result.total.rectificationNum; + // dataList2.value[1].value = res.result.total.totalNum - res.result.total.rectificationNum; + // questionTotal.value = res.result.total.totalNum; + + const res: any = await getCountDangerLevelApi({ projectSn: store.sn,isNotQualified:true, }); + dataList2.value = res.result.data.map((item:any,index:number) => { + return { + ...item, + value: item.count, + show: true, + itemStyle: { + normal: { + color: index == 0 ? "#038cf5" : '#01d6f4', + borderWidth: 20 + } + } + }; + }); + questionTotal.value = res.result.count; + drawEchart2(); }; +const getSelectQualityStatisticsNum= async () => { + const res: any = await getSelectQualityStatisticsNumApi({ projectSn: store.sn, }); + console.log(res); + overdueMajorDangerCount.value = res.result.overdueRectificationNum; + overdueMajorDangerRate.value = res.result.overdueRectificationNumRatio; + majorDangerCount.value = res.result.notCloseNum; + // majorDangerRate.value = res.result.overdueRectificationNumRatio; +} + + onMounted(async () => { await getSafeInfo(); await qualityInfo(); + await getSelectQualityStatisticsNum(); }); diff --git a/src/views/commandScreen/dialogCompnnents/data-dialog.vue b/src/views/commandScreen/dialogCompnnents/data-dialog.vue index a7835ae..d2cf7db 100644 --- a/src/views/commandScreen/dialogCompnnents/data-dialog.vue +++ b/src/views/commandScreen/dialogCompnnents/data-dialog.vue @@ -28,6 +28,9 @@
+
+ +
@@ -40,6 +43,8 @@ import weatherInfo from "./weather-info.vue"; import riskCount from "./risk-count.vue"; import safeHidden from "./safe-hidden.vue"; import aiAlarm from "./ai-alarm.vue"; +import majorHidder from "./major-hidder.vue"; + import { GlobalStore } from "@/stores"; let showDialog = ref(false as any); const showIndex = ref(0); diff --git a/src/views/commandScreen/dialogCompnnents/major-hidder.vue b/src/views/commandScreen/dialogCompnnents/major-hidder.vue new file mode 100644 index 0000000..4ca0aa3 --- /dev/null +++ b/src/views/commandScreen/dialogCompnnents/major-hidder.vue @@ -0,0 +1,1248 @@ + + + + +