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
25129bd7
Commit
25129bd7
authored
Apr 14, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型字段编辑增加非空
parent
144855cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
6 deletions
+23
-6
ImportActionTable.jsx
src/view/Manage/Model/Component/ImportActionTable.jsx
+23
-6
No files found.
src/view/Manage/Model/Component/ImportActionTable.jsx
View file @
25129bd7
import
React
,
{
useState
,
useCallback
,
useRef
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useCallback
,
useRef
,
useEffect
}
from
'react'
;
import
{
Table
,
Input
,
Form
,
Typography
,
Radio
,
Divider
,
Button
,
Popconfirm
,
Select
,
Row
,
Col
,
Popover
}
from
'antd'
;
import
{
Table
,
Input
,
Form
,
Typography
,
Radio
,
Divider
,
Button
,
Popconfirm
,
Select
,
Row
,
Col
,
Popover
,
Checkbox
}
from
'antd'
;
import
{
QuestionCircleOutlined
}
from
'@ant-design/icons'
;
import
{
QuestionCircleOutlined
}
from
'@ant-design/icons'
;
import
{
DndProvider
,
useDrag
,
useDrop
}
from
'react-dnd'
;
import
{
DndProvider
,
useDrag
,
useDrop
}
from
'react-dnd'
;
import
{
HTML5Backend
}
from
'react-dnd-html5-backend'
;
import
{
HTML5Backend
}
from
'react-dnd-html5-backend'
;
...
@@ -117,21 +117,24 @@ const EditableCell = ({
...
@@ -117,21 +117,24 @@ const EditableCell = ({
let
editingComponent
=
null
;
let
editingComponent
=
null
;
if
(
editing
)
{
if
(
editing
)
{
if
(
dataIndex
!==
'datatype'
)
{
if
(
dataIndex
!==
'datatype'
)
{
const
inputNode
=
inputType
===
'check'
?
<
Checkbox
/>
:
<
Input
/>
editingComponent
=
(
editingComponent
=
(
<
Form
.
Item
<
Form
.
Item
name=
{
dataIndex
}
name=
{
dataIndex
}
style=
{
{
style=
{
{
margin
:
0
,
margin
:
0
,
}
}
}
}
valuePropName=
{
'value'
}
valuePropName=
{
(
inputType
===
'check'
)?
'checked'
:
'value'
}
rules=
{
[
rules=
{
[
{
{
required
:
true
,
required
:
(
inputType
===
'text'
)
,
message
:
`请输入${title}!`
,
message
:
`请输入${title}!`
,
},
},
]
}
]
}
>
>
<
Input
/>
{
inputNode
}
</
Form
.
Item
>
</
Form
.
Item
>
);
);
}
else
{
}
else
{
...
@@ -364,7 +367,6 @@ const ImportActionTable = (props) => {
...
@@ -364,7 +367,6 @@ const ImportActionTable = (props) => {
{
{
title
:
'类型'
,
title
:
'类型'
,
width
:
200
,
width
:
200
,
dataIndex
:
'datatype'
,
dataIndex
:
'datatype'
,
editable
:
true
,
editable
:
true
,
render
:
(
datatype
,
record
,
index
)
=>
{
render
:
(
datatype
,
record
,
index
)
=>
{
...
@@ -381,6 +383,21 @@ const ImportActionTable = (props) => {
...
@@ -381,6 +383,21 @@ const ImportActionTable = (props) => {
}
}
},
},
{
{
title
:
'非空'
,
width
:
50
,
dataIndex
:
'nullable'
,
editable
:
true
,
render
:
(
nullable
,
record
,
index
)
=>
{
if
(
nullable
===
false
)
{
return
'否'
;
}
else
if
(
nullable
===
true
)
{
return
'是'
;
}
return
''
;
}
},
{
title
:
'描述'
,
title
:
'描述'
,
dataIndex
:
'remark'
,
dataIndex
:
'remark'
,
editable
:
true
,
editable
:
true
,
...
@@ -499,8 +516,8 @@ const ImportActionTable = (props) => {
...
@@ -499,8 +516,8 @@ const ImportActionTable = (props) => {
...
col
,
...
col
,
onCell
:
(
record
)
=>
({
onCell
:
(
record
)
=>
({
record
,
record
,
inputType
:
'text'
,
dataIndex
:
col
.
dataIndex
,
dataIndex
:
col
.
dataIndex
,
inputType
:
col
.
dataIndex
===
'nullable'
?
'check'
:
'text'
,
title
:
col
.
title
,
title
:
col
.
title
,
editing
:
isEditing
(
record
),
editing
:
isEditing
(
record
),
datatypes
:
supportedDatatypes
,
datatypes
:
supportedDatatypes
,
...
...
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