1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
| <template>
| <!-- 任务平均时长-->
| <div id="tasktime" class="global-content">
| <div class="width flex align-center justify-end">
| <label class="color909399 fontsiez1rem">查询日期:</label>
|
| <el-date-picker
| class="margin-right"
| v-model="pickertime"
| size="mini"
| type="daterange"
| value-format="yyyy-MM-dd"
| range-separator="至"
| start-placeholder="开始日期"
| end-placeholder="结束日期"
| >
| </el-date-picker>
| <el-button type="primary" size="mini" @click="inquer">查询</el-button>
| <el-button type="primary" size="mini" @click="linkto">跳转</el-button>
| </div>
| <div class="width height-calc90 overflow margin-top4">
| <tasktime-echart class="width height" :chartData="chartData" :colorList="colorList" />
| </div>
| </div>
| </template>
|
| <script>
| import { GetInOutAverageTime } from '@/api/reportforms';
| import { GetDateStr } from '@/utils/date';
| import TasktimeEchart from '@/views/Home/components/tasktimeecharts.vue';
| export default {
| data() {
| return {
| pickertime: [GetDateStr(-15), GetDateStr(0)],
| chartData: {},
| colorList: [
| '#0090FF',
| '#36CE9E',
| '#FFC005',
| '#FF515A',
| '#8B5CFF',
| '#00CA69',
| '#F3A43B',
| '#D7504B',
| '#C6E579',
| '#F0805A',
| '#26C0C0',
| '#660077',
| '#FFCCCC',
| '#550088',
| '#FFFFBB',
| '#99FFFF',
| '#CC00CC',
| '#CC00CC',
| '#C63300',
| '#9955FF',
| '#66FF66',
| '#B5C334',
| '#FCCE10',
| '#27727B',
| '#FE8463',
| '#FAD860',
| '#F3A43B',
| '#D7504B',
| '#C6E579',
| '#F0805A',
| '#26C0C0',
| '#660077',
| '#FFCCCC',
| '#550088',
| '#FFAA33',
| '#CC00CC',
| '#FF77FF',
| '#C63300',
| '#F4E001',
| '#66FF66'
| ]
| };
| },
| components: { TasktimeEchart },
| computed: {},
| mounted() {
| this.GetInOutAverageTime();
| },
| methods: {
| inquer() {
| this.GetInOutAverageTime();
| },
| //跳转
| linkto() {
| const { href } = this.$router.resolve({
| path: '/tasktime'
| });
| window.open(href, '_blank');
| },
| GetInOutAverageTime() {
| console.log(this.pickertime);
| let startTime = this.pickertime ? this.pickertime[0] : '';
| let endTime = this.pickertime ? this.pickertime[1] : '';
| GetInOutAverageTime({ startTime: startTime, endTime: endTime }).then(res => {
| this.chartData = res;
| });
| }
| }
| };
| </script>
|
| <style lang="scss" scoped>
| #tasktime {
| }
| </style>
|
|