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

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

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