Commit c698c607 by zhaochengxiang

去掉警告

parent e45643b1
......@@ -2,7 +2,6 @@ import React, { useState, useEffect, useContext } from "react";
import { Modal, Space, Button, Form } from "antd";
import ImportAction from "./ImportAction";
import { inheritanceHistoricalType, inheritanceZipperType } from "./ImportActionInherited";
import { EditInheritedModelContext } from "./ContextManage";
const FC = (props) => {
......@@ -19,6 +18,7 @@ const FC = (props) => {
} else {
setModelerData(undefined);
}
//eslint-disable-next-line react-hooks/exhaustive-deps
}, [visible])
const onChange = (newModelerData) => {
......
......@@ -5,7 +5,7 @@ import { DownOutlined, UpOutlined } from "@ant-design/icons";
import Preview from './InheritedPreview';
import { EditInheritedModelContext } from "./ContextManage";
import { dispatch } from '../../../../model';
import { Action, CatalogId, ModelerId, Hints, ModelerData, PermitCheckOut, Editable, StateId, Holder, DDL, DataModelerRoleReader, ReadOnly } from '../../../../util/constant';
import { Action, ModelerId, PermitCheckOut, Editable, StateId, Holder, ReadOnly } from '../../../../util/constant';
export const inheritanceHistoricalType = 'historical';
export const inheritanceZipperType = 'zipper';
......@@ -48,6 +48,7 @@ const FC = (props) => {
}
}
}
//eslint-disable-next-line react-hooks/exhaustive-deps
}, [editable, modelerData])
const getInheriteDataModel = (type) => {
......@@ -124,7 +125,7 @@ const FC = (props) => {
}
key={inheritanceHistoricalType}
>
{ !collapse && <Preview modelerData={modelerData} type={inheritanceHistoricalType} /> }
{ !collapse && <Preview modelerData={historicalModelerData} type={inheritanceHistoricalType} /> }
</Tabs.TabPane>
<Tabs.TabPane
tab={
......@@ -140,7 +141,7 @@ const FC = (props) => {
}
key={inheritanceZipperType}
>
{ !collapse && <Preview modelerData={modelerData} type={inheritanceZipperType} /> }
{ !collapse && <Preview modelerData={zipperModelerData} type={inheritanceZipperType} /> }
</Tabs.TabPane>
</Tabs> : <div className='flex' style={{ alignItems: 'center' }}>
<h2 className='mr-3' style={{ marginBottom: 0 }}>历史存储形式</h2>
......
......@@ -1012,7 +1012,11 @@ export const ImportActionTable = (props) => {
icon={<DeleteOutlined style={{ color: 'red' }} />}
onClick={(event) => {
event.stopPropagation();
remove(record);
if (record.inherited || record.provided) {
showMessage('warn', '衍生表中自动生成的字段不允许删除');
} else {
remove(record);
}
}}
/>
</React.Fragment>
......@@ -1300,8 +1304,8 @@ export const ImportActionTable = (props) => {
if (record?.partOfPrimaryKeyLogically) {
return 'editable-row primary-row';
}
if (record?.modelingTemplateTag?.id) {
return 'editable-row template-highlight-row';
if (record?.provided || record?.inherited || record?.modelingTemplateTag?.id) {
return 'editable-row gray-row';
}
}
......@@ -1324,7 +1328,11 @@ export const ImportActionTable = (props) => {
if (!isEditing(record)) {
rowParams = {...rowParams, onClick: (event) => {
event.stopPropagation();
edit(record);
if (record.inherited || record.provided) {
showMessage('warn', '衍生表中自动生成的字段不允许编辑');
} else {
edit(record);
}
}
}
......
......@@ -11,21 +11,16 @@
}
}
.template-highlight-row {
.yy-table-cell {
background-color: #f7f7f7 !important;
}
}
.attention-row {
.primary-row {
.yy-table-cell {
background-color: #fff9ed !important;
background-color: #d3ebff !important;
}
}
.primary-row {
.gray-row {
.yy-table-cell {
background-color: #d3ebff !important;
background-color: #f7f7f7 !important;
}
}
}
\ No newline at end of file
import React, { useEffect, useState, useMemo } from "react";
import { Row, Col, Tooltip, Typography, Space, Button } from "antd";
import React, { useState, useMemo } from "react";
import { Row, Col, Tooltip, Typography, Button } from "antd";
import DataGrid from '../../VirtualTable';
import EditInherited from './EditInherited';
import { inheritanceHistoricalType, inheritanceZipperType } from "./ImportActionInherited";
import './InheritedPreview.less';
const FC = (props) => {
const { modelerData, type } = props;
......@@ -192,12 +193,19 @@ const Table = ({ data }) => {
return (
<DataGrid
className='inherited-preview'
style={{ blockSize: 146 }}
columns={cols}
rows={data||[]}
headerHeight={30}
rowHeight={36}
rowClassName={(row) => {
if (row?.partOfPrimaryKeyLogically) {
return 'primary-row';
}
if (row?.provided || row?.inherited || row?.modelingTemplateTag?.id) {
return 'gray-row';
}
return ''
}}
/>
......
.inherited-preview {
.primary-row {
background-color: #d3ebff !important;
}
.gray-row {
background-color: #f7f7f7 !important;
}
}
\ No newline at end of file
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