Commit 9d816518 by Liu

Merge branch 'test-1127' into test01

parents 7437b1d0 3da16ef3
......@@ -34,7 +34,15 @@ return
setFeedbackConfig(_data)
}
const hasSelectedReason = feedbackConfig?.questionList?.[0]?.answerList?.some(
(item: any) => item.answerValue === '1',
)
const canSubmit = !!(hasSelectedReason || answerValue.trim())
const onSubmit = async () => {
if (!canSubmit) {
return
}
const content = JSON.parse(JSON.stringify(feedbackConfig))
content.questionList[0].answerList = content.questionList[0].answerList.filter(
(item: any) => item.answerValue === '1',
......@@ -55,7 +63,9 @@ return
if (isOpen) {
getConfig()
}
// getConfig()
else {
setAnswerValue('')
}
}, [isOpen])
return (
(
......@@ -95,7 +105,7 @@ return
<Button onPress={onClose}>
取消
</Button>
<Button onPress={onSubmit} color="primary">
<Button onPress={onSubmit} color="primary" isDisabled={!canSubmit}>
提交
</Button>
</ModalFooter>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment