|
@@ -9,7 +9,7 @@
|
9
|
9
|
|
10
|
10
|
<el-row class="sec" type="flex" justify="space-between" :gutter="20">
|
11
|
11
|
<el-col :span="12">
|
12
|
|
- <el-card style="height:488px">
|
|
12
|
+ <el-card style="height:496px">
|
13
|
13
|
<div slot="header">
|
14
|
14
|
<span>各学期总人数柱状图</span>
|
15
|
15
|
</div>
|
|
@@ -17,7 +17,7 @@
|
17
|
17
|
</el-card>
|
18
|
18
|
</el-col>
|
19
|
19
|
<el-col :span="12">
|
20
|
|
- <el-card style="height:488px">
|
|
20
|
+ <el-card style="height:496px">
|
21
|
21
|
<div slot="header">
|
22
|
22
|
<span>班级人数列表</span>
|
23
|
23
|
</div>
|
|
@@ -50,30 +50,13 @@
|
50
|
50
|
|
51
|
51
|
<el-row class="sec" type="flex" justify="space-between" :gutter="20">
|
52
|
52
|
<el-col :span="12">
|
53
|
|
- <el-card>
|
54
|
|
- <div slot="header">
|
55
|
|
- <span>{{ radio2 }}签到率折线图</span>
|
56
|
|
- </div>
|
57
|
|
- <el-radio-group v-model="radio2" style="margin-right:32px" @change="handleChangeDate">
|
58
|
|
- <el-radio-button label="每日" />
|
59
|
|
- <el-radio-button label="每周" />
|
60
|
|
- <el-radio-button label="每月" />
|
61
|
|
- </el-radio-group>
|
62
|
|
- <line-chart :value="lineData" />
|
63
|
|
- </el-card>
|
64
|
|
- </el-col>
|
65
|
|
- <el-col :span="11">
|
66
|
|
- <el-card>
|
|
53
|
+ <el-card style="height:496px">
|
67
|
54
|
<div slot="header">
|
68
|
55
|
<span>年龄分布图</span>
|
69
|
56
|
</div>
|
70
|
|
- <el-radio-group v-model="radio1" style="margin-right:32px" @change="handleChange">
|
71
|
|
- <el-radio-button label="学期" />
|
72
|
|
- <el-radio-button label="班级" />
|
73
|
|
- </el-radio-group>
|
74
|
|
- <div v-if="radio1==='学期'" style="display: inline-block;">
|
|
57
|
+ <div style="display: inline-block;">
|
75
|
58
|
学期名称:
|
76
|
|
- <el-select v-model="termId" filterable placeholder="请选择" @change="changeTerm">
|
|
59
|
+ <el-select v-model="termId2" filterable placeholder="请选择" @change="changeTermAge">
|
77
|
60
|
<el-option
|
78
|
61
|
v-for="item in options"
|
79
|
62
|
:key="item.termId"
|
|
@@ -82,24 +65,26 @@
|
82
|
65
|
/>
|
83
|
66
|
</el-select>
|
84
|
67
|
</div>
|
85
|
|
- <div v-else style="display: inline-block;">
|
86
|
|
- 班级名称:
|
87
|
|
- <el-select v-model="classId" filterable placeholder="请选择" @change="changeClass">
|
88
|
|
- <el-option
|
89
|
|
- v-for="item in classOptions"
|
90
|
|
- :key="item.classId"
|
91
|
|
- :label="item.name"
|
92
|
|
- :value="item.classId"
|
93
|
|
- />
|
94
|
|
- </el-select>
|
|
68
|
+ <pie-chart :option="current" :value="ageData" style="margin-top:32px" />
|
|
69
|
+ </el-card>
|
|
70
|
+ </el-col>
|
|
71
|
+ <el-col :span="12">
|
|
72
|
+ <el-card style="height:496px">
|
|
73
|
+ <div slot="header">
|
|
74
|
+ <span>{{ radio }}签到率折线图</span>
|
95
|
75
|
</div>
|
96
|
|
- <pie-chart :option="current" style="margin-top:32px" />
|
|
76
|
+ <el-radio-group v-model="radio" style="margin-right:32px" @change="handleChangeDate">
|
|
77
|
+ <el-radio-button label="每日" />
|
|
78
|
+ <el-radio-button label="每周" />
|
|
79
|
+ <el-radio-button label="每月" />
|
|
80
|
+ </el-radio-group>
|
|
81
|
+ <line-chart :value="lineData" />
|
97
|
82
|
</el-card>
|
98
|
83
|
</el-col>
|
99
|
84
|
</el-row>
|
100
|
85
|
<el-row class="sec" type="flex" justify="space-between" :gutter="20">
|
101
|
|
- <el-col :span="12">
|
102
|
|
- <el-card>
|
|
86
|
+ <el-col :span="24">
|
|
87
|
+ <el-card style="height:496px">
|
103
|
88
|
<div slot="header">
|
104
|
89
|
<span>各培训签到率柱状图</span>
|
105
|
90
|
</div>
|
|
@@ -114,7 +99,7 @@
|
114
|
99
|
import { mapGetters } from 'vuex'
|
115
|
100
|
import { getSchoolTermList } from '@/api/schoolTerm'
|
116
|
101
|
import { getSchoolClassList } from '@/api/schoolClass'
|
117
|
|
-import { getStudentTermTotalList, getStudentclassTotalList, getStudentAgeTotalList } from '@/api/dashboard'
|
|
102
|
+import { getStudentTermTotalList, getStudentclassTotalList, getStudentAgeTotalList, getSigninRatioList } from '@/api/dashboard'
|
118
|
103
|
|
119
|
104
|
export default {
|
120
|
105
|
name: 'Dashboard',
|
|
@@ -127,10 +112,10 @@ export default {
|
127
|
112
|
data() {
|
128
|
113
|
return {
|
129
|
114
|
total: { reg: 972 },
|
130
|
|
- radio1: '学期',
|
131
|
|
- radio2: '每日',
|
|
115
|
+ radio: '每日',
|
132
|
116
|
options: [],
|
133
|
117
|
termId: undefined,
|
|
118
|
+ termId2: undefined,
|
134
|
119
|
current: { name: undefined },
|
135
|
120
|
classId: undefined,
|
136
|
121
|
lineData: [],
|
|
@@ -225,19 +210,17 @@ export default {
|
225
|
210
|
}
|
226
|
211
|
],
|
227
|
212
|
termData: [],
|
228
|
|
- signData: [
|
229
|
|
- ['2021年十月第一次签到', '2021年十月第二次签到', '2021年十月第三次签到', '2021年十一月第一次签到', '2021年十二月第二次签到', '2022年一月第一次签到', '2022年二月第一次签到', '2022年二月第二次签到',
|
230
|
|
- '2021年十月第一次签到', '2021年十月第二次签到', '2021年十月第三次签到', '2021年十一月第一次签到', '2021年十二月第二次签到', '2022年一月第一次签到', '2022年二月第一次签到', '2022年二月第二次签到',
|
231
|
|
- '2021年十月第一次签到', '2021年十月第二次签到', '2021年十月第三次签到', '2021年十一月第一次签到', '2021年十二月第二次签到', '2022年一月第一次签到', '2022年二月第一次签到', '2022年二月第二次签到'
|
232
|
|
- ],
|
233
|
|
- [97, 25, 50, 70, 22, 90, 77, 86, 97, 25, 50, 70, 22, 90, 77, 86, 97, 25, 50, 70, 22, 90, 77, 86]
|
234
|
|
- ],
|
|
213
|
+ signData: [],
|
235
|
214
|
|
|
215
|
+ // 表格分页数据
|
236
|
216
|
allData: [],
|
237
|
217
|
tableData: [],
|
238
|
218
|
pageSize: 5,
|
239
|
219
|
currentPage: 1,
|
240
|
|
- Total: 0 // 条目总数
|
|
220
|
+ Total: 0, // 条目总数
|
|
221
|
+
|
|
222
|
+ // 年龄分布数据
|
|
223
|
+ ageData: []
|
241
|
224
|
}
|
242
|
225
|
},
|
243
|
226
|
computed: {
|
|
@@ -248,6 +231,7 @@ export default {
|
248
|
231
|
this.options = res.data.records
|
249
|
232
|
this.current.name = res.data.records[0].name
|
250
|
233
|
this.termId = res.data.records[0].termId
|
|
234
|
+ this.termId2 = res.data.records[0].termId
|
251
|
235
|
getStudentclassTotalList({ termId: this.termId }).then(res => {
|
252
|
236
|
this.Total = res.data.length
|
253
|
237
|
this.allData = res.data
|
|
@@ -257,6 +241,12 @@ export default {
|
257
|
241
|
}
|
258
|
242
|
}
|
259
|
243
|
})
|
|
244
|
+ getStudentAgeTotalList({ termId: this.termId2 }).then((res) => {
|
|
245
|
+ const list = res.data
|
|
246
|
+ list.map(item => {
|
|
247
|
+ this.ageData.push({ value: parseInt(item.value), name: item.key })
|
|
248
|
+ })
|
|
249
|
+ })
|
260
|
250
|
})
|
261
|
251
|
getSchoolClassList().then((res) => {
|
262
|
252
|
this.classOptions = res.data.records
|
|
@@ -272,8 +262,15 @@ export default {
|
272
|
262
|
this.termData.push(arr1)
|
273
|
263
|
this.termData.push(arr2)
|
274
|
264
|
})
|
275
|
|
- getStudentAgeTotalList().then((res) => {
|
276
|
|
-
|
|
265
|
+ getSigninRatioList().then(res => {
|
|
266
|
+ const arr1 = []
|
|
267
|
+ const arr2 = []
|
|
268
|
+ res.data.map(item => {
|
|
269
|
+ arr1.push(item.key)
|
|
270
|
+ arr2.push(item.value)
|
|
271
|
+ })
|
|
272
|
+ this.signData.push(arr1)
|
|
273
|
+ this.signData.push(arr2)
|
277
|
274
|
})
|
278
|
275
|
},
|
279
|
276
|
methods: {
|
|
@@ -294,16 +291,7 @@ export default {
|
294
|
291
|
case '每月': this.lineData = this.monthData; break
|
295
|
292
|
default: break
|
296
|
293
|
}
|
297
|
|
- this.radio2 = val
|
298
|
|
- },
|
299
|
|
- handleChange(val) {
|
300
|
|
- if (val === '学期') {
|
301
|
|
- this.termId = this.options[0].termId
|
302
|
|
- this.current.name = this.options[0].name
|
303
|
|
- } else {
|
304
|
|
- this.classId = this.classOptions[0].classId
|
305
|
|
- this.current.name = this.classOptions[0].name
|
306
|
|
- }
|
|
294
|
+ this.radio = val
|
307
|
295
|
},
|
308
|
296
|
changeTerm(val) {
|
309
|
297
|
getStudentclassTotalList({ termId: val }).then(res => {
|
|
@@ -316,11 +304,20 @@ export default {
|
316
|
304
|
}
|
317
|
305
|
}
|
318
|
306
|
})
|
319
|
|
- // this.options.map((item) => {
|
320
|
|
- // if (item.termId === val) {
|
321
|
|
- // this.current.name = item.name
|
322
|
|
- // }
|
323
|
|
- // })
|
|
307
|
+ },
|
|
308
|
+ changeTermAge(val) {
|
|
309
|
+ this.ageData = []
|
|
310
|
+ getStudentAgeTotalList({ termId: val }).then((res) => {
|
|
311
|
+ const list = res.data
|
|
312
|
+ list.map(item => {
|
|
313
|
+ this.ageData.push({ value: parseInt(item.value), name: item.key })
|
|
314
|
+ })
|
|
315
|
+ })
|
|
316
|
+ this.options.map((item) => {
|
|
317
|
+ if (item.termId === val) {
|
|
318
|
+ this.current.name = item.name
|
|
319
|
+ }
|
|
320
|
+ })
|
324
|
321
|
},
|
325
|
322
|
changeClass(val) {
|
326
|
323
|
this.classOptions.map((item) => {
|