Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
6ce040fb
提交
6ce040fb
authored
3月 16, 2019
作者:
YunaiV
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
前端:商品添加。完成度 10% ,先搭建好框框~
上级
45b2497c
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
171 行增加
和
3 行删除
+171
-3
router.config.js
admin-web/config/router.config.js
+10
-0
Home.js
admin-web/src/pages/Home/Home.js
+3
-3
ProductSpuAddOrUpdate.js
admin-web/src/pages/Product/ProductSpuAddOrUpdate.js
+143
-0
ProductSpuAddOrUpdate.less
admin-web/src/pages/Product/ProductSpuAddOrUpdate.less
+15
-0
没有找到文件。
admin-web/config/router.config.js
浏览文件 @
6ce040fb
...
@@ -69,6 +69,16 @@ export default [
...
@@ -69,6 +69,16 @@ export default [
name
:
'product-spu-list'
,
name
:
'product-spu-list'
,
component
:
'./Product/ProductSpuList'
,
component
:
'./Product/ProductSpuList'
,
},
},
{
path
:
'/product/product-spu-add'
,
name
:
'product-spu-add'
,
component
:
'./Product/ProductSpuAddOrUpdate'
,
},
{
path
:
'/product/product-category-list'
,
name
:
'product-category-list'
,
component
:
'./Product/ProductCategoryList'
,
},
{
{
path
:
'/product/product-category-list'
,
path
:
'/product/product-category-list'
,
name
:
'product-category-list'
,
name
:
'product-category-list'
,
...
...
admin-web/src/pages/Home/Home.js
浏览文件 @
6ce040fb
...
@@ -10,9 +10,9 @@ export default class Home extends Component {
...
@@ -10,9 +10,9 @@ export default class Home extends Component {
render
()
{
render
()
{
return
(
return
(
<
div
>
<
div
>
<
AuthorityControl
authKey
=
"home.button"
>
{
/*<AuthorityControl authKey="home.button">*/
}
<
Button
type
=
"primary"
>
按钮
控制
<
/Button
>
{
/*<Button type="primary">按钮 控制</Button>*/
}
<
/AuthorityControl
>
{
/*</AuthorityControl>*/
}
<
h1
>
home
...
<
/h1
>
<
h1
>
home
...
<
/h1
>
<
DictionarySelect
dicKey
=
"gender"
defaultValue
=
"1"
/>
<
DictionarySelect
dicKey
=
"gender"
defaultValue
=
"1"
/>
...
...
admin-web/src/pages/Product/ProductSpuAddOrUpdate.js
0 → 100644
浏览文件 @
6ce040fb
/* eslint-disable */
import
React
,
{
PureComponent
,
Fragment
}
from
'react'
;
import
{
connect
}
from
'dva'
;
import
moment
from
'moment'
;
import
{
Card
,
Form
,
Input
,
Radio
,
Button
,
Table
,
Divider
}
from
'antd'
;
import
PageHeaderWrapper
from
'@/components/PageHeaderWrapper'
;
import
styles
from
'./ProductSpuAddOrUpdate.less'
;
const
FormItem
=
Form
.
Item
;
const
RadioGroup
=
Radio
.
Group
;
// roleList
@
connect
(({
productSpuList
,
loading
})
=>
({
productSpuList
,
list
:
productSpuList
.
list
.
spus
,
loading
:
loading
.
models
.
productSpuList
,
}))
@
Form
.
create
()
class
ProductSpuAddOrUpdate
extends
PureComponent
{
state
=
{
modalVisible
:
false
,
modalType
:
'add'
,
//add update
initValues
:
{},
roleAssignVisible
:
false
,
roleAssignRecord
:
{},
};
componentDidMount
()
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'productSpuList/page'
,
payload
:
{
name
:
''
,
pageNo
:
0
,
pageSize
:
10
,
},
});
}
handleSubmit
=
e
=>
{
const
{
dispatch
,
form
}
=
this
.
props
;
e
.
preventDefault
();
form
.
validateFieldsAndScroll
((
err
,
values
)
=>
{
if
(
!
err
)
{
dispatch
({
type
:
'form/submitRegularForm'
,
payload
:
values
,
});
}
});
}
render
()
{
// debugger;
const
{
form
,
data
}
=
this
.
props
;
// 规格明细
const
columns
=
[
{
title
:
'颜色'
,
dataIndex
:
'price'
},
{
title
:
'价格'
,
dataIndex
:
'price'
,
render
(
val
)
{
return
<
span
>
{
status
[
val
]}
<
/span>
;
},
},
{
title
:
'库存'
,
dataIndex
:
'quantity'
,
}
];
return
(
<
PageHeaderWrapper
title
=
""
>
<
Card
bordered
=
{
false
}
>
<
Form
onSubmit
=
{
this
.
handleSubmit
}
hideRequiredMark
style
=
{{
marginTop
:
8
}}
>
<
FormItem
labelCol
=
{{
span
:
5
}}
wrapperCol
=
{{
span
:
15
}}
label
=
"商品名"
>
{
form
.
getFieldDecorator
(
'name'
,
{
rules
:
[{
required
:
true
,
message
:
'请输入商品名!'
,
min
:
2
}],
initialValue
:
''
,
// TODO 修改
})(
<
Input
placeholder
=
"请输入"
/>
)}
<
/FormItem
>
<
FormItem
labelCol
=
{{
span
:
5
}}
wrapperCol
=
{{
span
:
15
}}
label
=
"商品卖点"
>
{
form
.
getFieldDecorator
(
'sellPoint'
,
{
rules
:
[{
required
:
true
,
message
:
'请输入商品卖点!'
}],
initialValue
:
''
,
// TODO 修改
})(
<
Input
placeholder
=
"请输入"
/>
)}
<
/FormItem
>
<
FormItem
labelCol
=
{{
span
:
5
}}
wrapperCol
=
{{
span
:
15
}}
label
=
"商品描述"
>
{
form
.
getFieldDecorator
(
'description'
,
{
rules
:
[{
required
:
true
,
message
:
'请输入商品描述!'
}],
initialValue
:
''
,
// TODO 修改
})(
<
Input
.
TextArea
placeholder
=
"请输入"
/>
)}
<
/FormItem
>
<
FormItem
labelCol
=
{{
span
:
5
}}
wrapperCol
=
{{
span
:
15
}}
label
=
"分类编号"
>
{
form
.
getFieldDecorator
(
'cid'
,
{
rules
:
[{
required
:
true
,
message
:
'请输入分类编号!'
}],
initialValue
:
''
,
// TODO 修改 // TODO 芋艿,和面做成下拉框
})(
<
Input
placeholder
=
"请输入"
/>
)}
<
/FormItem
>
<
FormItem
labelCol
=
{{
span
:
5
}}
wrapperCol
=
{{
span
:
15
}}
label
=
"商品主图"
>
{
form
.
getFieldDecorator
(
'picUrls'
,
{
initialValue
:
''
,
// TODO 修改 // TODO 芋艿,做成上传组件
})(
<
Input
placeholder
=
"请输入"
/>
)}
<
/FormItem
>
<
FormItem
labelCol
=
{{
span
:
5
}}
wrapperCol
=
{{
span
:
15
}}
label
=
"是否上架"
>
{
form
.
getFieldDecorator
(
'visible'
,
{
initialValue
:
1
,
// TODO 修改
})(
<
RadioGroup
>
<
Radio
value
=
{
1
}
>
是
<
/Radio
>
<
Radio
value
=
{
2
}
>
否
<
/Radio
>
<
/RadioGroup
>
)}
<
/FormItem
>
<
FormItem
labelCol
=
{{
span
:
5
}}
wrapperCol
=
{{
span
:
15
}}
label
=
"商品规格"
>
{
form
.
getFieldDecorator
(
'visible'
,
{
initialValue
:
1
,
// TODO 修改
})(
<
Button
>
添加规格项目
<
/Button
>
)}
<
/FormItem
>
<
FormItem
labelCol
=
{{
span
:
5
}}
wrapperCol
=
{{
span
:
15
}}
label
=
"规格明细"
>
{
form
.
getFieldDecorator
(
'visible'
,
{
initialValue
:
1
,
// TODO 修改
})(
<
Table
defaultExpandAllRows
=
{
true
}
columns
=
{
columns
}
rowKey
=
"id"
/>
)}
<
/FormItem
>
<
/Form
>
<
/Card
>
<
/PageHeaderWrapper
>
);
}
}
export
default
ProductSpuAddOrUpdate
;
admin-web/src/pages/Product/ProductSpuAddOrUpdate.less
0 → 100644
浏览文件 @
6ce040fb
@import '~antd/lib/style/themes/default.less';
@import '~@/utils/utils.less';
.tableList {
.tableListOperator {
margin-bottom: 16px;
button {
margin-right: 8px;
}
}
}
.tableDelete {
color: red;
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论