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
30d5d2f3
Commit
30d5d2f3
authored
Apr 16, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型table一行显示
parent
f90bca90
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
24 deletions
+36
-24
index.less
src/index.less
+7
-0
ImportActionTable.jsx
src/view/Manage/Model/Component/ImportActionTable.jsx
+21
-17
ImportModal.jsx
src/view/Manage/Model/Component/ImportModal.jsx
+1
-1
ModelTable.jsx
src/view/Manage/Model/Component/ModelTable.jsx
+7
-6
No files found.
src/index.less
View file @
30d5d2f3
...
@@ -61,6 +61,13 @@ code {
...
@@ -61,6 +61,13 @@ code {
margin-left: auto !important;
margin-left: auto !important;
}
}
.textOverflow {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
word-break: break-all;
}
.text-white {
.text-white {
color: white;
color: white;
}
}
...
...
src/view/Manage/Model/Component/ImportActionTable.jsx
View file @
30d5d2f3
...
@@ -57,10 +57,10 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
...
@@ -57,10 +57,10 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
return
(
return
(
<>
<>
<
Row
align=
'middle'
>
<
Row
align=
'middle'
>
<
Col
span=
{
12
}
>
<
Col
span=
{
9
}
>
<
span
>
类型名称:
</
span
>
<
span
>
类型名称:
</
span
>
</
Col
>
</
Col
>
<
Col
span=
{
1
2
}
>
<
Col
span=
{
1
5
}
>
<
Select
<
Select
onChange=
{
onNameChange
}
onChange=
{
onNameChange
}
value=
{
value
.
name
||
''
}
value=
{
value
.
name
||
''
}
...
@@ -81,10 +81,10 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
...
@@ -81,10 +81,10 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
//使用InputNumber:当value改变时 InputNumber显示值没改变 但实际值有改变 是ant design的bug 这里使用只能输入数字的Input
//使用InputNumber:当value改变时 InputNumber显示值没改变 但实际值有改变 是ant design的bug 这里使用只能输入数字的Input
return
(
return
(
<
Row
key=
{
index
}
className=
'mt-2'
align=
'middle'
>
<
Row
key=
{
index
}
className=
'mt-2'
align=
'middle'
>
<
Col
span=
{
12
}
>
<
Col
span=
{
9
}
>
<
span
>
{
`${parameterCnName||''}:`
}
</
span
>
<
span
>
{
`${parameterCnName||''}:`
}
</
span
>
</
Col
>
</
Col
>
<
Col
span=
{
1
2
}
>
<
Col
span=
{
1
5
}
>
<
Input
<
Input
onChange=
{
(
e
)
=>
{
onChange=
{
(
e
)
=>
{
onParameterValuesChange
(
e
,
index
);
onParameterValuesChange
(
e
,
index
);
...
@@ -105,7 +105,7 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
...
@@ -105,7 +105,7 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
const
EditableCell
=
({
const
EditableCell
=
({
editing
,
editing
,
dataIndex
,
dataIndex
,
t
itle
,
colT
itle
,
inputType
,
inputType
,
record
,
record
,
index
,
index
,
...
@@ -130,7 +130,7 @@ const EditableCell = ({
...
@@ -130,7 +130,7 @@ const EditableCell = ({
rules=
{
[
rules=
{
[
{
{
required
:
(
inputType
===
'text'
),
required
:
(
inputType
===
'text'
),
message
:
`请输入${
t
itle}!`
,
message
:
`请输入${
colT
itle}!`
,
},
},
]
}
]
}
>
>
...
@@ -149,7 +149,7 @@ const EditableCell = ({
...
@@ -149,7 +149,7 @@ const EditableCell = ({
rules=
{
[
rules=
{
[
{
{
required
:
true
,
required
:
true
,
message
:
`请输入${
t
itle}!`
,
message
:
`请输入${
colT
itle}!`
,
},
},
]
}
]
}
>
>
...
@@ -159,6 +159,7 @@ const EditableCell = ({
...
@@ -159,6 +159,7 @@ const EditableCell = ({
}
}
}
}
return
(
return
(
<
td
{
...
restProps
}
>
<
td
{
...
restProps
}
>
{
editing
?
(
{
editing
?
(
...
@@ -357,18 +358,21 @@ const ImportActionTable = (props) => {
...
@@ -357,18 +358,21 @@ const ImportActionTable = (props) => {
width
:
100
,
width
:
100
,
dataIndex
:
'cnName'
,
dataIndex
:
'cnName'
,
editable
:
true
,
editable
:
true
,
ellipsis
:
true
,
},
},
{
{
title
:
'英文名称'
,
title
:
'英文名称'
,
width
:
1
0
0
,
width
:
1
5
0
,
dataIndex
:
'name'
,
dataIndex
:
'name'
,
editable
:
true
,
editable
:
true
,
ellipsis
:
true
,
},
},
{
{
title
:
'类型'
,
title
:
'类型'
,
width
:
200
,
width
:
200
,
dataIndex
:
'datatype'
,
dataIndex
:
'datatype'
,
editable
:
true
,
editable
:
true
,
ellipsis
:
true
,
render
:
(
datatype
,
record
,
index
)
=>
{
render
:
(
datatype
,
record
,
index
)
=>
{
let
_text
=
''
;
let
_text
=
''
;
...
@@ -384,7 +388,7 @@ const ImportActionTable = (props) => {
...
@@ -384,7 +388,7 @@ const ImportActionTable = (props) => {
},
},
{
{
title
:
'可否为空'
,
title
:
'可否为空'
,
width
:
5
0
,
width
:
8
0
,
dataIndex
:
'nullable'
,
dataIndex
:
'nullable'
,
editable
:
true
,
editable
:
true
,
render
:
(
nullable
,
record
,
index
)
=>
{
render
:
(
nullable
,
record
,
index
)
=>
{
...
@@ -399,7 +403,7 @@ const ImportActionTable = (props) => {
...
@@ -399,7 +403,7 @@ const ImportActionTable = (props) => {
},
},
{
{
title
:
'主键'
,
title
:
'主键'
,
width
:
5
0
,
width
:
8
0
,
dataIndex
:
'partOfPrimaryKey'
,
dataIndex
:
'partOfPrimaryKey'
,
editable
:
true
,
editable
:
true
,
render
:
(
partOfPrimaryKey
,
record
,
index
)
=>
{
render
:
(
partOfPrimaryKey
,
record
,
index
)
=>
{
...
@@ -414,7 +418,7 @@ const ImportActionTable = (props) => {
...
@@ -414,7 +418,7 @@ const ImportActionTable = (props) => {
},
},
{
{
title
:
'分布键'
,
title
:
'分布键'
,
width
:
5
0
,
width
:
8
0
,
dataIndex
:
'partOfDistributionKey'
,
dataIndex
:
'partOfDistributionKey'
,
editable
:
true
,
editable
:
true
,
render
:
(
partOfDistributionKey
,
record
,
index
)
=>
{
render
:
(
partOfDistributionKey
,
record
,
index
)
=>
{
...
@@ -431,6 +435,7 @@ const ImportActionTable = (props) => {
...
@@ -431,6 +435,7 @@ const ImportActionTable = (props) => {
title
:
'描述'
,
title
:
'描述'
,
dataIndex
:
'remark'
,
dataIndex
:
'remark'
,
editable
:
true
,
editable
:
true
,
ellipsis
:
true
,
},
},
];
];
...
@@ -440,7 +445,6 @@ const ImportActionTable = (props) => {
...
@@ -440,7 +445,6 @@ const ImportActionTable = (props) => {
title
:
'操作'
,
title
:
'操作'
,
dataIndex
:
'action'
,
dataIndex
:
'action'
,
width
:
100
,
width
:
100
,
render
:
(
_
,
record
)
=>
{
render
:
(
_
,
record
)
=>
{
if
(
!
editable
)
return
null
;
if
(
!
editable
)
return
null
;
...
@@ -470,7 +474,7 @@ const ImportActionTable = (props) => {
...
@@ -470,7 +474,7 @@ const ImportActionTable = (props) => {
const
validateColumn
=
{
const
validateColumn
=
{
title
:
'规范'
,
title
:
'规范'
,
dataIndex
:
'validate'
,
dataIndex
:
'validate'
,
width
:
1
2
0
,
width
:
1
8
0
,
render
:
(
text
,
record
,
index
)
=>
{
render
:
(
text
,
record
,
index
)
=>
{
let
shortCauses
=
[];
let
shortCauses
=
[];
let
causes
=
[];
let
causes
=
[];
...
@@ -484,13 +488,13 @@ const ImportActionTable = (props) => {
...
@@ -484,13 +488,13 @@ const ImportActionTable = (props) => {
});
});
return
(
return
(
<
div
className=
'd-flex'
key=
{
index
}
style=
{
{
alignItems
:
'center'
}
}
>
<
div
className=
'd-flex'
key=
{
index
}
style=
{
{
alignItems
:
'center'
,
justifyContent
:
'space-between'
}
}
>
<
div
>
<
div
>
{
{
shortCauses
&&
shortCauses
.
map
((
shortCause
,
index
)
=>
{
shortCauses
&&
shortCauses
.
map
((
shortCause
,
index
)
=>
{
return
(
return
(
<
div
key=
{
index
}
>
<
div
className=
'textOverflow'
style=
{
{
width
:
130
,
color
:
'#f5222d'
}
}
title=
{
shortCause
}
key=
{
index
}
>
<
span
style=
{
{
color
:
'#f5222d'
}
}
>
{
shortCause
||
''
}
</
span
>
<
span
>
{
shortCause
||
''
}
</
span
>
</
div
>
</
div
>
);
);
})
})
...
@@ -548,7 +552,7 @@ const ImportActionTable = (props) => {
...
@@ -548,7 +552,7 @@ const ImportActionTable = (props) => {
record
,
record
,
dataIndex
:
col
.
dataIndex
,
dataIndex
:
col
.
dataIndex
,
inputType
:
(
col
.
dataIndex
===
'nullable'
||
col
.
dataIndex
===
'partOfDistributionKey'
||
col
.
dataIndex
===
'partOfPrimaryKey'
)
?
'check'
:
'text'
,
inputType
:
(
col
.
dataIndex
===
'nullable'
||
col
.
dataIndex
===
'partOfDistributionKey'
||
col
.
dataIndex
===
'partOfPrimaryKey'
)
?
'check'
:
'text'
,
t
itle
:
col
.
title
,
colT
itle
:
col
.
title
,
editing
:
isEditing
(
record
),
editing
:
isEditing
(
record
),
datatypes
:
supportedDatatypes
,
datatypes
:
supportedDatatypes
,
}),
}),
...
...
src/view/Manage/Model/Component/ImportModal.jsx
View file @
30d5d2f3
...
@@ -260,7 +260,7 @@ const ImportModal = (props) => {
...
@@ -260,7 +260,7 @@ const ImportModal = (props) => {
forceRender
forceRender
visible=
{
visible
}
visible=
{
visible
}
title=
{
title
}
title=
{
title
}
width=
{
step
===
2
?
1
0
00
:
520
}
width=
{
step
===
2
?
1
3
00
:
520
}
maskClosable=
{
false
}
maskClosable=
{
false
}
destroyOnClose
destroyOnClose
onCancel=
{
()
=>
{
onCancel=
{
()
=>
{
...
...
src/view/Manage/Model/Component/ModelTable.jsx
View file @
30d5d2f3
...
@@ -30,28 +30,29 @@ const ModelTable = (props) => {
...
@@ -30,28 +30,29 @@ const ModelTable = (props) => {
render
:
(
text
,
record
,
index
)
=>
{
render
:
(
text
,
record
,
index
)
=>
{
return
(
index
+
1
).
toString
();
return
(
index
+
1
).
toString
();
},
},
width
:
8
0
,
width
:
5
0
,
},
},
{
{
title
:
'模型名称'
,
title
:
'模型名称'
,
dataIndex
:
'name'
,
dataIndex
:
'name'
,
width
:
180
,
width
:
180
,
ellipsis
:
true
,
},
},
{
{
title
:
'中文名称'
,
title
:
'中文名称'
,
dataIndex
:
'cnName'
,
dataIndex
:
'cnName'
,
width
:
180
,
width
:
180
,
ellipsis
:
true
,
},
},
{
{
title
:
'模型描述'
,
title
:
'模型描述'
,
dataIndex
:
'remark'
,
dataIndex
:
'remark'
,
ellipsis
:
true
,
},
},
{
{
title
:
'操作'
,
title
:
'操作'
,
key
:
'action'
,
key
:
'action'
,
width
:
120
,
width
:
120
,
render
:
(
text
,
record
)
=>
{
render
:
(
text
,
record
)
=>
{
return
(
return
(
...
...
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