Commit 2471eca5 by zhaochengxiang

去掉不要的代码

parent 677a2185
...@@ -3,7 +3,7 @@ import { Modal, Space, Button, Form, Tabs, Checkbox } from "antd"; ...@@ -3,7 +3,7 @@ import { Modal, Space, Button, Form, Tabs, Checkbox } from "antd";
import LocalStorage from 'local-storage'; import LocalStorage from 'local-storage';
import ImportAction from "./ImportAction"; import ImportAction from "./ImportAction";
import { inheritanceHistoricalType, inheritanceZipperType } from "./ImportActionInherited"; import { inheritanceHistoricalType, inheritanceZipperType } from "./ImportActionRelation";
import { dispatch } from '../../../../model'; import { dispatch } from '../../../../model';
const FC = (props) => { const FC = (props) => {
......
...@@ -3,7 +3,6 @@ import { Spin, Tabs, Anchor, Affix, Button } from 'antd'; ...@@ -3,7 +3,6 @@ import { Spin, Tabs, Anchor, Affix, Button } from 'antd';
import LocalStorage from 'local-storage'; import LocalStorage from 'local-storage';
import ImportActionHeader from './ImportActionHeader'; import ImportActionHeader from './ImportActionHeader';
import ImportActionInherited from './ImportActionInherited';
import { ImportActionTable } from './ImportActionTable'; import { ImportActionTable } from './ImportActionTable';
import ImportActionIndex from './ImportActionIndex'; import ImportActionIndex from './ImportActionIndex';
import ImportActionManage from './ImportActionManage'; import ImportActionManage from './ImportActionManage';
......
import React, { useState, useEffect } from "react";
import { Popover } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons';
import { Action, ModelerId, PermitCheckOut, Editable, StateId, Holder, ReadOnly } from '../../../../util/constant';
export const inheritanceHistoricalType = 'historical';
export const inheritanceZipperType = 'zipper';
const FC = (props) => {
const { modelerData, action } = props;
const [relationModelerDatas, setRelationModelerDatas] = useState([]);
useEffect(() => {
if (modelerData?.inheritedFromEasyDataModelerDataModel) {
const newRelationModelerDatas = [];
newRelationModelerDatas.push(modelerData?.inheritedFromEasyDataModelerDataModel);
if (modelerData?.otherEasyDataModelerDataModelsInheritedFromSameOrigin) {
Object.keys(modelerData.otherEasyDataModelerDataModelsInheritedFromSameOrigin).forEach(key => {
newRelationModelerDatas.push(modelerData.otherEasyDataModelerDataModelsInheritedFromSameOrigin[key]);
})
}
setRelationModelerDatas(newRelationModelerDatas);
} else {
const newRelationModelerDatas = [];
if (modelerData?.inheritedEasyDataModelerDataModels?.historical) {
newRelationModelerDatas.push(modelerData?.inheritedEasyDataModelerDataModels?.historical);
}
if (modelerData?.inheritedEasyDataModelerDataModels?.zipper) {
newRelationModelerDatas.push(modelerData?.inheritedEasyDataModelerDataModels?.zipper);
}
setRelationModelerDatas(newRelationModelerDatas);
}
//eslint-disable-next-line react-hooks/exhaustive-deps
}, [modelerData])
return (
<div className='model-import-action-inherited'>
<div className='mb-3'>
<div className='flex' style={{ alignItems: 'center' }}>
<h3 className={action==='add'?'mr-1':'mr-3'} style={{ marginBottom: 0 }}>历史存储形式</h3>
{
action==='add' && <Popover className='mr-3' content='保存当前模型后方可选择历史存储形式'>
<QuestionCircleOutlined className='pointer' />
</Popover>
}
{
relationModelerDatas?.length===0 ? <span>暂无信息</span> : relationModelerDatas?.map((item, index) => <a className='mr-3' key={index} onClick={() => {
window.open(`/data-govern/data-model-action?${Action}=detail&${ModelerId}=${item.id}&${PermitCheckOut}=${item.permitCheckOut||false}&${Editable}=${item.editable||false}&${StateId}=${item.state?.id||''}&${Holder}=${item.holder||''}&${ReadOnly}=false`);
}}>{item.cnName}</a>)
}
</div>
</div>
</div>
)
}
export default FC;
\ No newline at end of file
...@@ -4,6 +4,9 @@ import { DownOutlined, UpOutlined, QuestionCircleOutlined } from '@ant-design/ic ...@@ -4,6 +4,9 @@ import { DownOutlined, UpOutlined, QuestionCircleOutlined } from '@ant-design/ic
import { Action, ModelerId, PermitCheckOut, Editable, StateId, Holder, ReadOnly } from '../../../../util/constant' import { Action, ModelerId, PermitCheckOut, Editable, StateId, Holder, ReadOnly } from '../../../../util/constant'
export const inheritanceHistoricalType = 'historical'
export const inheritanceZipperType = 'zipper'
const FC = (props) => { const FC = (props) => {
const { modelerData, action } = props const { modelerData, action } = props
const [isCollapse, setCollapse] = React.useState(true) const [isCollapse, setCollapse] = React.useState(true)
......
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