Commit eb41407f by zhaochengxiang

模型详情抽屉风格

parent 680cef7a
......@@ -294,7 +294,7 @@ const EditModel = (props) => {
actionsBtn = (
<Space>
<Button type='primary' onClick={onHistory} danger >版本历史</Button>
{/* <Button type='primary' onClick={onHistory} danger >版本历史</Button> */}
<Tooltip title={editTip}>
<Button type='primary' onClick={edit} disabled={(stateId==='4')?!permitCheckOut:!editable} danger >
编辑
......@@ -308,9 +308,9 @@ const EditModel = (props) => {
<Button onClick={cancelEdit} >
取消
</Button>
<Button type='primary' onClick={onHistory} danger >
{/* <Button type='primary' onClick={onHistory} danger >
版本历史
</Button>
</Button> */}
<Button
type='primary'
onClick={save}
......@@ -324,9 +324,9 @@ const EditModel = (props) => {
} else if (action === 'flow') {
actionsBtn = (
<Space>
<Button type='primary' onClick={onHistory} danger>
{/* <Button type='primary' onClick={onHistory} danger>
版本历史
</Button>
</Button> */}
{
editable && <Button type='primary' onClick={edit} danger >
编辑
......@@ -338,9 +338,9 @@ const EditModel = (props) => {
return (
<div className='edit-model position-relative'>
<div className='edit-header'>
{/* <div className='edit-header'>
<span style={{ fontSize: 16, fontWeight: 'bold', color: '#fff' }}>{title}</span>
</div>
</div> */}
<div className='edit-container'>
<div className='edit-container-card'>
<ImportAction hints={hints} onChange={onActionChange} action={action} modelerId={modelerId} ddl={ddl} form={form} terms={terms} roughModelerData={roughModelerData} permitCheckOut={permitCheckOut} stateId={stateId} versionId={versionId} autoTabKey={autoTabKey} {...props} />
......
......@@ -11,6 +11,7 @@ import { dispatch } from '../../../../model';
import { showMessage, getQueryParam, paginate, isSzseEnv, formatDate } from '../../../../util';
import { AnchorId, AnchorTimestamp, Action, CatalogId, ModelerId } from '../../../../util/constant';
// import Tag from "../../Tag";
import IframeDrawer from '../../ModelConfig/Component/IframeDrawer' ;
import './ModelTable.less';
import 'react-contexify/dist/ReactContexify.css';
......@@ -140,6 +141,11 @@ const ModelTable = (props) => {
const [ sortRule, setSortRule ] = useState(null);
const [ filterData, setFilterData ] = useState([]);
const [ subData, setSubData ] = useState([]);
const [ iframeDrawerParams, setIframeDrawerParams ] = useState({
visible: false,
title: undefined,
url: undefined,
})
const cols = [
{
......@@ -669,7 +675,11 @@ const ModelTable = (props) => {
} else if (key === 'history') {
historyItem(currentItem);
} else if (key === 'copy') {
window.open(`/data-govern/data-model-action?${Action}=add&${CatalogId}=${(view==='dir')?(catalogId||''):''}&${ModelerId}=${currentItem.id}`);
setIframeDrawerParams({
visible: true,
title: '新增模型',
url: `/data-govern/data-model-action?${Action}=add&${CatalogId}=${(view==='dir')?(catalogId||''):''}&${ModelerId}=${currentItem.id}`
})
} else if (key === 'createTable') {
deployAction(currentItem);
} else if (key.indexOf('action') !== -1) {
......@@ -808,6 +818,17 @@ const ModelTable = (props) => {
}
</RcMenu>
<IframeDrawer
{...iframeDrawerParams}
onCancel={() => {
setIframeDrawerParams({
visible: false,
title: undefined,
url: undefined,
})
}}
/>
{ contextHolder }
</div>
);
......
......@@ -4,12 +4,18 @@ import { Timeline, Spin } from 'antd';
import { dispatch } from '../../../../model';
import { formatVersionHistoryDate } from '../../../../util';
import { Action, ModelerId, VersionId } from '../../../../util/constant';
import IframeDrawer from '../../ModelConfig/Component/IframeDrawer' ;
const VersionHistory = (props) => {
const { id } = props;
const [ versions, setVersions ] = useState([]);
const [ loading, setLoading ] = useState(false);
const [ iframeDrawerParams, setIframeDrawerParams ] = useState({
visible: false,
title: undefined,
url: undefined,
})
useEffect(() => {
if ((id||'') !== '') {
......@@ -39,7 +45,11 @@ const VersionHistory = (props) => {
}
const onVersionItemClick = (version) => {
window.open(`/data-govern/data-model-action?${Action}=detail-version&${ModelerId}=${version.dataModelId||''}&${VersionId}=${version.id||''}`);
setIframeDrawerParams({
visible: true,
title: '模型版本详情',
url: `/data-govern/data-model-action?${Action}=detail-version&${ModelerId}=${version.dataModelId||''}&${VersionId}=${version.id||''}`
})
}
return (
......@@ -83,6 +93,16 @@ const VersionHistory = (props) => {
})
}
</Timeline>
<IframeDrawer
{...iframeDrawerParams}
onCancel={() => {
setIframeDrawerParams({
visible: false,
title: undefined,
url: undefined,
})
}}
/>
</Spin>
);
}
......
......@@ -20,6 +20,7 @@ import { AppContext } from '../../../App';
import DebounceInput from './Component/DebounceInput';
import MetadataAnalysis from '../../QianKun/MetadataAnalysis';
import BatchModeler from './Component/BatchModeler';
import IframeDrawer from '../ModelConfig/Component/IframeDrawer'
import './index.less';
......@@ -60,6 +61,11 @@ class Model extends React.Component {
showUnbindTip: false,
showMode: 'list',
showBatchModeler: false,
iframeDrawerParams: {
visible: false,
title: undefined,
url: undefined,
}
}
}
......@@ -201,8 +207,13 @@ class Model extends React.Component {
onTableItemAction = (record, action) => {
this.setState({ importModalAction: action, modelerId: record.id }, () => {
const { catalogId, importModalAction, modelerId } = 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||''}`);
this.setState({
iframeDrawerParams: {
visible: true,
title: (importModalAction==='detail')?'模型详情':'模型编辑',
url: `/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||''}`
}
})
});
}
......@@ -221,7 +232,13 @@ class Model extends React.Component {
onImportUnconditionBtnClick = () => {
const { catalogId, currentView } = this.state;
window.open(`/data-govern/data-model-action?${Action}=add&${CatalogId}=${(currentView==='dir')?(catalogId||''):''}`);
this.setState({
iframeDrawerParams: {
visible: true,
title: '新增模型',
url: `/data-govern/data-model-action?${Action}=add&${CatalogId}=${(currentView==='dir')?(catalogId||''):''}`
}
})
}
onExportDDLBtnClick = () => {
......@@ -315,21 +332,45 @@ class Model extends React.Component {
if ((hints||[]).length > 0) {
if (currentView === 'requirement') {
setTimeout(() => {
window.open(`/data-govern/data-model-action?${Action}=add&${RequireId}=${catalogId||''}&${Hints}=${encodeURIComponent((hints||[]).join(','))}`);
this.setState({
iframeDrawerParams: {
visible: true,
title: '新增模型',
url: `/data-govern/data-model-action?${Action}=add&${RequireId}=${catalogId||''}&${Hints}=${encodeURIComponent((hints||[]).join(','))}`
}
})
}, 1000);
} else {
setTimeout(() => {
window.open(`/data-govern/data-model-action?${Action}=add&${CatalogId}=${(currentView==='dir')?(catalogId||''):''}&${Hints}=${encodeURIComponent((hints||[]).join(','))}`);
this.setState({
iframeDrawerParams: {
visible: true,
title: '新增模型',
url: `/data-govern/data-model-action?${Action}=add&${CatalogId}=${(currentView==='dir')?(catalogId||''):''}&${Hints}=${encodeURIComponent((hints||[]).join(','))}`
}
})
}, 1000);
}
} else {
if (currentView === 'requirement') {
setTimeout(() => {
window.open(`/data-govern/data-model-action?${Action}=add&${RequireId}=${catalogId||''}`);
this.setState({
iframeDrawerParams: {
visible: true,
title: '新增模型',
url: `/data-govern/data-model-action?${Action}=add&${RequireId}=${catalogId||''}`
}
})
}, 1000);
} else {
setTimeout(() => {
window.open(`/data-govern/data-model-action?${Action}=add&${CatalogId}=${(currentView==='dir')?(catalogId||''):''}`);
this.setState({
iframeDrawerParams: {
visible: true,
title: '新增模型',
url: `/data-govern/data-model-action?${Action}=add&${CatalogId}=${(currentView==='dir')?(catalogId||''):''}`
}
})
}, 1000);
}
}
......@@ -355,13 +396,25 @@ class Model extends React.Component {
if (currentView === 'requirement') {
setTimeout(() => {
wordData.content.slice(0, 5).forEach(data => {
window.open(`/data-govern/data-model-action?${Action}=add&${RequireId}=${catalogId}&${ModelerData}=${encodeURIComponent(JSON.stringify(data))}`, '_blank');
this.setState({
iframeDrawerParams: {
visible: true,
title: '新增模型',
url: `/data-govern/data-model-action?${Action}=add&${RequireId}=${catalogId}&${ModelerData}=${encodeURIComponent(JSON.stringify(data))}`
}
})
})
}, 2000);
} else {
setTimeout(() => {
wordData.content.slice(0, 5).forEach(data => {
window.open(`/data-govern/data-model-action?${Action}=add&${CatalogId}=${catalogId}&${ModelerData}=${encodeURIComponent(JSON.stringify(data))}`, '_blank');
this.setState({
iframeDrawerParams: {
visible: true,
title: '新增模型',
url: `/data-govern/data-model-action?${Action}=add&${CatalogId}=${catalogId}&${ModelerData}=${encodeURIComponent(JSON.stringify(data))}`
}
})
})
}, 2000);
}
......@@ -377,11 +430,23 @@ class Model extends React.Component {
if (confirm && (ddl||'') !== '') {
if (currentView === 'requirement') {
setTimeout(() => {
window.open(`/data-govern/data-model-action?${Action}=add&${RequireId}=${catalogId}&${DDL}=${encodeURIComponent(ddl)}`, '_blank');
this.setState({
iframeDrawerParams: {
visible: true,
title: '新增模型',
url: `/data-govern/data-model-action?${Action}=add&${RequireId}=${catalogId}&${DDL}=${encodeURIComponent(ddl)}`
}
})
}, 1000);
} else {
setTimeout(() => {
window.open(`/data-govern/data-model-action?${Action}=add&${CatalogId}=${catalogId}&${DDL}=${encodeURIComponent(ddl)}`, '_blank');
this.setState({
iframeDrawerParams: {
visible: true,
title: '新增模型',
url: `/data-govern/data-model-action?${Action}=add&${CatalogId}=${catalogId}&${DDL}=${encodeURIComponent(ddl)}`
}
})
}, 1000);
}
......@@ -743,6 +808,21 @@ class Model extends React.Component {
tip='您确定要解绑这些模型吗?'
onCancel={this.onUnbindTipModalCancel}
/>
<IframeDrawer
{...this.state.iframeDrawerParams}
onCancel={() => {
this.setState({
iframeDrawerParams: {
visible: false,
title: undefined,
url: undefined
}
})
}}
/>
</div>
);
}
......
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