96 lines
1.6 KiB
JavaScript
96 lines
1.6 KiB
JavaScript
import request from '@/utils/request'
|
|
|
|
// 获取机构树形列表
|
|
export function listOrgTree(query) {
|
|
return request({
|
|
url: '/system/newDept/org/treeList',
|
|
method: 'get',
|
|
params: query
|
|
})
|
|
}
|
|
|
|
// 获取机构树(用于部门管理左侧)
|
|
export function listOrgTreeSimple() {
|
|
return request({
|
|
url: '/system/newDept/org/tree',
|
|
method: 'get'
|
|
})
|
|
}
|
|
|
|
// 根据机构获取部门列表
|
|
export function listDeptByOrg(orgId, query) {
|
|
return request({
|
|
url: `/system/newDept/dept/list/${orgId}`,
|
|
method: 'get',
|
|
params: query
|
|
})
|
|
}
|
|
|
|
// 新增机构
|
|
export function addOrg(data) {
|
|
return request({
|
|
url: '/system/newDept/org',
|
|
method: 'post',
|
|
data: data
|
|
})
|
|
}
|
|
|
|
// 修改机构
|
|
export function updateOrg(data) {
|
|
return request({
|
|
url: '/system/newDept/org',
|
|
method: 'put',
|
|
data: data
|
|
})
|
|
}
|
|
|
|
// 删除机构
|
|
export function deleteOrg(orgId) {
|
|
return request({
|
|
url: `/system/newDept/org/${orgId}`,
|
|
method: 'delete'
|
|
})
|
|
}
|
|
|
|
// 新增部门
|
|
export function addDept(data) {
|
|
return request({
|
|
url: '/system/newDept/dept',
|
|
method: 'post',
|
|
data: data
|
|
})
|
|
}
|
|
|
|
// 修改部门
|
|
export function updateDept(data) {
|
|
return request({
|
|
url: '/system/newDept/dept',
|
|
method: 'put',
|
|
data: data
|
|
})
|
|
}
|
|
|
|
// 删除部门
|
|
export function deleteDept(deptId) {
|
|
return request({
|
|
url: `/system/newDept/dept/${deptId}`,
|
|
method: 'delete'
|
|
})
|
|
}
|
|
|
|
// 导入机构
|
|
export function importOrg() {
|
|
return request({
|
|
url: '/system/newDept/org/import',
|
|
method: 'post'
|
|
})
|
|
}
|
|
|
|
// 导入部门
|
|
export function importDept() {
|
|
return request({
|
|
url: '/system/newDept/dept/import',
|
|
method: 'post'
|
|
})
|
|
}
|