From 1d79d3950a3d8c489ca9ee2c88a50b01e2b5ab6e Mon Sep 17 00:00:00 2001
From: zhuzhuanzhuan
Date: 星期四, 09 五月 2024 14:54:32 +0800
Subject: [PATCH] 新增首页看板点击图表出现的弹窗组件

---
 src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue |   78 +++++++++++++++++++++++++++++++++++---
 1 files changed, 71 insertions(+), 7 deletions(-)

diff --git a/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue b/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue
index 0b18f26..a364dab 100644
--- a/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue
+++ b/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue
@@ -5,7 +5,17 @@
       <div class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="searchQuery">
           <a-row :gutter="24">
-            <a-col :md="5" :sm="5" :xs="5">
+            <a-col :md="4" :sm="4" :xs="4">
+              <a-form-item label="璁惧绫诲瀷">
+                <a-select placeholder="璇烽�夋嫨璁惧绫诲瀷" :triggerChange="true" v-model="queryParam.equipmentType"
+                          :allowClear="true">
+                  <a-select-option v-for='item in selectList' :key='item.id' :value='item.equipmentTypeName'>
+                    {{item.equipmentTypeName}}
+                  </a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="4" :xs="4">
               <a-form-item label="椹卞姩绫诲瀷">
                 <a-auto-complete
                   v-model="queryParam.driveType"
@@ -16,7 +26,19 @@
                 />
               </a-form-item>
             </a-col>
-            <a-col :md="7" :sm="7" :xs="7">
+            <a-col :md="4" :sm="4" :xs="4">
+              <a-form-item label="璁惧绾у埆">
+                <j-dict-select-tag placeholder="璇烽�夋嫨璁惧绾у埆" dictCode="device_level" v-model="queryParam.deviceLevel"
+                                   allow-clear/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="4" :xs="4">
+              <a-form-item label="璁惧绉嶇被">
+                <j-dict-select-tag placeholder="璇烽�夋嫨璁惧绉嶇被" dictCode="device_category" v-model="queryParam.deviceCategory"
+                                   allow-clear/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="5" :sm="5" :xs="5">
               <a-form-item label="鏃堕棿">
                 <a-range-picker
                   :placeholder="['寮�濮嬫椂闂�', '缁撴潫鏃堕棿']"
@@ -28,11 +50,18 @@
                 />
               </a-form-item>
             </a-col>
-            <a-col :md="2" :sm="2" :xs="2">
+
+          </a-row>
+
+          <a-row :gutter="24" style="margin-bottom: 20px">
+            <a-col :md="4" :sm="4" :xs="4">
               <a-space>
                 <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>
                 <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button>
                 <a-button type="primary" @click="exportExcel" icon="download">瀵煎嚭</a-button>
+                <a-button type="primary" icon="printer" v-print="'#EfficiencyShift'" v-has="'efficiencyShift:print'">
+                  鎵撳嵃
+                </a-button>
               </a-space>
             </a-col>
           </a-row>
@@ -84,7 +113,8 @@
         url: {
           list: '/mdc/mdcOverallEquipmentEfficiency/list',
           initShiftList: '/mdc/mdcMdcShift/initShiftList',
-          initShiftSubList: '/mdc/mdcShiftSub/initShiftSubList'
+          initShiftSubList: '/mdc/mdcShiftSub/initShiftSubList',
+          queryEquipmentType: '/mdc/mdcEquipmentType/queryEquipmentType'
         },
         shiftList: [],
         shiftSubList: [],
@@ -272,17 +302,27 @@
         ],
         dataSource: [],
         driveTypeList: [],
+        selectList: [],
         scrollY: 465,
         tableLoading: false
       }
     },
     props: { nodeTree: '', Type: '', nodePeople: '' },
     created() {
+      const { isEquipment, productionId } = this.$route.params
+      if (productionId) {
+        console.log('productionId', productionId)
+        console.log('isEquipment', isEquipment)
+        if (!isEquipment) this.queryParam.parentId = productionId
+        else this.queryParam.equipmentId = productionId
+      }
+
       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()
+      this.queryGroup()
     },
     mounted() {
       window.addEventListener('resize', this.handleWindowResize)
@@ -392,6 +432,8 @@
           this.queryParam.parentId = this.queryParamPeople.parentId
           this.queryParam.equipmentId = ''
         }
+
+
         this.queryParam.pageNo = 1
         this.loadData()
       },
@@ -411,6 +453,25 @@
       getDriveTypeByApi() {
         api.getDriveTypeApi().then((res) => {
           this.driveTypeList = res.result.map(item => item.value)
+        })
+      },
+
+      queryGroup() {
+        getAction(this.url.queryEquipmentType).then(res => {
+          if (res.success) {
+            this.selectList = res.result
+            // this.selectList = res.result.map((item, index, arr) => {
+            //   return { label: item.id, value: item.equipmentTypeName + '' }
+            // })
+          } else {
+            // this.$message.warning(res.message)
+            this.$notification.warning({
+              message: '娑堟伅',
+              description: res.message
+            })
+          }
+        }).finally(() => {
+          this.loading = false
         })
       },
 
@@ -463,9 +524,12 @@
        * 褰撴祻瑙堝櫒鍙绐楀彛灏哄鍙戠敓鏀瑰彉鏃惰Е鍙�
        */
       handleWindowResize() {
-        const boxHeight = +window.getComputedStyle(document.getElementById('EfficiencyShift')).height.slice(0, -2)
-        const tableHeadHeight = +window.getComputedStyle(document.querySelector('.ant-table-thead th')).height.slice(0, -2)
-        this.scrollY = boxHeight - tableHeadHeight
+        const devicePixelRatio = window.devicePixelRatio // 娴忚鍣ㄧ缉鏀炬瘮
+        if (devicePixelRatio < 1) return // 缂╂斁姣斿皬浜�1鏃朵笉杩涜楂樺害閲嶆柊璁剧疆锛屽洜涓簊crollY鍙樺ぇ鍚庤〃鏍艰秴鍑洪儴鍒嗕細琚殣钘忓鑷存粴鍔ㄦ潯涓嶅彲瑙�
+        const clientHeight = document.body.clientHeight // 娴忚鍣ㄥ彲瑙嗗尯鍩熼珮搴�
+        const containerTopToClientTopHeight = document.getElementById('EfficiencyShift').getBoundingClientRect().top // 琛ㄦ牸瀹瑰櫒椤堕儴鍒版祻瑙堝櫒鍙鍖哄煙椤堕儴鐨勯棿璺�
+        const tableHeadHeight = +window.getComputedStyle(document.querySelector('.ant-table-thead th')).height.slice(0, -2) // 琛ㄦ牸琛ㄥご楂樺害
+        this.scrollY = clientHeight - containerTopToClientTopHeight - tableHeadHeight  // 琛ㄦ牸鍨傜洿婊氬姩鏉¢珮搴�
       }
     }
   }

--
Gitblit v1.9.3