Commit acf31b2d authored by 田翔's avatar 田翔

fix: 承办人配置位置修改

parent 4f4e6a67
Pipeline #93652 passed with stages
import React, { useState, useEffect, useRef, forwardRef, useImperativeHandle } from 'react';
import { Space, Button, Divider, Table, Tooltip, message } from 'antd';
import { Space, Button, Divider, Table, Tooltip, message, Switch } from 'antd';
import { DeleteOutlined, EditTwoTone, PlusOutlined } from '@ant-design/icons';
import debounce from 'lodash/debounce';
import RoalChoose from './RoalChoose';
......@@ -13,11 +13,13 @@ const ConfgUndertake = (props, ref) => {
const [chooseUser, setChooseUser] = useState(); // 当前编辑角色或者机构的默认承办人
const [showUnderTaker, setShowUnderTaker] = useState(false); // 是否显示选择默认承办人弹窗
const [roleList, setRoleList] = useState([]);
const [IsDynamicDefaultUser, setIsDynamicDefaultUser] = useState(0)
const delayedNodeChange = useRef(debounce(list => nodeChage('roleList', list), 500)).current;
useImperativeHandle(ref, () => ({
getParmar,
}));
useEffect(() => {
setIsDynamicDefaultUser(editMsg.IsDynamicDefaultUser || 0)
setRoleList(editMsg.roleList);
}, [editMsg]);
const getParmar = () => ({ roleList });
......@@ -55,6 +57,11 @@ const ConfgUndertake = (props, ref) => {
nodeChage('roleList', list);
setShowUnderTaker(false);
};
const onChangeDefaultUser = e => {
setIsDynamicDefaultUser(e ? 1 : 0)
nodeChage('IsDynamicDefaultUser', e ? 1 : 0);
};
// 定义表格
const columns = [
{
......@@ -192,6 +199,17 @@ const ConfgUndertake = (props, ref) => {
})}
pagination={false}
/>
<div style={{ display: 'flex', justifyContent: 'right', marginTop: 14, marginBottom: '12px' }}>
是否动态承办人
<Switch
style={{ marginLeft: '5px' }}
checked={IsDynamicDefaultUser !== 0}
onChange={onChangeDefaultUser}
/>
</div>
<div className={styles.titleBox} style={{ color: '#BCBCBC', fontSize: 14, paddingLeft: 20 }}>
开启动态承办人后当前角色里所有人都是承办人
</div>
<RoalChoose
roleList={roleList}
visible={showRoal}
......
......@@ -15,7 +15,6 @@ const ConfigCopyPerson = (props, ref) => {
const { nodeChage, editMsg, flowID, flowData } = props;
const [showPersonSelect, setShowPersonSelect] = useState(false); // 是否显示人员选择器
const TurnOnCc = useRef(0);
const IsDynamicDefaultUser = useRef(0)
const [fieldList, setFieldList] = useState([]); // 当规则字段
const [ruleIndex, setRuleIndex] = useState(); // 编辑当前规则索引
const allFieldList = useRef([]); // 所有字段列表
......@@ -35,7 +34,6 @@ const ConfigCopyPerson = (props, ref) => {
allFieldList.current = [];
talbeList.current = [];
TurnOnCc.current = 0;
IsDynamicDefaultUser.current = editMsg.IsDynamicDefaultUser || 0
TurnOnCc.current = editMsg.TurnOnCc;
RuleList.current = editMsg.CCRuleList || [];
// 获取表数据
......@@ -74,16 +72,6 @@ const ConfigCopyPerson = (props, ref) => {
setFlag(flag + 1);
};
const onChangeDefaultUser = e => {
if (e) {
IsDynamicDefaultUser.current = 1;
} else {
IsDynamicDefaultUser.current = 0;
}
nodeChage('IsDynamicDefaultUser', IsDynamicDefaultUser.current);
setFlag(flag + 1);
};
// 规则回填
const saveRule = e => {
let list = JSON.parse(JSON.stringify(RuleList.current));
......@@ -258,17 +246,6 @@ const ConfigCopyPerson = (props, ref) => {
当开启”允许抄送“后,本节点具备抄送功能: 配置不同的抄送规则,可抄送给指定人员;
当不配置规则的时候,则默认本届点任何办理操作都会抄送给指定人员。
</div>
<div style={{ display: 'flex', justifyContent: 'right', marginBottom: '12px' }}>
是否动态承办人
<Switch
style={{ marginLeft: '5px' }}
checked={IsDynamicDefaultUser.current !== 0}
onChange={onChangeDefaultUser}
/>
</div>
<div className={styles.titleBox}>
说明:开启动态承办人后当前角色里所有人都是承办人
</div>
<div
className={styles.btnAddRule}
onClick={addRule}
......
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