|
@@ -81,7 +81,7 @@
|
81
|
81
|
</div>
|
82
|
82
|
<div class="tableTitle">统计表</div>
|
83
|
83
|
<el-table class='statisticsTable' :data="tableData" height="250" border style="width: 100">
|
84
|
|
- <el-table-column align="center" prop="date" label="医护姓名" width="100">
|
|
84
|
+ <el-table-column fixed align="center" prop="date" label="医护姓名" width="100">
|
85
|
85
|
<template slot-scope="scope">
|
86
|
86
|
<span>{{scope.row.user_name}}</span>
|
87
|
87
|
</template>
|
|
@@ -178,21 +178,10 @@ export default {
|
178
|
178
|
data: [],
|
179
|
179
|
barWidth: 30,
|
180
|
180
|
label: {
|
181
|
|
- normal: {
|
182
|
|
- show: true,
|
183
|
|
- position: "top",
|
184
|
|
- formatter: (params) => {
|
185
|
|
- if(this.percent.length > 0){
|
186
|
|
- let str = ''
|
187
|
|
- str = params.data + '('+ this.percent[params.dataIndex] +'%)'
|
188
|
|
- return str
|
189
|
|
- }else{
|
190
|
|
- let str = ''
|
191
|
|
- str = params.data
|
192
|
|
- return str
|
193
|
|
- }
|
|
181
|
+ normal: {
|
|
182
|
+ show: true,
|
|
183
|
+ position: "top",
|
194
|
184
|
}
|
195
|
|
- }
|
196
|
185
|
},
|
197
|
186
|
//配置样式
|
198
|
187
|
itemStyle: {
|
|
@@ -279,8 +268,7 @@ export default {
|
279
|
268
|
// 获取统计表的数据
|
280
|
269
|
this.getlist()
|
281
|
270
|
|
282
|
|
- //获取统计图数据
|
283
|
|
- this.getchartlist()
|
|
271
|
+
|
284
|
272
|
|
285
|
273
|
},
|
286
|
274
|
methods:{
|
|
@@ -297,6 +285,8 @@ export default {
|
297
|
285
|
this.doctorlist.push(...doctorlist)
|
298
|
286
|
|
299
|
287
|
console.log("医护列表",this.doctorlist)
|
|
288
|
+ //获取统计图数据
|
|
289
|
+ this.getchartlist()
|
300
|
290
|
}
|
301
|
291
|
|
302
|
292
|
})
|
|
@@ -723,11 +713,45 @@ export default {
|
723
|
713
|
//获取统计图数据
|
724
|
714
|
getchartlist(){
|
725
|
715
|
getchartlist().then(response=>{
|
726
|
|
- if(response.data.state == 1){
|
727
|
|
- var workdaylist = response.data.data.workDaylist
|
728
|
|
- console.log("早年公共",workdaylist)
|
729
|
|
- }
|
|
716
|
+ if(response.data.state == 1){
|
|
717
|
+ var workdaylist = response.data.data.workDaylist
|
|
718
|
+ console.log("早年公共",workdaylist)
|
|
719
|
+
|
|
720
|
+
|
|
721
|
+ let arr = [...workdaylist]
|
|
722
|
+
|
|
723
|
+ arr.sort(this.compare('doctor_id'))
|
|
724
|
+ this.doctorlist.sort(this.compare('admin_user_id'))
|
|
725
|
+ this.doctorlist.forEach((item, index) => {
|
|
726
|
+ if (arr[index] && item.admin_user_id == arr[index].doctor_id) {
|
|
727
|
+
|
|
728
|
+ }else{
|
|
729
|
+ arr.splice(index, 0, {user_name: item.user_name, doctor_id: item.admin_user_id,workminute: 0})
|
|
730
|
+ }
|
|
731
|
+ })
|
|
732
|
+ console.log('arrrrrrrrrrrrrrr',arr)
|
|
733
|
+
|
|
734
|
+ let chartX = []
|
|
735
|
+ let chartY = []
|
|
736
|
+ arr.map(item => {
|
|
737
|
+ chartX.push(item.user_name)
|
|
738
|
+ chartY.push(item.workminute / 60)
|
|
739
|
+ })
|
|
740
|
+ this.chart.xAxis.data = chartX
|
|
741
|
+ this.chart.series[0].data = chartY
|
|
742
|
+
|
|
743
|
+ this.getArrLength(this.chart.xAxis.data)
|
|
744
|
+ }
|
730
|
745
|
})
|
|
746
|
+ },
|
|
747
|
+ getArrLength(result){
|
|
748
|
+ if(result.length > 10){
|
|
749
|
+ var dataZoom_end = (10/result.length)*100;
|
|
750
|
+ this.chart.dataZoom[0].end = dataZoom_end
|
|
751
|
+ }else{
|
|
752
|
+ var dataZoom_end = 100;
|
|
753
|
+ this.chart.dataZoom[0].end = dataZoom_end
|
|
754
|
+ }
|
731
|
755
|
}
|
732
|
756
|
}
|
733
|
757
|
}
|