@@ -28,7 +28,7 @@ import emptyQueueImage from 'assets/emptyQueue.webp';
28
28
import { isCancel } from 'axios' ;
29
29
import { useNotUndefinedContext } from '../../../notUndefinedContext' ;
30
30
import { MyInfoContext } from '../../contexts' ;
31
- import { oldDifficultySystem } from '../../../constants' ;
31
+ import { ArticleCategory , oldDifficultySystem } from '../../../constants' ;
32
32
import { getArticle , submitArticleCheckResult } from '../../../fetch' ;
33
33
import {
34
34
ErrorDiv ,
@@ -55,6 +55,7 @@ export default function Article() {
55
55
const [ viewSourceCode , setViewSourceCode ] = useState ( false ) ;
56
56
const myProfile = useNotUndefinedContext ( MyInfoContext ) ;
57
57
const [ showHistory , setShowHistory ] = useState ( false ) ;
58
+ const [ solutionOnly , setSolutionOnly ] = useState ( true ) ;
58
59
59
60
let refuseCommit = otherRefuseCommit ;
60
61
if ( refuseCommit )
@@ -63,7 +64,9 @@ export default function Article() {
63
64
64
65
useEffect ( ( ) => {
65
66
const cancel = new AbortController ( ) ;
66
- getArticle ( skipBefore / 1000 , { signal : cancel . signal } )
67
+ getArticle ( skipBefore / 1000 , solutionOnly ? [ 2 ] : [ ] , {
68
+ signal : cancel . signal
69
+ } )
67
70
. then ( v => {
68
71
setStatus ( { details : v } ) ,
69
72
v . article && setSkipBefore ( v . article . promoteResult . updateAt * 1000 ) ;
@@ -76,7 +79,7 @@ export default function Article() {
76
79
} , [ ] ) ;
77
80
function updateArticle ( ) {
78
81
setStatus ( null ) ;
79
- getArticle ( skipBefore / 1000 )
82
+ getArticle ( skipBefore / 1000 , solutionOnly ? [ 2 ] : [ ] )
80
83
. then ( v => {
81
84
setStatus ( { details : v } ) ;
82
85
if ( v . article ) setSkipBefore ( v . article . promoteResult . updateAt * 1000 ) ;
@@ -175,32 +178,35 @@ export default function Article() {
175
178
{ details . article . lid }
176
179
</ Link >
177
180
</ Text >
178
- { details . article . solutionFor && (
179
- < Text >
180
- 关联于题目{ ' ' }
181
- < ProblemNameWithDifficulty
182
- pid = { details . article . solutionFor . pid }
183
- name = { details . article . solutionFor . title }
184
- difficulty = { oldDifficultySystem . findIndex (
185
- x => x >= details . article . solutionFor ! . difficulty
181
+ < Text >
182
+ 文章分类:{ ArticleCategory [ details . article . category ] } 。
183
+ { details . article . solutionFor && (
184
+ < >
185
+ 关联于题目{ ' ' }
186
+ < ProblemNameWithDifficulty
187
+ pid = { details . article . solutionFor . pid }
188
+ name = { details . article . solutionFor . title }
189
+ difficulty = { oldDifficultySystem . findIndex (
190
+ x => x >= details . article . solutionFor ! . difficulty
191
+ ) }
192
+ />
193
+ 。
194
+ { details . countForProblem && (
195
+ < >
196
+ 共有 { details . countForProblem . pending } 篇待审核题解,
197
+ { details . countForProblem . available } 篇
198
+ < Link
199
+ href = { `https://www.luogu.com.cn/problem/solution/${ details . article . solutionFor . pid } ` }
200
+ target = "_blank"
201
+ >
202
+ 已通过题解
203
+ </ Link >
204
+ 。
205
+ </ >
186
206
) }
187
- />
188
- 。
189
- { details . countForProblem && (
190
- < >
191
- 共有 { details . countForProblem . pending } 篇待审核题解,
192
- { details . countForProblem . available } 篇
193
- < Link
194
- href = { `https://www.luogu.com.cn/problem/solution/${ details . article . solutionFor . pid } ` }
195
- target = "_blank"
196
- >
197
- 已通过题解
198
- </ Link >
199
- 。
200
- </ >
201
- ) }
202
- </ Text >
203
- ) }
207
+ </ >
208
+ ) }
209
+ </ Text >
204
210
< div className = "adminCommit" >
205
211
< Text > 管理员备注:</ Text >
206
212
< textarea
@@ -261,6 +267,11 @@ export default function Article() {
261
267
</ Field >
262
268
< div className = "submitButton" >
263
269
< Text as = "span" > 队列中还有 { details ?. count || 0 } 篇文章。</ Text >
270
+ < Switch
271
+ label = "只审题解"
272
+ checked = { solutionOnly }
273
+ onChange = { ( e , x ) => setSolutionOnly ( x . checked ) }
274
+ />
264
275
< Button
265
276
appearance = "primary"
266
277
disabled = { ! ( details ?. article && ! status ?. submiting ) }
0 commit comments