seimin il y a 3 ans
Parent
commit
fb7a97f02e

+ 4 - 1
src/components/AppHeader.vue

@@ -14,7 +14,7 @@
14 14
     <!-- /头部线条及标题 -->
15 15
     <div class="app-header__content">
16 16
       <!-- 累计工单数,标本送检,患者陪检 -->
17
-      <div class="app-header__contentCumulative">
17
+      <div class="app-header__contentToday">
18 18
         <!-- 今日工单数,标本送检,陪检人次 -->
19 19
         <AppToday></AppToday>
20 20
         <!-- /今日工单数,标本送检,陪检人次 -->
@@ -204,6 +204,9 @@ export default {
204 204
     align-items: center;
205 205
     width: 100%;
206 206
     height: 0.475rem;
207
+    .app-header__contentToday{
208
+      width: 8rem;
209
+    }
207 210
     .app-header__contentNews {
208 211
       display: flex;
209 212
       justify-content: space-between;

+ 212 - 140
src/components/BusinessTypeRatio.vue

@@ -12,173 +12,240 @@ export default {
12 12
     return {
13 13
       timer: null,
14 14
       myChart: null,
15
+      associationTypeProportion: [],
15 16
       associationTypeProportionNum: [],
16
-      associationTypeProportionName: []
17
+      associationTypeProportionName: [],
18
+      associationTypeProportionAll: []
17 19
     }
18 20
   },
19 21
   methods: {
20 22
     // 画图
21 23
     draw () {
24
+      const that = this
22 25
       this.myChart = echarts.init(this.$refs.BusinessTypeRatio)
23
-      var colorArray = [
24
-        {
25
-          top: '#c2ab70', // 第一
26
-          bottom: 'rgba(194, 171, 112, 0.5)',
27
-          borderColor: '#c2ab70'
28
-        },
29
-        {
30
-          top: '#70c282', // 第二
31
-          bottom: 'rgba(112, 194, 130, 0.5)'
32
-        },
33
-        {
34
-          top: '#709cc2', // 第三
35
-          bottom: 'rgba(112, 156, 194, 0.5)'
36
-        },
37
-        {
38
-          top: '#709cc2', // 第四
39
-          bottom: 'rgba(112, 156, 194, 0.5)'
40
-        },
41
-        {
42
-          top: '#709cc2', // 第五
43
-          bottom: 'rgba(112, 156, 194, 0.5)'
44
-        }
45
-      ]
46 26
       const option = {
47 27
         tooltip: {
48
-          show: false,
49
-          formatter: '{b}:{c}'
28
+          trigger: 'item',
29
+          formatter: '{a} <br/>{b} : {c} ({d}%)'
50 30
         },
51 31
         grid: {
52
-          left: '5%',
32
+          show: false,
53 33
           top: '5%',
34
+          left: '5%',
54 35
           right: '5%',
55
-          bottom: '0%',
56
-          containLabel: true
36
+          bottom: '0%'
57 37
         },
58
-        xAxis: {
59
-          type: 'value',
60
-          show: false,
61
-          position: 'top',
62
-          max: function (value) {
63
-            return value.max * 1.5
64
-          },
65
-          axisTick: {
66
-            show: false
67
-          },
68
-          axisLine: {
69
-            show: false,
70
-            lineStyle: {
38
+        // legend: {
39
+        //   left: '20%',
40
+        //   orient: 'horizontal',
41
+        //   itemWidth: 8,
42
+        //   itemHeight: 8,
43
+        //   icon: 'rect',
44
+        //   bottom: '0%',
45
+        //   data: this.associationTypeProportionName,
46
+        //   textStyle: {
47
+        //     color: '#fff'
48
+        //   },
49
+        //   formatter (name) {
50
+        //     const arr = that.associationTypeProportionAll.filter(item => item[0] === name)
51
+        //     return `${name} ${arr[0][1]}单 ${arr[0][2]}%`
52
+        //   }
53
+        // },
54
+        legend: [
55
+          {
56
+            right: '55%',
57
+            orient: 'horizontal',
58
+            itemWidth: 8,
59
+            itemHeight: 8,
60
+            icon: 'rect',
61
+            bottom: '20%',
62
+            data: this.associationTypeProportionName.slice(
63
+              0,
64
+              Math.ceil(this.associationTypeProportionName.length / 2)
65
+            ),
66
+            textStyle: {
71 67
               color: '#fff'
68
+            },
69
+            formatter (name) {
70
+              const arr = that.associationTypeProportionAll.filter(
71
+                (item) => item[0] === name
72
+              )
73
+              return `${name} ${arr[0][1]}单 ${arr[0][2]}%`
72 74
             }
73 75
           },
74
-          splitLine: {
75
-            show: false
76
-          }
77
-        },
78
-        yAxis: [
79 76
           {
80
-            type: 'category',
81
-            axisTick: {
82
-              show: false,
83
-              alignWithLabel: false,
84
-              length: 5
85
-            },
86
-            splitLine: {
87
-              // 网格线
88
-              show: false
77
+            left: '55%',
78
+            orient: 'horizontal',
79
+            itemWidth: 8,
80
+            itemHeight: 8,
81
+            icon: 'rect',
82
+            bottom: '24%',
83
+            data: this.associationTypeProportionName.slice(
84
+              Math.ceil(this.associationTypeProportionName.length / 2),
85
+              this.associationTypeProportionName.length
86
+            ),
87
+            textStyle: {
88
+              color: '#fff'
89 89
             },
90
-            inverse: 'true', // 排序
91
-            axisLine: {
92
-              show: false,
93
-              lineStyle: {
94
-                color: '#fff'
90
+            formatter (name) {
91
+              const arr = that.associationTypeProportionAll.filter(
92
+                (item) => item[0] === name
93
+              )
94
+              return `${name} ${arr[0][1]}单 ${arr[0][2]}%`
95
+            }
96
+          }
97
+        ],
98
+        color: [
99
+          {
100
+            type: 'linear',
101
+            x: 0,
102
+            y: 0,
103
+            x2: 0,
104
+            y2: 1,
105
+            colorStops: [
106
+              {
107
+                offset: 0,
108
+                color: '#c27073' // 0% 处的颜色
109
+              },
110
+              {
111
+                offset: 1,
112
+                color: 'rgba(194, 112, 115, 0.5)' // 100% 处的颜色
95 113
               }
96
-            },
97
-            data: this.associationTypeProportionName
114
+            ],
115
+            global: false // 缺省为 false
116
+          },
117
+          {
118
+            type: 'linear',
119
+            x: 0,
120
+            y: 0,
121
+            x2: 0,
122
+            y2: 1,
123
+            colorStops: [
124
+              {
125
+                offset: 0,
126
+                color: '#c2ab70' // 0% 处的颜色
127
+              },
128
+              {
129
+                offset: 1,
130
+                color: 'rgba(194, 171, 112, 0.5)' // 100% 处的颜色
131
+              }
132
+            ],
133
+            global: false // 缺省为 false
134
+          },
135
+          {
136
+            type: 'linear',
137
+            x: 0,
138
+            y: 0,
139
+            x2: 0,
140
+            y2: 1,
141
+            colorStops: [
142
+              {
143
+                offset: 0,
144
+                color: '#70c2ab' // 0% 处的颜色
145
+              },
146
+              {
147
+                offset: 1,
148
+                color: 'rgba(112, 194, 171, 0.5)' // 100% 处的颜色
149
+              }
150
+            ],
151
+            global: false // 缺省为 false
152
+          },
153
+          {
154
+            type: 'linear',
155
+            x: 0,
156
+            y: 0,
157
+            x2: 0,
158
+            y2: 1,
159
+            colorStops: [
160
+              {
161
+                offset: 0,
162
+                color: '#70c282' // 0% 处的颜色
163
+              },
164
+              {
165
+                offset: 1,
166
+                color: 'rgba(112, 194, 130, 0.5)' // 100% 处的颜色
167
+              }
168
+            ],
169
+            global: false // 缺省为 false
170
+          },
171
+          {
172
+            type: 'linear',
173
+            x: 0,
174
+            y: 0,
175
+            x2: 0,
176
+            y2: 1,
177
+            colorStops: [
178
+              {
179
+                offset: 0,
180
+                color: '#9cc270' // 0% 处的颜色
181
+              },
182
+              {
183
+                offset: 1,
184
+                color: 'rgba(156, 194, 112, 0.5)' // 100% 处的颜色
185
+              }
186
+            ],
187
+            global: false // 缺省为 false
188
+          },
189
+          {
190
+            type: 'linear',
191
+            x: 0,
192
+            y: 0,
193
+            x2: 0,
194
+            y2: 1,
195
+            colorStops: [
196
+              {
197
+                offset: 0,
198
+                color: '#709cc2' // 0% 处的颜色
199
+              },
200
+              {
201
+                offset: 1,
202
+                color: 'rgba(112, 156, 194, 0.5)' // 100% 处的颜色
203
+              }
204
+            ],
205
+            global: false // 缺省为 false
206
+          },
207
+          {
208
+            type: 'linear',
209
+            x: 0,
210
+            y: 0,
211
+            x2: 0,
212
+            y2: 1,
213
+            colorStops: [
214
+              {
215
+                offset: 0,
216
+                color: '#c270b0' // 0% 处的颜色
217
+              },
218
+              {
219
+                offset: 1,
220
+                color: 'rgba(194, 112, 176, 0.5)' // 100% 处的颜色
221
+              }
222
+            ],
223
+            global: false // 缺省为 false
98 224
           }
99 225
         ],
100 226
         series: [
101 227
           {
102
-            name: 'xxx',
103
-            type: 'bar',
228
+            name: '数据统计',
229
+            type: 'pie',
230
+            center: ['50%', '35%'],
231
+            roseType: 'radius',
104 232
             label: {
105 233
               normal: {
106
-                show: true,
107
-                position: [330, 0],
108
-                formatter: '{c}单',
109
-                textStyle: {
110
-                  color: '#fff'
111
-                }
234
+                show: false
235
+              },
236
+              emphasis: {
237
+                show: false
112 238
               }
113 239
             },
114
-            itemStyle: {
240
+            lableLine: {
115 241
               normal: {
116
-                show: true,
117
-                color: function (params) {
118
-                  const num = colorArray.length
119
-                  return {
120
-                    type: 'linear',
121
-                    colorStops: [
122
-                      {
123
-                        offset: 0,
124
-                        color: colorArray[params.dataIndex % num].bottom
125
-                      },
126
-                      {
127
-                        offset: 1,
128
-                        color: colorArray[params.dataIndex % num].top
129
-                      },
130
-                      {
131
-                        offset: 0,
132
-                        color: colorArray[params.dataIndex % num].bottom
133
-                      },
134
-                      {
135
-                        offset: 1,
136
-                        color: colorArray[params.dataIndex % num].top
137
-                      },
138
-                      {
139
-                        offset: 0,
140
-                        color: colorArray[params.dataIndex % num].bottom
141
-                      },
142
-                      {
143
-                        offset: 1,
144
-                        color: colorArray[params.dataIndex % num].top
145
-                      },
146
-                      {
147
-                        offset: 0,
148
-                        color: colorArray[params.dataIndex % num].bottom
149
-                      },
150
-                      {
151
-                        offset: 1,
152
-                        color: colorArray[params.dataIndex % num].top
153
-                      },
154
-                      {
155
-                        offset: 0,
156
-                        color: colorArray[params.dataIndex % num].bottom
157
-                      },
158
-                      {
159
-                        offset: 1,
160
-                        color: colorArray[params.dataIndex % num].top
161
-                      },
162
-                      {
163
-                        offset: 0,
164
-                        color: colorArray[params.dataIndex % num].bottom
165
-                      },
166
-                      {
167
-                        offset: 1,
168
-                        color: colorArray[params.dataIndex % num].top
169
-                      }
170
-                    ]
171
-                  }
172
-                },
173
-                barBorderRadius: 70,
174
-                borderWidth: 0,
175
-                borderColor: '#333'
242
+                show: false
243
+              },
244
+              emphasis: {
245
+                show: true
176 246
               }
177 247
             },
178
-            barGap: '0%',
179
-            barCategoryGap: '70%',
180
-            barWidth: 8,
181
-            data: this.associationTypeProportionNum
248
+            data: this.associationTypeProportion
182 249
           }
183 250
         ]
184 251
       }
@@ -186,17 +253,22 @@ export default {
186 253
     },
187 254
     // 获取数据
188 255
     async getData () {
189
-      const srartTime = this.$moment().format('YYYY-MM-DD') // 今天
256
+      const srartTime = this.$moment()
257
+        .subtract(29, 'days')
258
+        .format('YYYY-MM-DD') // 近三十天
190 259
       const endTime = this.$moment().format('YYYY-MM-DD') // 今天
191 260
       const result = await post(
192
-        `/largeScreen/getData/getTasktypeTop5/${this.hospitalId}`,
261
+        `/largeScreen/getData/associationTypeProportion/${this.hospitalId}`,
193 262
         { srartTime, endTime }
194 263
       )
195 264
       this.associationTypeProportionNum = []
196 265
       this.associationTypeProportionName = []
197
-      result.list.forEach((item) => {
266
+      this.associationTypeProportion = []
267
+      this.associationTypeProportionAll = result.associationTypeProportion
268
+      result.associationTypeProportion.forEach((item) => {
198 269
         this.associationTypeProportionNum.push(item[1]) // 获取到的数据
199 270
         this.associationTypeProportionName.push(item[0]) // 获取到的名称
271
+        this.associationTypeProportion.push({ value: item[1], name: item[0] }) // 获取到的名称
200 272
       })
201 273
       this.draw()
202 274
       this.polling()
@@ -220,7 +292,7 @@ export default {
220 292
 
221 293
 <style lang="less">
222 294
 .business-type-ratio {
223
-  height: 5rem;
295
+  height: 7rem;
224 296
   margin: 0 auto;
225 297
 }
226 298
 </style>

+ 9 - 17
src/components/TimeUtilization.vue

@@ -23,7 +23,7 @@ export default {
23 23
 
24 24
       const option = {
25 25
         title: {
26
-          text: '时间利用率(%)',
26
+          text: '工单数量(单)',
27 27
           top: 5,
28 28
           left: 15,
29 29
           textStyle: {
@@ -56,9 +56,9 @@ export default {
56 56
         },
57 57
         yAxis: [
58 58
           {
59
-            max: 1,
60
-            min: 0,
61
-            interval: 0.25,
59
+            max: function (value) {
60
+              return value.max * 1.5
61
+            },
62 62
             axisTick: {
63 63
               show: false
64 64
             },
@@ -68,9 +68,6 @@ export default {
68 68
               }
69 69
             },
70 70
             axisLabel: {
71
-              formatter (value) {
72
-                return value * 100
73
-              },
74 71
               textStyle: {
75 72
                 color: '#d4d6d7',
76 73
                 fontSize: 12
@@ -140,22 +137,17 @@ export default {
140 137
     },
141 138
     // 获取数据
142 139
     async getData () {
143
-      const srartTime = this.$moment()
144
-        .subtract(29, 'days')
145
-        .format('YYYY-MM-DD') // 近三十天
140
+      const srartTime = this.$moment().format('YYYY-MM-DD') // 今天
146 141
       const endTime = this.$moment().format('YYYY-MM-DD') // 今天
147 142
       const result = await post(
148
-        `/largeScreen/getData/groupWorkRatio/${this.hospitalId}`,
143
+        `/largeScreen/getData/getTasktypeTop5/${this.hospitalId}`,
149 144
         { srartTime, endTime }
150 145
       )
151 146
       this.groupWorkRatioNum = []
152 147
       this.groupWorkRatioName = []
153
-      if (result.groutWorkRatio.length > 5) {
154
-        result.groutWorkRatio = result.groutWorkRatio.slice(0, 5)
155
-      }
156
-      result.groutWorkRatio.forEach(item => {
157
-        this.groupWorkRatioNum.push(item[1] / 100) // 获取到的数据
158
-        this.groupWorkRatioName.push(item[2]) // 获取到的名称
148
+      result.list.forEach(item => {
149
+        this.groupWorkRatioNum.push(item[1]) // 获取到的数据
150
+        this.groupWorkRatioName.push(item[0]) // 获取到的名称
159 151
       })
160 152
       this.draw()
161 153
       this.polling()

+ 6 - 6
src/views/AppIndex.vue

@@ -17,9 +17,9 @@
17 17
               <h2 class="app-item__header">科室当日建单TOP10</h2>
18 18
               <GroupPerformance></GroupPerformance>
19 19
             </div>
20
-            <!-- 近三十天各小组人员工作时间利用率 -->
20
+            <!-- 当日任务类型TOP5 -->
21 21
             <div class="app-item">
22
-              <h2 class="app-item__header">近三十天各小组人员工作时间利用率</h2>
22
+              <h2 class="app-item__header">当日任务类型TOP5</h2>
23 23
               <TimeUtilization></TimeUtilization>
24 24
             </div>
25 25
           </aside>
@@ -79,9 +79,9 @@
79 79
               <h2 class="app-item__header">近三十天人员按时到达率排行榜</h2>
80 80
               <OnTimeArrivalRate></OnTimeArrivalRate>
81 81
             </div>
82
-            <!-- 当日任务类型TOP5 -->
82
+            <!-- 近三十天各业务类型占比 -->
83 83
             <div class="app-item">
84
-              <h2 class="app-item__header">当日任务类型TOP5</h2>
84
+              <h2 class="app-item__header">近三十天各业务类型占比</h2>
85 85
               <BusinessTypeRatio></BusinessTypeRatio>
86 86
             </div>
87 87
           </aside>
@@ -112,10 +112,10 @@ export default {
112 112
     OnDutyToday, // 今日各人员工作情况
113 113
     TodayWorkOrder, // 当日工单趋势图
114 114
     PointsRanking, // 近三十天人员积分排行榜
115
-    BusinessTypeRatio, // 当日任务类型TOP5
115
+    BusinessTypeRatio, // 近三十天各业务类型占比
116 116
     ErrorWorkOrder, // 今日工单异常情况
117 117
     DeliveryRate, // 近三十天各类型工单按时送达率趋势
118
-    TimeUtilization, // 近三十天各小组人员工作时间利用率
118
+    TimeUtilization, // 当日任务类型TOP5
119 119
     OnTimeArrivalRate// 近三十天人员按时到达率排行榜
120 120
   },
121 121
   data () {