index.vue
5.19 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<template>
<div>
<Dec :content="content" />
<div class="test">
<div class="search">
<span>分类:</span>
<el-select v-model="classVal" size="small" style="width:120px" placeholder="请选择">
<el-option
v-for="item in classify"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<span>年级:</span>
<el-select v-model="gradeVal" size="small" style="width:120px" placeholder="请选择">
<el-option
v-for="item in grade"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<span>科目:</span>
<el-select v-model="objectVal" size="small" style="width:120px" placeholder="请选择">
<el-option
v-for="item in object"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-input
v-model="searchtext"
size="small"
placeholder="试卷名称、编号、班级名称、班级ID"
style="width:260px"
>
<i slot="suffix" class="el-input__icon el-icon-search" @click="search" />
</el-input>
</div>
<el-table
ref="multipleTable"
:data="tableData"
tooltip-effect="dark"
style="width: 100%"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="25"
/>
<el-table-column
prop="no"
width="50"
label="序号"
/>
<el-table-column
prop="testtime"
width="150"
label="考试时间"
/>
<el-table-column
prop="testno"
label="考试编号"
/>
<el-table-column
prop="testtitle"
width="200"
:show-overflow-tooltip="true"
label="试卷名称"
/>
<el-table-column
prop="classify"
label="分类"
/>
<el-table-column
prop="subject"
label="科目"
/>
<el-table-column
prop="classes"
label="班级"
/>
<el-table-column
prop="avg"
label="平均分"
/>
<el-table-column
prop="total"
label="总分"
/>
<el-table-column
prop="highest"
label="最高分"
>
<template slot-scope="scope">
<span style="color:green">{{ scope.row.highest }}</span>
</template>
</el-table-column>
<el-table-column
prop="lowest"
label="最低分"
>
<template slot-scope="scope">
<span style="color:red">{{ scope.row.lowest }}</span>
</template>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
width="150"
>
<template slot-scope="scope">
<el-button type="primary" icon="el-icon-data-line" size="small" circle @click="handleEdit(scope.$index, scope.row)" />
<el-button type="primary" icon="el-icon-document" size="small" circle @click="detail(scope.$index, scope.row)" />
<el-button type="danger" icon="el-icon-delete" size="small" circle @click="handleDelete(scope.$index, scope.row)" />
</template>
</el-table-column>
</el-table>
</div>
</div>
</template>
<script>
import Dec from '@/components/Dec'
export default {
name: 'Test',
components: {
Dec
},
data() {
return {
content: '',
classVal: '',
gradeVal: '',
objectVal: '',
searchtext: '',
classify: [{
value: '选项1',
label: '黄金糕'
}, {
value: '选项2',
label: '双皮奶'
}],
grade: [{
value: '选项1',
label: '黄金糕'
}, {
value: '选项2',
label: '双皮奶'
}],
object: [{
value: '选项1',
label: '黄金糕'
}, {
value: '选项2',
label: '双皮奶'
}],
tableData: [
{
no: '1',
testtime: '2019-12-26 12:00',
testno: '1001',
testtitle: '【第六章-经济学人】测试试卷(中)',
classify: '月考',
subject: '高中数学',
classes: '高三一班',
avg: '88',
total: '100',
highest: '98',
lowest: '23'
}
]
}
},
methods: {
search() {
},
handleEdit(index, row) {
this.$router.push('/analysis/testinfo')
console.log(index, row)
},
handleDelete(index, row) {
console.log(index, row)
},
handleSelectionChange(val) {
console.log(val)
},
detail(index, row) {
this.$router.push('/analysis/testdetail')
console.log(row)
}
}
}
</script>
<style scoped>
.test{
max-width: 1100px;
height:calc(100vh - 115px);
margin:0 auto;
background: #fff;
margin-top:15px;
padding:20px;
}
.search{
text-align: right;
font-size: 12px;
}
</style>