Commit 90421caa by zhaochengxiang

模型导出

parent ed452bed
......@@ -350,13 +350,16 @@ const EditModel = (props) => {
const onExportCancel = (val) => {
setExportParams({ visible: false })
let _id = (approvalId) ? currentApprovalModelId : modelerData?.id
if (val === 'ddl') {
setExportDDLParams({ visible: true })
} else if (val === 'erwin') {
dispatch({
type: 'datamodel.exportERWinString',
payload: {
ids: modelerData?.id,
ids: _id,
},
callback: data => {
copy(JSON.stringify(data));
......@@ -364,11 +367,11 @@ const EditModel = (props) => {
}
});
} else if (val === 'excel') {
window.open(`/api/datamodeler/easyDataModelerExport/excel?ids=${modelerData?.id}`);
window.open(`/api/datamodeler/easyDataModelerExport/excel?ids=${_id}`);
} else if (val === 'word') {
window.open(`/api/datamodeler/easyDataModelerExport/word/template?ids=${modelerData?.id}`);
window.open(`/api/datamodeler/easyDataModelerExport/word/template?ids=${_id}`);
} else if (val === 'basicExcel') {
window.open(`/api/datamodeler/easyDataModelerExport/modelBaseDataExcel?ids=${modelerData?.id}`);
window.open(`/api/datamodeler/easyDataModelerExport/modelBaseDataExcel?ids=${_id}`);
}
}
......@@ -587,6 +590,9 @@ const EditModel = (props) => {
data={approvalData}
id={currentApprovalModelId}
type={approvalType}
onExport={() => {
setExportParams({ visible: true })
}}
onHistory={() => {
setHistoryAndVersionDrawerVisible(true)
}}
......@@ -699,7 +705,7 @@ const EditModel = (props) => {
<ExportDDLModel
{...exportDDLParams}
reference='exportDDL'
ids={[modelerData?.id]}
ids={(approvalId) ? [currentApprovalModelId] : [modelerData?.id]}
names={[modelerData?.name]}
onCancel={() => {
setExportDDLParams({
......@@ -726,7 +732,7 @@ const EditModel = (props) => {
export default EditModel;
const PhysicalModelApprovalBottom = ({ loading, type, data, id, onChange, onOk, onHistory }) => {
const PhysicalModelApprovalBottom = ({ loading, type, data, id, onChange, onOk, onHistory, onExport }) => {
const [item, setItem] = useState()
const [waiting, setWaiting] = useState(false)
......@@ -750,6 +756,10 @@ const PhysicalModelApprovalBottom = ({ loading, type, data, id, onChange, onOk,
return [0, false, false]
}, [data, id])
const onExportClick = () => {
onExport?.()
}
const onHistoryClick = () => {
onHistory?.()
}
......@@ -795,6 +805,7 @@ const PhysicalModelApprovalBottom = ({ loading, type, data, id, onChange, onOk,
return (
<div className='flex' style={{ width: '100%', justifyContent: 'space-between' }}>
<Space>
<Button type='primary' ghost onClick={onExportClick}>导出</Button>
<Button type='primary' ghost onClick={onHistoryClick}>历史版本</Button>
</Space>
<Space>
......
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