Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
NZWZ
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
刘旭
NZWZ
Commits
1e1844b2
提交
1e1844b2
authored
7月 29, 2022
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新
上级
c71b13ec
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
76 行增加
和
0 行删除
+76
-0
DeptModel.ts
src/services/department/DeptModel.ts
+43
-0
departmentAPI.ts
src/services/department/departmentAPI.ts
+3
-0
deptAPI.ts
src/services/department/deptAPI.ts
+30
-0
没有找到文件。
src/services/department/DeptModel.ts
0 → 100644
浏览文件 @
1e1844b2
//查询列表的参数类型
export
interface
ListParm
{
searchName
:
string
;
}
//返回值
export
interface
DeptListRes
{
list
:
any
}
//部门表格每行数据的格式
export
interface
DeptModel
{
id
:
number
;
pid
:
number
;
likeId
:
number
;
parentName
:
string
;
manager
:
string
;
name
:
string
;
deptCode
:
string
;
deptAddress
:
string
;
deptPhone
:
string
;
orderNum
:
number
;
open
:
boolean
;
children
:
Array
<
DeptModel
>
}
//表单提交的数据类型
export
interface
AddDeptModel
{
type
:
string
;
id
:
string
|
number
;
pid
:
string
|
number
;
parentName
:
string
;
manager
:
string
;
deptAddress
:
string
;
deptPhone
:
string
;
name
:
string
;
deptCode
:
string
;
orderNum
:
string
;
}
//上级部门树选中的数据
export
interface
SelectNode
{
id
:
string
|
number
;
name
:
string
;
}
\ No newline at end of file
src/services/department/departmentAPI.ts
0 → 100644
浏览文件 @
1e1844b2
import
httpRequest
from
"@/services/common"
;
import
{
urlConfig
}
from
'@/services/config'
;
\ No newline at end of file
src/services/department/deptAPI.ts
0 → 100644
浏览文件 @
1e1844b2
import
httpRequest
from
"@/services/common"
;
import
{
userUrlConfig
,
authUrlConfig
}
from
'@/services/config'
import
{
AddDeptModel
,
ListParm
}
from
'./DeptModel'
enum
Api
{
getDeptList
=
'/api/department/list'
,
getParent
=
'/api/department/parent'
,
add
=
'/api/department'
,
edit
=
'/api/department'
,
delete
=
'/api/department'
}
//查询部门列表
export
const
getDeptListApi
=
async
(
parms
:
ListParm
)
=>
{
return
await
httpRequest
.
get
(
Api
.
getDeptList
,
parms
)
}
//查询上级部门树
export
const
getDeptParentApi
=
async
()
=>
{
return
await
httpRequest
.
get
(
Api
.
getParent
)
}
//新增
export
const
addDeptApi
=
async
(
parms
:
AddDeptModel
)
=>
{
return
await
httpRequest
.
post
(
Api
.
add
,
parms
)
}
//编辑
export
const
editDeptApi
=
async
(
parms
:
AddDeptModel
)
=>
{
return
await
httpRequest
.
put
(
Api
.
edit
,
parms
)
}
//删除
export
const
deleteDeptApi
=
async
(
parms
:
any
)
=>
{
return
await
httpRequest
.
delete
(
Api
.
delete
,
parms
)
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论