@@ -19,6 +19,7 @@ import { isArray } from '@visactor/vutils';
19
19
import { VChartSpec } from '../../../../../src' ;
20
20
21
21
const { Option } = Select ;
22
+ const TextArea = Input . TextArea ;
22
23
const FormItem = Form . Item ;
23
24
const globalVariables = ( import . meta as any ) . env ;
24
25
const url = globalVariables . VITE_VCHART_EDITOR_URL || 'http://localhost/' ;
@@ -60,6 +61,89 @@ const baseSpec = {
60
61
position : 'start'
61
62
}
62
63
} ;
64
+ const topKeys = [
65
+ 'type' ,
66
+ 'series' ,
67
+ 'axes' ,
68
+ 'crosshair' ,
69
+ 'data' ,
70
+ 'width' ,
71
+ 'height' ,
72
+ 'autoFit' ,
73
+ 'color' ,
74
+ 'seriesStyle' ,
75
+ 'animationThreshold' ,
76
+ 'hover' ,
77
+ 'select' ,
78
+ 'region' ,
79
+ 'title' ,
80
+ 'layout' ,
81
+ 'legends' ,
82
+ 'tooltip' ,
83
+ 'player' ,
84
+ 'dataZoom' ,
85
+ 'scrollBar' ,
86
+ 'brush' ,
87
+ 'scales' ,
88
+ 'customMark' ,
89
+ 'theme' ,
90
+ 'background' ,
91
+ 'stackInverse' ,
92
+ 'stackSort' ,
93
+ 'media' ,
94
+ 'autoBandSize' ,
95
+ 'direction' ,
96
+ 'markLine' ,
97
+ 'markArea' ,
98
+ 'markPoint' ,
99
+ 'padding' ,
100
+ 'percent' ,
101
+ 'name' ,
102
+ 'id' ,
103
+ 'animation' ,
104
+ 'stack' ,
105
+ 'animationEnter' ,
106
+ 'animationUpdate' ,
107
+ 'animationExit' ,
108
+ 'dataIndex' ,
109
+ 'sampling' ,
110
+ 'animationState' ,
111
+ 'large' ,
112
+ 'largeThreshold' ,
113
+ 'progressiveStep' ,
114
+ 'progressiveThreshold' ,
115
+ 'support3d' ,
116
+ 'regionIndex' ,
117
+ 'regionId' ,
118
+ 'totalLabel' ,
119
+ 'animationAppear' ,
120
+ 'animationDisappear' ,
121
+ 'animationNormal' ,
122
+ 'xField' ,
123
+ 'yField' ,
124
+ 'label' ,
125
+ 'bar' ,
126
+ 'barBackground' ,
127
+ 'barWidth' ,
128
+ 'barMinWidth' ,
129
+ 'barMaxWidth' ,
130
+ 'barGapInGroup' ,
131
+ 'barMinHeight' ,
132
+ 'stackCornerRadius' ,
133
+ 'x2Field' ,
134
+ 'y2Field' ,
135
+ 'zField' ,
136
+ 'sortDataByAxis' ,
137
+ 'dataId' ,
138
+ 'dataKey' ,
139
+ 'seriesField' ,
140
+ 'stackOffsetSilhouette' ,
141
+ 'invalidType' ,
142
+ 'extensionMark' ,
143
+ 'interactions' ,
144
+ 'activePoint' ,
145
+ 'samplingFactor'
146
+ ] ;
63
147
const vchartSpecAtom = new VChartSpec ( { spec : baseSpec } , { } ) ;
64
148
export function QARag ( ) {
65
149
const vchartInstance = React . useRef < any > ( null ) ;
@@ -290,6 +374,9 @@ export function QARag() {
290
374
onOk = { handleDownFeedback }
291
375
confirmLoading = { confirmLoading }
292
376
onCancel = { ( ) => setFeedbackVisible ( false ) }
377
+ style = { {
378
+ width : 650
379
+ } }
293
380
>
294
381
< Form
295
382
{ ...{
@@ -302,20 +389,26 @@ export function QARag() {
302
389
} }
303
390
form = { form }
304
391
labelCol = { {
305
- style : { flexBasis : 150 }
392
+ style : { flexBasis : 220 }
306
393
} }
307
394
wrapperCol = { {
308
- style : { flexBasis : 'calc(100% - 160px )' }
395
+ style : { flexBasis : 'calc(100% - 230px )' }
309
396
} }
310
397
>
311
- < FormItem label = "Type" required field = "wrongType" rules = { [ { required : true } ] } >
312
- < Select options = { [ 'DSL' , 'VChart Render' , 'Not sure' ] } />
398
+ < FormItem label = "哪里错了" required field = "wrongType" rules = { [ { required : true } ] } >
399
+ < Select
400
+ options = { [
401
+ { label : 'Only DSL' , value : 'DSL' } ,
402
+ { label : 'Only VChart Render' , value : 'VChart' } ,
403
+ { label : 'Not sure/Both' , value : 'Not sure' }
404
+ ] }
405
+ />
313
406
</ FormItem >
314
- < FormItem label = "TopKeyPath " field = "topKeyAnswer" rules = { [ { required : true } ] } >
315
- < Input placeholder = "" />
407
+ < FormItem label = "正确答案对应的topKey是什么 " field = "topKeyAnswer" rules = { [ { required : true } ] } >
408
+ < Select options = { topKeys } showSearch />
316
409
</ FormItem >
317
- < FormItem label = "Answer DSL " field = "keyPathAnswer" >
318
- < Input placeholder = "" />
410
+ < FormItem label = "正确的DSL是啥 " field = "keyPathAnswer" >
411
+ < TextArea placeholder = { `{"label": {"visible": true}}` } />
319
412
</ FormItem >
320
413
</ Form >
321
414
</ Modal >
@@ -377,7 +470,7 @@ export function QARag() {
377
470
</ div >
378
471
< div className = "qa-div" >
379
472
< div className = "title" > Answer:</ div >
380
- < span > { item . answer } </ span >
473
+ < span > { JSON . stringify ( item . answer ) } </ span >
381
474
</ div >
382
475
</ Card >
383
476
) ) }
0 commit comments