|
@@ -16,8 +16,9 @@ import { getTdQuestion } from '@/service/tdquestion';
|
16
|
16
|
const queryQu = transformQuery(getTdQuestion, { searchKey: 'title', labelKey: 'title', valueKey: 'quId' });
|
17
|
17
|
|
18
|
18
|
export default (props) => {
|
19
|
|
- const {open, onOpenChange, quInfo, itemId, itemType, onChange} = props;
|
|
19
|
+ const { open, onOpenChange, quInfo, itemId, itemType, onChange } = props;
|
20
|
20
|
const [form] = Form.useForm();
|
|
21
|
+ const [value, setValue] = React.useState();
|
21
|
22
|
|
22
|
23
|
const onFinish = async (values) => {
|
23
|
24
|
const data = {
|
|
@@ -54,6 +55,7 @@ export default (props) => {
|
54
|
55
|
}
|
55
|
56
|
}, [quInfo]);
|
56
|
57
|
|
|
58
|
+ // console.log('value', value);
|
57
|
59
|
return (
|
58
|
60
|
<DrawerForm
|
59
|
61
|
title="问题维护"
|
|
@@ -66,16 +68,16 @@ export default (props) => {
|
66
|
68
|
destroyOnClose: true,
|
67
|
69
|
extra: (
|
68
|
70
|
<>
|
69
|
|
- {
|
70
|
|
- itemType == 'survey' && (
|
71
|
|
- <SearchSelect
|
72
|
|
- placeholder="请输入题干搜索题库"
|
73
|
|
- style={{width: '300px'}}
|
74
|
|
- request={queryQu}
|
75
|
|
- onChange={onTplChange}
|
76
|
|
- />
|
77
|
|
- )
|
78
|
|
- }
|
|
71
|
+ {
|
|
72
|
+ itemType == 'survey' && (
|
|
73
|
+ <SearchSelect
|
|
74
|
+ placeholder="请输入题干搜索题库"
|
|
75
|
+ style={{ width: '300px' }}
|
|
76
|
+ request={queryQu}
|
|
77
|
+ onChange={onTplChange}
|
|
78
|
+ />
|
|
79
|
+ )
|
|
80
|
+ }
|
79
|
81
|
</>
|
80
|
82
|
)
|
81
|
83
|
}}
|
|
@@ -166,7 +168,7 @@ export default (props) => {
|
166
|
168
|
<Col span={12}>
|
167
|
169
|
<ProFormDependency name={['quType']}>
|
168
|
170
|
{
|
169
|
|
- ({quType}) => (
|
|
171
|
+ ({ quType }) => (
|
170
|
172
|
quType != 'fill' ? null : (
|
171
|
173
|
<ProFormDigit
|
172
|
174
|
name="anScore"
|
|
@@ -188,7 +190,7 @@ export default (props) => {
|
188
|
190
|
<Col span={12}>
|
189
|
191
|
<ProFormDependency name={['quType']}>
|
190
|
192
|
{
|
191
|
|
- ({quType}) => (
|
|
193
|
+ ({ quType }) => (
|
192
|
194
|
quType != 'fill' ? null : (
|
193
|
195
|
<ProFormText
|
194
|
196
|
name="fillUnit"
|
|
@@ -225,54 +227,74 @@ export default (props) => {
|
225
|
227
|
</Form.Item>
|
226
|
228
|
)
|
227
|
229
|
}
|
228
|
|
-
|
|
230
|
+
|
229
|
231
|
<ProFormDependency name={['quType']}>
|
230
|
232
|
{
|
231
|
|
- ({quType}) => (
|
|
233
|
+ ({ quType }) => (
|
232
|
234
|
quType == 'fill' ? null : (
|
233
|
235
|
<ProFormList
|
234
|
236
|
name="answerList"
|
235
|
237
|
label="选项列表"
|
236
|
238
|
copyIconProps={false}
|
237
|
|
- >
|
238
|
|
- <Row gutter={24} style={{ width: '730px' }}>
|
239
|
|
- <Col span={6}>
|
240
|
|
- <ProFormText
|
241
|
|
- name="answerCode"
|
242
|
|
- label="选项"
|
243
|
|
- help="类似 A, B, C, D"
|
244
|
|
- />
|
245
|
|
- </Col>
|
246
|
|
- <Col span={6}>
|
247
|
|
- <ProFormDigit
|
248
|
|
- name="score"
|
249
|
|
- label="计分"
|
250
|
|
- help="计分"
|
251
|
|
- min={0}
|
252
|
|
- fieldProps={{ precision: 2 }}
|
253
|
|
- />
|
254
|
|
- </Col>
|
255
|
|
- <Col span={6}>
|
256
|
|
- <ProFormSelect
|
257
|
|
- name="reportIssue"
|
258
|
|
- label="上报问题"
|
259
|
|
- help="上报问题"
|
260
|
|
- placeholder="是否上报问题"
|
261
|
|
- valueEnum={{
|
262
|
|
- 0: '不上报',
|
263
|
|
- 1: '上报',
|
264
|
|
- }}
|
265
|
|
- />
|
266
|
|
- </Col>
|
267
|
|
- <Col span={6}>
|
268
|
|
- <ProFormText
|
269
|
|
- name="answer"
|
270
|
|
- label="答案"
|
271
|
|
- help="答案"
|
272
|
|
- placeholder="具体选项内容"
|
273
|
|
- />
|
274
|
|
- </Col>
|
275
|
|
- </Row>
|
|
239
|
+ creatorRecord={{ answerCode: value }}
|
|
240
|
+ >{(f, index) => {
|
|
241
|
+
|
|
242
|
+ // console.log('index', index == 0)
|
|
243
|
+ if (index == 0) {
|
|
244
|
+ setValue('B')
|
|
245
|
+ } else if (index == 1) {
|
|
246
|
+ setValue('C')
|
|
247
|
+ } else if (index == 2) {
|
|
248
|
+ setValue('D')
|
|
249
|
+ } else if (index == 3) {
|
|
250
|
+ setValue('E')
|
|
251
|
+ } else if (index == 4) {
|
|
252
|
+ setValue('F')
|
|
253
|
+ }
|
|
254
|
+ return (
|
|
255
|
+ <Row gutter={24} style={{ width: '730px' }}>
|
|
256
|
+ <Col span={6}>
|
|
257
|
+ <ProFormText
|
|
258
|
+ name="answerCode"
|
|
259
|
+ label="选项"
|
|
260
|
+ help="类似 A, B, C, D"
|
|
261
|
+ initialValue={'A'}
|
|
262
|
+ />
|
|
263
|
+ </Col>
|
|
264
|
+ <Col span={6}>
|
|
265
|
+ <ProFormDigit
|
|
266
|
+ name="score"
|
|
267
|
+ label="计分"
|
|
268
|
+ help="计分"
|
|
269
|
+ min={0}
|
|
270
|
+ fieldProps={{ precision: 2 }}
|
|
271
|
+ />
|
|
272
|
+ </Col>
|
|
273
|
+ <Col span={6}>
|
|
274
|
+ <ProFormSelect
|
|
275
|
+ name="reportIssue"
|
|
276
|
+ label="上报问题"
|
|
277
|
+ help="上报问题"
|
|
278
|
+ placeholder="是否上报问题"
|
|
279
|
+ valueEnum={{
|
|
280
|
+ 0: '不上报',
|
|
281
|
+ 1: '上报',
|
|
282
|
+ }}
|
|
283
|
+ />
|
|
284
|
+ </Col>
|
|
285
|
+ <Col span={6}>
|
|
286
|
+ <ProFormText
|
|
287
|
+ name="answer"
|
|
288
|
+ label="答案"
|
|
289
|
+ help="答案"
|
|
290
|
+ placeholder="具体选项内容"
|
|
291
|
+ />
|
|
292
|
+ </Col>
|
|
293
|
+ </Row>
|
|
294
|
+ )
|
|
295
|
+ }
|
|
296
|
+ }
|
|
297
|
+
|
276
|
298
|
</ProFormList>
|
277
|
299
|
)
|
278
|
300
|
)
|