Yansen 2 年前
父节点
当前提交
4ea112eb5b
共有 1 个文件被更改,包括 4 次插入15 次删除
  1. 4
    15
      src/pages/check/components/QuForm.jsx

+ 4
- 15
src/pages/check/components/QuForm.jsx 查看文件

18
 export default (props) => {
18
 export default (props) => {
19
   const { open, onOpenChange, quInfo, itemId, itemType, onChange } = props;
19
   const { open, onOpenChange, quInfo, itemId, itemType, onChange } = props;
20
   const [form] = Form.useForm();
20
   const [form] = Form.useForm();
21
-  const [value, setValue] = React.useState();
22
 
21
 
23
   const onFinish = async (values) => {
22
   const onFinish = async (values) => {
24
     const data = {
23
     const data = {
237
                 name="answerList"
236
                 name="answerList"
238
                 label="选项列表"
237
                 label="选项列表"
239
                 copyIconProps={false}
238
                 copyIconProps={false}
240
-                creatorRecord={{ answerCode: value }}
241
               >{(f, index) => {
239
               >{(f, index) => {
242
 
240
 
243
-                // console.log('index', index == 0)
244
-                if (index == 0) {
245
-                  setValue('B')
246
-                } else if (index == 1) {
247
-                  setValue('C')
248
-                } else if (index == 2) {
249
-                  setValue('D')
250
-                } else if (index == 3) {
251
-                  setValue('E')
252
-                } else if (index == 4) {
253
-                  setValue('F')
254
-                }
241
+                const charCode = index + 65;
242
+                const initialValue = charCode < 91 ? String.fromCharCode(charCode) : '';
243
+
255
                 return (
244
                 return (
256
                   <Row gutter={24} style={{ width: '730px' }}>
245
                   <Row gutter={24} style={{ width: '730px' }}>
257
                     <Col span={8}>
246
                     <Col span={8}>
259
                         name="answerCode"
248
                         name="answerCode"
260
                         label="选项"
249
                         label="选项"
261
                         help="类似 A, B, C, D"
250
                         help="类似 A, B, C, D"
262
-                        initialValue={'A'}
251
+                        initialValue={initialValue}
263
                       />
252
                       />
264
                     </Col>
253
                     </Col>
265
                     <Col span={8}>
254
                     <Col span={8}>