|
|
|
@ -226,13 +226,22 @@ const QuestionBank = () => {
|
|
|
|
|
hideInTable: false,
|
|
|
|
|
hideInForm: false,
|
|
|
|
|
hideInSearch: true,
|
|
|
|
|
dependencies:['answers'],
|
|
|
|
|
renderFormItem: (item, { defaultRender, ...rest }, form) => {
|
|
|
|
|
console.log('正确答案...', form.getFieldValue('answers'))
|
|
|
|
|
// 需要处理 关联长度变化及编辑回显
|
|
|
|
|
console.log('edit answertrue11', item)
|
|
|
|
|
console.log('form::::::',form.getFieldValue('answertrue'))
|
|
|
|
|
console.log('rest', rest)
|
|
|
|
|
console.log('question_type:::', form.getFieldValue('question_type'))
|
|
|
|
|
|
|
|
|
|
// 获取选项长度
|
|
|
|
|
const len = form.getFieldValue('answers')?.length || 2;
|
|
|
|
|
const opts = []
|
|
|
|
|
for(let i=0; i<len; i++){
|
|
|
|
|
opts.push(labels[i])
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(Number(form.getFieldValue('question_type')) === 0){
|
|
|
|
|
console.log('my type', Number(form.getFieldValue('question_type')))
|
|
|
|
|
}else{
|
|
|
|
@ -245,12 +254,12 @@ const QuestionBank = () => {
|
|
|
|
|
return ((addType?.value === 0 || addType?.value === 2) || (Number(form.getFieldValue('question_type')) === 0) || Number(form.getFieldValue('question_type')) === 2) ?
|
|
|
|
|
<Radio.Group
|
|
|
|
|
name="answertrue"
|
|
|
|
|
options={addType?.value === 0 || (Number(form.getFieldValue('question_type')) === 0) ? ['A', 'B', 'C', 'D'] : ['A', 'B']}
|
|
|
|
|
options={addType?.value === 0 || (Number(form.getFieldValue('question_type')) === 0) ? opts : ['A', 'B']}
|
|
|
|
|
/>
|
|
|
|
|
:
|
|
|
|
|
<Checkbox.Group
|
|
|
|
|
name="answertrue"
|
|
|
|
|
options={['A', 'B', 'C', 'D']}
|
|
|
|
|
options={opts}
|
|
|
|
|
/>
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@ -542,7 +551,7 @@ const QuestionBank = () => {
|
|
|
|
|
<Typography>正确答案:
|
|
|
|
|
{answer}
|
|
|
|
|
</Typography>
|
|
|
|
|
<Typography>解析:<div dangerouslySetInnerHTML={{__html: parsing.get(record.id)}} /></Typography>
|
|
|
|
|
<Typography>【解析】:<div dangerouslySetInnerHTML={{__html: parsing.get(record.id)}} /></Typography>
|
|
|
|
|
</Space>
|
|
|
|
|
);
|
|
|
|
|
}else{
|
|
|
|
|