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
7a7c2741
Commit
7a7c2741
authored
Jan 09, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产目录编码限制
parent
957f033f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
UpdateDirectoryModal.jsx
...iew/Manage/AssetManage/Component/UpdateDirectoryModal.jsx
+21
-2
No files found.
src/view/Manage/AssetManage/Component/UpdateDirectoryModal.jsx
View file @
7a7c2741
...
...
@@ -11,6 +11,25 @@ const resourceTypes = [
{
key
:
'custom'
,
name
:
'自定义'
},
]
const
CodeInput
=
({
value
=
''
,
onChange
,
restrict
=
false
,
action
})
=>
{
const
onCodeChange
=
(
e
)
=>
{
if
(
!
restrict
||
(
restrict
&&
/^
[
a-zA-Z
]
+$/
.
test
(
e
.
target
.
value
)
))
{
onChange
?.(
e
.
target
.
value
);
}
}
return
<
Input
placeholder=
"请输入编号"
disabled=
{
action
!==
'add'
}
maxLength=
{
restrict
?
3
:
null
}
value=
{
value
}
onChange=
{
onCodeChange
}
/>
}
const
UpdateDirectoryModal
=
(
props
)
=>
{
const
{
visible
,
onCancel
,
dirId
,
action
}
=
props
;
...
...
@@ -154,7 +173,7 @@ const UpdateDirectoryModal = (props) => {
if
(
action
===
'add'
)
{
if
(
changedValues
.
type
===
'theme'
)
{
setIsThemeAdd
(
true
);
if
(
allValues
.
code
?.
length
>
3
)
{
if
(
allValues
.
code
?.
length
>
3
||
!
(
/^
[
a-zA-Z
]
+$/
.
test
(
allValues
.
code
))
)
{
form
.
setFieldsValue
({
code
:
''
});
}
}
else
if
(
changedValues
.
type
===
'directory'
)
{
...
...
@@ -231,7 +250,7 @@ const UpdateDirectoryModal = (props) => {
name=
"code"
rules=
{
[{
required
:
true
,
message
:
'必填项'
}]
}
>
<
Input
placeholder=
"请输入编号"
disabled=
{
action
!==
'add'
}
maxLength=
{
codeRestrict
?
3
:
null
}
/>
<
CodeInput
restrict=
{
codeRestrict
}
action=
{
action
}
/>
</
Form
.
Item
>
<
Form
.
Item
label=
"名称"
...
...
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