Commit 0044845e authored by 邓超's avatar 邓超

fix: 工作流编辑优化,添加用户 时添加站点

parent 765d6705
Pipeline #65300 passed with stages
...@@ -611,13 +611,13 @@ const TableView = props => { ...@@ -611,13 +611,13 @@ const TableView = props => {
editable: true, editable: true,
align: 'center', align: 'center',
}, },
{ // {
title: '允许空值', // title: '允许空值',
dataIndex: 'IsNullable', // dataIndex: 'IsNullable',
width: 100, // width: 100,
editable: true, // editable: true,
align: 'center', // align: 'center',
}, // },
{ {
title: '操作', title: '操作',
width: 100, width: 100,
......
...@@ -65,17 +65,17 @@ const ConfgUndertake = (props, ref) => { ...@@ -65,17 +65,17 @@ const ConfgUndertake = (props, ref) => {
filters: [ filters: [
{ {
text: <span style={{ color: '#d46b08' }}>角色</span>, text: <span style={{ color: '#d46b08' }}>角色</span>,
value: 2, value: 1,
}, },
{ {
text: <span style={{ color: '#08979c' }}>机构</span>, text: <span style={{ color: '#08979c' }}>机构</span>,
value: 1, value: 2,
}, },
], ],
onFilter: (value, record) => record.type === value, onFilter: (value, record) => record.type === value,
render: (text, record) => ( render: (text, record) => (
<Tooltip placement="topLeft" title={text}> <Tooltip placement="topLeft" title={text}>
<span style={{ color: record.type === 2 ? '#d46b08' : '#08979c' }}>{text}</span> <span style={{ color: record.type === 1 ? '#d46b08' : '#08979c' }}>{text}</span>
</Tooltip> </Tooltip>
), ),
}, },
......
...@@ -272,21 +272,21 @@ const ConfigNodeMsg = (props, ref) => { ...@@ -272,21 +272,21 @@ const ConfigNodeMsg = (props, ref) => {
onFieldsChange={changeValue} onFieldsChange={changeValue}
labelAlign="left" labelAlign="left"
> >
<Form.Item label="排序" name="SerialNo" rules={[{ required: true, message: '请输入排序' }]}> {/* <Form.Item label="排序" name="SerialNo" rules={[{ required: true, message: '请输入排序' }]}>
<Input placeholder="请输入序号" disabled /> <Input placeholder="请输入序号" disabled />
</Form.Item> </Form.Item> */}
{/* 第一次填写显示,如果是网关、子节点一直显示 */} {/* 第一次填写显示,如果是网关、子节点一直显示 */}
<Form.Item <Form.Item
style={{ // style={{
display: // display:
!editMsg.ActivityId || // !editMsg.ActivityId ||
nodeMsg.NodeType === '20' || // nodeMsg.NodeType === '20' ||
nodeMsg.NodeType === '21' || // nodeMsg.NodeType === '21' ||
nodeMsg.NodeType === '22' || // nodeMsg.NodeType === '22' ||
nodeMsg.NodeType === '30' // nodeMsg.NodeType === '30'
? 'flex' // ? 'flex'
: 'none', // : 'none',
}} // }}
label={`${ label={`${
nodeMsg.NodeType === '20' || nodeMsg.NodeType === '21' || nodeMsg.NodeType === '22' nodeMsg.NodeType === '20' || nodeMsg.NodeType === '21' || nodeMsg.NodeType === '22'
? '网关' ? '网关'
...@@ -335,10 +335,10 @@ const ConfigNodeMsg = (props, ref) => { ...@@ -335,10 +335,10 @@ const ConfigNodeMsg = (props, ref) => {
style={{ style={{
display: editMsg.ActivityId ? 'flex' : 'none', display: editMsg.ActivityId ? 'flex' : 'none',
}} }}
label="节点名称" label="展示名称"
name="NodeAliasName" name="NodeAliasName"
> >
<Input placeholder="请输入节点名称" /> <Input placeholder="请输展示名称" />
</Form.Item> </Form.Item>
<Form.Item label="移交方式" name="Handover"> <Form.Item label="移交方式" name="Handover">
<Radio.Group> <Radio.Group>
...@@ -346,6 +346,7 @@ const ConfigNodeMsg = (props, ref) => { ...@@ -346,6 +346,7 @@ const ConfigNodeMsg = (props, ref) => {
<Radio value="自处理">自处理</Radio> <Radio value="自处理">自处理</Radio>
<Radio value="移交默认人">移交默认人</Radio> <Radio value="移交默认人">移交默认人</Radio>
<Radio value="移交发起人">移交发起人</Radio> <Radio value="移交发起人">移交发起人</Radio>
<Radio value="跨站移交">跨站移交</Radio>
</Radio.Group> </Radio.Group>
</Form.Item> </Form.Item>
<Form.Item label="工单主表" name="TableName"> <Form.Item label="工单主表" name="TableName">
......
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { GetRoleUser } from '@/services/workflow/workflow'; import { GetRoleUser } from '@/services/workflow/workflow';
import { Modal, Checkbox, notification, Empty, Divider } from 'antd'; import { Modal, Checkbox, notification, Empty, Divider } from 'antd';
import './Undertaker.less';
const Undertaker = props => { const Undertaker = props => {
const { onSubumit, handleCancel, visible, chooseUser } = props; const { onSubumit, handleCancel, visible, chooseUser } = props;
const [checkedList, setCheckedList] = useState([]); // 选中的数据 const [checkedList, setCheckedList] = useState([]); // 选中的数据
......
.ant-checkbox-group .ant-checkbox-group-item {
margin-right: 0px !important;
width: 150px;
}
\ No newline at end of file
...@@ -20,6 +20,34 @@ ...@@ -20,6 +20,34 @@
} }
.siteManageContainer { .siteManageContainer {
.ant-modal-root {
.ant-tree-switcher {
line-height: 1;
color: #1890ff;
margin-right: 0px !important;
}
.ant-checkbox-group .ant-checkbox-group-item {
margin-right: 0px !important;
width: 300px;
}
.ant-tree-list-holder {
overflow: auto;
overflow-x: hidden;
height: 40vh;
}
.ant-tabs-content-holder {
// overflow: auto;
// height: 50vh;
}
}
.siteCheckbox .ant-collapse-content>.ant-collapse-content-box {
padding: 16px 16px 0;
}
.ant-card-body { .ant-card-body {
padding: 15px; padding: 15px;
} }
...@@ -204,9 +232,7 @@ ...@@ -204,9 +232,7 @@
min-width: 600px; min-width: 600px;
} }
.siteCheckbox .ant-collapse-content>.ant-collapse-content-box {
padding: 16px 16px 0;
}
.siteList { .siteList {
width: 199px; width: 199px;
...@@ -313,29 +339,7 @@ ...@@ -313,29 +339,7 @@
justify-content: flex-end; justify-content: flex-end;
} }
.ant-modal-root {
.ant-tree-switcher {
line-height: 1;
color: #1890ff;
margin-right: 0px !important;
}
.ant-checkbox-group .ant-checkbox-group-item {
margin-right: 0px !important;
width: 300px;
}
.ant-tree-list-holder {
overflow: auto;
overflow-x: hidden;
height: 40vh;
}
.ant-tabs-content-holder {
overflow: auto;
height: 50vh;
}
}
.title { .title {
display: flex; display: flex;
......
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { Modal, Form, Input, notification, message, TreeSelect } from 'antd'; import { Modal, Form, Input, notification, message, TreeSelect, Select } from 'antd';
import { addUser, GetUserRelationListNew } from '@/services/userManage/api'; import { addUser, GetUserRelationListNew } from '@/services/userManage/api';
import classNames from 'classnames'; import classNames from 'classnames';
import sha1 from 'sha1'; import sha1 from 'sha1';
...@@ -8,7 +8,7 @@ import styles from './AddUserModal.less'; ...@@ -8,7 +8,7 @@ import styles from './AddUserModal.less';
const { SHOW_CHILD } = TreeSelect; const { SHOW_CHILD } = TreeSelect;
const AddUserModal = props => { const AddUserModal = props => {
const { visible, orgID, onCancel, updateTrees1, orgTitle1, onSelect } = props; const { visible, orgID, onCancel, updateTrees1, orgTitle1, onSelect, siteList } = props;
const [addUserForm] = Form.useForm(); // 添加用户 const [addUserForm] = Form.useForm(); // 添加用户
/** ***正则验证**** */ /** ***正则验证**** */
const noChinese = new RegExp(/^[^\u4e00-\u9fa5]+$/); // 不能包含中文 const noChinese = new RegExp(/^[^\u4e00-\u9fa5]+$/); // 不能包含中文
...@@ -76,6 +76,7 @@ const AddUserModal = props => { ...@@ -76,6 +76,7 @@ const AddUserModal = props => {
const password = addUserForm.getFieldValue('password') || ''; const password = addUserForm.getFieldValue('password') || '';
const phone = addUserForm.getFieldValue('phone') || ''; const phone = addUserForm.getFieldValue('phone') || '';
const email = addUserForm.getFieldValue('email') || ''; const email = addUserForm.getFieldValue('email') || '';
// 正则验证 // 正则验证
if (loginName === '') { if (loginName === '') {
notification.error({ notification.error({
...@@ -121,7 +122,9 @@ const AddUserModal = props => { ...@@ -121,7 +122,9 @@ const AddUserModal = props => {
(phone === '' || isPhone.test(phone)) && (phone === '' || isPhone.test(phone)) &&
(email === '' || isEmail.test(email)) (email === '' || isEmail.test(email))
) { ) {
console.log(addUserForm.getFieldValue('GroupId'), 'afasdf');
addUser({ addUser({
GroupId: addUserForm.getFieldValue('GroupId') || '',
OUID: orgID.id, OUID: orgID.id,
loginName, loginName,
userName, userName,
...@@ -130,6 +133,7 @@ const AddUserModal = props => { ...@@ -130,6 +133,7 @@ const AddUserModal = props => {
email, email,
}) })
.then(res => { .then(res => {
console.log('fasdkljgiodsaujgioasdgi');
if (res.code === 0) { if (res.code === 0) {
addUserForm.resetFields(); addUserForm.resetFields();
onCancel(); // 设置Modal不可见 onCancel(); // 设置Modal不可见
...@@ -322,9 +326,18 @@ const AddUserModal = props => { ...@@ -322,9 +326,18 @@ const AddUserModal = props => {
> >
<Input placeholder="请输入电子邮箱" autoComplete="off" /> <Input placeholder="请输入电子邮箱" autoComplete="off" />
</Form.Item> </Form.Item>
{/* <Form.Item name="stationList" label="关联站点" rules={[{ required: true }]}> <Form.Item name="GroupId" label="关联站点" rules={[{ required: true }]}>
<TreeSelect {...tProps} showSearch treeDefaultExpandAll /> {/* <TreeSelect {...tProps} showSearch treeDefaultExpandAll /> */}
</Form.Item> */} <Select
allowClear
showSearch
filterOption={(input, option) =>
option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
placeholder="请选择关联站点"
options={siteList}
/>
</Form.Item>
</Form> </Form>
</div> </div>
</Modal> </Modal>
......
...@@ -65,6 +65,8 @@ import { ...@@ -65,6 +65,8 @@ import {
DeleteUserNew, DeleteUserNew,
loadAllUserRole, loadAllUserRole,
DragGroup, DragGroup,
GetAllSite,
SetGroupManager,
} from '@/services/userManage/api'; } from '@/services/userManage/api';
import { AddUserAuthSetting, GetUserAuthSet } from '@/services/database/api'; import { AddUserAuthSetting, GetUserAuthSet } from '@/services/database/api';
import Tree from '@/components/ExpendableTree'; import Tree from '@/components/ExpendableTree';
...@@ -130,6 +132,7 @@ const UserManage = () => { ...@@ -130,6 +132,7 @@ const UserManage = () => {
const [authUserVisible, setAuthUserVisible] = useState(false); // 鉴权用户 const [authUserVisible, setAuthUserVisible] = useState(false); // 鉴权用户
const [orgTitle, setOrgTitle] = useState('当前机构'); // 弹框标题 const [orgTitle, setOrgTitle] = useState('当前机构'); // 弹框标题
const [groupId, setGroupId] = useState();
const [orgTitle1, setOrgTitle1] = useState('当前机构'); // 弹框标题 const [orgTitle1, setOrgTitle1] = useState('当前机构'); // 弹框标题
const [description, setDescription] = useState(''); // 机构描述信息 const [description, setDescription] = useState(''); // 机构描述信息
const [selectedRowKeys, setSelectedRowKeys] = useState([]); // 已选用户数,机构改变时重置 const [selectedRowKeys, setSelectedRowKeys] = useState([]); // 已选用户数,机构改变时重置
...@@ -171,6 +174,7 @@ const UserManage = () => { ...@@ -171,6 +174,7 @@ const UserManage = () => {
const [searchWordOrg, setSearchWordOrg] = useState(''); const [searchWordOrg, setSearchWordOrg] = useState('');
const [keepDataList, setKeepDataList] = useState([]); const [keepDataList, setKeepDataList] = useState([]);
const [siteList, setSiteList] = useState([]);
const setRowClassName = record => const setRowClassName = record =>
record.userID === selectColor.userID ? styles.clickRowStyle : ''; record.userID === selectColor.userID ? styles.clickRowStyle : '';
// 用户表列名 // 用户表列名
...@@ -253,6 +257,38 @@ const UserManage = () => { ...@@ -253,6 +257,38 @@ const UserManage = () => {
align: 'center', align: 'center',
render: record => ( render: record => (
<Space size="middle"> <Space size="middle">
<Tooltip title="设置为主管">
<Popconfirm
placement="bottomRight"
title={
<p>
确定将用户
<span className={styles.redText}>{voca.stripTags(record.loginName)}</span>
设置为{orgTitle}主管吗?
</p>
}
okText="确认"
cancelText="取消"
onConfirm={() => {
console.log(groupId, 'groupId');
SetGroupManager({ groupId, userId: record.userID }).then(res => {
if (res.code === 0) {
// eslint-disable-next-line no-unused-expressions
currentSelectOrg === '-1' ? submitSearchUser() : onSelect([currentSelectOrg]);
} else {
notification.error({
message: '设置失败',
description: res.msg,
});
}
});
}}
>
<UserOutlined
style={{ fontSize: '20px', color: record.isManager ? '#FAAD14' : '#1890FF' }}
/>
</Popconfirm>
</Tooltip>
<Tooltip title="关联权限"> <Tooltip title="关联权限">
<IdcardOutlined <IdcardOutlined
onClick={() => relateRole(record)} onClick={() => relateRole(record)}
...@@ -353,24 +389,22 @@ const UserManage = () => { ...@@ -353,24 +389,22 @@ const UserManage = () => {
{record.loginName == 'panda' || record.loginName == 'admin' ? ( {record.loginName == 'panda' || record.loginName == 'admin' ? (
<DeleteOutlined style={{ fontSize: '16px' }} /> <DeleteOutlined style={{ fontSize: '16px' }} />
) : ( ) : (
<Tooltip title="删除用户"> <Popconfirm
<Popconfirm placement="bottomRight"
placement="bottomRight" title={
title={ <p>
<p> 即将删除用户{' '}
即将删除用户{' '} <span className={styles.redText}>{voca.stripTags(record.loginName)}</span>
<span className={styles.redText}>{voca.stripTags(record.loginName)}</span> ,是否确认删除?
,是否确认删除? </p>
</p> }
} // title={`确认删除用户${currentUser}`}
// title={`确认删除用户${currentUser}`} okText="确认"
okText="确认" cancelText="取消"
cancelText="取消" onConfirm={() => deleteUser(record)}
onConfirm={() => deleteUser(record)} >
> <DeleteOutlined style={{ fontSize: '16px', color: '#e86060' }} />
<DeleteOutlined style={{ fontSize: '16px', color: '#e86060' }} /> </Popconfirm>
</Popconfirm>
</Tooltip>
)} )}
</Space> </Space>
), ),
...@@ -384,6 +418,12 @@ const UserManage = () => { ...@@ -384,6 +418,12 @@ const UserManage = () => {
// 获取用户机构树 // 获取用户机构树
useEffect(() => { useEffect(() => {
window.addEventListener('resize', resizeListener); window.addEventListener('resize', resizeListener);
GetAllSite().then(res => {
if (res.code === 0) {
setSiteList(res.data.map(item => ({ value: item.GroupId, label: item.GroupName })));
}
});
updateTrees(); updateTrees();
return () => { return () => {
window.removeEventListener('resize', resizeListener); window.removeEventListener('resize', resizeListener);
...@@ -704,6 +744,8 @@ const UserManage = () => { ...@@ -704,6 +744,8 @@ const UserManage = () => {
console.log(props[0]); console.log(props[0]);
setMenuID(props[0]); setMenuID(props[0]);
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
setGroupId(props[0]);
getOneOUUserListNew(props[0] || currentSelectOrg) getOneOUUserListNew(props[0] || currentSelectOrg)
.then(res => { .then(res => {
setCurrentOrgOperate(false); // 重置禁用当前机构操作为false setCurrentOrgOperate(false); // 重置禁用当前机构操作为false
...@@ -1661,6 +1703,7 @@ const UserManage = () => { ...@@ -1661,6 +1703,7 @@ const UserManage = () => {
orgTitle1={orgTitle1} orgTitle1={orgTitle1}
onCancel={kee} onCancel={kee}
updateTrees1={updateTrees1} updateTrees1={updateTrees1}
siteList={siteList}
onSelect={onSelect} onSelect={onSelect}
/> />
{/* 添加下级机构 */} {/* 添加下级机构 */}
......
...@@ -37,7 +37,7 @@ export const GetUserByKeyNew = params => get(`${PUBLISH_SERVICE}/UserCenter/GetU ...@@ -37,7 +37,7 @@ export const GetUserByKeyNew = params => get(`${PUBLISH_SERVICE}/UserCenter/GetU
* 添加用户 * 添加用户
* @param {*} param0 * @param {*} param0
*/ */
export const addUser = ({ OUID, loginName, userName, password, phone, email }) => export const addUser = ({ GroupId, OUID, loginName, userName, password, phone, email }) =>
post(`${PUBLISH_SERVICE}/UserCenter/AddUser`, { post(`${PUBLISH_SERVICE}/UserCenter/AddUser`, {
_version: 9999, _version: 9999,
_dc: Date.now(), _dc: Date.now(),
...@@ -47,6 +47,7 @@ export const addUser = ({ OUID, loginName, userName, password, phone, email }) = ...@@ -47,6 +47,7 @@ export const addUser = ({ OUID, loginName, userName, password, phone, email }) =
password, password,
phone, phone,
email, email,
GroupId,
}); });
export const addOrg = (orgID, OUName, description, comment) => export const addOrg = (orgID, OUName, description, comment) =>
...@@ -179,7 +180,11 @@ export const DeleteUserNew = params => get(`${PUBLISH_SERVICE}/UserCenter/Delete ...@@ -179,7 +180,11 @@ export const DeleteUserNew = params => get(`${PUBLISH_SERVICE}/UserCenter/Delete
export const SetUserRelationListNew = params => export const SetUserRelationListNew = params =>
get(`${PUBLISH_SERVICE}/UserCenter/SetUserRelationList`, params); get(`${PUBLISH_SERVICE}/UserCenter/SetUserRelationList`, params);
// 菜单拖拽 // 菜单拖拽
export const DragGroup = params => post(`${PUBLISH_SERVICE}/UserCenter/DragGroup `, params); export const DragGroup = params => post(`${PUBLISH_SERVICE}/UserCenter/DragGroup`, params);
// 获取所有站点
export const GetAllSite = params => get(`${PUBLISH_SERVICE}/UserCenter/GetAllSite`, params);
// 设置为主管
export const SetGroupManager = params => get(`${PUBLISH_SERVICE}/UserCenter/SetGroupManager`, params);
// export const DeleteOUNew = params => // export const DeleteOUNew = params =>
// get(`${PUBLISH_SERVICE}/UserCenter/DeleteOU`, params) // get(`${PUBLISH_SERVICE}/UserCenter/DeleteOU`, params)
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