Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
merchant-manage-ui
Commits
b920da7c
Commit
b920da7c
authored
Aug 09, 2022
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 添加校验
parent
cbcb7f83
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
404 additions
and
7 deletions
+404
-7
storeModal.jsx
src/pages/chainStoreManage/components/storeModal.jsx
+5
-2
index.jsx
src/pages/chainStoreManage/index.jsx
+26
-5
validator.js
src/utils/validator.js
+373
-0
No files found.
src/pages/chainStoreManage/components/storeModal.jsx
View file @
b920da7c
...
@@ -16,7 +16,7 @@ import { apiAddrArea, apiCreatStore, apiEditStore } from '../services';
...
@@ -16,7 +16,7 @@ import { apiAddrArea, apiCreatStore, apiEditStore } from '../services';
import
{
weekOptions
,
weekDefault
,
layout
}
from
'
../data
'
;
import
{
weekOptions
,
weekDefault
,
layout
}
from
'
../data
'
;
import
MapModal
from
'
@/components/BaiduMap
'
;
import
MapModal
from
'
@/components/BaiduMap
'
;
import
style
from
'
./style.less
'
;
import
style
from
'
./style.less
'
;
// import { await } from '@umijs/deps/compiled/signale
';
import
{
isCheckNumberLine
}
from
'
@/utils/validator
'
;
const
FormItem
=
Form
.
Item
;
const
FormItem
=
Form
.
Item
;
...
@@ -209,7 +209,10 @@ const StoreModal = props => {
...
@@ -209,7 +209,10 @@ const StoreModal = props => {
</
FormItem
>
</
FormItem
>
<
FormItem
label=
"门店电话"
name=
"phone"
>
<
FormItem
label=
"门店电话"
name=
"phone"
>
{
getFieldDecorator
(
'
phone
'
,
{
{
getFieldDecorator
(
'
phone
'
,
{
rules
:
[{
required
:
true
,
message
:
'
请输入门店电话!
'
}],
rules
:
[
{
required
:
true
,
message
:
'
请输入门店电话!
'
},
{
validator
:
isCheckNumberLine
,
message
:
'
请输入正确的门店电话!
'
},
],
initialValue
:
formData
.
phone
,
initialValue
:
formData
.
phone
,
})(<
Input
placeholder=
"请输入门店电话"
allowClear
maxLength=
{
20
}
/>)
}
})(<
Input
placeholder=
"请输入门店电话"
allowClear
maxLength=
{
20
}
/>)
}
</
FormItem
>
</
FormItem
>
...
...
src/pages/chainStoreManage/index.jsx
View file @
b920da7c
...
@@ -127,6 +127,31 @@ export default () => {
...
@@ -127,6 +127,31 @@ export default () => {
getList
();
getList
();
getAreaAddr
();
getAreaAddr
();
},
[]);
},
[]);
const
getWeekSlot
=
bw
=>
{
const
s
=
bw
[
0
];
let
e
=
bw
[
0
];
const
sy
=
[];
const
htmlarr
=
[];
bw
.
forEach
((
item
,
i
)
=>
{
if
(
s
+
i
===
item
)
{
e
=
item
;
}
else
{
sy
.
push
(<
span
key=
{
item
}
>
,
{
weeks
[
item
]
}
</
span
>);
}
});
if
(
s
===
e
)
{
htmlarr
.
push
(<
span
key=
{
s
}
>
{
weeks
[
s
]
}
</
span
>);
}
else
{
htmlarr
.
push
(
<
span
key=
{
s
}
>
{
weeks
[
s
]
}
~
{
weeks
[
e
]
}
</
span
>,
);
}
return
[...
htmlarr
,
...
sy
];
};
const
columns
=
[
const
columns
=
[
{
{
title
:
'
门店名称
'
,
title
:
'
门店名称
'
,
...
@@ -146,11 +171,7 @@ export default () => {
...
@@ -146,11 +171,7 @@ export default () => {
width
:
150
,
width
:
150
,
render
:
businessHours
=>
(
render
:
businessHours
=>
(
<
div
>
<
div
>
<
div
>
<
div
>
{
getWeekSlot
(
businessHours
.
weeks
)
}
</
div
>
{
businessHours
.
weeks
.
map
(
item
=>
(
<
span
key=
{
item
}
>
{
weeks
[
item
]
}
</
span
>
))
}
</
div
>
<
div
>
<
div
>
{
businessHours
.
hoursItems
.
map
(
item
=>
(
{
businessHours
.
hoursItems
.
map
(
item
=>
(
<
div
key=
{
item
.
begin
}
>
<
div
key=
{
item
.
begin
}
>
...
...
src/utils/validator.js
0 → 100644
View file @
b920da7c
This diff is collapsed.
Click to expand it.
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