liuzhihui il y a 2 ans
Parent
commit
4c99d031a6

+ 7 - 1
CallCenterWeb.UI/RMYY/src/views/leadConcernNew/cpns/LineChart.vue

@@ -83,6 +83,12 @@
83 83
           },
84 84
           tooltip: {
85 85
             trigger: "axis",
86
+            axisPointer: {
87
+              type: 'cross',
88
+              crossStyle: {
89
+                color: '#999'
90
+              }
91
+            },
86 92
             formatter(params) {
87 93
               console.log(params)
88 94
               let str = params[0].name + '<br />'
@@ -94,7 +100,7 @@
94 100
                   str += `${item.marker}${item.seriesName}: ${item.data}%<br />`
95 101
                 }
96 102
               })
97
-              return "<div style='color:#fff'>"+str+"</div>"
103
+              return "<div style='color:#fff'>" + str + "</div>"
98 104
             }
99 105
           },
100 106
           legend: {

+ 148 - 147
CallCenterWeb.UI/RMYY/src/views/leadConcernNew/officeWorkReport/cpns/LineChart.vue

@@ -1,148 +1,149 @@
1
-<template>
2
-  <div
3
-    id="gzbx_chart2"
4
-    :class="className"
5
-    :style="{ height: height, width: width }"
6
-  />
7
-</template>
8
-<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",
16
-    },
17
-    width: {
18
-      type: String,
19
-      default: "100%",
20
-    },
21
-    height: {
22
-      type: String,
23
-      default: "300px",
24
-    },
25
-    chartsTwoValue: {
26
-      type: String,
27
-      default: "1",
28
-    },
29
-    dataType: {
30
-      type: String,
31
-      default: "1",
32
-    },
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
-    initChart(xAxisData, seriesData1, seriesData2, seriesData3) {
65
-      const myChart = this.$echarts.init(
66
-        document.getElementById("gzbx_chart2")
67
-      );
68
-      myChart.setOption({
69
-        title: {
70
-          text: "",
71
-        },
72
-        tooltip: {
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
-          }
86
-        },
87
-        legend: {
88
-          data: ["总量", "完成量", "完成率"],
89
-        },
90
-        grid: {
91
-          left: "3%",
92
-          right: "4%",
93
-          bottom: "3%",
94
-          containLabel: true,
95
-        },
96
-        toolbox: {
97
-          feature: {
98
-            saveAsImage: {},
99
-          },
100
-        },
101
-        xAxis: {
102
-          type: "category",
103
-          boundaryGap: false,
104
-          data: xAxisData,
105
-        },
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
-        // },
124
-        series: [
125
-          {
126
-            name: "总量",
127
-            type: "line",
128
-            yAxisIndex: 0,
129
-            data: seriesData1,
130
-          },
131
-          {
132
-            name: "完成量",
133
-            type: "line",
134
-            yAxisIndex: 0,
135
-            data: seriesData2,
136
-          },
137
-          {
138
-            name: "完成率",
139
-            type: "line",
140
-            yAxisIndex: 1,
141
-            data: seriesData3,
142
-          },
143
-        ],
144
-      });
145
-    },
146
-  },
147
-};
1
+<template>
2
+  <div id="gzbx_chart2" :class="className" :style="{ height: height, width: width }" />
3
+</template>
4
+<script>
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
+      },
31
+    },
32
+    watch: {
33
+      chartsTwoValue: function() {
34
+        this.statisticsTopFiveReport();
35
+      },
36
+      dataType: function() {
37
+        this.statisticsTopFiveReport();
38
+      },
39
+    },
40
+    data() {
41
+      return {
42
+        gzbxData: [],
43
+        chart: null,
44
+        echartsData: [],
45
+        userNameData: [],
46
+        committedData: [],
47
+        uncommittedData: [],
48
+      };
49
+    },
50
+    mounted() {
51
+      // this.getDeptRepairReport();
52
+      // this.initChart();
53
+    },
54
+    beforeDestroy() {
55
+      if (!this.chart) {
56
+        return;
57
+      }
58
+      this.chart.dispose();
59
+      this.chart = null;
60
+    },
61
+    methods: {
62
+      initChart(xAxisData, seriesData1, seriesData2, seriesData3) {
63
+        const myChart = this.$echarts.init(
64
+          document.getElementById("gzbx_chart2")
65
+        );
66
+        myChart.setOption({
67
+          title: {
68
+            text: "",
69
+          },
70
+          tooltip: {
71
+            trigger: "axis",
72
+            axisPointer: { 
73
+              type: 'cross',
              crossStyle: {
                 color: '#999'
74
+              }
75
+            },
76
+            formatter(params) {
77
+              console.log(params)
78
+              let str = params[0].name + '<br />'
79
+              params.forEach(item => {
80
+                if (item.seriesName === '总量' || item.seriesName === '完成量') {
81
+                  str += `${item.marker}${item.seriesName}: ${item.data}<br />`
82
+                } else {
83
+                  str += `${item.marker}${item.seriesName}: ${item.data}%<br />`
84
+                }
85
+              })
86
+              return "<div style='color:#fff'>" + str + "</div>"
87
+            }
88
+          },
89
+          legend: {
90
+            data: ["总量", "完成量", "完成率"],
91
+          },
92
+          grid: {
93
+            left: "3%",
94
+            right: "4%",
95
+            bottom: "3%",
96
+            containLabel: true,
97
+          },
98
+          toolbox: {
99
+            feature: {
100
+              saveAsImage: {},
101
+            },
102
+          },
103
+          xAxis: {
104
+            type: "category",
105
+            boundaryGap: false,
106
+            data: xAxisData,
107
+          },
108
+          yAxis: [{
109
+              type: 'value',
110
+              name: '数量',
111
+              min: 0,
112
+            },
113
+            {
114
+              type: 'value',
115
+              name: '百分比',
116
+              min: 0,
117
+              // max: 100,
118
+              axisLabel: {
119
+                formatter: '{value} %'
120
+              }
121
+            }
122
+          ],
123
+          // yAxis: {
124
+          //   type: "value",
125
+          // },
126
+          series: [{
127
+              name: "总量",
128
+              type: "line",
129
+              yAxisIndex: 0,
130
+              data: seriesData1,
131
+            },
132
+            {
133
+              name: "完成量",
134
+              type: "line",
135
+              yAxisIndex: 0,
136
+              data: seriesData2,
137
+            },
138
+            {
139
+              name: "完成率",
140
+              type: "line",
141
+              yAxisIndex: 1,
142
+              data: seriesData3,
143
+            },
144
+          ],
145
+        });
146
+      },
147
+    },
148
+  };
148 149
 </script>