Commit 1c3ccf90 by zhaochengxiang

bug fix

parent 6aec78db
......@@ -7,7 +7,7 @@ const FC = (props) => {
const havePermission = useMemo(() => {
let _havePermission = true;
if (defaultPermission===false) {
if (defaultPermission!==undefined && defaultPermission!==null) {
_havePermission = defaultPermission;
} else if (permissionKey) {
const index = (permissions||[]).findIndex(item => item === permissionKey);
......
......@@ -345,7 +345,7 @@ const EditModel = (props) => {
}
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 = () => {
......@@ -513,7 +513,7 @@ const EditModel = (props) => {
导出
</PermissionButton>
{
!modelerData?.fork && <PermissionButton
!branchId && <PermissionButton
type='primary'
onClick={onChangeCatalog}
ghost
......@@ -537,7 +537,7 @@ const EditModel = (props) => {
{
readOnly!=='true' && <Space>
{
!modelerData?.inheritedFromEasyDataModelerDataModel && !modelerData?.fork && <PermissionButton
!modelerData?.inheritedFromEasyDataModelerDataModel && !branchId && <PermissionButton
type='primary'
onClick={() => {
if (importActionRef.current && importActionRef.current.isLoading()) {
......
......@@ -352,9 +352,15 @@ class Model extends React.Component {
onTableItemAction = (record, action, readOnly=false) => {
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