Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
szse
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhaochengxiang
szse
Commits
c698c607
Commit
c698c607
authored
Apr 20, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去掉警告
parent
e45643b1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
20 deletions
+43
-20
EditInherited.jsx
src/view/Manage/Model/Component/EditInherited.jsx
+1
-1
ImportActionInherited.jsx
src/view/Manage/Model/Component/ImportActionInherited.jsx
+4
-3
ImportActionTable.jsx
src/view/Manage/Model/Component/ImportActionTable.jsx
+12
-4
ImportActionTable.less
src/view/Manage/Model/Component/ImportActionTable.less
+5
-9
InheritedPreview.jsx
src/view/Manage/Model/Component/InheritedPreview.jsx
+11
-3
InheritedPreview.less
src/view/Manage/Model/Component/InheritedPreview.less
+10
-0
No files found.
src/view/Manage/Model/Component/EditInherited.jsx
View file @
c698c607
...
...
@@ -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
)
=>
{
...
...
src/view/Manage/Model/Component/ImportActionInherited.jsx
View file @
c698c607
...
...
@@ -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
,
DataModelerRoleRea
der
,
ReadOnly
}
from
'../../../../util/constant'
;
import
{
Action
,
ModelerId
,
PermitCheckOut
,
Editable
,
StateId
,
Hol
der
,
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=
{
m
odelerData
}
type=
{
inheritanceHistoricalType
}
/>
}
{
!
collapse
&&
<
Preview
modelerData=
{
historicalM
odelerData
}
type=
{
inheritanceHistoricalType
}
/>
}
</
Tabs
.
TabPane
>
<
Tabs
.
TabPane
tab=
{
...
...
@@ -140,7 +141,7 @@ const FC = (props) => {
}
key=
{
inheritanceZipperType
}
>
{
!
collapse
&&
<
Preview
modelerData=
{
m
odelerData
}
type=
{
inheritanceZipperType
}
/>
}
{
!
collapse
&&
<
Preview
modelerData=
{
zipperM
odelerData
}
type=
{
inheritanceZipperType
}
/>
}
</
Tabs
.
TabPane
>
</
Tabs
>
:
<
div
className=
'flex'
style=
{
{
alignItems
:
'center'
}
}
>
<
h2
className=
'mr-3'
style=
{
{
marginBottom
:
0
}
}
>
历史存储形式
</
h2
>
...
...
src/view/Manage/Model/Component/ImportActionTable.jsx
View file @
c698c607
...
...
@@ -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);
}
}
}
...
...
src/view/Manage/Model/Component/ImportActionTable.less
View file @
c698c607
...
...
@@ -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;
}
}
.
primar
y-row {
.
gra
y-row {
.yy-table-cell {
background-color: #
d3ebff
!important;
background-color: #
f7f7f7
!important;
}
}
}
\ No newline at end of file
src/view/Manage/Model/Component/InheritedPreview.jsx
View file @
c698c607
import
React
,
{
use
Effect
,
use
State
,
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
''
}
}
/>
...
...
src/view/Manage/Model/Component/InheritedPreview.less
0 → 100644
View file @
c698c607
.inherited-preview {
.primary-row {
background-color: #d3ebff !important;
}
.gray-row {
background-color: #f7f7f7 !important;
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment