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
3f82ac25
Commit
3f82ac25
authored
Jan 17, 2022
by
beisir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 添加输入框pleaholder
parent
4b842556
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
3 deletions
+31
-3
index.jsx
src/pages/GoodsManage/createModal/index.jsx
+31
-3
No files found.
src/pages/GoodsManage/createModal/index.jsx
View file @
3f82ac25
...
@@ -343,7 +343,11 @@ class goodsManage extends Component {
...
@@ -343,7 +343,11 @@ class goodsManage extends Component {
if
(
validateSpuInfo
(
values
,
initData
,
editData
,
productType
))
return
;
if
(
validateSpuInfo
(
values
,
initData
,
editData
,
productType
))
return
;
editData
.
forEach
(
item
=>
{
editData
.
forEach
(
item
=>
{
item
.
productStockWarning
=
item
.
productStockWarning
<
0
?
0
:
item
.
productStockWarning
;
item
.
productStockWarning
=
item
.
productStockWarning
<
0
?
0
:
item
.
productStockWarning
;
item
.
imageList
=
values
?.
imageList
[
item
.
firstSpecValue
]
||
values
.
commonImageList
||
[];
if
(
values
?.
imageList
)
{
item
.
imageList
=
values
?.
imageList
[
item
.
firstSpecValue
]
||
values
.
commonImageList
;
}
else
{
item
.
imageList
=
values
.
commonImageList
||
[];
}
if
(
!
item
.
imageList
||
!
item
.
imageList
.
length
)
{
if
(
!
item
.
imageList
||
!
item
.
imageList
.
length
)
{
imgErr
=
true
;
imgErr
=
true
;
}
}
...
@@ -434,6 +438,13 @@ class goodsManage extends Component {
...
@@ -434,6 +438,13 @@ class goodsManage extends Component {
this
.
BatchSetting
.
props
.
form
.
resetFields
();
this
.
BatchSetting
.
props
.
form
.
resetFields
();
};
};
validateToInputName
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
.
trim
().
length
<
2
)
{
callback
(
new
Error
(
'
商品名称不可小于2个字符
'
));
}
callback
();
};
render
()
{
render
()
{
const
{
visible
,
form
,
initData
=
{},
treeData
,
virtualTreeData
}
=
this
.
props
;
const
{
visible
,
form
,
initData
=
{},
treeData
,
virtualTreeData
}
=
this
.
props
;
const
isEdit
=
Object
.
keys
(
initData
).
length
!==
0
;
const
isEdit
=
Object
.
keys
(
initData
).
length
!==
0
;
...
@@ -550,8 +561,9 @@ class goodsManage extends Component {
...
@@ -550,8 +561,9 @@ class goodsManage extends Component {
<
SuperSelect
<
SuperSelect
allowClear
allowClear
showSearch
showSearch
style=
{
{
width
:
19
0
}
}
style=
{
{
width
:
28
0
}
}
filterOption=
{
filterOption
}
filterOption=
{
filterOption
}
placeholder=
"请选择,支持模糊搜索"
>
>
{
brandListArray
?.
length
&&
{
brandListArray
?.
length
&&
brandListArray
.
map
(
item
=>
(
brandListArray
.
map
(
item
=>
(
...
@@ -563,6 +575,9 @@ class goodsManage extends Component {
...
@@ -563,6 +575,9 @@ class goodsManage extends Component {
)
}
)
}
</
FormItem
>
</
FormItem
>
</
Col
>
</
Col
>
<
span
style=
{
{
display
:
'
inline-block
'
,
lineHeight
:
'
35px
'
,
color
:
'
#999
'
}
}
>
若需新增品牌请联系业务员
</
span
>
</
Row
>
</
Row
>
<
Row
type=
"flex"
>
<
Row
type=
"flex"
>
<
Col
span=
{
24
}
>
<
Col
span=
{
24
}
>
...
@@ -570,13 +585,24 @@ class goodsManage extends Component {
...
@@ -570,13 +585,24 @@ class goodsManage extends Component {
<
FormItem
label=
"商品名称"
labelCol=
{
{
span
:
2
}
}
>
<
FormItem
label=
"商品名称"
labelCol=
{
{
span
:
2
}
}
>
{
getFieldDecorator
(
'
name
'
,
{
{
getFieldDecorator
(
'
name
'
,
{
initialValue
:
initData
.
name
,
initialValue
:
initData
.
name
,
validateTrigger
:
[
'
onBlur
'
],
rules
:
[
rules
:
[
{
{
required
:
true
,
required
:
true
,
message
:
'
请输入商品名称
'
,
message
:
'
请输入商品名称
'
,
},
},
{
validator
:
this
.
validateToInputName
,
},
],
],
})(<
Input
style=
{
{
width
:
690
}
}
allowClear
/>)
}
})(
<
Input
style=
{
{
width
:
690
}
}
maxLength=
"100"
placeholder=
"请输入商品名称"
allowClear
/>,
)
}
</
FormItem
>
</
FormItem
>
</
Popover
>
</
Popover
>
{
isJDGoods
&&
(
{
isJDGoods
&&
(
...
@@ -597,6 +623,7 @@ class goodsManage extends Component {
...
@@ -597,6 +623,7 @@ class goodsManage extends Component {
allowClear
allowClear
showSearch
showSearch
style=
{
{
width
:
200
}
}
style=
{
{
width
:
200
}
}
placeholder=
"请选择一级规格"
disabled=
{
isEdit
&&
initData
.
firstSpecId
}
disabled=
{
isEdit
&&
initData
.
firstSpecId
}
onChange=
{
(
val
,
option
)
=>
onChange=
{
(
val
,
option
)
=>
this
.
specChange
(
'
first
'
,
option
?.
props
.
children
,
val
)
this
.
specChange
(
'
first
'
,
option
?.
props
.
children
,
val
)
...
@@ -676,6 +703,7 @@ class goodsManage extends Component {
...
@@ -676,6 +703,7 @@ class goodsManage extends Component {
allowClear
allowClear
showSearch
showSearch
disabled=
{
isEdit
&&
initData
.
secondSpecId
}
disabled=
{
isEdit
&&
initData
.
secondSpecId
}
placeholder=
"请选择二级规格"
style=
{
{
width
:
200
}
}
style=
{
{
width
:
200
}
}
onChange=
{
(
val
,
option
)
=>
this
.
specChange
(
'
second
'
,
option
?.
props
.
children
)
}
onChange=
{
(
val
,
option
)
=>
this
.
specChange
(
'
second
'
,
option
?.
props
.
children
)
}
filterOption=
{
(
input
,
option
)
=>
filterOption=
{
(
input
,
option
)
=>
...
...
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