1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
| /*
| * @Description:
| * @Version: 2.0
| * @Autor: yuxinqiang
| * @Date: 2022-08-19 16:59:27
| * @LastEditors: wuyun
| * @LastEditTime: 2023-01-31 18:05:30
| */
| import createAxios from '@/utils/axios'
|
| // 用户管理API
| const url: string = '/admin/sysDict'
|
| const sysDictService = {
| // 新增字典
| addDict(data: object = {}): ApiPromise {
| return createAxios({
| url: `${url}/create`,
| headers: {
| 'Content-Type': 'application/json;charset=UTF-8'
| },
| data: data
| }) as ApiPromise
| },
|
| // 更新字典
| updateDict(data: object = {}): ApiPromise {
| return createAxios({
| url: `${url}/update`,
| headers: {
| 'Content-Type': 'application/json;charset=UTF-8'
| },
| data: data
| }) as ApiPromise
| },
|
| // 删除字典
| deleteDict(data: object = {}): ApiPromise {
| return createAxios({
| url: `${url}/delete`,
| headers: {
| 'Content-Type': 'application/json;charset=UTF-8'
| },
| data: data
| }) as ApiPromise
| },
|
| // 获取字典详情
| getDictDetail(data: object = {}): ApiPromise {
| return createAxios({
| url: `${url}/detail`,
| headers: {
| 'Content-Type': 'application/json;charset=UTF-8'
| },
| data: data
| }) as ApiPromise
| },
|
| // 字典排序
| setDictSort(data: object = {}): ApiPromise {
| return createAxios({
| url: `${url}/sort`,
| headers: {
| 'Content-Type': 'application/json;charset=UTF-8'
| },
| data: data
| }) as ApiPromise
| },
|
| // 父级列表
| queryDictList(data: object = {}): ApiPromise {
| return createAxios({
| url: `${url}/list`,
| headers: {
| 'Content-Type': 'application/json;charset=UTF-8'
| },
| data: data
| }) as ApiPromise
| },
|
| // 子级列表
| queryDictSubList(data: object = {}): ApiPromise {
| return createAxios({
| url: `${url}/subList`,
| headers: {
| 'Content-Type': 'application/json;charset=UTF-8'
| },
| data: data
| }) as ApiPromise
| },
| //根据编码查询子级列表
| getSubListByCode(data: object = {}): ApiPromise {
| return createAxios({
| url: `${url}/subListByCode`,
| headers: {
| 'Content-Type': 'application/json;charset=UTF-8'
| },
| data: data
| }) as ApiPromise
| }
| }
|
| export default sysDictService
|
|