From 2145108a5bf0c721fea728e0a4936cb7007a92a2 Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期六, 06 一月 2024 15:31:41 +0800
Subject: [PATCH] mdc更新

---
 src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue |   68 ++++++++++++++++++++--------------
 1 files changed, 40 insertions(+), 28 deletions(-)

diff --git a/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue b/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue
index fd2560d..4a0be14 100644
--- a/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue
+++ b/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue
@@ -7,6 +7,16 @@
           <a-form layout="inline" @keyup.enter.native="searchQuery">
             <a-row :gutter="24">
               <a-col :md="5" :sm="5" :xs="5">
+                <a-form-item label="椹卞姩绫诲瀷">
+                  <a-auto-complete
+                    v-model="queryParam.driveType"
+                    :data-source="driveTypeList"
+                    placeholder="璇烽�夋嫨椹卞姩绫诲瀷"
+                    :filter-option="filterOption"
+                  />
+                </a-form-item>
+              </a-col>
+              <a-col :md="5" :sm="5" :xs="5">
                 <a-form-item label="鏃堕棿">
                   <a-range-picker
                     :placeholder="['寮�濮嬫椂闂�', '缁撴潫鏃堕棿']"
@@ -17,27 +27,6 @@
                   />
                 </a-form-item>
               </a-col>
-              <!--<a-col :md="5" :sm="5" :xs="5">-->
-              <!--<a-form-item label="鐝埗">-->
-              <!--<a-select v-model="queryParam.shiftId" placeholder="璇烽�夋嫨鐝埗"-->
-              <!--@change="initShiftSubList" :allowClear="allowClear">-->
-              <!--<a-select-option v-for="(em,index) in shiftList" :key="index" :value="em.value">-->
-              <!--{{ em.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 v-model="queryParam.shiftSubId" placeholder="璇烽�夋嫨鐝" @change="initShiftSubListChange"-->
-              <!--:allowClear="allowClearSu">-->
-              <!--<a-select-option v-for="(em,index) in shiftSubList" :key="index" :value="em.value">-->
-              <!--{{ em.label }}-->
-              <!--</a-select-option>-->
-              <!--</a-select>-->
-              <!--</a-form-item>-->
-              <!--</a-col>-->
-
               <a-col :md="8" :sm="8" :xs="8">
                 <a-space>
                   <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>
@@ -81,6 +70,7 @@
   import $ from 'jquery'
   import '@/components/table2excel/table2excel'
   import { ajaxGetDictItems, getDictItemsFromCache, duplicateCheck } from '@/api/api'
+  import api from '@api/mdc'
 
   export default {
     name: 'OEEAnalysisList',
@@ -148,7 +138,7 @@
           {
             title: '鐝',
             align: 'center',
-            width: 300,
+            width: 100,
             dataIndex: 'shift',
             ellipsis: true,
           },
@@ -250,7 +240,7 @@
             dataIndex: 'timeActuationRate',
             align: 'center',
             width: 110,
-            customRender: text => text != 0 ? text * 100 + '%' : 0
+            customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0
           },
           {
             title: '鍔犲伐闆朵欢鏁帮紙浠讹級',
@@ -269,7 +259,7 @@
             dataIndex: 'performanceRate',
             align: 'center',
             width: 110,
-            customRender: text => text != 0 ? text * 100 + '%' : 0
+            customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0
           },
           {
             title: '搴熷搧鏁�',
@@ -282,26 +272,28 @@
             dataIndex: 'passRate',
             align: 'center',
             width: 100,
-            customRender: text => text != 0 ? text * 100 + '%' : 0
+            customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0
           },
           {
             title: '璁惧缁煎悎鏁堢巼',
             dataIndex: 'overallEquipmentEfficiency',
             align: 'center',
             width: 120,
-            customRender: text => text != 0 ? text * 100 + '%' : 0
+            customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0
           }
         ],
-        dataSource: []
+        dataSource: [],
+        driveTypeList: []
       }
     },
     props: { nodeTree: '', Type: '', nodePeople: '' },
     created() {
-      this.initShiftList()
+      // this.initShiftList()
       this.queryParam.startTime = moment(this.dates[0]).format('YYYY-MM')
       this.queryParam.endTime = moment(this.dates[1]).format('YYYY-MM')
       this.queryParam.typeTree = '1'
       this.loadData()
+      this.getDriveTypeByApi()
     },
     watch: {
       Type(valmath) {
@@ -418,6 +410,15 @@
         this.loadData()
       },
 
+      /**
+       * 璋冪敤鎺ュ彛鑾峰彇鎺у埗绯荤粺绫诲瀷
+       */
+      getDriveTypeByApi() {
+        api.getDriveTypeApi().then((res) => {
+          this.driveTypeList = res.result.map(item => item.value)
+        })
+      },
+
       loadData() {
         getAction(this.url.list, this.queryParam).then(res => {
           if (res.success) {
@@ -444,6 +445,17 @@
       handlePageSizeChange(current, size) {
         this.queryParam.pageSize = size
         this.loadData()
+      },
+      /**
+       * 鑱旀兂杈撳叆妗嗙瓫閫夊姛鑳�
+       * @param input 杈撳叆鐨勫唴瀹�
+       * @param option 閰嶇疆
+       * @returns {boolean} 鍒ゆ柇鏄惁绛涢��
+       */
+      filterOption(input, option) {
+        return (
+          option.componentOptions.children[0].text.toUpperCase().indexOf(input.toUpperCase()) >= 0
+        )
       }
     }
   }

--
Gitblit v1.9.3