Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
aa42de21
提交
aa42de21
authored
7月 06, 2019
作者:
zhenxianyimeng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
部门列表页
上级
89d875d0
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
179 行增加
和
2 行删除
+179
-2
router.config.js
admin-web/config/router.config.js
+5
-0
package.json
admin-web/package.json
+1
-1
menu.js
admin-web/src/locales/zh-CN/menu.js
+1
-0
deptmentList.js
admin-web/src/models/admin/deptmentList.js
+61
-0
DeptmentList.js
admin-web/src/pages/Admin/DeptmentList.js
+86
-0
DeptmentList.less
admin-web/src/pages/Admin/DeptmentList.less
+11
-0
admin.js
admin-web/src/services/admin.js
+7
-0
DeptmentController.java
...min/application/controller/admins/DeptmentController.java
+3
-1
DeptmentPageDTO.java
...iocoder/mall/admin/api/dto/depetment/DeptmentPageDTO.java
+4
-0
没有找到文件。
admin-web/config/router.config.js
浏览文件 @
aa42de21
...
...
@@ -51,6 +51,11 @@ export default [
name
:
'role-list'
,
component
:
'./Admin/RoleList'
,
},
{
path
:
'/admin/dept-list'
,
name
:
'deptment-list'
,
component
:
'./Admin/DeptmentList'
,
},
{
path
:
'/admin/dictionary-list'
,
name
:
'dictionary-list'
,
...
...
admin-web/package.json
浏览文件 @
aa42de21
...
...
@@ -118,7 +118,7 @@
"node ./scripts/lint-prettier.js"
,
"git add"
],
"**/*.{js
,jsx
}"
:
"npm run lint-staged:js"
,
"**/*.{js}"
:
"npm run lint-staged:js"
,
"**/*.less"
:
"stylelint --syntax less"
},
"engines"
:
{
...
...
admin-web/src/locales/zh-CN/menu.js
浏览文件 @
aa42de21
...
...
@@ -44,6 +44,7 @@ export default {
'menu.admin.resource-list'
:
'权限列表'
,
'menu.admin.role-list'
:
'角色列表'
,
'menu.admin.dictionary-list'
:
'数据字典'
,
'menu.admin.deptment-list'
:
'部门列表'
,
// 商品相关
'menu.product'
:
'商品管理'
,
'menu.product.product-spu-list'
:
'商品管理'
,
...
...
admin-web/src/models/admin/deptmentList.js
0 → 100644
浏览文件 @
aa42de21
import
{
message
}
from
'antd'
;
import
{
deptTreePage
}
from
'../../services/admin'
;
export
default
{
namespace
:
'deptmentList'
,
state
:
{
list
:
[],
selectTree
:
[],
deptmentData
:
{
list
:
[],
},
},
effects
:
{
*
getDeptmentList
({
payload
},
{
call
,
put
})
{
const
result
=
yield
call
(
deptTreePage
,
payload
);
let
deptmentData
=
{};
if
(
result
.
code
===
0
)
{
deptmentData
=
result
.
data
;
}
yield
put
({
type
:
'save'
,
payload
:
{
deptmentData
,
},
});
},
},
reducers
:
{
save
(
state
,
action
)
{
return
{
...
state
,
...
action
.
payload
,
};
},
treeSuccess
(
state
,
{
payload
})
{
const
resultData
=
payload
;
const
treeData
=
buildSelectTree
(
resultData
);
// value 要保护 displayName 不然,搜索会失效
const
rootNode
=
[
{
title
:
'根节点'
,
value
:
`根节点-0`
,
key
:
0
,
children
:
[],
},
];
const
selectTree
=
rootNode
.
concat
(
treeData
);
return
{
...
state
,
list
:
resultData
,
selectTree
,
};
},
},
};
admin-web/src/pages/Admin/DeptmentList.js
0 → 100644
浏览文件 @
aa42de21
import
React
,
{
PureComponent
,
Fragment
}
from
'react'
;
import
{
Button
,
Card
,
Table
,
Form
,
Divider
}
from
'antd'
;
import
PageHeaderWrapper
from
'@/components/PageHeaderWrapper'
;
import
{
connect
}
from
'dva'
;
import
styles
from
'./DeptmentList.less'
;
import
PaginationHelper
from
'../../../helpers/PaginationHelper'
;
import
moment
from
'moment'
;
@
connect
(({
deptmentList
,
loading
})
=>
({
deptmentList
,
deptmentData
:
deptmentList
.
deptmentData
,
loading
:
loading
.
models
.
deptmentList
,
}))
@
Form
.
create
()
export
default
class
DepetmentList
extends
PureComponent
{
componentDidMount
()
{
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'deptmentList/getDeptmentList'
,
payload
:
{
...
PaginationHelper
.
defaultPayload
,
},
});
}
render
()
{
const
{
deptmentData
,
deptmentList
}
=
this
.
props
;
const
columns
=
[
{
title
:
'部门名称'
,
dataIndex
:
'name'
,
},
{
title
:
'排序'
,
dataIndex
:
'sort'
,
},
{
title
:
'创建时间'
,
dataIndex
:
'createTime'
,
sorter
:
true
,
render
:
val
=>
<
span
>
{
moment
(
val
).
format
(
'YYYY-MM-DD'
)}
<
/span>
,
},
{
title
:
'操作'
,
render
:
(
text
,
record
)
=>
(
<
Fragment
>
<
a
onClick
=
{()
=>
this
.
handleModalVisible
(
true
,
'update'
,
record
)}
>
编辑
<
/a
>
<
Divider
type
=
"vertical"
/>
<
a
className
=
{
styles
.
tableDelete
}
onClick
=
{()
=>
this
.
handleDelete
(
record
)}
>
删除
<
/a
>
<
/Fragment
>
),
},
];
// const {
// deptmentList: {deptmentData},
// loading,
// } = this.props;
return
(
<
PageHeaderWrapper
>
<
Card
bordered
=
{
false
}
>
<
div
className
=
{
styles
.
tableList
}
>
<
div
className
=
{
styles
.
tableListOperator
}
>
<
Button
icon
=
"plus"
type
=
"primary"
onClick
=
{()
=>
this
.
handleModalVisible
(
true
,
'add'
,
{})}
>
新建部门
<
/Button
>
<
/div
>
<
/div
>
<
Table
defaultExpandAllRows
=
{
true
}
columns
=
{
columns
}
dataSource
=
{
deptmentData
.
list
?
deptmentData
.
list
:
[]}
rowKey
=
"id"
/>
<
/Card
>
<
/PageHeaderWrapper
>
);
}
}
admin-web/src/pages/Admin/DeptmentList.less
0 → 100644
浏览文件 @
aa42de21
@import '~antd/lib/style/themes/default.less';
@import '~@/utils/utils.less';
.tableList {
.tableListOperator {
margin-bottom: 16px;
button {
margin-right: 8px;
}
}
}
admin-web/src/services/admin.js
浏览文件 @
aa42de21
...
...
@@ -55,6 +55,13 @@ export async function adminRoleAssign(params) {
});
}
// deptment
export
async
function
deptTreePage
(
params
)
{
return
request
(
`/admin-api/admins/dept/tree/page?
${
stringify
(
params
)}
`
,
{
method
:
'GET'
,
});
}
// resource
export
async
function
addResource
(
params
)
{
...
...
system/system-application/src/main/java/cn/iocoder/mall/admin/application/controller/admins/DeptmentController.java
浏览文件 @
aa42de21
...
...
@@ -16,8 +16,10 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.Valid
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -42,7 +44,7 @@ public class DeptmentController {
@GetMapping
(
"tree/page"
)
@ApiOperation
(
value
=
"根部门分页的部门树"
)
public
CommonResult
<
PageResult
<
DeptmentVO
>>
treePage
(
DeptmentPageDTO
deptmentPageDTO
){
public
CommonResult
<
PageResult
<
DeptmentVO
>>
treePage
(
@Validated
DeptmentPageDTO
deptmentPageDTO
){
PageResult
<
DeptmentBO
>
pageResult
=
deptmentService
.
getPageRootDeptment
(
deptmentPageDTO
);
PageResult
<
DeptmentVO
>
voPageResult
=
DeptmentConvert
.
INSTANCE
.
convert
(
pageResult
);
List
<
DeptmentBO
>
list
=
deptmentService
.
getAllDeptments
();
...
...
system/system-service-api/src/main/java/cn/iocoder/mall/admin/api/dto/depetment/DeptmentPageDTO.java
浏览文件 @
aa42de21
package
cn
.
iocoder
.
mall
.
admin
.
api
.
dto
.
depetment
;
import
cn.iocoder.common.framework.vo.PageParam
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
/**
...
...
@@ -12,7 +14,9 @@ import lombok.Data;
* @date: 2019-06-21
* @time: 00:22
*/
@ApiModel
(
value
=
"部门分页 DTO"
)
@Data
@Accessors
(
chain
=
true
)
public
class
DeptmentPageDTO
extends
PageParam
{
@ApiModelProperty
(
value
=
"根部门名字"
,
example
=
"研发部"
)
private
String
name
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论