From 456b737c86bb9614b43df9108826c18e852a44e2 Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期一, 09 六月 2025 10:46:36 +0800
Subject: [PATCH] 解决报警分析页面饼图颜色缺失问题

---
 .env.development                                               |    2 
 vue.config.js                                                  |    5 +-
 src/views/eam/repair/EamReportRepairList.vue                   |    2 
 src/views/mdc/base/modules/alarmAnalysis/alarmAnalysisMain.vue |   54 ++++++++-------------------
 4 files changed, 21 insertions(+), 42 deletions(-)

diff --git a/.env.development b/.env.development
index 15843a6..f5ed1e6 100644
--- a/.env.development
+++ b/.env.development
@@ -2,7 +2,7 @@
 # VUE_APP_API_BASE_URL=http://192.168.1.118:3000
 # VUE_APP_API_BASE_URL=http://195.0.1.10:6099
 # VUE_APP_API_BASE_URL=http://192.168.1.12:9999
-VUE_APP_API_BASE_URL=http://127.0.0.1:9999
+VUE_APP_API_BASE_URL=http://127.0.0.1:8888
 # VUE_APP_API_BASE_URL=http://195.0.1.10:8099
 VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas
 VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview
\ No newline at end of file
diff --git a/src/views/eam/repair/EamReportRepairList.vue b/src/views/eam/repair/EamReportRepairList.vue
index 143e8a3..75a9c8f 100644
--- a/src/views/eam/repair/EamReportRepairList.vue
+++ b/src/views/eam/repair/EamReportRepairList.vue
@@ -34,7 +34,7 @@
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <a-form-item label="鏄惁鍋滄満">
               <a-radio-group v-model="queryParam.breakdownFlag">
-                <a-radio v-for="item in breakdown_flag_list" :value="item.value">{{ item.label }}</a-radio>
+                <a-radio v-for="item in breakdown_flag_list" :key="item.value" :value="item.value">{{ item.label }}</a-radio>
               </a-radio-group>
             </a-form-item>
           </a-col>
diff --git a/src/views/mdc/base/modules/alarmAnalysis/alarmAnalysisMain.vue b/src/views/mdc/base/modules/alarmAnalysis/alarmAnalysisMain.vue
index 66f1ecb..edda50f 100644
--- a/src/views/mdc/base/modules/alarmAnalysis/alarmAnalysisMain.vue
+++ b/src/views/mdc/base/modules/alarmAnalysis/alarmAnalysisMain.vue
@@ -142,7 +142,7 @@
         YData: [0],
         columns,
         innerColumns,
-        hasRequsetAlarmCodeList: []
+        hasRequestAlarmCodeList: []
       }
     },
     props: { nodeTree: '', Type: '', nodePeople: '' },
@@ -258,14 +258,6 @@
               that.XData = res.result.dateCountList.map(item => item.key)
               that.YData = res.result.dateCountList.map(item => item.count)
 
-              // this.tableHeads = res.result.dates
-              // this.dataList = res.result
-              // this.draw()
-              // this.checkSameData(this.dataList)
-              // this.checkSameData1(this.dataList)
-              // this.checkSameData2(this.dataList)
-              // this.combineCell();
-              // this.initDeviceType(this.dataList)
               that.drawWrin()
             }
           })
@@ -326,16 +318,8 @@
         this.dataList = []
         getAction(this.url.efficiencyList, this.queryParam).then(res => {
           if (res.success) {
-            // this.tableHeads = res.result.dates
             this.dataList = res.result
-            this.hasRequsetAlarmCodeList = []
-            // this.draw()
-            // this.checkSameData(this.dataList)
-            // this.checkSameData1(this.dataList)
-            // this.checkSameData2(this.dataList)
-            // this.combineCell();
-            // this.initDeviceType(this.dataList)
-
+            this.hasRequestAlarmCodeList = []
           }
         }).finally(() => {
           this.outerDataLoading = false
@@ -354,32 +338,26 @@
           },
           tooltip: {
             trigger: 'item',
-            formatter: '<br/>{b} : {c} ({d}%)'
+            formatter: '{b} : {c} ({d}%)'
           },
           calculable: true,
-          series: [{
+          series: {
             type: 'pie',
             radius: '60%',
+            label: {
+              show: true,
+              formatter: '{b}\n{c}',
+              color: 'inherit'
+            },
             itemStyle: {
-              normal: {
-                color: function(params) {
-                  var colorList = ['#5AB1EF', '#2EC7C9', '#B6A2DE', '#FFB980', '#D87A80', '#8D98B3']
-                  return colorList[params.dataIndex]
-                },
-                label: {
-                  show: true,
-                  // position: 'top',
-                  formatter: '{b}\n{c}',
-                  color: function(params) {
-                    var colorList = ['#5AB1EF', '#2EC7C9', '#B6A2DE', '#FFB980', '#D87A80', '#8D98B3']
-                    return colorList[params.dataIndex]
-                  }
-                }
+              color: function(params) {
+                const colorList = ['#5AB1EF', '#2EC7C9', '#B6A2DE', '#FFB980', '#D87A80', '#8D98B3']
+                return colorList[params.dataIndex % colorList.length]
               }
+
             },
             data: this.pieDate
-            // data:[{name:'jjjjjjj',value:'2'}]
-          }]
+          }
         }
         this.equipmentWarningPie.setOption(equipmentWarningPieOption, true)
         this.equipmentWarningLine = this.$echarts.init(document.getElementById('MdcEquipmentWarningLine'), 'macarons')
@@ -483,7 +461,7 @@
         let _this = this
         // 褰撳睍寮�鏃惰嫢璇ヨ鏈灞曞紑杩囨墠浼氳姹傚悗鍙版暟鎹紝灞曞紑杩囩殑鏁版嵁浼氳缂撳瓨鏃犻渶閲嶅璇锋眰
         this.queryParam.alarmCode = record.alarmCode
-        if (expanded && !this.hasRequsetAlarmCodeList.includes(record.alarmCode)) {
+        if (expanded && !this.hasRequestAlarmCodeList.includes(record.alarmCode)) {
           this.innerDataLoading = true
           getAction(this.url.equipmentAlarmList, this.queryParam).then(res => {
             if (res.success) {
@@ -492,7 +470,7 @@
                   item.innerDataList = res.result
                 }
               })
-              _this.hasRequsetAlarmCodeList.push(record.alarmCode)
+              _this.hasRequestAlarmCodeList.push(record.alarmCode)
             }
           })
             .finally(() => {
diff --git a/vue.config.js b/vue.config.js
index 232ae99..eb24574 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -88,7 +88,7 @@
   devServer: {
     port: 3000,
     open: true,
-    https: false,
+    // https: true,
     // hot: true,
     disableHostCheck: true,
     // overlay: {
@@ -110,7 +110,8 @@
       /* 娉ㄦ剰锛歫eecgboot鍓嶇鍋氫簡鏀归�狅紝姝ゅ涓嶉渶瑕侀厤缃法鍩熷拰鍚庡彴鎺ュ彛锛堝彧闇�瑕佹敼.env鐩稿叧閰嶇疆鏂囦欢鍗冲彲锛�
           issues/3462 寰堝浜烘澶勫仛浜嗛厤缃紝瀵艰嚧鍒锋柊鍓嶇404闂锛岃涓�瀹氭敞鎰�*/
       '/jeecg-boot': {
-        target: 'http://localhost:9999/', // 璇锋眰鏈湴 闇�瑕乯eecg-boot鍚庡彴椤圭洰
+        target: 'http://localhost:8888/', // 璇锋眰鏈湴 闇�瑕乯eecg-boot鍚庡彴椤圭洰
+        // target: 'http://192.168.1.24:9999/', // 璇锋眰鏈湴 闇�瑕乯eecg-boot鍚庡彴椤圭洰
         ws: false,
         changeOrigin: true
       }

--
Gitblit v1.9.3