Blame view

src/api/systemData/dictionary.js 2.77 KB
477ec56f   monkeyhouyi   权限
1
2
3
4
5
  import request from '@/utils/request'
  
  // 获取数据字典分类
  export function getDictionaryType() {
    return request({
c21fb5b0   monkeyhouyi   巡查上报页面
6
      url: '/system/DictionaryType',
477ec56f   monkeyhouyi   权限
7
8
9
10
11
12
13
      method: 'GET'
    })
  }
  
  // 获取字典分类下拉框列表
  export function getDictionaryTypeSelector(id) {
    return request({
c21fb5b0   monkeyhouyi   巡查上报页面
14
      url: '/system/DictionaryType/Selector/' + (!!id ? id : 0),
477ec56f   monkeyhouyi   权限
15
16
17
18
19
20
21
      method: 'GET'
    })
  }
  
  // 添加数据字典分类
  export function createDictionaryType(data) {
    return request({
c21fb5b0   monkeyhouyi   巡查上报页面
22
      url: `/system/DictionaryType`,
477ec56f   monkeyhouyi   权限
23
24
25
26
27
28
29
30
      method: 'POST',
      data
    })
  }
  
  // 修改数据字典分类
  export function updateDictionaryType(data) {
    return request({
c21fb5b0   monkeyhouyi   巡查上报页面
31
      url: `/system/DictionaryType/${data.id}`,
477ec56f   monkeyhouyi   权限
32
33
34
35
36
37
38
39
      method: 'PUT',
      data
    })
  }
  
  // 获取数据字典分类信息
  export function getDictionaryTypeInfo(id) {
    return request({
c21fb5b0   monkeyhouyi   巡查上报页面
40
      url: `/system/DictionaryType/${id}`,
477ec56f   monkeyhouyi   权限
41
42
43
44
45
46
47
      method: 'GET'
    })
  }
  
  // 删除数据字典分类
  export function delDictionaryType(id) {
    return request({
c21fb5b0   monkeyhouyi   巡查上报页面
48
      url: `/system/DictionaryType/${id}`,
477ec56f   monkeyhouyi   权限
49
50
51
52
53
54
55
      method: 'DELETE'
    })
  }
  
  // 获取数据字典列表
  export function getDictionaryDataList(typeId, data) {
    return request({
c21fb5b0   monkeyhouyi   巡查上报页面
56
      url: `/system/DictionaryData/${typeId}`,
477ec56f   monkeyhouyi   权限
57
58
59
60
61
62
63
64
      method: 'GET',
      data
    })
  }
  
  // 获取数据字典列表(分类+内容)
  export function getDictionaryAll() {
    return request({
c21fb5b0   monkeyhouyi   巡查上报页面
65
      url: `/system/DictionaryData/All`,
477ec56f   monkeyhouyi   权限
66
67
68
69
70
71
72
      method: 'GET'
    })
  }
  
  // 获取字典分类下拉框(项目上级)
  export function getDictionaryDataTypeSelector(dictionaryTypeId, isTree, id) {
    return request({
c21fb5b0   monkeyhouyi   巡查上报页面
73
      url: `/system/DictionaryData/${dictionaryTypeId}/Selector/` + (!!id ? id : 0),
477ec56f   monkeyhouyi   权限
74
75
76
77
78
79
80
81
      method: 'GET',
      data: { isTree }
    })
  }
  
  // 获取字典数据下拉框列表
  export function getDictionaryDataSelector(dictionaryTypeId) {
    return request({
c21fb5b0   monkeyhouyi   巡查上报页面
82
      url: `/system/DictionaryData/${dictionaryTypeId}/Data/Selector`,
477ec56f   monkeyhouyi   权限
83
84
85
86
87
88
89
      method: 'GET'
    })
  }
  
  // 添加数据字典
  export function createDictionaryData(data) {
    return request({
c21fb5b0   monkeyhouyi   巡查上报页面
90
      url: '/system/DictionaryData',
477ec56f   monkeyhouyi   权限
91
92
93
94
95
96
97
98
      method: 'POST',
      data
    })
  }
  
  // 修改数据字典
  export function updateDictionaryData(data) {
    return request({
c21fb5b0   monkeyhouyi   巡查上报页面
99
      url: `/system/DictionaryData/${data.id}`,
477ec56f   monkeyhouyi   权限
100
101
102
103
104
105
106
107
      method: 'PUT',
      data
    })
  }
  
  // 获取数据字典信息
  export function getDictionaryDataInfo(id) {
    return request({
c21fb5b0   monkeyhouyi   巡查上报页面
108
      url: `/system/DictionaryData/${id}/Info`,
477ec56f   monkeyhouyi   权限
109
110
111
112
113
114
115
      method: 'GET'
    })
  }
  
  // 删除数据字典信息
  export function delDictionaryData(id) {
    return request({
c21fb5b0   monkeyhouyi   巡查上报页面
116
      url: `/system/DictionaryData/${id}`,
477ec56f   monkeyhouyi   权限
117
118
119
120
121
122
123
      method: 'DELETE'
    })
  }
  
  // 更新字典状态
  export function updateDictionaryState(id) {
    return request({
c21fb5b0   monkeyhouyi   巡查上报页面
124
      url: `/system/DictionaryData/${id}/Actions/State`,
477ec56f   monkeyhouyi   权限
125
126
127
128
129
130
131
      method: 'PUT'
    })
  }
  
  // 导出数据字典数据
  export function exportData(id) {
    return request({
c21fb5b0   monkeyhouyi   巡查上报页面
132
      url: `/system/DictionaryData/${id}/Action/Export`,
477ec56f   monkeyhouyi   权限
133
134
135
      method: 'GET'
    })
  }