Commit 1817acab authored by 皮倩雯's avatar 皮倩雯

fix: '修改流程中心规则配置接口'

parent 6935f8a7
import React, { useEffect, useState, useRef } from 'react';
import { RuleValidation } from '@/services/workflow/workflow';
import { RuleValidation, RuleValidationPost } from '@/services/workflow/workflow';
import { Modal, Input, Form, message, Dropdown, Menu } from 'antd';
import styles from './index.less';
import Tree from '@/components/ExpendableTree';
......@@ -28,12 +28,9 @@ const RuleConfig = props => {
const [form] = Form.useForm();
useEffect(() => {
if (visible) {
console.log(fieldList, 'fieldList');
setExpandedKey(fieldList[0].TableName);
setRule(RuleContent);
setTimeout(() => {
console.log(document.getElementById('ruleText'));
console.log(ruleText.current);
document
.getElementById('ruleText')
.setSelectionRange(RuleContent.length, RuleContent.length); // 重新定位光标
......@@ -48,13 +45,20 @@ const RuleConfig = props => {
// 保存线配置
const onSave = () => {
if (rule) {
RuleValidation({ ruleContent: rule, flowId: flowID }).then(res => {
RuleValidationPost({ ruleContent: rule, flowId: flowID }).then(res => {
if (res.data) {
onSubumit(rule);
} else {
message.error('请检查规则是否正确');
}
});
// RuleValidation({ ruleContent: rule, flowId: flowID }).then(res => {
// if (res.data) {
// onSubumit(rule);
// } else {
// message.error('请检查规则是否正确');
// }
// });
} else {
onSubumit('');
handleCancel();
......
......@@ -53,6 +53,7 @@ import userStyles from '@/pages/userCenter/userManage/UserManage.less';
import iconStyles from '@/assets/font/omsfont/iconfont.css';
import SelectUser from './SelectUser/SelectUser';
import NewSelectUser from './SelectUser/NewSelectUser';
import OpePermissions from './SelectUser/OpePermissions';
import { data } from '@/pages/platformCenter/messageManage/projectManage/components/Mock';
const { Search } = Input;
......@@ -92,31 +93,36 @@ const SiteManage = () => {
const [keepTreeData, setKeepTreeData] = useState([]);
const [searchTreeValue, setSearchTreeValue] = useState('');
// const [childData, setChildData] = useState({visibleValue:''})
const [operation, setOperation] = useState(false);
// 点击树的回调
const handleTreeSelect = (e, treenode) => {
setSearchWord('');
console.log(e);
console.log(treenode);
if (treenode) {
const { node } = treenode;
const { roleID: id } = node;
console.log(node);
debugger;
setItemObj(node);
if (node.BuiltInRole) {
setKeyValue('0');
}
setUserNewVisible(true);
console.log(id);
if (id) {
if (node.subSystemValue === 'view') {
setOperation(true);
} else {
setOperation(false);
}
setSaveTreeId(id);
setRoleID(id);
setFlagSearch(1);
setValueList([...valueList]);
console.log([...valueList]);
} else {
if (node.visibleValue === 'view') {
setOperation(true);
} else {
setOperation(false);
}
// setRoleID(saveTreeId);
setRoleID('');
setDescrip('当前未选中角色');
......@@ -141,7 +147,6 @@ const SiteManage = () => {
setSpinLoading(false);
if (res.code === 0) {
const { roleList } = res.data;
console.log(roleList);
let list = [...roleList];
list.map((i, j) => {
if (i.visibleTitle.indexOf('手持') !== -1 && i.type !== 'mobile') {
......@@ -149,7 +154,6 @@ const SiteManage = () => {
list.push(i);
}
});
console.log(list);
setKeepTreeData([...list]);
let arr = transTree(JSON.parse(JSON.stringify(list)), '');
setTreeData(arr);
......@@ -1008,6 +1012,25 @@ const SiteManage = () => {
)}
</TabPane>
)}
{operation && (
<TabPane tab="操作权限" key="2">
{roleID ? (
<div className={styles.cardBoxRNew}>
<OpePermissions
visible={userNewVisible}
itemObj={itemObj}
onCancel={() => setUserNewVisible(false)}
confirmModal={userNewModal}
roleID={roleID}
/>
</div>
) : (
<div className={styles.cardBoxH}>
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description={descrip} />
</div>
)}
</TabPane>
)}
{/* <TabPane tab="菜单权限优化" key="2">
{roleID ? (
......
......@@ -2,10 +2,14 @@
display: flex;
justify-content: space-between;
}
.headerLeft {
display: flex;
justify-content: flex-end;
}
.pushTestContent {
.ant-table-body {
height: calc(100vh - 225px) !important;
}
}
display: flex;
height: calc(100% - 43px);
.checkScrollBox {
......@@ -37,7 +41,7 @@
line-height: 20px;
}
.topCheckbox>label :hover {
.topCheckbox > label :hover {
font-weight: 600;
}
......@@ -52,15 +56,14 @@
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-top:10px;
margin-top: 10px;
.ant-checkbox + span {
display: flex;
}
}
}
.fontlabel {
display: inline-block;
width:130px;
width: 130px;
overflow: hidden;
text-overflow: ellipsis;
// white-space: nowrap;
......@@ -88,16 +91,11 @@
.tableRight {
margin-left: 10px;
margin-top:10px;
margin-top: 10px;
.ant-spin-nested-loading {
.ant-table {
.ant-table-container {
}
}
}
......@@ -106,4 +104,4 @@
.ant-table-body {
// height: calc(100vh - 290px);
}
}
\ No newline at end of file
}
......@@ -56,4 +56,12 @@ export const getMenuByRoleWithLevel = params =>
export const getWebConfigTypes = params =>
get(`${PUBLISH_SERVICE}/PlatformCenter/GetWebConfigTypes`, params);
// 菜单拖拽
export const DragGroup = params => post(`${PUBLISH_SERVICE}/UserCenter/DragGroup `, params);
export const DragGroup = params => post(`${PUBLISH_SERVICE}/UserCenter/DragGroup`, params);
// 获取角色拥有的工程权限
export const getRolePermission = params =>
get(`/PandaView/publish/RolePermission/GetRolePermission`, params);
// 更新角色工程权限
export const updateRolePermission = params =>
post(`/PandaView/publish/RolePermission/UpdateRolePermission`, params);
......@@ -27,6 +27,11 @@ export const GetFormDataSource = param =>
// 规则效验
export const RuleValidation = param => get(`${PUBLISH_SERVICE}/WorkFlow/RuleValidation`, param);
export const RuleValidationPost = data =>
post(`${PUBLISH_SERVICE}/WorkFlow/RuleValidationPost`, data, {
headers: { 'Content-Type': 'application/json' },
});
// 获取可选的子事件流程
export const GetSubEventFlows = param => get(`${PUBLISH_SERVICE}/WorkFlow/GetSubEventFlows`, param);
// 获取流程映射表字段信息
......
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