Commit 8d3743a2 authored by 田翔's avatar 田翔

fix: 测试提交增加提示

parent e54cb6dc
{
"name": "panda-xform",
"version": "3.0.1",
"description": "3.0.1: 验证方法修改",
"version": "3.0.2",
"description": "3.0.2: 测试提交增加提示 ",
"keywords": [
"panda-xform"
],
......
......@@ -29,6 +29,7 @@ const FormDesigner = (props, ref) => {
const [visible, setVisible] = useState(false)
const [schema, setSchema] = useState({})
const [fieldName, setFieldName] = useState([])
const [textShow, setTextShow] = useState(false)
const designerRef = useRef(null)
const formRenderRef = useRef(null)
......@@ -155,6 +156,7 @@ const FormDesigner = (props, ref) => {
let json = getJSON(designerRef.current.getValue(), fieldName)
let verify = getVerify(json)
if (verify === true) {
setTextShow(false)
setVisible(true)
setSchema(json)
designerRef.current.setValue(json)
......@@ -257,6 +259,8 @@ const FormDesigner = (props, ref) => {
const { formValue, relationForm, errors } = await formRenderRef?.current?.getValues()
if (errors.length) {
return message.error('表单校验未通过!')
} else {
setTextShow(true)
}
}
......@@ -308,8 +312,9 @@ const FormDesigner = (props, ref) => {
destroyOnClose
footer={
<div>
<span style={{ color: '#18b918', fontSize: '14px', paddingRight: '10px', display: textShow ? 'inline-block' : 'none' }}>该表单内容校验通过,可正常使用!</span>
<Button onClick={() => setVisible(false)}>取消</Button>
<Button onClick={testSubmit}>测试提交</Button>
<Button type='primary' onClick={testSubmit}>测试提交</Button>
</div>
}
>
......
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