Commit 505f84b1 by zhaochengxiang

分支管理权限

parent 3a4adce7
...@@ -113,9 +113,11 @@ class Model extends React.Component { ...@@ -113,9 +113,11 @@ class Model extends React.Component {
} }
componentDidUpdate(prevProps, prevState) { componentDidUpdate(prevProps, prevState) {
const { selectModelerIds, tableData, catalogId, permissions } = this.state; const { selectModelerIds, tableData, catalogId, permissions, view } = this.state;
if (selectModelerIds !== prevState.selectModelerIds || tableData !== prevState.tableData) { if (selectModelerIds !== prevState.selectModelerIds || tableData !== prevState.tableData) {
let canExport = true, canStartFlow = true, canChangeCatalog = true, canDelete = true, canBatchAddTag = true; let canExport = true, canStartFlow = true, canChangeCatalog = true, canDelete = true, canBatchAddTag = true;
//分支管理返回的模型 都是有权限的
if (view !== 'branch') {
selectModelerIds?.forEach(id => { selectModelerIds?.forEach(id => {
const index = (tableData||[]).findIndex(item => item.id?.split('-')[0] === id?.split('-')[0]); const index = (tableData||[]).findIndex(item => item.id?.split('-')[0] === id?.split('-')[0]);
if (index !== -1) { if (index !== -1) {
...@@ -136,6 +138,7 @@ class Model extends React.Component { ...@@ -136,6 +138,7 @@ class Model extends React.Component {
canBatchAddTag = false; canBatchAddTag = false;
} }
}); });
}
this.setState({ this.setState({
canExport, canExport,
...@@ -147,7 +150,8 @@ class Model extends React.Component { ...@@ -147,7 +150,8 @@ class Model extends React.Component {
} }
if (catalogId !== prevState.catalogId || permissions !== prevState.permissions) { if (catalogId !== prevState.catalogId || permissions !== prevState.permissions) {
let canAdd = true; let canAdd = (view === 'branch');
if (view !== 'branch') {
const index = (permissions||[]).findIndex(item => item.privilegedObjectId === catalogId); const index = (permissions||[]).findIndex(item => item.privilegedObjectId === catalogId);
if (index !== -1) { if (index !== -1) {
permissions[index].optionList?.forEach(item => { permissions[index].optionList?.forEach(item => {
...@@ -155,7 +159,8 @@ class Model extends React.Component { ...@@ -155,7 +159,8 @@ class Model extends React.Component {
canAdd = false; canAdd = false;
} }
}); });
}; }
}
this.setState({ this.setState({
canAdd canAdd
......
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