@@ -208,75 +208,75 @@ const IssueModal = (props: IssueModalProps) => {
208
208
} ) }
209
209
>
210
210
{ // 本行有问题 || 问题行为0,即文件问题显示在第一行之前
211
- ( fileError || issueLines . includes ( line ) ) && (
212
- < div className = { style . ruleWrapper } >
213
- < div
214
- className = { style . rule }
215
- onClick = { ( ) => {
216
- if ( issueIndex > - 1 ) {
217
- const list = cloneDeep ( expanded ) ;
218
- list [ issueIndex ] = ! expanded [ issueIndex ] ;
219
- setExpanded ( list ) ;
220
- }
221
- } }
222
- >
223
- < span className = { style . ruleContent } >
224
- { expanded [ issueIndex ] || fileError ? (
225
- < CaretDown />
226
- ) : (
227
- < CaretRight />
228
- ) }
229
- 【{ detail . checkrule_real_name } 】规则描述:
230
- { ruleDetail . rule_title }
231
- </ span >
232
- < span >
233
- { issueIndex !== 0 && ! fileError && (
234
- < Tooltip
235
- title = "上一处问题"
236
- getPopupContainer = { ( ) => document . body }
237
- >
238
- < Button
239
- type = "link"
240
- icon = { < AngleUp /> }
241
- onClick = { ( e : any ) => {
242
- e . stopPropagation ( ) ;
243
- if ( issueIndex > - 1 ) {
244
- scrollToItem ( issueLines [ issueIndex - 1 ] ) ;
245
- const nextIssueDetail = getCurIssueDetail ( issueLines [ issueIndex - 1 ] ) ;
246
- if ( nextIssueDetail ) {
247
- setCurIssueLine ( nextIssueDetail . line ) ;
211
+ ( fileError || issueLines . includes ( line ) ) && (
212
+ < div className = { style . ruleWrapper } >
213
+ < div
214
+ className = { style . rule }
215
+ onClick = { ( ) => {
216
+ if ( issueIndex > - 1 ) {
217
+ const list = cloneDeep ( expanded ) ;
218
+ list [ issueIndex ] = ! expanded [ issueIndex ] ;
219
+ setExpanded ( list ) ;
220
+ }
221
+ } }
222
+ >
223
+ < span className = { style . ruleContent } >
224
+ { expanded [ issueIndex ] || fileError ? (
225
+ < CaretDown />
226
+ ) : (
227
+ < CaretRight />
228
+ ) }
229
+ 【{ detail . checkrule_real_name } 】规则描述:
230
+ { ruleDetail . rule_title }
231
+ </ span >
232
+ < span >
233
+ { issueIndex !== 0 && ! fileError && (
234
+ < Tooltip
235
+ title = "上一处问题"
236
+ getPopupContainer = { ( ) => document . body }
237
+ >
238
+ < Button
239
+ type = "link"
240
+ icon = { < AngleUp /> }
241
+ onClick = { ( e : any ) => {
242
+ e . stopPropagation ( ) ;
243
+ if ( issueIndex > - 1 ) {
244
+ scrollToItem ( issueLines [ issueIndex - 1 ] ) ;
245
+ const nextIssueDetail = getCurIssueDetail ( issueLines [ issueIndex - 1 ] ) ;
246
+ if ( nextIssueDetail ) {
247
+ setCurIssueLine ( nextIssueDetail . line ) ;
248
+ }
248
249
}
249
- }
250
- } }
251
- / >
252
- </ Tooltip >
253
- ) }
254
- { issueIndex < issueLines . length - 1 && ! fileError && (
255
- < Tooltip
256
- title = "下一处问题"
257
- getPopupContainer = { ( ) => document . body }
258
- >
259
- < Button
260
- type = "link"
261
- icon = { < AngleDown /> }
262
- onClick = { ( e : any ) => {
263
- e . stopPropagation ( ) ;
264
- if ( issueIndex > - 1 ) {
265
- scrollToItem ( issueLines [ issueIndex + 1 ] ) ;
266
- const nextIssueDetail = getCurIssueDetail ( issueLines [ issueIndex + 1 ] ) ;
267
- if ( nextIssueDetail ) {
268
- setCurIssueLine ( nextIssueDetail . line ) ;
250
+ } }
251
+ />
252
+ </ Tooltip >
253
+ ) }
254
+ { issueIndex < issueLines . length - 1 && ! fileError && (
255
+ < Tooltip
256
+ title = "下一处问题"
257
+ getPopupContainer = { ( ) => document . body }
258
+ >
259
+ < Button
260
+ type = "link"
261
+ icon = { < AngleDown /> }
262
+ onClick = { ( e : any ) => {
263
+ e . stopPropagation ( ) ;
264
+ if ( issueIndex > - 1 ) {
265
+ scrollToItem ( issueLines [ issueIndex + 1 ] ) ;
266
+ const nextIssueDetail = getCurIssueDetail ( issueLines [ issueIndex + 1 ] ) ;
267
+ if ( nextIssueDetail ) {
268
+ setCurIssueLine ( nextIssueDetail . line ) ;
269
+ }
269
270
}
270
- }
271
- } }
272
- />
273
- </ Tooltip >
274
- ) }
275
- </ span >
276
- </ div >
277
- < div className = { style . issueMsg } >
278
- 错误原因:{ detail . msg }
279
- { ! isEmpty ( curIssueDetail ?. issue_refers ) && (
271
+ } }
272
+ />
273
+ </ Tooltip >
274
+ ) }
275
+ </ span >
276
+ </ div >
277
+ < div className = { style . issueMsg } >
278
+ 错误原因:{ detail . msg }
279
+ { ! isEmpty ( curIssueDetail ?. issue_refers ) && (
280
280
< Button
281
281
type = "link"
282
282
onClick = { ( ) => {
@@ -286,19 +286,19 @@ const IssueModal = (props: IssueModalProps) => {
286
286
>
287
287
{ showRefers && ! isEmpty ( curIssueRefers ) ? '关闭' : '展开' } 追溯
288
288
</ Button >
289
- ) }
289
+ ) }
290
290
</ div >
291
- { ( expanded [ issueIndex ] || fileError )
292
- && ruleDetail . checkruledesc ?. desc && (
293
- < div className = { style . ruleDesc } >
294
- < h4 > 规则详细说明</ h4 >
295
- < ReactMarkdown >
296
- { ruleDetail . checkruledesc ?. desc }
297
- </ ReactMarkdown >
298
- </ div >
299
- ) }
300
- </ div >
301
- ) }
291
+ { ( expanded [ issueIndex ] || fileError )
292
+ && ruleDetail . checkruledesc ?. desc && (
293
+ < div className = { style . ruleDesc } >
294
+ < h4 > 规则详细说明</ h4 >
295
+ < ReactMarkdown >
296
+ { ruleDetail . checkruledesc ?. desc }
297
+ </ ReactMarkdown >
298
+ </ div >
299
+ ) }
300
+ </ div >
301
+ ) }
302
302
< Highlight className = { language } >
303
303
{ content . length > CODE_MAX_CHAR_LENGTH
304
304
? `${ content . substring ( 0 , CODE_MAX_CHAR_LENGTH ) } ...`
@@ -400,10 +400,10 @@ const IssueModal = (props: IssueModalProps) => {
400
400
< div className = { style . modalTitle } >
401
401
< p >
402
402
{ detail . file_path ?. split ( '/' ) . pop ( ) }
403
- < span className = { style . modalDesc } >
403
+ < p className = { style . modalDesc } >
404
404
文件路径:{ detail . file_path }
405
- </ span >
406
- < Copy text = { detail . file_path } className = { style . copyIcon } / >
405
+ < Copy text = { detail . file_path } className = { style . copyIcon } / >
406
+ </ p >
407
407
</ p >
408
408
{ /* todo: 全屏查看issue */ }
409
409
{ /* <Tooltip title='点击跳转新窗口打开详情页'>
0 commit comments