1
1
<template >
2
2
<div class =" main" >
3
+ <template >
4
+ <el-backtop >
5
+ <div style ="
6
+ height : 100% ;
7
+ width : 100% ;
8
+ background-color : #64c8ff ;
9
+ box-shadow : 0 0 6px rgba (0 ,0 ,0 , .12 );
10
+ text-align : center ;
11
+ line-height : 40px ;
12
+ color : #1989fa ;
13
+ border-radius : 30px ; "
14
+ ><i class =" el-icon-top" ></i >
15
+ </div >
16
+ </el-backtop >
17
+ </template >
3
18
<el-form ref =" form" label-width =" 80px"
4
19
style =" box-shadow : 0 2px 12px 0 rgba (0 , 0 , 0 , 0.1 ); padding-top : 10px ; padding-right : 20px ; padding-bottom : 3px " >
5
20
<el-form-item label =" 题目标签" >
26
41
v-model =" sortValue"
27
42
:options =" sortOptions"
28
43
:props =" { expandTrigger: 'hover' }" ></el-cascader >
29
- <el-button type =" primary" @click =" getProblemSet " style =" margin-left : 10px ; width : 120px "
44
+ <el-button type =" primary" @click =" fetchProblemSet " style =" margin-left : 10px ; width : 120px "
30
45
:loading =" loading" >拉取
31
46
</el-button >
32
47
</el-form-item >
79
94
</el-table-column >
80
95
</el-table >
81
96
</template >
97
+ <div style =" margin-top : 30px " >
98
+ 第
99
+ <el-input-number v-model =" page" :min =" 1" :max =" max_page" style =" margin-left : 15px ; margin-right : 15px "
100
+ label =" 页" :disabled =" loading" ></el-input-number >
101
+ / {{max_page}}
102
+ 页
103
+ <el-button type =" primary" style =" margin-left : 15px " icon =" el-icon-right" :loading =" loading" v-on:click =" getProblemSet" round ></el-button >
104
+ </div >
82
105
</div >
83
106
</template >
84
107
@@ -164,11 +187,17 @@ export default {
164
187
}]
165
188
}
166
189
],
167
- sortValue: [' 0' ]
190
+ sortValue: [' 0' ],
191
+ page: 1 ,
192
+ max_page: 1
168
193
}
169
194
},
170
195
171
196
methods: {
197
+ fetchProblemSet () {
198
+ this .page = 1
199
+ this .getProblemSet ()
200
+ },
172
201
getProblemSet () {
173
202
this .notFetch = true
174
203
this .loading = true
@@ -183,13 +212,15 @@ export default {
183
212
args += ' ,' + this .score [0 ] + ' -' + this .score [1 ]
184
213
else
185
214
args += ' tags=' + this .score [0 ] + ' -' + this .score [1 ]
186
- problemSet .getProblemSetList (args, (e , p ) => {
215
+ problemSet .getProblemSetList (this . page , args, (e , p , m ) => {
187
216
if (e) {
188
217
console .log (p)
189
218
this .$message .error (' 拉取失败' )
190
219
} else {
191
220
this .notFetch = false
192
221
this .problems = p
222
+ m = parseInt (m)
223
+ this .max_page = m > this .page ? m : this .page
193
224
}
194
225
this .loading = false
195
226
})
@@ -206,21 +237,22 @@ export default {
206
237
clickProblem (index ) {
207
238
console .log (this .problems [index].id )
208
239
this .$emit (' proMessage' , {contest: this .problems [index].contest , id: this .problems [index].id , next: ' 5' })
209
- }
240
+ },
210
241
}
211
242
}
212
243
</script >
213
244
214
245
<style scoped>
215
- .el-select {
216
- width : 100% ;
217
- }
218
-
219
246
.el-table .accept {
220
247
background : #64ff64 ;
221
248
}
222
249
223
250
.el-table .reject {
224
251
background : #ff6464 ;
225
252
}
253
+
254
+ .el-table tbody tr :hover > td {
255
+ background-color : #96ffff !important ;
256
+ font-weight : bolder ;
257
+ }
226
258
</style >
0 commit comments