From a22a69946912221dab4d32987dda6c4c8ba3c5d8 Mon Sep 17 00:00:00 2001
From: cuilei <ray_tsu1@163.com>
Date: 星期二, 24 六月 2025 17:43:24 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/mdc/base/DeliveryGroupUtilizationRateChart.vue |  504 +++++++++++++++++++++++++++----------------------------
 1 files changed, 248 insertions(+), 256 deletions(-)

diff --git a/src/views/mdc/base/DeliveryGroupUtilizationRateChart.vue b/src/views/mdc/base/DeliveryGroupUtilizationRateChart.vue
index b07adcc..7fa62f0 100644
--- a/src/views/mdc/base/DeliveryGroupUtilizationRateChart.vue
+++ b/src/views/mdc/base/DeliveryGroupUtilizationRateChart.vue
@@ -28,7 +28,7 @@
 
           <a-col :md="8" :sm="8">
             <a-form-item label="閰嶉�佸皬缁�">
-              <a-select v-model="teamCodes" placeholder="璇烽�夋嫨閰嶉�佸皬缁�" mode="multiple" :maxTagCount="3"
+              <a-select :value="teamCodes" placeholder="璇烽�夋嫨閰嶉�佸皬缁�" mode="multiple" :maxTagCount="3"
                         @change="handleDeliverGroupSelectChange" allowClear>
                 <a-select-option v-for="item in deliveryGroupList" :key="item.key">{{ item.title }}</a-select-option>
               </a-select>
@@ -45,7 +45,6 @@
           <a-col :md="2" :sm="2">
             <a-space>
               <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>
-              <!--              <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button>-->
             </a-space>
           </a-col>
         </a-row>
@@ -57,271 +56,264 @@
 </template>
 
 <script>
-import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-import moment from 'moment/moment'
-import mdcApi from '@api/mdc'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import moment from 'moment/moment'
+  import mdcApi from '@api/mdc'
 
-export default {
-  name: 'DeliveryGroupUtilizationRateChart',
-  components: {},
-  mixins: [JeecgListMixin],
-  data() {
-    return {
-      disableMixinCreated: true,
-      queryParam: {
-        month: moment().subtract('1', 'month').format('YYYYMM')
-      },
-      productionIds: [],//鐝粍
-      teamCodes: [],//閰嶉�佸皬缁�
-      centerList: [],
-      groupList: [],
-      deliveryGroupList: []
-    }
-  },
-  mounted() {
-    window.addEventListener('resize', this.handleWindowResize)
-    this.getCenterListByApi()
-    this.handleWindowResize()
-  },
-  methods: {
-    loadData() {
-      this.chartContainer = this.$echarts.init(document.getElementById('chart-container'))
-      this.initChart({})
-      this.chartContainer.showLoading({
-        text: '鏁版嵁鍔犺浇涓� ...',
-        color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊
-        textColor: '#0696e1'
-      })
-      const that = this
-      mdcApi.getDeliveryGroupChartDataApi(this.queryParam)
-        .then(res => {
-          if (res.success) {
-            if (Object.keys(res.result).length === 0 || res.result.teamCodeList.length === 0) {
+  export default {
+    name: 'DeliveryGroupUtilizationRateChart',
+    components: {},
+    mixins: [JeecgListMixin],
+    data() {
+      return {
+        disableMixinCreated: true,
+        queryParam: {
+          month: moment().subtract('1', 'month').format('YYYYMM')
+        },
+        productionIds: [],//鐝粍
+        teamCodes: [],//閰嶉�佸皬缁�
+        centerList: [],//涓績鍒楄〃
+        groupList: [],//鐝粍鍒楄〃
+        deliveryGroupList: []//閰嶉�佸皬缁勫垪琛�
+      }
+    },
+    mounted() {
+      window.addEventListener('resize', this.handleWindowResize)
+      this.getCenterListByApi()
+      this.handleWindowResize()
+    },
+    methods: {
+      loadData() {
+        this.chartContainer = this.$echarts.init(document.getElementById('chart-container'))
+        this.initChart({})
+        this.chartContainer.showLoading({
+          text: '鏁版嵁鍔犺浇涓� ...',
+          color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊
+          textColor: '#0696e1'
+        })
+        const that = this
+        mdcApi.getDeliveryGroupChartDataApi(this.queryParam)
+          .then(res => {
+            if (res.success) {
+              if (Object.keys(res.result).length === 0 || res.result.teamCodeList.length === 0) {
+                that.$notification.warning({
+                  message: '娑堟伅',
+                  description: '鏆傛棤鏁版嵁'
+                })
+                // 姝ゅ鏈猺eturn鏄负淇濊瘉鍥捐〃鏁版嵁鑳借娓呴櫎骞跺睍绀虹┖鍥捐〃
+              }
+              that.initChart(res.result)
+            } else {
               that.$notification.warning({
                 message: '娑堟伅',
-                description: '鏆傛棤鏁版嵁'
+                description: res.message
               })
-              // 姝ゅ鏈猺eturn鏄负淇濊瘉鍥捐〃鏁版嵁鑳借娓呴櫎骞跺睍绀虹┖鍥捐〃
             }
-            that.initChart(res.result)
-          } else {
-            that.$notification.warning({
-              message: '娑堟伅',
-              description: res.message
-            })
-          }
-        })
-        .catch(err => {
-          that.$notification.error({
-            message: '娑堟伅',
-            description: err.message
           })
-        })
-    },
-
-    /**
-     * 鍒濆鍖栧浘琛�
-     * @param chartDataObj 鏁版嵁瀵硅薄 Object
-     */
-    initChart(chartDataObj) {
-      const option = {
-        title: {
-          text: (this.queryParam.month.slice(-2) >= 10 ? this.queryParam.month.slice(-2) : this.queryParam.month.slice(-1)) + '鏈堥厤閫佸皬缁勭患鍚堝埄鐢ㄧ巼',
-          left: 'center',
-          top: 0,
-          textStyle: {
-            fontSize: 22
-          }
-        },
-        grid: {
-          top: '12%',
-          left: '1%',
-          right: '1%',
-          bottom: '8%',
-          containLabel: true
-        },
-        legend: {
-          top: '6%',
-          right: 'center',
-          itemGap: 20,
-          data: ['24h缁煎悎鍒╃敤鐜�', '鍘婚櫎鏁呴殰璁惧鏃堕棿24h缁煎悎鍒╃敤鐜�', '鐝鍒╃敤鐜�']
-        },
-        tooltip: {
-          show: true,
-          trigger: 'axis'
-        },
-        xAxis: {
-          type: 'category',
-          data: chartDataObj.teamCodeList ? chartDataObj.teamCodeList : []
-          // data: ['鏉庢湁涓虹粍', '涓佺孩鐕曠粍', '鍞愪笢缁�', '鏈卞皬纾婄粍', '寮犲缁�', '瀹嬪畤鍧ょ粍', '缃楀啗缁�', '寮犲弻杩涚粍', '甯告尟鍕囩粍', '钁涘簲榫欑粍', '璧靛箍娑涚粍', '浜庡崕浜粍', '闄堝郴缁�', '鐜嬬户宄扮粍', '鐜嬫檽鏄庣粍', '闄堟灄缁�', '鍚村悏骞崇粍']
-        },
-        yAxis: [
-          {
-            type: 'value',
-            name: '鍒╃敤鐜�(%)',
-            axisLine: {
-              show: true
-            },
-            axisLabel: {
-              formatter: '{value}%'
-            }
-          }
-        ],
-        series: [
-          {
-            type: 'bar',
-            name: '24h缁煎悎鍒╃敤鐜�',
-            // barWidth: '40%',
-            // data: [85, 32, 23, 56, 24, 64, 34, 85, 32, 23, 56, 24, 85, 63, 74, 11, 58]
-            data: chartDataObj.dataList ? chartDataObj.dataList.map(item => item.utilizationRate) : []
-          },
-          {
-            type: 'bar',
-            name: '鍘婚櫎鏁呴殰璁惧鏃堕棿24h缁煎悎鍒╃敤鐜�',
-            // barWidth: '40%',
-            // data: [24, 64, 34, 85, 32, 23, 56, 24, 85, 32, 23, 56, 24, 64, 34, 85, 54],
-            data: chartDataObj.dataList ? chartDataObj.dataList.map(item => item.amendUtilizationRate) : []
-          },
-          {
-            type: 'bar',
-            name: '鐝鍒╃敤鐜�',
-            // barWidth: '40%',
-            // data: [24, 64, 34, 85, 32, 23, 56, 24, 85, 32, 23, 56, 24, 64, 34, 85, 54],
-            data: chartDataObj.dataList ? chartDataObj.dataList.map(item => item.shiftUtilizationRate) : []
-          }
-        ],
-        dataZoom: [
-          {
-            type: 'slider',
-            show: true,
-            xAxisIndex: 0,
-            startValue: 0,
-            endValue: 19,
-            // 鏄惁鏄剧ずdetail锛屽嵆鎷栨嫿鏃跺�欐樉绀鸿缁嗘暟鍊间俊鎭�
-            showDetail: false,
-            // empty锛氬綋鍓嶆暟鎹獥鍙e鐨勬暟鎹紝琚缃负绌恒��
-            // 鍗充笉浼氬奖鍝嶅叾浠栬酱鐨勬暟鎹寖鍥�
-            filterMode: 'empty',
-            // 鎺у埗鎵嬫焺鐨勫昂瀵�
-            // handleSize: 0,
-            // 鏄惁閿佸畾閫夋嫨鍖哄煙锛堟垨鍙仛鏁版嵁绐楀彛锛夌殑澶у皬
-            zoomLock: true,
-            brushSelect: false
-          },
-          {
-            // 娌℃湁涓嬮潰杩欏潡鐨勮瘽锛屽彧鑳芥嫋鍔ㄦ粴鍔ㄦ潯锛�
-            // 榧犳爣婊氳疆鍦ㄥ尯鍩熷唴涓嶈兘鎺у埗澶栭儴婊氬姩鏉�
-            type: 'inside',
-            show: true,
-            // 鎺у埗鍝釜杞达紝濡傛灉鏄痭umber琛ㄧず鎺у埗涓�涓酱锛�
-            xAxisIndex: 0,
-            // 婊氳疆鏄惁瑙﹀彂缂╂斁
-            zoomOnMouseWheel: false,
-            // 榧犳爣绉诲姩鑳藉惁瑙﹀彂骞崇Щ
-            moveOnMouseMove: true,
-            // 榧犳爣婊氳疆鑳藉惁瑙﹀彂骞崇Щ
-            moveOnMouseWheel: true
-          }
-        ]
-      }
-      this.chartContainer.setOption(option, true)
-      this.chartContainer.hideLoading()
-    },
-
-    // 鑾峰彇涓績鍒楄〃
-    getCenterListByApi() {
-      const that = this
-      mdcApi.getCenterOrGroupListApi()
-        .then(res => {
-          if (res.success) {
-            that.centerList = res.result
-            that.queryParam.productionId = res.result[0].value
-            that.getGroupListByApi(res.result[0].value, true)
-          }
-        })
-    },
-
-    /**
-     * 鑾峰彇鐝粍鍒楄〃
-     * @param productionId 涓績Id
-     * @param isInitLoad 鏄惁涓哄垵濮嬪寲鍔犺浇
-     */
-    getGroupListByApi(productionId, isInitLoad = false) {
-      const that = this
-      mdcApi.getCenterOrGroupListApi(productionId)
-        .then(res => {
-          if (res.success) {
-            that.groupList = res.result
-            if (!isInitLoad) return
-            that.handleGroupSelectChange([res.result[0].value])
-            that.loadData()
-          }
-        })
-    },
-
-    /**
-     * 鑾峰彇閰嶉�佸皬缁勫垪琛�
-     * @param productionId 鐝粍Id
-     * @param isReduceSelectOption 鏄惁鍑忓皯鐝粍閫変腑椤�
-     */
-    getDeliveryGroupListByApi(productionId, isReduceSelectOption = false) {
-      const that = this
-      mdcApi.getDeliveryGroupListApi(productionId)
-        .then(res => {
-          if (res.success) {
-            that.deliveryGroupList = res.result
-
-            if (!isReduceSelectOption) return
-            that.teamCodes.forEach((key, keyIndex, self) => {
-              // 濡傛灉灏嗗敮涓�涓�缁勫寘鍚�変腑閰嶉�佸皬缁勯」鐨勭彮缁勫彇娑堝嬀閫夊悗搴斿皢宸插嬀閫夌殑閰嶉�佸皬缁勪竴骞跺彇娑堝嬀閫�
-              if (that.deliveryGroupList.findIndex(item => item.key === key) === -1) self.splice(keyIndex, 1)
+          .catch(err => {
+            that.$notification.error({
+              message: '娑堟伅',
+              description: err.message
             })
-          }
-        })
-    },
+          })
+      },
 
-    /**
-     * 涓績鏀瑰彉鏃惰Е鍙�
-     * @param value 鏀瑰彉鍚庣殑涓績Id
-     */
-    handleCenterSelectChange(value) {
-      if (this.productionIds.length > 0) {
+      /**
+       * 鍒濆鍖栧浘琛�
+       * @param chartDataObj 鏁版嵁瀵硅薄 Object
+       */
+      initChart(chartDataObj) {
+        const option = {
+          title: {
+            text: (this.queryParam.month.slice(-2) >= 10 ? this.queryParam.month.slice(-2) : this.queryParam.month.slice(-1)) + '鏈堥厤閫佸皬缁勭患鍚堝埄鐢ㄧ巼',
+            left: 'center',
+            top: 0,
+            textStyle: {
+              fontSize: 22
+            }
+          },
+          grid: {
+            top: '12%',
+            left: '1%',
+            right: '1%',
+            bottom: '8%',
+            containLabel: true
+          },
+          legend: {
+            top: '6%',
+            right: 'center',
+            itemGap: 20,
+            data: ['24h缁煎悎鍒╃敤鐜�', '鍘婚櫎鏁呴殰璁惧鏃堕棿24h缁煎悎鍒╃敤鐜�', '鐝鍒╃敤鐜�']
+          },
+          tooltip: {
+            show: true,
+            trigger: 'axis'
+          },
+          xAxis: {
+            type: 'category',
+            data: chartDataObj.teamCodeList ? chartDataObj.teamCodeList : []
+            // data: ['鏉庢湁涓虹粍', '涓佺孩鐕曠粍', '鍞愪笢缁�', '鏈卞皬纾婄粍', '寮犲缁�', '瀹嬪畤鍧ょ粍', '缃楀啗缁�', '寮犲弻杩涚粍', '甯告尟鍕囩粍', '钁涘簲榫欑粍', '璧靛箍娑涚粍', '浜庡崕浜粍', '闄堝郴缁�', '鐜嬬户宄扮粍', '鐜嬫檽鏄庣粍', '闄堟灄缁�', '鍚村悏骞崇粍']
+          },
+          yAxis: [
+            {
+              type: 'value',
+              name: '鍒╃敤鐜�(%)',
+              axisLine: {
+                show: true
+              },
+              axisLabel: {
+                formatter: '{value}%'
+              }
+            }
+          ],
+          series: [
+            {
+              type: 'bar',
+              name: '24h缁煎悎鍒╃敤鐜�',
+              // barWidth: '40%',
+              // data: [85, 32, 23, 56, 24, 64, 34, 85, 32, 23, 56, 24, 85, 63, 74, 11, 58]
+              data: chartDataObj.dataList ? chartDataObj.dataList.map(item => item.utilizationRate) : []
+            },
+            {
+              type: 'bar',
+              name: '鍘婚櫎鏁呴殰璁惧鏃堕棿24h缁煎悎鍒╃敤鐜�',
+              // barWidth: '40%',
+              // data: [24, 64, 34, 85, 32, 23, 56, 24, 85, 32, 23, 56, 24, 64, 34, 85, 54],
+              data: chartDataObj.dataList ? chartDataObj.dataList.map(item => item.amendUtilizationRate) : []
+            },
+            {
+              type: 'bar',
+              name: '鐝鍒╃敤鐜�',
+              // barWidth: '40%',
+              // data: [24, 64, 34, 85, 32, 23, 56, 24, 85, 32, 23, 56, 24, 64, 34, 85, 54],
+              data: chartDataObj.dataList ? chartDataObj.dataList.map(item => item.shiftUtilizationRate) : []
+            }
+          ],
+          dataZoom: [
+            {
+              type: 'slider',
+              show: true,
+              xAxisIndex: 0,
+              startValue: 0,
+              endValue: 19,
+              // 鏄惁鏄剧ずdetail锛屽嵆鎷栨嫿鏃跺�欐樉绀鸿缁嗘暟鍊间俊鎭�
+              showDetail: false,
+              // empty锛氬綋鍓嶆暟鎹獥鍙e鐨勬暟鎹紝琚缃负绌恒��
+              // 鍗充笉浼氬奖鍝嶅叾浠栬酱鐨勬暟鎹寖鍥�
+              filterMode: 'empty',
+              // 鎺у埗鎵嬫焺鐨勫昂瀵�
+              // handleSize: 0,
+              // 鏄惁閿佸畾閫夋嫨鍖哄煙锛堟垨鍙仛鏁版嵁绐楀彛锛夌殑澶у皬
+              zoomLock: true,
+              brushSelect: false
+            },
+            {
+              // 娌℃湁涓嬮潰杩欏潡鐨勮瘽锛屽彧鑳芥嫋鍔ㄦ粴鍔ㄦ潯锛�
+              // 榧犳爣婊氳疆鍦ㄥ尯鍩熷唴涓嶈兘鎺у埗澶栭儴婊氬姩鏉�
+              type: 'inside',
+              show: true,
+              // 鎺у埗鍝釜杞达紝濡傛灉鏄痭umber琛ㄧず鎺у埗涓�涓酱锛�
+              xAxisIndex: 0,
+              // 婊氳疆鏄惁瑙﹀彂缂╂斁
+              zoomOnMouseWheel: false,
+              // 榧犳爣绉诲姩鑳藉惁瑙﹀彂骞崇Щ
+              moveOnMouseMove: true,
+              // 榧犳爣婊氳疆鑳藉惁瑙﹀彂骞崇Щ
+              moveOnMouseWheel: true
+            }
+          ]
+        }
+        this.chartContainer.setOption(option, true)
+        this.chartContainer.hideLoading()
+      },
+
+      // 鑾峰彇涓績鍒楄〃
+      getCenterListByApi() {
+        const that = this
+        mdcApi.getCenterOrGroupListApi()
+          .then(res => {
+            if (res.success) {
+              that.centerList = res.result
+              that.queryParam.productionId = res.result[0].value
+              that.getGroupListByApi(res.result[0].value, true)
+            }
+          })
+      },
+
+      /**
+       * 鑾峰彇鐝粍鍒楄〃
+       * @param productionId 涓績Id
+       * @param isInitLoad 鏄惁涓哄垵濮嬪寲鍔犺浇
+       */
+      getGroupListByApi(productionId, isInitLoad = false) {
         this.groupList = []
-        this.productionIds = []
-        delete this.queryParam.productionIds
-      }
-      if (this.teamCodes.length > 0) {
+        const that = this
+        mdcApi.getCenterOrGroupListApi(productionId)
+          .then(res => {
+            if (res.success) {
+              that.groupList = res.result ? res.result : []
+              that.handleGroupSelectChange(res.result && res.result.length > 0 && isInitLoad ? [res.result[0].value] : [])
+              if (!isInitLoad) return
+              that.loadData()
+            }
+          })
+      },
+
+      /**
+       * 鑾峰彇閰嶉�佸皬缁勫垪琛�
+       * @param productionId 鐝粍Id
+       * @param isReduceSelectOption 鏄惁鍑忓皯鐝粍閫変腑椤�
+       */
+      getDeliveryGroupListByApi(productionId, isReduceSelectOption = false) {
         this.deliveryGroupList = []
-        this.teamCodes = []
-        delete this.queryParam.teamCodes
+        const that = this
+        mdcApi.getDeliveryGroupListApi(productionId)
+          .then(res => {
+            if (res.success) {
+              that.deliveryGroupList = res.result ? res.result : []
+
+              // 浠呭噺灏戝嬀閫夐」鏃舵墠杩涜涓嬩竴姝�
+              if (!isReduceSelectOption) return
+              // 淇濈暀鏀瑰彉鍚庣殑閰嶉�佸皬缁勫垪琛ㄤ腑涔嬪墠宸插嬀閫夌殑閰嶉�佸皬缁�
+              const filterTeamCodes = that.teamCodes.filter(item => that.deliveryGroupList.map(item => item.key).includes(item))
+              that.handleDeliverGroupSelectChange(filterTeamCodes)
+            }
+          })
+      },
+
+      /**
+       * 涓績鏀瑰彉鏃惰Е鍙�
+       * @param value 鏀瑰彉鍚庣殑涓績Id
+       */
+      handleCenterSelectChange(value) {
+        this.getGroupListByApi(value)
+      },
+
+      /**
+       * 鐝粍鏀瑰彉鏃惰Е鍙�
+       * @param value 鏀瑰彉鍚庣殑鐝粍Id
+       */
+      handleGroupSelectChange(value) {
+        let isReduceSelectOption
+        if (value.length > this.productionIds.length) isReduceSelectOption = false //澧炲姞鍕鹃�夐」
+        else isReduceSelectOption = true // 鍑忓皯鍕鹃�夐」
+        this.productionIds = value
+        this.queryParam.productionIds = value.join(',')
+        this.getDeliveryGroupListByApi(value.join(','), isReduceSelectOption)
+      },
+
+      /**
+       * 閰嶉�佸皬缁勫彂鐢熸敼鍙樻椂瑙﹀彂
+       * @param value 鏀瑰彉鍚庣殑閰嶉�佸皬缁処d
+       */
+      handleDeliverGroupSelectChange(value) {
+        this.teamCodes = value
+        this.queryParam.teamCodes = value.join(',')
+      },
+
+      handleWindowResize() {
+        if (this.chartContainer) this.chartContainer.resize()
       }
-      this.getGroupListByApi(value)
-    },
-
-    /**
-     * 鐝粍鏀瑰彉鏃惰Е鍙�
-     * @param value 鏀瑰彉鍚庣殑鐝粍Id
-     */
-    handleGroupSelectChange(value) {
-      let isReduceSelectOption
-      if (value.length > this.productionIds.length) isReduceSelectOption = false //澧炲姞鍕鹃�夐」
-      else isReduceSelectOption = true // 鍑忓皯鍕鹃�夐」
-      this.productionIds = value
-      this.queryParam.productionIds = value.join(',')
-      this.getDeliveryGroupListByApi(value.join(','), isReduceSelectOption)
-    },
-
-    /**
-     * 閰嶉�佸皬缁勫彂鐢熸敼鍙樻椂瑙﹀彂
-     * @param value 鏀瑰彉鍚庣殑閰嶉�佸皬缁処d
-     */
-    handleDeliverGroupSelectChange(value) {
-      this.queryParam.teamCodes = value.join(',')
-    },
-
-    handleWindowResize() {
-      if (this.chartContainer) this.chartContainer.resize()
     }
   }
-}
 </script>
\ No newline at end of file

--
Gitblit v1.9.3