Commit 7ba52688 by zhaochengxiang

冲突详情

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