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

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

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