zhengpengju 3 years ago
parent 2589f5f3e2
commit d08f77deb0

@ -93,7 +93,7 @@ const AutoSelector = (props: any, ref: any) => {
formRef?.current.setFieldsValue({questionType: questionType}) formRef?.current.setFieldsValue({questionType: questionType})
}} }}
/></Form.Item></>, /></Form.Item></>,
//key: 'code', key: 'code',
dataIndex: `type${item?.code}`, dataIndex: `type${item?.code}`,
render: ( _dom, record, index) => { render: ( _dom, record, index) => {
return <Form.Item style={{margin:0}} name={['questionType', idx, index]}><Input min={0} max={3} defaultValue={0} type='text' /></Form.Item>; return <Form.Item style={{margin:0}} name={['questionType', idx, index]}><Input min={0} max={3} defaultValue={0} type='text' /></Form.Item>;
@ -123,7 +123,6 @@ const AutoSelector = (props: any, ref: any) => {
return ( return (
<> <>
<Button onClick={()=>{ console.log('formRef',formRef.current.getFieldsValue()); formRef.current.setFieldsValue({questionType:[['10']]})}}>show</Button>
<Form ref={formRef}> <Form ref={formRef}>
<ProTable <ProTable
bordered bordered

@ -436,7 +436,23 @@ export default () => {
{/** 一旦录入另一项将禁用,清空组卷后可选另一项 */} {/** 一旦录入另一项将禁用,清空组卷后可选另一项 */}
<Row> <Row>
<Col span={12} style={{padding:5}}><Button size="large" onClick={()=>{handleSelectorModalVisible(true)}} value={1} style={{ display:'block', textAlign: 'center', width:'100%'}}></Button></Col> <Col span={12} style={{padding:5}}><Button size="large" onClick={()=>{handleSelectorModalVisible(true)}} value={1} style={{ display:'block', textAlign: 'center', width:'100%'}}></Button></Col>
<Col span={12} style={{padding:5}}><Button size="large" onClick={()=>{handleAutoModalVisible(true)}} value={2} style={{ display:'block', textAlign: 'center', width:'100%'}}></Button></Col> <Col span={12} style={{padding:5}}>
{questions ?
<Popconfirm
title="目前已有题目,如果点击确定将清空之前题目数据?"
onConfirm={()=>{
handleAutoModalVisible(true)
}}
onCancel={()=>{}}
okText="是"
cancelText="否"
>
<Button size="large" value={2} style={{ display:'block', textAlign: 'center', width:'100%'}}></Button>
</Popconfirm>
:
<Button size="large" onClick={()=>{handleAutoModalVisible(true)}} value={2} style={{ display:'block', textAlign: 'center', width:'100%'}}></Button>
}
</Col>
</Row> </Row>
<Divider style={{ margin: '6px 0', opacity: 0.5 }} /> <Divider style={{ margin: '6px 0', opacity: 0.5 }} />

Loading…
Cancel
Save