Commit f7f6b3b8 by zhaochengxiang

衍生表

parent c698c607
...@@ -317,7 +317,7 @@ const EditModel = (props) => { ...@@ -317,7 +317,7 @@ const EditModel = (props) => {
readOnly!=='true' && <Space> readOnly!=='true' && <Space>
{ {
!modelerData?.final && <Button type='primary' onClick={editInherite} danger > !modelerData?.final && <Button type='primary' onClick={editInherite} danger >
编辑历史存储形式 编辑衍生表
</Button> </Button>
} }
<Tooltip title={editTip}> <Tooltip title={editTip}>
...@@ -344,7 +344,7 @@ const EditModel = (props) => { ...@@ -344,7 +344,7 @@ const EditModel = (props) => {
loading={confirmLoading} loading={confirmLoading}
danger danger
> >
保存 {action==='edit' ? '保存' : '保存衍生表'}
</Button> </Button>
</Space> </Space>
) )
......
...@@ -31,7 +31,6 @@ const ImportAction = (props) => { ...@@ -31,7 +31,6 @@ const ImportAction = (props) => {
const modelerDataRef = useRef(null); const modelerDataRef = useRef(null);
useEffect(() =>{ useEffect(() =>{
if ((action||'')==='') return; if ((action||'')==='') return;
if (!mountRef.current && action === 'edit' && !permitCheckOut) { if (!mountRef.current && action === 'edit' && !permitCheckOut) {
......
import React, { useState, useContext, useEffect } from "react"; import React, { useState, useContext, useEffect, useRef } from "react";
import { Button, Tabs, Checkbox } from "antd"; import { Button, Tabs, Checkbox } from "antd";
import { DownOutlined, UpOutlined } from "@ant-design/icons"; import { DownOutlined, UpOutlined } from "@ant-design/icons";
...@@ -19,6 +19,8 @@ const FC = (props) => { ...@@ -19,6 +19,8 @@ const FC = (props) => {
const [zipperModelerData, setZipperModelerData] = useState(undefined); const [zipperModelerData, setZipperModelerData] = useState(undefined);
const { createHistoryModel, createZipperModel, setInheriteState, setInheriteData } = useContext(EditInheritedModelContext); const { createHistoryModel, createZipperModel, setInheriteState, setInheriteData } = useContext(EditInheritedModelContext);
const mountRef = useRef(true);
useEffect(() => { useEffect(() => {
if (!editable) { if (!editable) {
if (modelerData?.final) { if (modelerData?.final) {
...@@ -38,18 +40,20 @@ const FC = (props) => { ...@@ -38,18 +40,20 @@ const FC = (props) => {
if (modelerData) { if (modelerData) {
if (modelerData.inherited?.historical) { if (modelerData.inherited?.historical) {
setHistoricalModelerData(modelerData.inherited?.historical); setHistoricalModelerData(modelerData.inherited?.historical);
} else { } else if (mountRef.current) {
getInheriteDataModel(inheritanceHistoricalType); getInheriteDataModel(inheritanceHistoricalType);
} }
if (modelerData.inherited?.zipper) { if (modelerData.inherited?.zipper) {
setZipperModelerData(modelerData.inherited?.zipper); setZipperModelerData(modelerData.inherited?.zipper);
} else { } else if (mountRef.current) {
getInheriteDataModel(inheritanceZipperType); getInheriteDataModel(inheritanceZipperType);
} }
mountRef.current = false;
} }
} }
//eslint-disable-next-line react-hooks/exhaustive-deps //eslint-disable-next-line react-hooks/exhaustive-deps
}, [editable, modelerData]) }, [modelerData, editable])
const getInheriteDataModel = (type) => { const getInheriteDataModel = (type) => {
dispatch({ dispatch({
...@@ -146,7 +150,7 @@ const FC = (props) => { ...@@ -146,7 +150,7 @@ const FC = (props) => {
</Tabs> : <div className='flex' style={{ alignItems: 'center' }}> </Tabs> : <div className='flex' style={{ alignItems: 'center' }}>
<h2 className='mr-3' style={{ marginBottom: 0 }}>历史存储形式</h2> <h2 className='mr-3' style={{ marginBottom: 0 }}>历史存储形式</h2>
{ {
relationModelerDatas?.map((item, index) => <a className='mr-3' key={index} onClick={() => { 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`); 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>) }}>{item.cnName}</a>)
} }
......
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