From ceed2940c085a05378c5d01e08e82a98a17f317b Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期一, 23 九月 2024 09:27:57 +0800
Subject: [PATCH] 统计分析、统计图表、对比分析、设备日利用率、设备日利用率对比、利用率走势分析以及利用率分段分析左侧树数据新增参数key,用来过滤异常状态设备

---
 src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue |  184 +++++++++++++++++++++++++++++++--------------
 1 files changed, 125 insertions(+), 59 deletions(-)

diff --git a/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue b/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue
index acb9a04..52d0796 100644
--- a/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue
+++ b/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue
@@ -21,7 +21,7 @@
                 </a-select>
               </a-form-item>
             </a-col>
-            <a-col :md="5" :sm="5" :xs="5">
+            <a-col :md="6" :sm="6" :xs="6">
               <a-form-item label="椹卞姩绫诲瀷">
                 <a-select
                   :value="queryParams.driveType"
@@ -37,20 +37,16 @@
                 </a-select>
               </a-form-item>
             </a-col>
-            <a-col :md="4" :sm="4" :xs="4">
-              <a-form-item label="璁惧绾у埆">
-                <a-select
-                  :value="queryParams.deviceLevel"
-                  mode="multiple"
-                  placeholder="璇烽�夋嫨璁惧绾у埆"
-                  allow-clear
-                  :maxTagCount="1"
-                  @change="selectChange($event,'deviceLevel')"
-                >
-                  <a-select-option v-for="(item,index) in device_level_list" :value="item.value" :key="index">
-                    {{item.label}}
-                  </a-select-option>
-                </a-select>
+            <a-col :md="5" :sm="5" :xs="5">
+              <a-form-item label="鏃堕棿">
+                <a-range-picker
+                  :placeholder="['寮�濮嬫椂闂�', '缁撴潫鏃堕棿']"
+                  format="YYYY-MM"
+                  :value="dates"
+                  :mode="['month', 'month']"
+                  @panelChange="dateParamChange"
+                  @change="handleDateChange"
+                />
               </a-form-item>
             </a-col>
             <a-col :md="5" :sm="5" :xs="5">
@@ -69,19 +65,68 @@
                 </a-select>
               </a-form-item>
             </a-col>
+            <a-col :md="2" :sm="2">
+              <a
+                @click="toggleSearchStatus=!toggleSearchStatus"
+                @selectstart="$event.preventDefault()"
+                style="display: inline-block;height: 32px;line-height: 32px"
+              >
+                {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }}
+                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+
+          <a-row :gutter="24" v-if="toggleSearchStatus">
             <a-col :md="5" :sm="5" :xs="5">
-              <a-form-item label="鏃堕棿">
-                <a-range-picker
-                  :placeholder="['寮�濮嬫椂闂�', '缁撴潫鏃堕棿']"
-                  format="YYYY-MM"
-                  :value="dates"
-                  :mode="['month', 'month']"
-                  @panelChange="dateParamChange"
-                  @change="handleDateChange"
-                />
+              <a-form-item label="璁惧绾у埆">
+                <a-select
+                  :value="queryParams.deviceLevel"
+                  mode="multiple"
+                  placeholder="璇烽�夋嫨璁惧绾у埆"
+                  allow-clear
+                  :maxTagCount="1"
+                  @change="selectChange($event,'deviceLevel')"
+                >
+                  <a-select-option v-for="(item,index) in device_level_list" :value="item.value" :key="index">
+                    {{item.label}}
+                  </a-select-option>
+                </a-select>
               </a-form-item>
             </a-col>
-
+            <!--<a-col :md="5" :sm="5" :xs="5">-->
+              <!--<a-form-item label="鏁版嵁鍒嗗竷">-->
+                <!--<a-select-->
+                  <!--:value="queryParams.deviceLevel"-->
+                  <!--mode="multiple"-->
+                  <!--placeholder="璇烽�夋嫨鏁版嵁鍒嗗竷"-->
+                  <!--allow-clear-->
+                  <!--:maxTagCount="1"-->
+                  <!--@change="selectChange($event,'deviceLevel')"-->
+                <!--&gt;-->
+                  <!--<a-select-option v-for="(item,index) in device_level_list" :value="item.value" :key="index">-->
+                    <!--{{item.label}}-->
+                  <!--</a-select-option>-->
+                <!--</a-select>-->
+              <!--</a-form-item>-->
+            <!--</a-col>-->
+            <a-col :md="5" :sm="5" :xs="5">
+              <a-form-item label="閲嶈绋嬪害">
+                <a-select
+                  :value="queryParams.deviceImportanceLevel"
+                  mode="multiple"
+                  placeholder="璇烽�夋嫨璁惧閲嶈绋嬪害"
+                  allow-clear
+                  :maxTagCount="1"
+                  @change="selectChange($event,'deviceImportanceLevel')"
+                >
+                  <a-select-option v-for="(item,index) in device_importance_level_list" :value="item.value"
+                                   :key="index">
+                    {{item.label}}
+                  </a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
           </a-row>
 
           <a-row :gutter="24" style="margin-bottom: 20px">
@@ -102,8 +147,13 @@
     </div>
 
     <div id="EfficiencyShift" style="flex:1;overflow: hidden;height: inherit">
-      <a-table :columns="columns" rowKey="id" :dataSource="dataSource.records" :loading="tableLoading"
-               :pagination="false" :scroll="{x:'max-content',y:scrollY}" bordered></a-table>
+      <a-table :columns="columns" rowKey="id" :dataSource="dataSource.records?dataSource.records:[]"
+               :loading="tableLoading"
+               :pagination="false" :scroll="{x:'max-content',y:scrollY}" bordered>
+        <!--<template slot="equipmentModel" slot-scope="text, record">-->
+        <!--<editable-cell :text="text" @change="onCellChange(record.id, 'equipmentModel', $event)"/>-->
+        <!--</template>-->
+      </a-table>
     </div>
     <!--<div class="pagination">-->
     <!--<a-pagination-->
@@ -129,6 +179,8 @@
   import { ajaxGetDictItems, getDictItemsFromCache, duplicateCheck } from '@/api/api'
   import api from '@api/mdc'
 
+  // import EditableCell from './EditableCell.vue'
+
   export default {
     name: 'OEEAnalysisList',
     components: {},
@@ -143,7 +195,8 @@
           equipmentType: [],
           driveType: [],
           deviceLevel: [],
-          deviceCategory: []
+          deviceCategory: [],
+          deviceImportanceLevel: []
         },
         queryParamEquip: {},
         queryParamPeople: {},
@@ -156,14 +209,20 @@
             title: '搴忓彿',
             dataIndex: '',
             key: 'rowIndex',
-            width: 70,
+            width: 60,
             align: 'center',
             customRender: function(t, r, index) {
               return parseInt(index) + 1
             }
           },
           {
-            title: '璁惧缁熶竴缂栧彿',
+            title: '杞﹂棿',
+            align: 'center',
+            dataIndex: 'productionName',
+            width: 110
+          },
+          {
+            title: '璁惧缂栧彿',
             align: 'center',
             dataIndex: 'equipmentId',
             width: 120
@@ -171,14 +230,15 @@
           {
             title: '璁惧鍚嶇О',
             align: 'center',
-            width: 200,
+            width: 120,
             dataIndex: 'equipmentName'
           },
           {
             title: '璁惧鍨嬪彿',
             align: 'center',
-            width: 110,
-            dataIndex: 'equipmentModel'
+            width: 120,
+            dataIndex: 'equipmentModel',
+            scopedSlots: { customRender: 'equipmentModel' }
           },
           {
             title: '鏃ユ湡',
@@ -189,32 +249,32 @@
           {
             title: '鐝',
             align: 'center',
-            width: 300,
+            width: 100,
             dataIndex: 'shift'
           },
           {
             title: '姣忕彮灏忔椂',
             dataIndex: 'shiftTimeCount',
             align: 'center',
-            width: 110
+            width: 100
           },
           {
             title: '鍔犵彮鏃堕棿锛堝垎閽燂級',
             dataIndex: 'overtime',
             align: 'center',
-            width: 110
+            width: 100
           },
           {
             title: '瀹為檯鐝骇澶╂暟',
             dataIndex: 'actualWorkDayCount',
             align: 'center',
-            width: 120
+            width: 100
           },
           {
             title: '鏈堝害瀹為檯鐝骇鎬绘椂闂达紙鍒嗛挓锛�',
             dataIndex: 'monthActualWorkDayTimeCount',
             align: 'center',
-            width: 110
+            width: 100
           },
           {
             title: '闈炶鍒掑仠鏈烘崯澶憋紙鍒嗛挓锛夛紙涓�涓湀锛�',
@@ -241,7 +301,7 @@
                 title: '璁″垝绛変换鍔�',
                 dataIndex: 'plannedTaskDuration',
                 align: 'center',
-                width: 110
+                width: 100
               },
               {
                 title: '妫�楠�',
@@ -270,45 +330,45 @@
                 title: '浼氳/鍩硅',
                 dataIndex: 'conferenceTrainingDuration',
                 align: 'center',
-                width: 110
+                width: 100
               },
               {
                 title: '鍏朵粬浼戞伅绛�',
                 dataIndex: 'otherRestDuration',
                 align: 'center',
-                width: 110
+                width: 100
               }]
           },
           {
             title: '璐熻嵎鏃堕棿锛堝皬鏃讹級',
             dataIndex: 'loadTime',
             align: 'center',
-            width: 110
+            width: 100
           },
           {
             title: '鏃堕棿寮�鍔ㄧ巼',
             dataIndex: 'timeActuationRate',
             align: 'center',
-            width: 110,
+            width: 100,
             customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0
           },
-          {
-            title: '鍔犲伐闆朵欢鏁帮紙浠讹級',
-            dataIndex: 'processQuantity',
-            align: 'center',
-            width: 120
-          },
-          {
-            title: '鏍囧噯鍔犲伐鏃堕棿锛堝垎閽燂級',
-            dataIndex: 'standardProcessDuration',
-            align: 'center',
-            width: 120
-          },
+          // {
+          //   title: '鍔犲伐闆朵欢鏁帮紙浠讹級',
+          //   dataIndex: 'processQuantity',
+          //   align: 'center',
+          //   width: 120
+          // },
+          // {
+          //   title: '鏍囧噯鍔犲伐鏃堕棿锛堝垎閽燂級',
+          //   dataIndex: 'standardProcessDuration',
+          //   align: 'center',
+          //   width: 120
+          // },
           {
             title: '鎬ц兘寮�鍔ㄧ巼',
             dataIndex: 'performanceRate',
             align: 'center',
-            width: 110,
+            width: 100,
             customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0
           },
           {
@@ -328,7 +388,7 @@
             title: '璁惧缁煎悎鏁堢巼',
             dataIndex: 'overallEquipmentEfficiency',
             align: 'center',
-            width: 120,
+            width: 100,
             customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0
           }
         ],
@@ -338,7 +398,8 @@
         device_level_list: [],
         device_category_list: [],
         scrollY: 465,
-        tableLoading: false
+        tableLoading: false,
+        toggleSearchStatus: false
       }
     },
     props: { nodeTree: '', Type: '', nodePeople: '' },
@@ -359,6 +420,7 @@
       this.queryGroup()
       this.initDictData('device_level')
       this.initDictData('device_category')
+      this.initDictData('device_importance_level')
     },
     mounted() {
       window.addEventListener('resize', this.handleWindowResize)
@@ -507,7 +569,7 @@
         this.tableLoading = true
         getAction(this.url.list, this.queryParam)
           .then(res => {
-            if (res.success) {
+            if (res.success && res.result) {
               this.dataSource = res.result
               this.tableLoading = false
             }
@@ -538,6 +600,10 @@
         this.loadData()
       },
 
+      onCellChange(key, dataIndex, value) {
+        console.log('瑙﹀彂onCellChange', key, dataIndex, value)
+      },
+
       /**
        * 褰撴祻瑙堝櫒鍙绐楀彛灏哄鍙戠敓鏀瑰彉鏃惰Е鍙�
        */

--
Gitblit v1.9.3