Commit acf31b2d authored by 田翔's avatar 田翔

fix: 承办人配置位置修改

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