From 38af7850e2c62b28ccb6f990140ac17c4bc21419 Mon Sep 17 00:00:00 2001
From: zhouwenxuan <1175765986@qq.com>
Date: 星期一, 18 三月 2024 14:49:27 +0800
Subject: [PATCH] 风险辨识管理

---
 src/views/specialWorkSystem/specialIndex/index.vue |  171 +++++++++++++++++++++++++++-----------------------------
 1 files changed, 82 insertions(+), 89 deletions(-)

diff --git a/src/views/specialWorkSystem/specialIndex/index.vue b/src/views/specialWorkSystem/specialIndex/index.vue
index ce6908a..dd9a486 100644
--- a/src/views/specialWorkSystem/specialIndex/index.vue
+++ b/src/views/specialWorkSystem/specialIndex/index.vue
@@ -252,14 +252,15 @@
       </div>
     </div>
     <el-dialog v-model="dialogDetails" title="作业申请详情" center>
-      <fire v-if="dialogType == 1" :details = details></fire>
-      <space v-else-if="dialogType == 2" :details = details></space>
-      <hoist v-else-if="dialogType == 3" :details = details></hoist>
-      <ground v-else-if="dialogType == 4" :details = details></ground>
-      <broken v-else-if="dialogType == 5" :details = details></broken>
-      <height v-else-if="dialogType == 6" :details = details></height>
-      <power v-else-if="dialogType == 7" :details = details></power>
-      <plate v-else :details = details></plate>
+<!--      <fire v-if="dialogType == 1" :details = details></fire>-->
+<!--      <space v-else-if="dialogType == 2" :details = details></space>-->
+<!--      <hoist v-else-if="dialogType == 3" :details = details></hoist>-->
+<!--      <ground v-else-if="dialogType == 4" :details = details></ground>-->
+<!--      <broken v-else-if="dialogType == 5" :details = details></broken>-->
+<!--      <height v-else-if="dialogType == 6" :details = details></height>-->
+<!--      <power v-else-if="dialogType == 7" :details = details></power>-->
+<!--      <plate v-else :details = details></plate>-->
+<!--      <detail-log :type=dialogType :statusList=statusList :details = details></detail-log>-->
       <template #footer>
               <span class="dialog-footer">
                 <el-button type="primary" @click="dialogDetails = false"
@@ -371,24 +372,24 @@
   components: {
     VideoDetail,
     WorkRecord,
-    fire: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsq/components/fireLog.vue')),
-    space: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsq/components/spaceLog.vue')),
-    hoist: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsq/components/hoistLog.vue')),
-    ground: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsq/components/groundLog.vue')),
-    broken: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsq/components/brokenLog.vue')),
-    height: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsq/components/heightLog.vue')),
-    power: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsq/components/powerLog.vue')),
-    plate: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsq/components/plateLog.vue'))
+    // fire: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/fireLog.vue')),
+    // space: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/spaceLog.vue')),
+    // hoist: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/hoistLog.vue')),
+    // ground: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/groundLog.vue')),
+    // broken: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/brokenLog.vue')),
+    // height: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/heightLog.vue')),
+    // power: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/powerLog.vue')),
+    // plate: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/plateLog.vue'))
   },
   setup() {
-    const userInfo = useUserInfo();
-    const { userInfos } = storeToRefs(userInfo);
-    const router = useRouter();
+    const userInfo = useUserInfo()
+    const { userInfos } = storeToRefs(userInfo)
+    const router = useRouter()
     const reviewFormRef = ref<FormInstance>()
     const zyfb = ref("eChartZyfb" + Date.now() + Math.random())
     const slfx = ref("eChartSlfx" + Date.now() + Math.random())
     const zyqs = ref("eChartZyqs" + Date.now() + Math.random())
-    const videoRef = ref();
+    const videoRef = ref()
     const recordRef = ref()
     const state = reactive<stateType>({
       pageIndex: 1,
@@ -415,7 +416,7 @@
       },
       chartSearch2: {
         depId: 1,
-        startTime: '',
+        // startTime: '',
         type: null
       },
       chartSearch3: {
@@ -522,9 +523,6 @@
       getTypePie()
       getWorkDep()
       getDepMonth()
-      initZyfb()
-      initSlfx()
-      initZyqs()
     });
     const initTime =()=>{
       state.chartSearch1.startTime = getPeriod(30)
@@ -574,10 +572,12 @@
       }else{
         state.themeColor = '#333'
       }
-      initZyfb()
-      initSlfx()
-      initZyqs()
+      initTime()
       getMydepList()
+      getAllDepartment();
+      getTypePie()
+      getWorkDep()
+      getDepMonth()
     }
     const getTypePie = async ()=>{
       const data = {
@@ -589,7 +589,7 @@
       if (res.data.code === '200') {
         // console.log('饼图数据>>>', res.data.data)
         state.pieData = JSON.parse(JSON.stringify(res.data.data))
-        // initZyfb()
+        initZyfb()
       } else {
         ElMessage({
           type: 'warning',
@@ -599,16 +599,17 @@
     }
     const getWorkDep = async ()=>{
       const data = {
-        startTime: state.chartSearch2.startTime,
-        endTime: state.endTime,
+        // startTime: state.chartSearch2.startTime,
+        // endTime: state.endTime,
         depId:state.chartSearch2.depId,
         type: state.chartSearch2.type
       }
       let res = await specialIndexApi().analyseAllWork(data);
       if (res.data.code === '200') {
-        // console.log('条形图数据>>>', res.data.data)
         state.squareData = JSON.parse(JSON.stringify(res.data.data))
-        // initSlfx()
+        let names = state.squareData.map(i=>i.name)
+        let vals = state.squareData.map(i=>i.value)
+        initSlfx(names,vals)
       } else {
         ElMessage({
           type: 'warning',
@@ -619,9 +620,10 @@
     const getDepMonth = async ()=>{
       let res = await specialIndexApi().analyseDepMonth(state.chartSearch3.depId);
       if (res.data.code === '200') {
-        // console.log('折线图数据>>>', res.data.data)
         state.squareData = JSON.parse(JSON.stringify(res.data.data))
-        // initSlfx()
+        let names = state.squareData.map(i=>i.name)
+        let vals = state.squareData.map(i=>i.value)
+        initZyqs(names,vals)
       } else {
         ElMessage({
           type: 'warning',
@@ -705,16 +707,7 @@
                 shadowColor: 'rgba(0, 0, 0, 0.5)'
               },
             },
-            data: [
-              { value: 0, name: '动火作业' },
-              { value: 0, name: '受限空间作业' },
-              { value: 0, name: '吊装作业' },
-              { value: 0, name: '动土作业' },
-              { value: 0, name: '断路作业' },
-              { value: 0, name: '高处作业' },
-              { value: 0, name: '临时用电作业' },
-              { value: 0, name: '盲板抽堵作业' }
-            ]
+            data: state.pieData
           }
         ]
       }
@@ -724,7 +717,7 @@
         myChart.resize();
       });
     }
-    const initSlfx =()=>{
+    const initSlfx =(names:Array<string>,vals:Array<any>)=>{
       let dom = document.getElementById(slfx.value);
       let myChart = echarts.init(dom);
       let option: EChartsOption;
@@ -744,7 +737,7 @@
         xAxis: [
           {
             type: 'category',
-            data: ['部门一','部门二','部门三'],
+            data: names,
             axisTick: {
               alignWithLabel: true
             },
@@ -763,7 +756,7 @@
             name: 'Direct',
             type: 'bar',
             barWidth: '60%',
-            data: [0,0,0],
+            data: vals,
           }
         ]
       }
@@ -773,14 +766,14 @@
         myChart.resize();
       });
     }
-    const initZyqs =()=>{
+    const initZyqs =(names:Array<string>,vals:Array<any>)=>{
       let dom = document.getElementById(zyqs.value);
       let myChart = echarts.init(dom);
       let option: EChartsOption;
       option = {
         xAxis: {
           type: 'category',
-          data: ['四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月', '一月', '二月', '三月'],
+          data: names,
           axisLabel: {
             color: state.themeColor
           }
@@ -804,7 +797,7 @@
         },
         series: [
           {
-            data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+            data: vals,
             type: 'line',
             label:{
               show: true
@@ -897,44 +890,44 @@
     };
 
     // 查看记录
-    const viewDetail = (row: any) => {
-      state.dialogType = row.workType
-      state.details = JSON.parse(JSON.stringify(row));
-      if(state.details.workDetail.otherSpecialWork == '' || !state.details.workDetail.otherSpecialWork){
-        state.details.workDetail.otherSpecialWork=[]
-      }
-      else {
-        const a = state.details.workDetail.otherSpecialWork
-        state.details.workDetail.otherSpecialWork = a.split(',').map((item) => {
-          return state.workTypeList.find((i: { id: number }) => i.id === Number(item))?.name;
-        });
-      }
-      if(state.details.workDetail.involvedDepIds == '' || !state.details.workDetail.involvedDepIds){
-        state.details.workDetail.involvedDepIds=[]
-      }
-      else {
-        const a = state.details.workDetail.involvedDepIds
-        state.details.workDetail.involvedDepIds = a.split(',').map((item) => {
-          return state.departmentRecursionList.find((i: { depId: number }) => i.depId === Number(item))?.depName;
-        });
-      }
-      if(state.details.workDetail.csDepId){
-        state.details.workDetail.csDepId = state.departmentRecursionList.find((i: { depId: number }) => i.depId === Number(state.details.workDetail.csDepId))?.depName;
-      }
-      if(state.details.workDetail.operationDepId){
-        state.details.workDetail.operationDepId = state.departmentRecursionList.find((i: { depId: number }) => i.depId === Number(state.details.workDetail.operationDepId))?.depName;
-      }
-      if(state.details.workDetail.gbPath){
-        state.details.workDetail.gbPath = state.details.workDetail.gbPath.split(',')
-      }
-      if(state.details.workDetail.bcPath){
-        state.details.workDetail.bcPath = state.details.workDetail.bcPath.split(',')
-      }
-      if(state.details.workDetail.bpLocationMapPath){
-        state.details.workDetail.bpLocationMapPath = state.details.workDetail.bpLocationMapPath.split(',')
-      }
-      state.dialogDetails = true;
-    };
+    // const viewDetail = (row: any) => {
+    //   state.dialogType = row.workType
+    //   state.details = JSON.parse(JSON.stringify(row));
+    //   if(state.details.workDetail.otherSpecialWork == '' || !state.details.workDetail.otherSpecialWork){
+    //     state.details.workDetail.otherSpecialWork=[]
+    //   }
+    //   else {
+    //     const a = state.details.workDetail.otherSpecialWork
+    //     state.details.workDetail.otherSpecialWork = a.split(',').map((item) => {
+    //       return state.workTypeList.find((i: { id: number }) => i.id === Number(item))?.name;
+    //     });
+    //   }
+    //   if(state.details.workDetail.involvedDepIds == '' || !state.details.workDetail.involvedDepIds){
+    //     state.details.workDetail.involvedDepIds=[]
+    //   }
+    //   else {
+    //     const a = state.details.workDetail.involvedDepIds
+    //     state.details.workDetail.involvedDepIds = a.split(',').map((item) => {
+    //       return state.departmentRecursionList.find((i: { depId: number }) => i.depId === Number(item))?.depName;
+    //     });
+    //   }
+    //   if(state.details.workDetail.csDepId){
+    //     state.details.workDetail.csDepId = state.departmentRecursionList.find((i: { depId: number }) => i.depId === Number(state.details.workDetail.csDepId))?.depName;
+    //   }
+    //   if(state.details.workDetail.operationDepId){
+    //     state.details.workDetail.operationDepId = state.departmentRecursionList.find((i: { depId: number }) => i.depId === Number(state.details.workDetail.operationDepId))?.depName;
+    //   }
+    //   if(state.details.workDetail.gbPath){
+    //     state.details.workDetail.gbPath = state.details.workDetail.gbPath.split(',')
+    //   }
+    //   if(state.details.workDetail.bcPath){
+    //     state.details.workDetail.bcPath = state.details.workDetail.bcPath.split(',')
+    //   }
+    //   if(state.details.workDetail.bpLocationMapPath){
+    //     state.details.workDetail.bpLocationMapPath = state.details.workDetail.bpLocationMapPath.split(',')
+    //   }
+    //   state.dialogDetails = true;
+    // };
 
     // const handleReview = (row: object)=>{
     //   state.dialogReview = true
@@ -1052,7 +1045,7 @@
       toApply,
       searchRecord,
       clearSearch,
-      viewDetail,
+      // viewDetail,
       viewRecord,
       viewTicket,
       downLoadTicket,

--
Gitblit v1.9.2