Commit 7ba52688 by zhaochengxiang

冲突详情

parent 355c03e3
......@@ -8,7 +8,7 @@ import './VersionCompare.less'
import { formatDate } from '../../../../util'
const FC = (props) => {
const { item, visible, onCancel } = props
const { item, visible, title = '基线模型变更提醒',readonly = false, onCancel } = props
const [waiting, setWaiting] = React.useState(false)
const close = (val) => {
......@@ -49,10 +49,10 @@ const FC = (props) => {
return (
<Modal
visible={visible}
footer={footer}
footer={readonly?null:footer}
width='80%'
bodyStyle={{ padding: '15px', height: '80vh', overflow: 'auto' }}
title='基线模型变更提醒'
title={title}
centered destroyOnClose
onCancel={() => { close() }}
>
......
......@@ -3,6 +3,7 @@ import { Modal } from 'antd'
import { dispatch } from '../../../../model'
import Table from '../../../../util/Component/Table'
import BranchModelSync from '../../Model/Component/branch-model-sync'
const FC = ({ visible, item, onCancel }) => {
const [loading, setLoading] = React.useState(false)
......@@ -10,6 +11,11 @@ const FC = ({ visible, item, onCancel }) => {
const [animating, setAnimating] = React.useState(true)
const [branchModelSyncParams, setBranchModelSyncParams] = React.useState({
visible: false,
item: undefined,
});
React.useEffect(() => {
if (visible) {
setTimeout(() => {
......@@ -20,6 +26,10 @@ const FC = ({ visible, item, onCancel }) => {
}
}, [visible, item])
const menuData = React.useMemo(() => {
return ['冲突详情']
}, [])
const cols = [
{
title: '序号',
......@@ -55,6 +65,15 @@ const FC = ({ visible, item, onCancel }) => {
})
}
const onRightMenuItemClick = (key, record) => {
if (key === '冲突详情') {
setBranchModelSyncParams({
visible: true,
item: {...record, forkedName: item?.name, forkedLastModifiedTs: item?.modifiedTs}
})
}
}
const close = () => {
setAnimating(true)
setLoading(false)
......@@ -62,24 +81,41 @@ const FC = ({ visible, item, 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>
<>
<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}
shouldRowContextMenu={() => true}
menuData={menuData}
menuPermissions={menuData}
onMenuItemClick={onRightMenuItemClick}
/>
}
</Modal>
<BranchModelSync
title='冲突详情'
{...branchModelSyncParams}
readonly={true}
onCancel={(refresh) => {
setBranchModelSyncParams({
visible: false,
item: undefined,
})
}}
/>
</>
)
}
......
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