Просмотр исходного кода

feat: 院区安全态势-生产安全新增接口

ai0187 1 месяц назад
Родитель
Сommit
45814178f0

+ 62 - 0
src/api/institute-safety/index.ts

@@ -0,0 +1,62 @@
+import { http } from '@/utils/http/axios';
+
+// 安全责任落实
+export interface ResponsibilityImplementation {
+  rate: string; // 签订率
+  leaderTotal: number; // 院领导总数
+  leaderSign: number; // 院领导签署数
+  firstDeptTotal: number; // 所/中心/智能.....(一级部门)总数
+  firstDeptSign: number; // 所/中心/智能.....(一级部门)签订数
+  secondDeptTotal: number; // 所/中心.....(二级部门)总数
+  secondDeptSign: number; // 所/中心.....(二级部门)签订数
+  unitTotal: number; // 科室总数
+  unitSign: number; // 科室签订数
+  employeeTotal: number; // 员工总数
+  employeeSign: number; // 员工签署数
+  supplierTotal: number; // 常驻供应商总数
+  supplierSign: number; // 常驻供应商签署数
+}
+export const getResponsibilityImplementation = (): Promise<ResponsibilityImplementation> => {
+  return http.request({
+    url: '/h5HomePage/queryResponsibility',
+    method: 'get',
+  });
+};
+
+// 安全教育培训
+export interface EducationTraining {
+  trainingCount: number; // 培训次数
+  participateNum: number; // 参与人数
+}
+export const getEducationTraining = (): Promise<EducationTraining> => {
+  return http.request({
+    url: '/h5HomePage/trainingTotal',
+    method: 'get',
+  });
+};
+
+// 风险的识别与管控
+export interface RiskIdentification {
+  dangerNum: number; // 危险作业数
+  constructionNum: number; // 施工作业数
+}
+export const getRiskIdentification = (): Promise<RiskIdentification> => {
+  return http.request({
+    url: '/h5HomePage/nowWorkTotal',
+    method: 'get',
+  });
+};
+
+// 隐患的排查与治理
+export interface DangerInvestigation {
+  totalCount: number; // 隐患数(未删除且未作废的隐患总数)
+  rectifyingCount: number; // 整改中(状态为待整改的隐患数)
+  closedLoopCount: number; // 闭环(状态为已完成的隐患数)
+  safeCheckCount: number; // 安全生产检查(检查记录总数)
+}
+export const getDangerInvestigation = (): Promise<DangerInvestigation> => {
+  return http.request({
+    url: '/productionHiddenDanger/mobile/statistics',
+    method: 'get',
+  });
+};

+ 6 - 3
src/views/institute-safety/components/production-safety/DangerInvestigation.vue

@@ -15,6 +15,7 @@
 
 <script setup lang="ts">
   import { computed, onMounted, ref } from 'vue';
+  import { getDangerInvestigation } from '@/api/institute-safety';
 
   const hiddenDangerCount = ref<number>(0);
   const rectificationCount = ref<number>(0);
@@ -27,9 +28,11 @@
   ]);
 
   onMounted(() => {
-    hiddenDangerCount.value = 124;
-    rectificationCount.value = 0;
-    closedCount.value = 124;
+    getDangerInvestigation().then((res) => {
+      hiddenDangerCount.value = res.totalCount;
+      rectificationCount.value = res.rectifyingCount;
+      closedCount.value = res.closedLoopCount;
+    });
   });
 </script>
 

+ 7 - 4
src/views/institute-safety/components/production-safety/EducationTraining.vue

@@ -15,6 +15,7 @@
 
 <script setup lang="ts">
   import { onMounted, ref } from 'vue';
+  import { getEducationTraining } from '@/api/institute-safety';
 
   interface EducationTrainingContent {
     name: string;
@@ -24,10 +25,12 @@
   const educationTrainingContent = ref<EducationTrainingContent[]>([]);
 
   onMounted(() => {
-    educationTrainingContent.value = [
-      { name: '安全知识培训(次)', value: 20 },
-      { name: '参加人总计(人)', value: 14197 },
-    ];
+    getEducationTraining().then((res) => {
+      educationTrainingContent.value = [
+        { name: '安全知识培训(次)', value: res.trainingCount },
+        { name: '参加人总计(人)', value: res.participateNum },
+      ];
+    });
   });
 </script>
 

+ 13 - 10
src/views/institute-safety/components/production-safety/ResponsibilityImplementation.vue

@@ -25,6 +25,7 @@
 
 <script setup lang="ts">
   import { onMounted, ref } from 'vue';
+  import { getResponsibilityImplementation } from '@/api/institute-safety';
 
   interface SigningList {
     name: string;
@@ -35,13 +36,15 @@
   const signingList = ref<SigningList[]>([]);
 
   onMounted(() => {
-    signingRate.value = 10;
-    signingList.value = [
-      { name: '所/中心', num: 28 },
-      { name: '科室', num: 347 },
-      { name: '员工', num: 3368 },
-      { name: '常驻供应商', num: 19 },
-    ];
+    getResponsibilityImplementation().then((res) => {
+      signingRate.value = Number(res.rate.replace('%', ''));
+      signingList.value = [
+        { name: '所/中心', num: res.firstDeptSign + res.secondDeptSign },
+        { name: '科室', num: res.unitSign },
+        { name: '员工', num: res.employeeSign },
+        { name: '常驻供应商', num: res.supplierSign },
+      ];
+    });
   });
 </script>
 
@@ -92,7 +95,7 @@
       justify-content: space-between;
 
       .signing-rate-value {
-        width: 192px;
+        width: 160px;
         height: 6px;
         background: #d8d8d8;
         border-radius: 4px;
@@ -117,8 +120,8 @@
     .signing-nums {
       display: flex;
       align-items: center;
-      justify-content: center;
-      gap: 28px;
+      justify-content: space-between;
+      margin: 0 16px;
 
       .signing-nums__item {
         display: flex;

+ 6 - 3
src/views/institute-safety/components/production-safety/RiskIdentification.vue

@@ -25,15 +25,18 @@
 
 <script setup lang="ts">
   import { onMounted, ref } from 'vue';
+  import { getRiskIdentification } from '@/api/institute-safety';
 
   const checkCount = ref<number>(0);
   const hazardousWorkCount = ref<number>(0);
   const constructionWorkCount = ref<number>(0);
 
   onMounted(() => {
-    checkCount.value = 270;
-    hazardousWorkCount.value = 0;
-    constructionWorkCount.value = 0;
+    getRiskIdentification().then((res) => {
+      // checkCount.value = res.safeCheckCount;
+      hazardousWorkCount.value = res.dangerNum;
+      constructionWorkCount.value = res.constructionNum;
+    });
   });
 </script>