@@ -16,13 +16,19 @@ import {
1616 PopoverSurface
1717} from '@fluentui/react-components' ;
1818import { getArticle , submitArticleCheckResult } from '../../../fetch' ;
19- import { ErrorDiv , InputDateTime , UserName } from '../../utils' ;
19+ import {
20+ ErrorDiv ,
21+ InputDateTime ,
22+ ProblemNameWithDifficulty ,
23+ UserName
24+ } from '../../utils' ;
2025import dayjs from 'dayjs' ;
2126import emptyQueueImage from 'assets/emptyQueue.webp' ;
2227import './style.css' ;
2328import { useNotUndefinedContext } from '../../../notUndefinedContext' ;
2429import { MyInfoContext } from '../../contexts' ;
2530import { isCancel } from 'axios' ;
31+ import { oldDifficultySystem } from '../../../constants' ;
2632
2733export default function Article ( ) {
2834 const [ status , setStatus ] = useState < {
@@ -46,12 +52,10 @@ export default function Article() {
4652 const cancel = new AbortController ( ) ;
4753 getArticle ( skipBefore / 1000 , { signal : cancel . signal } )
4854 . then ( v => {
49- console . log ( v ) ;
5055 setStatus ( { details : v } ) ,
5156 v . article && setSkipBefore ( v . article . promoteResult . updateAt * 1000 ) ;
5257 } )
5358 . catch ( e => {
54- console . log ( e ) ;
5559 if ( isCancel ( e ) ) return ;
5660 console . error ( 'Error in feature Article' , e ) , setFetchError ( e ) ;
5761 } ) ;
@@ -71,7 +75,9 @@ export default function Article() {
7175 async function submit ( ) {
7276 if ( ! details ?. article ) throw new Error ( 'No article' ) ;
7377 setStatus ( { details : details , submiting : true } ) ;
74- await submitArticleCheckResult ( [ details . article . lid , refuseCommit || true ] ) ;
78+ await submitArticleCheckResult ( [
79+ [ details . article . lid , refuseCommit || true ]
80+ ] ) ;
7581 setStatus ( null ) ;
7682 setOtherRefuseCommit ( '' ) ;
7783 updateArticle ( ) ;
@@ -129,13 +135,13 @@ export default function Article() {
129135 { details . article . solutionFor && (
130136 < Text >
131137 关联于题目{ ' ' }
132- < Link
133- href = { `https://www.luogu.com.cn/problem/ ${ details . article . solutionFor . pid } ` }
134- target = "_blank"
135- >
136- { details . article . solutionFor . pid } { ' ' }
137- { details . article . solutionFor . title }
138- </ Link >
138+ < ProblemNameWithDifficulty
139+ pid = { details . article . solutionFor . pid }
140+ name = { details . article . solutionFor . title }
141+ difficulty = { oldDifficultySystem . findIndex (
142+ x => x >= details . article . solutionFor ! . difficulty
143+ ) }
144+ / >
139145 。
140146 { details . countForProblem && (
141147 < >
@@ -154,7 +160,10 @@ export default function Article() {
154160 ) }
155161 < div className = "adminCommit" >
156162 < Text > 管理员备注:</ Text >
157- < textarea defaultValue = { details . article . adminComment } />
163+ < textarea
164+ defaultValue = { details . article . adminComment }
165+ spellCheck = "false"
166+ />
158167 </ div >
159168 </ >
160169 ) : undefined }
@@ -185,7 +194,7 @@ export default function Article() {
185194 很遗憾,您的《
186195 < Link
187196 href = { `https://www.luogu.com.cn/article/${ details . article . lid } ` }
188- target = ' _blank'
197+ target = " _blank"
189198 >
190199 { details . article . title }
191200 </ Link >
0 commit comments