Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
e3a3e005
提交
e3a3e005
authored
9月 01, 2019
作者:
zhenxianyimeng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
规格搜索,翻页
上级
14f6d760
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
125 行增加
和
3 行删除
+125
-3
ProductAttrList.js
admin-web/src/pages/Product/ProductAttrList.js
+124
-3
mall_admin.sql
docs/sql/mall_admin.sql
+1
-0
没有找到文件。
admin-web/src/pages/Product/ProductAttrList.js
浏览文件 @
e3a3e005
import
React
,
{
PureComponent
,
Fragment
,
Component
}
from
'react'
;
import
React
,
{
PureComponent
,
Fragment
,
Component
}
from
'react'
;
import
{
Form
,
Card
,
Table
,
Button
,
Divider
,
Modal
,
Input
,
message
,
Switch
,
Select
}
from
'antd'
;
import
{
Row
,
Col
,
Form
,
Card
,
Table
,
Button
,
Divider
,
Modal
,
Input
,
message
,
Switch
,
Select
,
}
from
'antd'
;
import
moment
from
'moment'
;
import
moment
from
'moment'
;
import
{
connect
}
from
'dva'
;
import
{
connect
}
from
'dva'
;
import
PageHeaderWrapper
from
'@/components/PageHeaderWrapper'
;
import
PageHeaderWrapper
from
'@/components/PageHeaderWrapper'
;
...
@@ -148,6 +161,9 @@ export default class ProductAttrList extends PureComponent {
...
@@ -148,6 +161,9 @@ export default class ProductAttrList extends PureComponent {
valueModalVisible
:
false
,
valueModalVisible
:
false
,
modalType
:
'add'
,
//add or update
modalType
:
'add'
,
//add or update
initValues
:
{},
initValues
:
{},
current
:
1
,
pageSize
:
10
,
name
:
null
,
};
};
componentDidMount
()
{
componentDidMount
()
{
...
@@ -156,10 +172,13 @@ export default class ProductAttrList extends PureComponent {
...
@@ -156,10 +172,13 @@ export default class ProductAttrList extends PureComponent {
initFetch
=
()
=>
{
initFetch
=
()
=>
{
const
{
dispatch
}
=
this
.
props
;
const
{
dispatch
}
=
this
.
props
;
const
{
current
,
pageSize
,
name
}
=
this
.
state
;
dispatch
({
dispatch
({
type
:
'productAttrList/page'
,
type
:
'productAttrList/page'
,
payload
:
{
payload
:
{
...
PaginationHelper
.
defaultPayload
,
pageNo
:
current
,
pageSize
,
name
,
},
},
});
});
// const { dispatch } = this.props;
// const { dispatch } = this.props;
...
@@ -306,6 +325,19 @@ export default class ProductAttrList extends PureComponent {
...
@@ -306,6 +325,19 @@ export default class ProductAttrList extends PureComponent {
});
});
};
};
handleTableChange
=
pagination
=>
{
const
{
pageSize
,
current
,
index
}
=
pagination
;
this
.
setState
(
{
current
,
pageSize
,
},
function
()
{
this
.
initFetch
();
}
);
};
switchValueChange
=
(
checked
,
record
)
=>
{
switchValueChange
=
(
checked
,
record
)
=>
{
const
{
dispatch
}
=
this
.
props
;
const
{
dispatch
}
=
this
.
props
;
dispatch
({
dispatch
({
...
@@ -340,8 +372,82 @@ export default class ProductAttrList extends PureComponent {
...
@@ -340,8 +372,82 @@ export default class ProductAttrList extends PureComponent {
});
});
};
};
handleFormReset
=
()
=>
{
const
{
form
,
dispatch
}
=
this
.
props
;
form
.
resetFields
();
this
.
setState
(
{
name
:
null
,
},
function
()
{
this
.
initFetch
();
}
);
};
handleCondition
=
e
=>
{
e
.
preventDefault
();
const
{
dispatch
,
form
}
=
this
.
props
;
form
.
validateFields
((
err
,
fieldsValue
)
=>
{
if
(
err
)
return
;
const
values
=
{
...
fieldsValue
,
};
if
(
values
.
name
)
{
this
.
setState
(
{
searched
:
true
,
name
:
values
.
name
,
},
function
()
{
this
.
initFetch
();
}
);
}
else
{
this
.
initFetch
();
}
// dispatch({
// type: 'fenfa/getCategoryList',
// payload: {
// key: values.name
// },
// });
});
};
renderSimpleForm
()
{
const
{
form
}
=
this
.
props
;
const
{
getFieldDecorator
}
=
form
;
return
(
<
Form
onSubmit
=
{
this
.
handleCondition
}
layout
=
"inline"
>
<
Row
gutter
=
{{
md
:
8
,
lg
:
24
,
xl
:
48
}}
>
<
Col
md
=
{
8
}
sm
=
{
24
}
>
<
FormItem
label
=
"规格名称"
>
{
getFieldDecorator
(
'name'
)(
<
Input
placeholder
=
"请输入"
/>
)}
<
/FormItem
>
<
/Col
>
<
Col
md
=
{
8
}
sm
=
{
24
}
>
<
span
className
=
{
styles
.
submitButtons
}
>
<
Button
type
=
"primary"
htmlType
=
"submit"
>
查询
<
/Button
>
<
Button
style
=
{{
marginLeft
:
8
}}
onClick
=
{
this
.
handleFormReset
}
>
重置
<
/Button
>
<
/span
>
<
/Col
>
<
/Row
>
<
/Form
>
);
}
render
()
{
render
()
{
const
{
attrData
,
productAttrList
,
loading
,
pagination
,
tree
}
=
this
.
props
;
const
{
attrData
,
productAttrList
,
loading
,
tree
}
=
this
.
props
;
const
columns
=
[
const
columns
=
[
{
{
title
:
'规格名称'
,
title
:
'规格名称'
,
...
@@ -395,11 +501,19 @@ export default class ProductAttrList extends PureComponent {
...
@@ -395,11 +501,19 @@ export default class ProductAttrList extends PureComponent {
tree
:
tree
,
tree
:
tree
,
};
};
const
pagination
=
{
total
:
attrData
.
count
,
index
:
this
.
state
.
current
,
pageSize
:
this
.
state
.
pageSize
,
};
return
(
return
(
<
PageHeaderWrapper
>
<
PageHeaderWrapper
>
<
Card
>
<
Card
>
<
div
className
=
{
styles
.
tableList
}
>
<
div
className
=
{
styles
.
tableList
}
>
<
div
className
=
{
styles
.
tableListOperator
}
>
<
div
className
=
{
styles
.
tableListOperator
}
>
<
Row
>
<
Col
span
=
{
8
}
>
<
Button
<
Button
icon
=
"plus"
icon
=
"plus"
type
=
"primary"
type
=
"primary"
...
@@ -407,6 +521,11 @@ export default class ProductAttrList extends PureComponent {
...
@@ -407,6 +521,11 @@ export default class ProductAttrList extends PureComponent {
>
>
新建规格
新建规格
<
/Button
>
<
/Button
>
<
/Col
>
<
Col
span
=
{
16
}
>
<
div
>
{
this
.
renderSimpleForm
()}
<
/div
>
<
/Col
>
<
/Row
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
Table
<
Table
...
@@ -417,6 +536,8 @@ export default class ProductAttrList extends PureComponent {
...
@@ -417,6 +536,8 @@ export default class ProductAttrList extends PureComponent {
loading
=
{
loading
}
loading
=
{
loading
}
pagination
=
{
pagination
}
pagination
=
{
pagination
}
expandedRowRender
=
{
this
.
expandedRowRender
}
expandedRowRender
=
{
this
.
expandedRowRender
}
defaultExpandAllRows
=
{
false
}
onChange
=
{
pagination
=>
this
.
handleTableChange
(
pagination
)}
/
>
/
>
<
/Card
>
<
/Card
>
{
modalVisible
?
<
CreateForm
{...
parentMethods
}
modalVisible
=
{
modalVisible
}
/> : null
}
{
modalVisible
?
<
CreateForm
{...
parentMethods
}
modalVisible
=
{
modalVisible
}
/> : null
}
...
...
docs/sql/mall_admin.sql
浏览文件 @
e3a3e005
...
@@ -315,6 +315,7 @@ INSERT INTO `resource` VALUES (51, 1, -1, '短信ss', 0, '', 'user', '', '2019-0
...
@@ -315,6 +315,7 @@ INSERT INTO `resource` VALUES (51, 1, -1, '短信ss', 0, '', 'user', '', '2019-0
INSERT
INTO
`resource`
VALUES
(
52
,
1
,
1
,
'短信签名'
,
51
,
'/sms/sign-list'
,
'user'
,
''
,
'2019-05-26 12:01:56'
,
'2019-05-26 12:01:56'
,
b
'0'
);
INSERT
INTO
`resource`
VALUES
(
52
,
1
,
1
,
'短信签名'
,
51
,
'/sms/sign-list'
,
'user'
,
''
,
'2019-05-26 12:01:56'
,
'2019-05-26 12:01:56'
,
b
'0'
);
INSERT
INTO
`resource`
VALUES
(
53
,
1
,
2
,
'短信模板'
,
51
,
'/sms/template-list'
,
'user'
,
''
,
'2019-05-26 12:02:19'
,
'2019-05-26 12:02:18'
,
b
'0'
);
INSERT
INTO
`resource`
VALUES
(
53
,
1
,
2
,
'短信模板'
,
51
,
'/sms/template-list'
,
'user'
,
''
,
'2019-05-26 12:02:19'
,
'2019-05-26 12:02:18'
,
b
'0'
);
INSERT
INTO
`resource`
VALUES
(
54
,
1
,
3
,
'部门管理'
,
13
,
'/admin/dept-list'
,
'user'
,
''
,
'2019-06-27 23:41:19'
,
'2019-06-27 23:41:51'
,
b
'0'
);
INSERT
INTO
`resource`
VALUES
(
54
,
1
,
3
,
'部门管理'
,
13
,
'/admin/dept-list'
,
'user'
,
''
,
'2019-06-27 23:41:19'
,
'2019-06-27 23:41:51'
,
b
'0'
);
INSERT
INTO
`resource`
VALUES
(
55
,
1
,
4
,
'规格管理'
,
20
,
'/product/product-attr-list'
,
null
,
null
,
'2019-08-14 23:59:38'
,
'2019-08-14 23:59:38'
,
b
'0'
);
COMMIT
;
COMMIT
;
-- ----------------------------
-- ----------------------------
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论