Commit bfb62e3f by zhaochengxiang

bug fix

parent 1c3ccf90
...@@ -113,11 +113,11 @@ class Model extends React.Component { ...@@ -113,11 +113,11 @@ class Model extends React.Component {
} }
componentDidUpdate(prevProps, prevState) { componentDidUpdate(prevProps, prevState) {
const { selectModelerIds, tableData, catalogId, permissions, view } = this.state; const { selectModelerIds, tableData, catalogId, permissions, currentView } = 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') { if (currentView !== '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) {
...@@ -150,8 +150,8 @@ class Model extends React.Component { ...@@ -150,8 +150,8 @@ class Model extends React.Component {
} }
if (catalogId !== prevState.catalogId || permissions !== prevState.permissions) { if (catalogId !== prevState.catalogId || permissions !== prevState.permissions) {
let canAdd = (view === 'branch'); let canAdd = (currentView === 'branch');
if (view !== 'branch') { if (currentView !== '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 => {
......
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