Commit 7938b9ea authored by 彭俊龙's avatar 彭俊龙

feat: 部门选择器优化

parent 83b3d983
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "6.10.78", "version": "6.10.80",
"description": "6.10.78 解决台账编辑功能白屏问题", "description": "6.10.80 部门选择支持选择父级自动带入子级",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
...@@ -167,6 +167,7 @@ const ValueEdit = (props) => { ...@@ -167,6 +167,7 @@ const ValueEdit = (props) => {
params: { params: {
tableName: tableName, tableName: tableName,
fieldName: `${displayName},${_fieldName}`, fieldName: `${displayName},${_fieldName}`,
time: new Date().getTime()
}, },
data: [] data: []
}) })
......
...@@ -19,7 +19,6 @@ const DeptSelector = (props) => { ...@@ -19,7 +19,6 @@ const DeptSelector = (props) => {
const { isMultiple, disabled, placeholder, presetValue, isStoreID } = schema const { isMultiple, disabled, placeholder, presetValue, isStoreID } = schema
const property = isStoreID ? 'deptId' : 'deptName' const property = isStoreID ? 'deptId' : 'deptName'
const [treeData, setTreeData] = useState([]) const [treeData, setTreeData] = useState([])
const treeChange = (value) => { const treeChange = (value) => {
if (addons) { if (addons) {
addons.setValue(addons.dataPath, isMultiple ? value.join(',') : value) addons.setValue(addons.dataPath, isMultiple ? value.join(',') : value)
...@@ -58,6 +57,11 @@ const DeptSelector = (props) => { ...@@ -58,6 +57,11 @@ const DeptSelector = (props) => {
} }
}, []) }, [])
const multipleConfig={
treeCheckable: true,
showCheckedStrategy: TreeSelect.SHOW_ALL
}
return ( return (
<TreeSelect <TreeSelect
style={{ width: '100%' }} style={{ width: '100%' }}
...@@ -75,6 +79,7 @@ const DeptSelector = (props) => { ...@@ -75,6 +79,7 @@ const DeptSelector = (props) => {
allowClear allowClear
treeDefaultExpandAll={true} treeDefaultExpandAll={true}
placeholder={disabled ? (placeholder || '') : (placeholder || '点击选择部门')} placeholder={disabled ? (placeholder || '') : (placeholder || '点击选择部门')}
{...(isMultiple ? multipleConfig : {})}
> >
</TreeSelect> </TreeSelect>
) )
......
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