web
9 天以前 81a0e26f1ba5fd0b95381ee902caa1579a8ec043
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
104
105
106
107
108
109
110
/*
 * @Author: Liuyi candymxq888@outlook.com
 * @Date: 2024-08-09 08:47:32
 * @LastEditors: Liuyi candymxq888@outlook.com
 * @LastEditTime: 2024-08-13 16:38:46
 * @FilePath: \water-qinghe-web\src\api\system\dict.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
 
import { publicRequest } from '@/utils/request'
 
//获取指定枚举类型的所有值
 
export function DictType() {
    return {
        getEnum: (enumName) => {
            return publicRequest({
                url: `/base/listEnumValue/${enumName}`,
                method: 'get',
            });
        },
    }
}
//字典类型
export function sysDictType() {
    return {
                //创建
                create: (data) => {
                    return publicRequest({
                            url: '/sysDictType/create',
                            method: 'post',
                            data
                    });
            },
            //编辑
            modify: (data) => {
                    return publicRequest({
                            url: '/sysDictType/modify',
                            method: 'post',
                            data
                    });
            },
            //分页查询
            search: (data) => {
                    return publicRequest({
                            url: '/sysDictType/search',
                            method: 'post',
                            data
                    });
            },
            //获取
            get: (id) => {
                    return publicRequest({
                            url: `/sysDictType/get?id=${id}`,
                            method: 'get'
                    });
            },
    };
}
 
//字典数据
export function sysDictData() {
    return {
                //根据类型获取[字典数据表]
                searchType: (data) => {
                    return publicRequest({
                            url: `/sysDictData/getListByType/${data}`,
                            method: 'get',
                    });
            },
                //创建
                create: (data) => {
                    return publicRequest({
                            url: '/sysDictData/create',
                            method: 'post',
                            data
                    });
            },
            //编辑
            modify: (data) => {
                    return publicRequest({
                            url: '/sysDictData/modify',
                            method: 'post',
                            data
                    });
            },
            //分页查询
            search: (data) => {
                    return publicRequest({
                            url: '/sysDictData/search',
                            method: 'post',
                            data
                    });
            },
            //获取
            get: (id) => {
                    return publicRequest({
                            url: `/sysDictData/get?id=${id}`,
                            method: 'get'
                    });
            },
            //删除
            remove: (id) => {
                    return publicRequest({
                            url: `/sysDictData/remove?id=${id}`,
                            method: 'get'
                    });
            },
    };
}