liuzhihui 2 anni fa
parent
commit
1cd9526b87

+ 176 - 151
CallCenterWeb.UI/RMYY/src/views/leadConcernNew/cpns/LineChart.vue

@@ -1,167 +1,192 @@
1 1
 <template>
2
-  <div
3
-    id="gzbx_chart2"
4
-    :class="className"
5
-    :style="{ height: height, width: width }"
6
-  />
2
+  <div id="gzbx_chart2" :class="className" :style="{ height: height, width: width }" />
7 3
 </template>
8 4
 <script>
9
-import { mapDeptRepairReport } from "@/api/leadConcern/leadConcern";
10
-// import getdate from "@/utils/getdate";
11
-export default {
12
-  props: {
13
-    className: {
14
-      type: String,
15
-      default: "chart",
5
+  import {
6
+    mapDeptRepairReport
7
+  } from "@/api/leadConcern/leadConcern";
8
+  // import getdate from "@/utils/getdate";
9
+  export default {
10
+    props: {
11
+      className: {
12
+        type: String,
13
+        default: "chart",
14
+      },
15
+      width: {
16
+        type: String,
17
+        default: "100%",
18
+      },
19
+      height: {
20
+        type: String,
21
+        default: "300px",
22
+      },
23
+      chartsTwoValue: {
24
+        type: String,
25
+        default: "1",
26
+      },
27
+      dataType: {
28
+        type: String,
29
+        default: "1",
30
+      },
16 31
     },
17
-    width: {
18
-      type: String,
19
-      default: "100%",
32
+    watch: {
33
+      chartsTwoValue: function() {
34
+        this.statisticsTopFiveReport();
35
+      },
36
+      dataType: function() {
37
+        this.statisticsTopFiveReport();
38
+      },
20 39
     },
21
-    height: {
22
-      type: String,
23
-      default: "300px",
40
+    data() {
41
+      return {
42
+        gzbxData: [],
43
+        chart: null,
44
+        echartsData: [],
45
+        userNameData: [],
46
+        committedData: [],
47
+        uncommittedData: [],
48
+      };
24 49
     },
25
-    chartsTwoValue: {
26
-      type: String,
27
-      default: "1",
50
+    mounted() {
51
+      // this.getDeptRepairReport();
52
+      // this.initChart();
28 53
     },
29
-    dataType: {
30
-      type: String,
31
-      default: "1",
54
+    beforeDestroy() {
55
+      if (!this.chart) {
56
+        return;
57
+      }
58
+      this.chart.dispose();
59
+      this.chart = null;
32 60
     },
33
-  },
34
-  watch: {
35
-    chartsTwoValue: function () {
36
-      this.statisticsTopFiveReport();
37
-    },
38
-    dataType: function () {
39
-      this.statisticsTopFiveReport();
40
-    },
41
-  },
42
-  data() {
43
-    return {
44
-      gzbxData: [],
45
-      chart: null,
46
-      echartsData: [],
47
-      userNameData: [],
48
-      committedData: [],
49
-      uncommittedData: [],
50
-    };
51
-  },
52
-  mounted() {
53
-    // this.getDeptRepairReport();
54
-    // this.initChart();
55
-  },
56
-  beforeDestroy() {
57
-    if (!this.chart) {
58
-      return;
59
-    }
60
-    this.chart.dispose();
61
-    this.chart = null;
62
-  },
63
-  methods: {
64
-    getsearchParam(startdata, enddata, users) {
65
-      this.startdata = startdata;
66
-      this.enddata = enddata;
67
-      this.users = users;
68
-    },
69
-    initChart(
70
-      xAxisData,
71
-      seriesData1,
72
-      seriesData2,
73
-      seriesData3,
74
-      seriesData4,
75
-      seriesData5,
76
-      seriesData6,
77
-      seriesData7
78
-    ) {
79
-      const myChart = this.$echarts.init(
80
-        document.getElementById("gzbx_chart2")
81
-      );
82
-      myChart.setOption({
83
-        title: {
84
-          text: "",
85
-        },
86
-        tooltip: {
87
-          trigger: "axis",
88
-        },
89
-        legend: {
90
-          data: [
91
-            "总量",
92
-            "完成量",
93
-            "完成率",
94
-            "超时量",
95
-            "超时率",
96
-            "满意量",
97
-            "满意率",
98
-          ],
99
-        },
100
-        grid: {
101
-          left: "3%",
102
-          right: "4%",
103
-          bottom: "3%",
104
-          containLabel: true,
105
-        },
106
-        toolbox: {
107
-          feature: {
108
-            saveAsImage: {},
61
+    methods: {
62
+      getsearchParam(startdata, enddata, users) {
63
+        this.startdata = startdata;
64
+        this.enddata = enddata;
65
+        this.users = users;
66
+      },
67
+      initChart(
68
+        xAxisData,
69
+        seriesData1,
70
+        seriesData2,
71
+        seriesData3,
72
+        seriesData4,
73
+        seriesData5,
74
+        seriesData6,
75
+        seriesData7
76
+      ) {
77
+        const myChart = this.$echarts.init(
78
+          document.getElementById("gzbx_chart2")
79
+        );
80
+        myChart.setOption({
81
+          title: {
82
+            text: "",
109 83
           },
110
-        },
111
-        xAxis: {
112
-          type: "category",
113
-          boundaryGap: false,
114
-          data: xAxisData,
115
-        },
116
-        yAxis: {
117
-          type: "value",
118
-        },
119
-        series: [
120
-          {
121
-            name: "总量",
122
-            type: "line",
123
-            stack: "Total",
124
-            data: seriesData1,
84
+          tooltip: {
85
+            trigger: "axis",
86
+            formatter(params) {
87
+              console.log(params)
88
+              let str = params[0].name + '<br />'
89
+              params.forEach(item => {
90
+                if (item.seriesName === '总量' || item.seriesName === '完成量' || item.seriesName === '超时量' || item
91
+                  .seriesName === '满意量') {
92
+                  str += `${item.marker}${item.seriesName}: ${item.data}<br />`
93
+                } else {
94
+                  str += `${item.marker}${item.seriesName}: ${item.data}%<br />`
95
+                }
96
+              })
97
+              return "<div style='color:#fff'>"+str+"</div>"
98
+            }
125 99
           },
126
-          {
127
-            name: "完成量",
128
-            type: "line",
129
-            stack: "Total",
130
-            data: seriesData2,
100
+          legend: {
101
+            data: [
102
+              "总量",
103
+              "完成量",
104
+              "完成率",
105
+              "超时量",
106
+              "超时率",
107
+              "满意量",
108
+              "满意率",
109
+            ],
131 110
           },
132
-          {
133
-            name: "完成率",
134
-            type: "line",
135
-            stack: "Total",
136
-            data: seriesData3,
111
+          grid: {
112
+            left: "3%",
113
+            right: "4%",
114
+            bottom: "3%",
115
+            containLabel: true,
137 116
           },
138
-          {
139
-            name: "超时量",
140
-            type: "line",
141
-            stack: "Total",
142
-            data: seriesData4,
117
+          toolbox: {
118
+            feature: {
119
+              saveAsImage: {},
120
+            },
143 121
           },
144
-          {
145
-            name: "超时率",
146
-            type: "line",
147
-            stack: "Total",
148
-            data: seriesData2,
122
+          xAxis: {
123
+            type: "category",
124
+            boundaryGap: false,
125
+            data: xAxisData,
149 126
           },
150
-          {
151
-            name: "满意量",
152
-            type: "line",
153
-            stack: "Total",
154
-            data: seriesData3,
155
-          },
156
-          {
157
-            name: "满意率",
158
-            type: "line",
159
-            stack: "Total",
160
-            data: seriesData3,
161
-          },
162
-        ],
163
-      });
127
+          yAxis: [{
128
+              type: 'value',
129
+              name: '数量',
130
+              min: 0,
131
+            },
132
+            {
133
+              type: 'value',
134
+              name: '百分比',
135
+              min: 0,
136
+              // max: 100,
137
+              axisLabel: {
138
+                formatter: '{value} %'
139
+              }
140
+            }
141
+          ],
142
+          // yAxis: {
143
+          //   type: "value",
144
+          // },
145
+          series: [{
146
+              name: "总量",
147
+              type: "line",
148
+              yAxisIndex: 0,
149
+              data: seriesData1,
150
+            },
151
+            {
152
+              name: "完成量",
153
+              type: "line",
154
+              yAxisIndex: 0,
155
+              data: seriesData2,
156
+            },
157
+            {
158
+              name: "完成率",
159
+              type: "line",
160
+              yAxisIndex: 1,
161
+              data: seriesData3,
162
+            },
163
+            {
164
+              name: "超时量",
165
+              type: "line",
166
+              yAxisIndex: 0,
167
+              data: seriesData4,
168
+            },
169
+            {
170
+              name: "超时率",
171
+              type: "line",
172
+              yAxisIndex: 1,
173
+              data: seriesData5,
174
+            },
175
+            {
176
+              name: "满意量",
177
+              type: "line",
178
+              yAxisIndex: 0,
179
+              data: seriesData6,
180
+            },
181
+            {
182
+              name: "满意率",
183
+              type: "line",
184
+              yAxisIndex: 1,
185
+              data: seriesData7,
186
+            },
187
+          ],
188
+        });
189
+      },
164 190
     },
165
-  },
166
-};
191
+  };
167 192
 </script>

+ 33 - 6
CallCenterWeb.UI/RMYY/src/views/leadConcernNew/officeWorkReport/cpns/LineChart.vue

@@ -71,6 +71,18 @@ export default {
71 71
         },
72 72
         tooltip: {
73 73
           trigger: "axis",
74
+          formatter(params) {
75
+            console.log(params)
76
+            let str = params[0].name + '<br />'
77
+            params.forEach(item => {
78
+              if (item.seriesName === '总量' || item.seriesName === '完成量') {
79
+                str += `${item.marker}${item.seriesName}: ${item.data}<br />`
80
+              } else {
81
+                str += `${item.marker}${item.seriesName}: ${item.data}%<br />`
82
+              }
83
+            })
84
+            return "<div style='color:#fff'>"+str+"</div>"
85
+          }
74 86
         },
75 87
         legend: {
76 88
           data: ["总量", "完成量", "完成率"],
@@ -91,26 +103,41 @@ export default {
91 103
           boundaryGap: false,
92 104
           data: xAxisData,
93 105
         },
94
-        yAxis: {
95
-          type: "value",
96
-        },
106
+        yAxis: [{
107
+            type: 'value',
108
+            name: '数量',
109
+            min: 0,
110
+          },
111
+          {
112
+            type: 'value',
113
+            name: '百分比',
114
+            min: 0,
115
+            // max: 100,
116
+            axisLabel: {
117
+              formatter: '{value} %'
118
+            }
119
+          }
120
+        ],
121
+        // yAxis: {
122
+        //   type: "value",
123
+        // },
97 124
         series: [
98 125
           {
99 126
             name: "总量",
100 127
             type: "line",
101
-            stack: "Total",
128
+            yAxisIndex: 0,
102 129
             data: seriesData1,
103 130
           },
104 131
           {
105 132
             name: "完成量",
106 133
             type: "line",
107
-            stack: "Total",
134
+            yAxisIndex: 0,
108 135
             data: seriesData2,
109 136
           },
110 137
           {
111 138
             name: "完成率",
112 139
             type: "line",
113
-            stack: "Total",
140
+            yAxisIndex: 1,
114 141
             data: seriesData3,
115 142
           },
116 143
         ],