Commit 56c32def by zhaochengxiang

分支模型

parent 733aa1b3
...@@ -716,6 +716,10 @@ export function* getForkedModel(payload) { ...@@ -716,6 +716,10 @@ export function* getForkedModel(payload) {
return yield call(datamodelerService.getForkedModel, payload) return yield call(datamodelerService.getForkedModel, payload)
} }
export function* getForkEasyDataModelerDataModelDistributions(payload) {
return yield call(datamodelerService.getForkEasyDataModelerDataModelDistributions, payload)
}
export function* getCooperationUsers() { export function* getCooperationUsers() {
return yield call(datamodelerService.getCooperationUsers) return yield call(datamodelerService.getCooperationUsers)
} }
......
...@@ -668,6 +668,10 @@ export function getForkedModel(payload) { ...@@ -668,6 +668,10 @@ export function getForkedModel(payload) {
return GetJSON("/datamodeler/easyDataModelerBranching/getForkedEasyDataModelerDataModel", payload) return GetJSON("/datamodeler/easyDataModelerBranching/getForkedEasyDataModelerDataModel", payload)
} }
export function getForkEasyDataModelerDataModelDistributions(payload) {
return GetJSON("/datamodeler/easyDataModelerBranching/getForkEasyDataModelerDataModelDistributions", payload)
}
/*approval*/ /*approval*/
export function getApprovalUsers(payload) { export function getApprovalUsers(payload) {
return GetJSON("/baseservice/sync/getUserByUserName", payload) return GetJSON("/baseservice/sync/getUserByUserName", payload)
......
...@@ -14,6 +14,7 @@ import TagCell from './tag-help'; ...@@ -14,6 +14,7 @@ import TagCell from './tag-help';
import BranchModelSync from './branch-model-sync'; import BranchModelSync from './branch-model-sync';
import ModelCompareSelectModel from './model-compare-select-model'; import ModelCompareSelectModel from './model-compare-select-model';
import MetadataCompare from './metadata-compare'; import MetadataCompare from './metadata-compare';
import ModelForkDetail from './model-fork-detail';
import './ModelTable.less'; import './ModelTable.less';
import 'react-contexify/dist/ReactContexify.css'; import 'react-contexify/dist/ReactContexify.css';
...@@ -167,6 +168,10 @@ const ModelTable = (props) => { ...@@ -167,6 +168,10 @@ const ModelTable = (props) => {
visible: false, visible: false,
item: undefined, item: undefined,
}) })
const [modelForkDetailParams, setModelForkDetailParams] = useState({
visible: false,
item: undefined,
})
const expandedDataMapRef = useRef(new Map()); const expandedDataMapRef = useRef(new Map());
const shouldScrollRef = useRef(false); const shouldScrollRef = useRef(false);
...@@ -687,6 +692,11 @@ const ModelTable = (props) => { ...@@ -687,6 +692,11 @@ const ModelTable = (props) => {
visible: true, visible: true,
item: currentItem, item: currentItem,
}) })
} else if (key === 'fork-model') {
setModelForkDetailParams({
visible: true,
item: currentItem,
})
} }
} }
...@@ -794,6 +804,13 @@ const ModelTable = (props) => { ...@@ -794,6 +804,13 @@ const ModelTable = (props) => {
> >
元数据对比 元数据对比
</PermissionRcItem> </PermissionRcItem>
<PermissionRcItem
id='fork-model'
defaultPermission={true}
onClick={handleItemClick}
>
分支模型
</PermissionRcItem>
{ {
view !== 'branch' && <PermissionRcItem view !== 'branch' && <PermissionRcItem
id='auth-transfer' id='auth-transfer'
...@@ -890,6 +907,15 @@ const ModelTable = (props) => { ...@@ -890,6 +907,15 @@ const ModelTable = (props) => {
}) })
}} }}
/> />
<ModelForkDetail
{...modelForkDetailParams}
onCancel={() => {
setModelForkDetailParams({
visible: false,
item: undefined,
})
}}
/>
{ contextHolder } { contextHolder }
</div> </div>
); );
......
import React from 'react'
import { Modal } from 'antd'
import { dispatch } from '../../../../model'
import Table from '../../../../util/Component/Table'
const FC = ({ visible, item, onCancel }) => {
const [loading, setLoading] = React.useState(false)
const [data, setData] = React.useState()
const [animating, setAnimating] = React.useState(true)
React.useEffect(() => {
if (visible) {
setTimeout(() => {
setAnimating(false)
}, 300)
getList()
}
}, [visible, item])
const cols = [
{
title: '序号',
dataIndex: 'index',
width:60,
render: (_, __, index)=> (index+1)
},
{
title: '项目名称',
dataIndex: 'branchName',
render: (_, record, index)=> record.branch?.name
},
{
title: '模型名称',
dataIndex: 'name',
},
]
const getList = () => {
setLoading(true)
dispatch({
type: 'datamodel.getForkEasyDataModelerDataModelDistributions',
payload: {
id: item?.id
},
callback: data => {
setLoading(false)
setData(data)
},
error: () => {
setLoading(false)
}
})
}
const close = () => {
setAnimating(true)
setLoading(false)
onCancel?.()
}
return (
<Modal
visible={visible}
footer={null}
width='50%'
bodyStyle={{ padding: '15px 15px 0', overflowX: 'auto', height: '50vh' }}
title={`${item?.name}的分支模型详情`}
centered destroyOnClose
onCancel={() => { close() }}
>
{
!animating && <Table
loading={loading}
columns={cols??[]}
dataSource={data??[]}
pagination={false}
/>
}
</Modal>
)
}
export default FC
\ No newline at end of file
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