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
shenshaokai
jinfa-platform
Commits
d7767e69
Commit
d7767e69
authored
Apr 06, 2022
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 编辑商品里面添加属性值做校验
parent
0d124c21
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
2 deletions
+19
-2
commodity.ts
src/locales/en-US/commodity.ts
+2
-0
commodity.ts
src/locales/ko-KR/commodity.ts
+2
-0
commodity.ts
src/locales/zh-CN/commodity.ts
+1
-1
productAttributeForm.tsx
...mmodity/products/addProductsItem/productAttributeForm.tsx
+14
-1
No files found.
src/locales/en-US/commodity.ts
View file @
d7767e69
...
...
@@ -1193,4 +1193,6 @@ export default {
'commodity.products.zhuangtai'
:
'Status'
,
'commodity.products.xuanzeshangyougongyingshangpin'
:
'Select upstream supply products'
,
'commodity.products.xuanzexiayouxiaoshoushangpin'
:
'Select downstream products for sale'
,
'commodity.addProduct.productAttributeForm.addAttribute.error1'
:
'Enter a maximum of 12 characters and 6 Chinese characters'
,
}
src/locales/ko-KR/commodity.ts
View file @
d7767e69
...
...
@@ -1194,4 +1194,6 @@ export default {
'commodity.products.zhuangtai'
:
'상태'
,
'commodity.products.xuanzeshangyougongyingshangpin'
:
'상류 공급 제품 선택'
,
'commodity.products.xuanzexiayouxiaoshoushangpin'
:
'판매할 다운스트림 제품 선택'
,
'commodity.addProduct.productAttributeForm.addAttribute.error1'
:
'최대 12자, 6자를 입력할 수 있습니다'
,
}
src/locales/zh-CN/commodity.ts
View file @
d7767e69
...
...
@@ -1203,5 +1203,5 @@ export default {
'commodity.products.xuanzeshangyougongyingshangpin'
:
'选择上游供应商品'
,
'commodity.products.xuanzexiayouxiaoshoushangpin'
:
'选择下游销售商品'
,
'commodity.addProduct.productAttributeForm.addAttribute.error1'
:
'最多输入12个字符,6个汉字'
,
}
src/pages/commodity/products/addProductsItem/productAttributeForm.tsx
View file @
d7767e69
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
import
{
history
,
useIntl
}
from
'umi'
import
{
Form
,
Select
,
Checkbox
,
Tabs
,
Input
,
DatePicker
,
Row
,
Col
,
Button
,
Modal
,
Divider
,
Space
,
Typography
}
from
'antd'
import
{
Form
,
Select
,
Checkbox
,
Tabs
,
Input
,
DatePicker
,
Row
,
Col
,
Button
,
Modal
,
Divider
,
Space
,
Typography
,
message
}
from
'antd'
import
{
inject
,
observer
}
from
'mobx-react'
import
{
store
}
from
'@/store'
import
{
validatorByte
}
from
'@/utils/regExp'
...
...
@@ -203,6 +203,10 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
const
addItem
=
(
e
,
record
)
=>
{
e
.
preventDefault
();
let
_str
=
newValue
.
replace
(
/
[\u
4e00-
\u
9fa5
]
/g
,
'OO'
)
if
(
_str
.
length
>
12
)
{
return
message
.
error
(
intl
.
formatMessage
({
id
:
'commodity.addProduct.productAttributeForm.addAttribute.error1'
}));
}
newValue
&&
postProductCustomerSaveOrUpdateCustomerAttributeValue
({
customerAttribute
:
{
id
:
record
.
id
,
name
:
record
.
name
,
groupName
:
record
.
groupName
},
isEnable
:
true
,
...
...
@@ -395,6 +399,15 @@ const ProductAttributeForm: React.FC<Iprops> = (props) => {
<
Form
.
Item
name=
'value'
label=
{
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.productAttributeForm.modal.formItem.label3'
})
}
rules=
{
[
{
required
:
true
,
message
:
intl
.
formatMessage
({
id
:
'classAndProperty.addPropertyValue.form.value.message'
}),
},
{
validator
:
(
r
,
v
,
c
)
=>
validatorByte
(
r
,
v
,
c
,
12
)
}
]
}
>
<
Input
placeholder=
{
intl
.
formatMessage
({
id
:
'commodity.products.addProductsItem.productAttributeForm.modal.formItem.label3.placeholder'
})
}
/>
</
Form
.
Item
>
...
...
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