You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
156 lines
2.8 KiB
156 lines
2.8 KiB
import type { BaseResponse } from '@/utils/request';
|
|
import { request } from '@/utils/request';
|
|
|
|
/**
|
|
* @description 查询类别列表
|
|
* @param {SearchPageListParams} data
|
|
* @returns
|
|
*/
|
|
export function fetchDictList() {
|
|
return request<BaseResponse<API.SearchPageListResult>>({
|
|
url: `/fieldType/list`,
|
|
method: 'post',
|
|
});
|
|
}
|
|
|
|
/**
|
|
* @description 新增单条
|
|
* @param {DictType} data
|
|
* @returns
|
|
*/
|
|
export function createDict(data: API.DictType) {
|
|
return request({
|
|
url: `/fieldType/create`,
|
|
method: 'post',
|
|
data,
|
|
});
|
|
}
|
|
|
|
/**
|
|
* @description 修改单条
|
|
* @param {DictType} data
|
|
* @returns
|
|
*/
|
|
export function updateDict(data: API.DictType) {
|
|
return request({
|
|
url: `/fieldType/update`,
|
|
method: 'put',
|
|
data,
|
|
});
|
|
}
|
|
|
|
/**
|
|
* @description 删除多条
|
|
*/
|
|
export function deleteBatchDictById(data: API.DeleteBatchDictParams) {
|
|
return request({
|
|
url: `/fieldType/deleteBatch`,
|
|
method: 'delete',
|
|
data,
|
|
});
|
|
}
|
|
|
|
/**
|
|
* @description 根据字典类型查询字典值列表
|
|
* @param { fieldTypeId:string} data
|
|
* @returns
|
|
*/
|
|
export function fetchDictValueListByType(data: { fieldTypeName: string }) {
|
|
return request({
|
|
url: `/dict/query`,
|
|
method: 'post',
|
|
data,
|
|
});
|
|
}
|
|
|
|
/**
|
|
* @description 根据字典类型查询字典值分页列表
|
|
* @param {SearchPageListParams} data
|
|
* @returns
|
|
*/
|
|
export function fetchDictValuePageList(data: API.SearchPageListParams) {
|
|
return request<BaseResponse<API.SearchPageListResult>>(
|
|
{
|
|
url: `/dict/page`,
|
|
method: 'post',
|
|
data,
|
|
},
|
|
{
|
|
isGetDataDirectly: false,
|
|
},
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @description 新增单条
|
|
* @param {DictValueType} data
|
|
* @returns
|
|
*/
|
|
export function createDictValue(data: API.DictValueType) {
|
|
return request({
|
|
url: `/dict/create`,
|
|
method: 'post',
|
|
data,
|
|
});
|
|
}
|
|
|
|
/**
|
|
* @description 启用
|
|
* @param {id: string } data
|
|
* @returns
|
|
*/
|
|
export function enableDictValue(data: { id: string }) {
|
|
return request({
|
|
url: `/dict/enable`,
|
|
method: 'post',
|
|
params: data,
|
|
});
|
|
}
|
|
|
|
/**
|
|
* @description 禁用
|
|
* @param {id: string } data
|
|
* @returns
|
|
*/
|
|
export function disableDictValue(data: { id: string }) {
|
|
return request({
|
|
url: `/dict/disable`,
|
|
method: 'post',
|
|
params: data,
|
|
});
|
|
}
|
|
|
|
/**
|
|
* @description 修改单条
|
|
* @param {DictValueType} data
|
|
* @returns
|
|
*/
|
|
export function updateDictValue(data: API.DictValueType) {
|
|
return request({
|
|
url: `/dict/update`,
|
|
method: 'put',
|
|
data,
|
|
});
|
|
}
|
|
|
|
/**
|
|
* @description 删除单条
|
|
*/
|
|
export function deleteDictValueById(params: API.DeleteDictValueParams) {
|
|
return request({
|
|
url: `/dict/delete`,
|
|
method: 'delete',
|
|
params: params,
|
|
});
|
|
}
|
|
|
|
/**
|
|
* @description 删除多条
|
|
*/
|
|
export function deleteBatchDictValueById(data: API.DeleteBatchDictValueParams) {
|
|
return request({
|
|
url: `/dict/deleteBatch`,
|
|
method: 'delete',
|
|
data,
|
|
});
|
|
}
|