Commit 2d87a566 by zhaochengxiang

分支下已发布的模型才能批量合并到基线

parent ff68c40e
......@@ -69,6 +69,7 @@ class Model extends React.Component {
canStartFlow: false,
canChangeCatalog: false,
canBatchAddTag: false,
canBatchJoin: false,
canDelete: false,
permissions: [],
selectSearchPropertiesVisible: false,
......@@ -115,7 +116,7 @@ class Model extends React.Component {
componentDidUpdate(prevProps, prevState) {
const { selectModelerIds, tableData, catalogId, permissions, currentView } = this.state;
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, canBatchJoin = true;
//分支管理返回的模型 都是有权限的
if (currentView !== 'branch') {
selectModelerIds?.forEach(id => {
......@@ -138,6 +139,12 @@ class Model extends React.Component {
canBatchAddTag = false;
}
});
} else {
selectModelerIds?.forEach(id => {
if ((id??'').indexOf('-4') === -1) {
canBatchJoin = false;
}
});
}
this.setState({
......@@ -145,7 +152,8 @@ class Model extends React.Component {
canStartFlow,
canChangeCatalog,
canDelete,
canBatchAddTag
canBatchAddTag,
canBatchJoin
});
}
......@@ -813,9 +821,9 @@ class Model extends React.Component {
{
currentView === 'branch' && <PermissionButton
defaultPermission={true}
tip={(selectModelerIds||[]).length===0?'请先选择模型':''}
tip={this.state.canBatchJoin?((selectModelerIds||[]).length===0?'请先选择已发布的模型':''):'只有已发布的模型才能合并到基线'}
onClick={this.onBatchMerge}
disabled={(selectModelerIds||[]).length===0}
disabled={(selectModelerIds||[]).length===0||!this.state.canBatchJoin}
>
合并到基线
</PermissionButton>
......
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