Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
6980c95c
提交
6980c95c
authored
7月 16, 2019
作者:
zhenxianyimeng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
删除部门
上级
631a571a
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
46 行增加
和
1 行删除
+46
-1
deptmentList.js
admin-web/src/models/admin/deptmentList.js
+14
-1
DeptmentList.js
admin-web/src/pages/Admin/DeptmentList.js
+26
-0
admin.js
admin-web/src/services/admin.js
+6
-0
没有找到文件。
admin-web/src/models/admin/deptmentList.js
浏览文件 @
6980c95c
import
{
message
}
from
'antd'
;
import
{
message
}
from
'antd'
;
import
{
deptTreePage
,
deptTreeAll
,
addDeptment
,
updateDeptment
}
from
'../../services/admin'
;
import
{
deptTreePage
,
deptTreeAll
,
addDeptment
,
updateDeptment
,
deleteDeptment
,
}
from
'../../services/admin'
;
const
buildSelectTree
=
list
=>
{
const
buildSelectTree
=
list
=>
{
return
list
.
map
(
item
=>
{
return
list
.
map
(
item
=>
{
...
@@ -35,6 +41,13 @@ export default {
...
@@ -35,6 +41,13 @@ export default {
onSuccess
&&
onSuccess
();
onSuccess
&&
onSuccess
();
}
}
},
},
*
delete
({
payload
},
{
call
,
put
})
{
const
{
onSuccess
,
body
}
=
payload
;
const
response
=
yield
call
(
deleteDeptment
,
body
);
if
(
response
&&
response
.
code
===
0
)
{
onSuccess
&&
onSuccess
();
}
},
*
update
({
payload
},
{
call
,
put
})
{
*
update
({
payload
},
{
call
,
put
})
{
const
{
onSuccess
,
body
}
=
payload
;
const
{
onSuccess
,
body
}
=
payload
;
const
response
=
yield
call
(
updateDeptment
,
body
);
const
response
=
yield
call
(
updateDeptment
,
body
);
...
...
admin-web/src/pages/Admin/DeptmentList.js
浏览文件 @
6980c95c
...
@@ -130,6 +130,32 @@ export default class DepetmentList extends PureComponent {
...
@@ -130,6 +130,32 @@ export default class DepetmentList extends PureComponent {
}
}
};
};
handleDelete
(
row
)
{
const
{
dispatch
}
=
this
.
props
;
Modal
.
confirm
({
title
:
`确认删除?`
,
content
:
`
${
row
.
name
}
`
,
onOk
()
{
dispatch
({
type
:
'deptmentList/delete'
,
payload
:
{
body
:
{
id
:
row
.
id
,
},
onSuccess
:
()
=>
{
message
.
success
(
'删除成功'
);
this
.
handleModalVisible
();
},
onFail
:
response
=>
{
message
.
warn
(
'删除失败'
+
response
.
message
);
},
},
});
},
onCancel
()
{},
});
}
handleAdd
=
({
fields
,
modalType
,
initValues
})
=>
{
handleAdd
=
({
fields
,
modalType
,
initValues
})
=>
{
const
{
dispatch
}
=
this
.
props
;
const
{
dispatch
}
=
this
.
props
;
if
(
modalType
===
'add'
)
{
if
(
modalType
===
'add'
)
{
...
...
admin-web/src/services/admin.js
浏览文件 @
6980c95c
...
@@ -74,6 +74,12 @@ export async function updateDeptment(params) {
...
@@ -74,6 +74,12 @@ export async function updateDeptment(params) {
});
});
}
}
export
async
function
deleteDeptment
(
params
)
{
return
request
(
`/admin-api/admins/dept/delete?
${
stringify
(
params
)}
`
,
{
method
:
'POST'
,
});
}
export
async
function
deptTreePage
(
params
)
{
export
async
function
deptTreePage
(
params
)
{
return
request
(
`/admin-api/admins/dept/tree/page?
${
stringify
(
params
)}
`
,
{
return
request
(
`/admin-api/admins/dept/tree/page?
${
stringify
(
params
)}
`
,
{
method
:
'GET'
,
method
:
'GET'
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论