Commit 1c3ccf90 by zhaochengxiang

bug fix

parent 6aec78db
...@@ -7,7 +7,7 @@ const FC = (props) => { ...@@ -7,7 +7,7 @@ const FC = (props) => {
const havePermission = useMemo(() => { const havePermission = useMemo(() => {
let _havePermission = true; let _havePermission = true;
if (defaultPermission===false) { if (defaultPermission!==undefined && defaultPermission!==null) {
_havePermission = defaultPermission; _havePermission = defaultPermission;
} else if (permissionKey) { } else if (permissionKey) {
const index = (permissions||[]).findIndex(item => item === permissionKey); const index = (permissions||[]).findIndex(item => item === permissionKey);
......
...@@ -345,7 +345,7 @@ const EditModel = (props) => { ...@@ -345,7 +345,7 @@ const EditModel = (props) => {
} }
const onCopy = () => { const onCopy = () => {
window.open(`/data-govern/data-model-action?${Action}=add&${CatalogId}=${privilege?.catalogId}&${ModelerId}=${modelerId}`) window.open(`/data-govern/data-model-action?${Action}=add&${CatalogId}=${privilege?.catalogId??''}&${ModelerId}=${modelerId}`)
} }
const onExport = () => { const onExport = () => {
...@@ -513,7 +513,7 @@ const EditModel = (props) => { ...@@ -513,7 +513,7 @@ const EditModel = (props) => {
导出 导出
</PermissionButton> </PermissionButton>
{ {
!modelerData?.fork && <PermissionButton !branchId && <PermissionButton
type='primary' type='primary'
onClick={onChangeCatalog} onClick={onChangeCatalog}
ghost ghost
...@@ -537,7 +537,7 @@ const EditModel = (props) => { ...@@ -537,7 +537,7 @@ const EditModel = (props) => {
{ {
readOnly!=='true' && <Space> readOnly!=='true' && <Space>
{ {
!modelerData?.inheritedFromEasyDataModelerDataModel && !modelerData?.fork && <PermissionButton !modelerData?.inheritedFromEasyDataModelerDataModel && !branchId && <PermissionButton
type='primary' type='primary'
onClick={() => { onClick={() => {
if (importActionRef.current && importActionRef.current.isLoading()) { if (importActionRef.current && importActionRef.current.isLoading()) {
......
...@@ -352,9 +352,15 @@ class Model extends React.Component { ...@@ -352,9 +352,15 @@ class Model extends React.Component {
onTableItemAction = (record, action, readOnly=false) => { onTableItemAction = (record, action, readOnly=false) => {
this.setState({ importModalAction: action, modelerId: record.id }, () => { this.setState({ importModalAction: action, modelerId: record.id }, () => {
const { catalogId, importModalAction, modelerId } = this.state; const { catalogId, importModalAction, modelerId, currentView } = this.state;
window.open(`/data-govern/data-model-action?${Action}=${importModalAction}&${CatalogId}=${catalogId}&${ModelerId}=${modelerId}&${PermitCheckOut}=${record.permitCheckOut||false}&${Editable}=${record.editable||false}&${StateId}=${record.state?.id||''}&${Holder}=${record.holder||''}&${ReadOnly}=${readOnly}`); let currentBranchId = '', currentCatalogId = catalogId
if (currentView === 'branch') {
currentCatalogId = ''
currentBranchId = catalogId
}
window.open(`/data-govern/data-model-action?${Action}=${importModalAction}&${CatalogId}=${currentCatalogId}&${ModelerId}=${modelerId}&${PermitCheckOut}=${record.permitCheckOut||false}&${Editable}=${record.editable||false}&${StateId}=${record.state?.id||''}&${Holder}=${record.holder||''}&${ReadOnly}=${readOnly}&${BranchId}=${currentBranchId}`);
}); });
} }
......
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