Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
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
陈智峰
jinfa-platform
Commits
ea7fe076
Commit
ea7fe076
authored
Oct 14, 2021
by
前端-李俊鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 自营商城配置问题修复
parent
0448815e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
4 deletions
+27
-4
index.tsx
src/pages/afterService/components/BasicInfo/index.tsx
+2
-2
index.tsx
src/pages/ownMall/ownMallManager/ownMallConfigure/index.tsx
+4
-2
regExp.ts
src/utils/regExp.ts
+21
-0
No files found.
src/pages/afterService/components/BasicInfo/index.tsx
View file @
ea7fe076
/*
* @Author: XieZhiXiong
* @Date: 2021-05-11 10:46:57
* @LastEditors:
XieZhiXiong
* @LastEditTime: 2021-
05-18 15:47:20
* @LastEditors:
Crayon
* @LastEditTime: 2021-
10-14 09:56:42
* @Description: 申请单基础信息
*/
import
React
,
{
CSSProperties
}
from
'react'
;
...
...
src/pages/ownMall/ownMallManager/ownMallConfigure/index.tsx
View file @
ea7fe076
...
...
@@ -3,7 +3,7 @@ import { Image, Button, Form, Spin, Row, Col, Switch, Space, Input, Empty } from
import
{
FormOutlined
}
from
'@ant-design/icons'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
MALL_ENV
,
MALL_PROPERTY
,
ENV_COLOR
,
ENV_BG_COLOR
}
from
'./constant'
import
{
validatorByte
}
from
'@/utils/regExp'
;
import
{
validatorByte
,
validatorAllTrim
}
from
'@/utils/regExp'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
UploadImage
from
'@/components/UploadImage'
import
styles
from
'./index.less'
...
...
@@ -48,6 +48,7 @@ const OwnMallConfigure = () => {
PublicApi
.
postManageActivityShopRuleUpdate
({
id
,
...
values
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
getMallList
()
showEdit
({
id
},
false
)
}
}).
finally
(()
=>
{
setSaveLoading
(
false
)
...
...
@@ -134,7 +135,8 @@ const OwnMallConfigure = () => {
name=
'name'
rules=
{
[
{
required
:
true
,
message
:
'请填写商城名称'
},
{
validator
:
(
r
,
v
,
c
)
=>
validatorByte
(
r
,
v
,
c
,
40
)
}
{
validator
:
(
r
,
v
,
c
)
=>
validatorByte
(
r
,
v
,
c
,
40
)
},
{
validator
:
(
r
,
v
,
c
)
=>
validatorAllTrim
(
v
,
c
,
'商城名称'
)
},
]
}
>
<
Input
/>
...
...
src/utils/regExp.ts
View file @
ea7fe076
...
...
@@ -68,3 +68,24 @@ export const validatorByte = (rule, value, callback, maxByte: number) => {
callback
(
err
)
}
}
/**
* 校验内容是否为纯空格
* @param value 表单输入的值
* @param callback
* @param name 字段名称
*/
export
const
validatorAllTrim
=
(
value
,
callback
,
name
=
''
)
=>
{
try
{
if
(
value
){
if
(
value
.
trim
().
length
===
0
)
throw
new
Error
(
`
${
name
}
不可为空`
);
else
callback
()
}
else
{
callback
()
}
}
catch
(
err
)
{
callback
(
err
)
}
}
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