Commit 4a02964f authored by 田翔's avatar 田翔

fix: 表单支持默认隐藏

parent 562d2dc9
{
"name": "panda-xform",
"version": "6.9.22",
"description": "6.9.22 表单点击详情字段显示问题",
"version": "6.9.23",
"description": "6.9.23 表单支持默认隐藏",
"keywords": [
"panda-xform"
],
......
This diff is collapsed.
import React, { useEffect } from 'react'
import { Switch } from 'antd'
const IsHidden = (props) => {
const { value, onChange, addons } = props
const switchChange = (checked) => {
if (addons) {
onChange(checked)
if (checked) {
addons.setValue('hiddenCondition', '1=1')
addons.setValue('hiddenRules', [])
} else {
addons.setValue('hiddenCondition', '')
addons.setValue('hiddenRules', [])
}
}
}
return (
<Switch
checked={value}
checkedChildren={'隐藏'}
unCheckedChildren={'显示'}
onChange={switchChange}
>
</Switch>
)
}
export default IsHidden
\ No newline at end of file
......@@ -9,6 +9,7 @@ import WidgetType from './WidgetType'
import HiddenCondition from './HiddenCondition'
import SwitchDefault from './SwitchDefault'
import RichTextDefault from './RichTextDefault'
import IsHidden from './IsHidden'
const groupBase = {
FieldNames,
......@@ -22,6 +23,7 @@ const groupBase = {
HiddenCondition,
SwitchDefault,
RichTextDefault,
IsHidden,
}
export default groupBase
\ No newline at end of file
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