Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
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
ReactWeb5
CivManage
Commits
1de914d0
Commit
1de914d0
authored
Nov 10, 2022
by
邓超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 建表对特殊字符进行限制
parent
f2a4ec16
Pipeline
#63600
passed with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
3 deletions
+27
-3
TableView.jsx
...ages/bsmanager/base/tablemanager/components/TableView.jsx
+21
-2
TableView.less
...ges/bsmanager/base/tablemanager/components/TableView.less
+6
-1
No files found.
src/pages/bsmanager/base/tablemanager/components/TableView.jsx
View file @
1de914d0
...
...
@@ -215,11 +215,15 @@ const EditableCell = ({
value
&&
dataSource
.
some
((
item
,
i
)
=>
item
.
Name
===
value
&&
item
.
keyIndex
!==
record
.
keyIndex
)
)
{
return
Promise
.
reject
(
new
Error
(
'字段名称
不能重复
'
));
return
Promise
.
reject
(
new
Error
(
'字段名称
重复,请重新输入
'
));
}
return
Promise
.
resolve
();
},
},
{
pattern
:
/^
(?!(\d
+
)
$
)[\u
4e00-
\u
9fffa-zA-Z0-9_
]
+$/
,
message
:
'不能输入特殊符号或者纯数字'
,
},
];
}
childNode
=
editing
?
(
...
...
@@ -662,7 +666,22 @@ const TableView = props => {
<
Form
form=
{
form
}
>
<
div
style=
{
{
display
:
'flex'
,
justifyContent
:
'space-between'
}
}
>
<
div
style=
{
{
display
:
'flex'
}
}
>
<
Form
.
Item
label=
"表名"
name=
"tableName"
required
style=
{
{
marginBottom
:
'0'
}
}
>
<
Form
.
Item
label=
"表名"
rules=
{
[
{
required
:
true
,
message
:
'表名称不能为空'
,
},
{
pattern
:
/^
[\u
4e00-
\u
9fffa-zA-Z0-9_
]
+$/
,
message
:
'不能输入特殊符号'
,
},
]
}
name=
"tableName"
required
style=
{
{
marginBottom
:
'0'
}
}
>
<
Input
addonBefore=
{
type
===
'add'
?
`${tableMap[tableType]}_`
:
null
}
placeholder=
"请填写表名"
...
...
src/pages/bsmanager/base/tablemanager/components/TableView.less
View file @
1de914d0
...
...
@@ -29,10 +29,15 @@
overflow: visible;
}
.ant-table-cell {
overflow: visible;
}
.ant-form-item-explain {
position: absolute;
height: 35px;
width: 140px;
// width: 180px;
padding: 0 5px;
background-color: #ff4d4f;
top: -50px;
left: 50%;
...
...
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