|
@@ -133,7 +133,9 @@ const CustomPerm = ({ onConfirm, defaultValues = [], onCancel, ...resetModalProp
|
|
|
// options-用于处理右侧自定义删除逻辑中,防止两个setState合并从而导致更新失败
|
|
// options-用于处理右侧自定义删除逻辑中,防止两个setState合并从而导致更新失败
|
|
|
const node = state.transferDataSource.find(item => item.key === key)
|
|
const node = state.transferDataSource.find(item => item.key === key)
|
|
|
if (node?.isDepartment) {
|
|
if (node?.isDepartment) {
|
|
|
- const filterKeys = state.transferDataSource.filter(item => item.parentId === node.key).map(item => item.key)
|
|
|
|
|
|
|
+ const filterKeys = state.transferDataSource
|
|
|
|
|
+ .filter(item => item.parentId === node.key)
|
|
|
|
|
+ .map(item => item.key)
|
|
|
setState({
|
|
setState({
|
|
|
...state,
|
|
...state,
|
|
|
...options,
|
|
...options,
|
|
@@ -195,10 +197,9 @@ const CustomPerm = ({ onConfirm, defaultValues = [], onCancel, ...resetModalProp
|
|
|
getContainer={() => document.getElementById('root')}
|
|
getContainer={() => document.getElementById('root')}
|
|
|
footer={
|
|
footer={
|
|
|
<>
|
|
<>
|
|
|
- <Button className="mr-4" onClick={onCancel}>
|
|
|
|
|
|
|
+ <Button className="mr-2" onClick={onCancel}>
|
|
|
取消
|
|
取消
|
|
|
</Button>
|
|
</Button>
|
|
|
-
|
|
|
|
|
<Button
|
|
<Button
|
|
|
type="primary"
|
|
type="primary"
|
|
|
onClick={() => {
|
|
onClick={() => {
|
|
@@ -209,11 +210,13 @@ const CustomPerm = ({ onConfirm, defaultValues = [], onCancel, ...resetModalProp
|
|
|
onConfirm({ staffIds: state.targetKeys, dataPermission: 'custom' })
|
|
onConfirm({ staffIds: state.targetKeys, dataPermission: 'custom' })
|
|
|
}
|
|
}
|
|
|
onCancel()
|
|
onCancel()
|
|
|
- }}>
|
|
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
确定
|
|
确定
|
|
|
</Button>
|
|
</Button>
|
|
|
</>
|
|
</>
|
|
|
- }>
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ >
|
|
|
<div className={styles.modalContent}>
|
|
<div className={styles.modalContent}>
|
|
|
<Transfer
|
|
<Transfer
|
|
|
showSearch
|
|
showSearch
|
|
@@ -221,12 +224,16 @@ const CustomPerm = ({ onConfirm, defaultValues = [], onCancel, ...resetModalProp
|
|
|
titles={['部门栏', '目标栏']}
|
|
titles={['部门栏', '目标栏']}
|
|
|
operations={['点击添加']}
|
|
operations={['点击添加']}
|
|
|
className="h-full"
|
|
className="h-full"
|
|
|
|
|
+ listStyle={{
|
|
|
|
|
+ height: 500
|
|
|
|
|
+ }}
|
|
|
render={item => item.title}
|
|
render={item => item.title}
|
|
|
onSearch={handleOnSearch}
|
|
onSearch={handleOnSearch}
|
|
|
dataSource={state.transferDataSource}
|
|
dataSource={state.transferDataSource}
|
|
|
targetKeys={state.targetKeys}
|
|
targetKeys={state.targetKeys}
|
|
|
onChange={onChange}
|
|
onChange={onChange}
|
|
|
- showSelectAll={false}>
|
|
|
|
|
|
|
+ showSelectAll={false}
|
|
|
|
|
+ >
|
|
|
{({ direction, onItemSelectAll, onItemSelect }) => {
|
|
{({ direction, onItemSelectAll, onItemSelect }) => {
|
|
|
if (direction === 'left') {
|
|
if (direction === 'left') {
|
|
|
return state.dataSource?.length ? (
|
|
return state.dataSource?.length ? (
|
|
@@ -330,7 +337,8 @@ const CustomPerm = ({ onConfirm, defaultValues = [], onCancel, ...resetModalProp
|
|
|
onClick={() => {
|
|
onClick={() => {
|
|
|
const currKeys = state.targetKeys.filter(i => i !== item.key)
|
|
const currKeys = state.targetKeys.filter(i => i !== item.key)
|
|
|
handleUnCheckItem(state.treeKeys, item.key, { targetKeys: currKeys })
|
|
handleUnCheckItem(state.treeKeys, item.key, { targetKeys: currKeys })
|
|
|
- }}>
|
|
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
<DeleteOutlined />
|
|
<DeleteOutlined />
|
|
|
</span>
|
|
</span>
|
|
|
</li>
|
|
</li>
|