Commit f7f6b3b8 by zhaochengxiang

衍生表

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