ny
22 小时以前 282fbc6488f4e8ceb5fda759f963ee88fbf7b999
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
import { defHttp } from '#/api/request';
 
enum Api {
  Prefix = '/api/system/DictionaryData',
  TypePrefix = '/api/system/DictionaryType',
}
 
// 获取数据字典分类
export function getDictionaryType() {
  return defHttp.get({ url: Api.TypePrefix });
}
// 获取字典分类下拉框列表
export function getDictionaryTypeSelector(id = '0') {
  return defHttp.get({ url: `${Api.TypePrefix}/Selector/${id || '0'}` });
}
// 添加数据字典分类
export function createDictionaryType(data) {
  return defHttp.post({ url: Api.TypePrefix, data });
}
// 修改数据字典分类
export function updateDictionaryType(data) {
  return defHttp.put({ url: `${Api.TypePrefix}/${data.id}`, data });
}
// 获取数据字典分类信息
export function getDictionaryTypeInfo(id) {
  return defHttp.get({ url: `${Api.TypePrefix}/${id}` });
}
// 删除数据字典分类
export function delDictionaryType(id) {
  return defHttp.delete({ url: `${Api.TypePrefix}/${id}` });
}
 
// 获取数据字典分类
export function getDictionaryDataList(params) {
  return defHttp.get({ url: `${Api.Prefix}/${params.typeId}`, params });
}
// 获取数据字典列表(分类+内容)
export function getDictionaryAll() {
  return defHttp.get({ url: `${Api.Prefix}/All` });
}
// 获取字典分类下拉框(项目上级)
export function getDictionaryDataTypeSelector(typeId, isTree, id = '0') {
  return defHttp.get({ url: `${Api.Prefix}/${typeId}/Selector/${id || '0'}`, params: { isTree } });
}
// 获取字典数据下拉框列表
export function getDictionaryDataSelector(typeId) {
  return defHttp.get({ url: `${Api.Prefix}/${typeId}/Data/Selector` });
}
// 添加数据字典
export function createDictionaryData(data) {
  return defHttp.post({ url: Api.Prefix, data });
}
// 修改数据字典
export function updateDictionaryData(data) {
  return defHttp.put({ url: `${Api.Prefix}/${data.id}`, data });
}
// 获取数据字典信息
export function getDictionaryDataInfo(id) {
  return defHttp.get({ url: `${Api.Prefix}/${id}/Info` });
}
// 删除数据字典信息
export function delDictionaryData(id) {
  return defHttp.delete({ url: `${Api.Prefix}/${id}` });
}
// 导出数据字典数据
export function exportData(id) {
  return defHttp.get({ url: `${Api.Prefix}/${id}/Actions/Export` });
}