Commit 931bcea0 authored by 涂伟's avatar 涂伟

fix: '1.流程节点权限人员角色面板回显bug修复2.运维中流程节点配置了多个角色,删除的过程中,页面会卡死崩溃修复'

parent d4dd8495
Pipeline #76845 passed with stages
import React, { useState, useEffect, useRef, forwardRef, useImperativeHandle } from 'react';
import { Space, Button, Divider, Table, Tooltip, message } from 'antd';
import { DeleteOutlined, EditTwoTone, PlusOutlined } from '@ant-design/icons';
import debounce from 'lodash/debounce';
import RoalChoose from './RoalChoose';
import Undertaker from './Undertaker';
import styles from './ConfgUndertake.less';
......@@ -12,6 +13,7 @@ const ConfgUndertake = (props, ref) => {
const [chooseUser, setChooseUser] = useState(); // 当前编辑角色或者机构的默认承办人
const [showUnderTaker, setShowUnderTaker] = useState(false); // 是否显示选择默认承办人弹窗
const [roleList, setRoleList] = useState([]);
const delayedNodeChange = useRef(debounce(list => nodeChage('roleList', list), 500)).current;
useImperativeHandle(ref, () => ({
getParmar,
}));
......@@ -31,7 +33,8 @@ const ConfgUndertake = (props, ref) => {
list.splice(index, 1);
setRoleList(list);
nodeChage('roleList', list);
delayedNodeChange(list);
// nodeChage('roleList', list);
};
// 添加角色或机构
const addUser = selectList => {
......
......@@ -105,14 +105,24 @@ const RoalChoose = props => {
let list = JSON.parse(JSON.stringify(res.data));
list.forEach(item => {
if (item.child.length) {
item.child[0].roleList.forEach(v => {
v.roleID = Number(v.roleID);
if (selected.has(v.roleID)) {
v.isChecked = true;
} else {
v.isChecked = false;
}
});
// item.child[0].roleList.forEach(v => {
// v.roleID = Number(v.roleID);
// if (selected.has(v.roleID)) {
// v.isChecked = true;
// } else {
// v.isChecked = false;
// }
// });
item.child.forEach(v => {
v.roleList.forEach(vv => {
vv.roleID = Number(vv.roleID);
if (selected.has(vv.roleID)) {
vv.isChecked = true;
} else {
vv.isChecked = false;
}
});
})
}
item.roleList.forEach(v => {
v.roleID = Number(v.roleID);
......
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