生成数据字典代码.
This commit is contained in:
71
orion-ops-ui/src/api/system/dict-key.ts
Normal file
71
orion-ops-ui/src/api/system/dict-key.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
import axios from 'axios';
|
||||
import qs from 'query-string';
|
||||
import { TableData } from '@arco-design/web-vue/es/table/interface';
|
||||
|
||||
/**
|
||||
* 字典配置项创建请求
|
||||
*/
|
||||
export interface DictKeyCreateRequest {
|
||||
keyName?: string;
|
||||
valueType?: string;
|
||||
extraSchema?: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典配置项更新请求
|
||||
*/
|
||||
export interface DictKeyUpdateRequest extends DictKeyCreateRequest {
|
||||
id?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典配置项查询响应
|
||||
*/
|
||||
export interface DictKeyQueryResponse extends TableData {
|
||||
id?: number;
|
||||
keyName?: string;
|
||||
valueType?: string;
|
||||
extraSchema?: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建字典配置项
|
||||
*/
|
||||
export function createDictKey(request: DictKeyCreateRequest) {
|
||||
return axios.post('/infra/dict-key/create', request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新字典配置项
|
||||
*/
|
||||
export function updateDictKey(request: DictKeyUpdateRequest) {
|
||||
return axios.put('/infra/dict-key/update', request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全部字典配置项
|
||||
*/
|
||||
export function getDictKeyList() {
|
||||
return axios.post<Array<DictKeyQueryResponse>>('/infra/dict-key/list');
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除字典配置项
|
||||
*/
|
||||
export function deleteDictKey(id: number) {
|
||||
return axios.delete('/infra/dict-key/delete', { params: { id } });
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除字典配置项
|
||||
*/
|
||||
export function batchDeleteDictKey(idList: Array<number>) {
|
||||
return axios.delete('/infra/dict-key/batch-delete', {
|
||||
params: { idList },
|
||||
paramsSerializer: params => {
|
||||
return qs.stringify(params, { arrayFormat: 'comma' });
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user