dataView.vue
2.17 KB
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
112
113
<!-- 等级考试数据 -->
<template>
<div class="dataView">
<d2-container>
<div class="title">
数据概览
</div>
<div class="content">
<div class="left">
<LeftDataView :data-view="dataViewObj"
:query-data="queryData">
</LeftDataView>
</div>
<div class="right">
<RightDataView :data-view="dataViewObj"></RightDataView>
</div>
</div>
<div class="database">
<DataTable :data-view="dataViewObj" :query-data="queryData">
</DataTable>
</div>
</d2-container>
</div>
</template>
<script>
import { getLevelExamOverView } from "@api/serviceCentre";
import dataTable from "./components/dataTable.vue";
import leftDataView from "./components/leftView.vue";
import rightDataView from "./components/rightView.vue";
export default {
name: "dataView",
components: {
LeftDataView: leftDataView,
RightDataView: rightDataView,
DataTable: dataTable,
},
props: {
queryData: {
type: Object,
default: () => {},
},
},
data() {
return {
dataViewObj: {
submitted: 0,
avg: 0,
topPersons: [],
scoreDistributions: [],
},
};
},
watch: {
queryData: {
handler(val) {
setTimeout(() => {
this.getLevelExamOverViewData();
}, 0);
},
deep: true,
immediate: true,
},
},
mounted() {
this.getLevelExamOverViewData();
},
methods: {
async getLevelExamOverViewData() {
try {
let params = {
id: this.queryData.id,
};
let result = await getLevelExamOverView(params);
console.log(result);
this.dataViewObj = result;
} catch (err) {
this.$message.error(err?.message || "获取失败");
}
},
},
};
</script>
<style lang="scss" scoped>
.dataView {
padding: 0 20px;
.title {
height: 50px;
border-bottom: 1px solid #e5e5e5;
background: #ffffff;
color: #333333;
font-size: 16px;
font-weight: 500;
padding: 13px 0 13px 20px;
box-sizing: border-box;
}
.content {
background: #ffffff;
padding: 16px 20px;
display: flex;
width: 100%;
box-sizing: border-box;
.left {
width: calc(100% - 376px);
}
}
.database {
background: #ffffff;
}
}
</style>