Commit 8a0adeb8 authored by 张伯涛's avatar 张伯涛

字典

parent cd0c2a66
......@@ -39,6 +39,23 @@ export function listType(query: any) {
params: query,
});
}
/** 查询字典类型详细*/
export function getType(dictId) {
return request({
url: "/system/dict/type/detail/" + dictId,
method: "get",
});
}
// 修改字典数据
export function updateData(data) {
const businessId = data.businessId;
return request({
url: "/system/dict/data/update/" + businessId,
method: "put",
data: data,
headers: {},
});
}
/** 获取字典选择框列表*/
export function selectDictType(dictType: any) {
return request({
......@@ -55,7 +72,50 @@ export function exportType(queryParams: DictTypeQuery) {
responseType: "arraybuffer",
});
}
// 下载字典数据导入模板
export function importTemplate(query) {
return request({
url: "/system/dict/data/importTemplate",
method: "get",
responseType: "arraybuffer",
params: query,
});
}
//导入字典数据信息
export function importExcel(data) {
return request({
url: "/system/dict/data/importDictData",
method: "post",
headers: {
"Content-Type": "multipart/form-data",
},
transformRequest: [
(data) => {
return data;
},
],
data,
});
}
// 下载错误文件
export function uploadFalseFile(params) {
params = Qs.stringify(params);
return request({
url: "/system/user/downFalseFile",
method: "post",
data: params,
responseType: "blob",
});
}
// 导出字典数据
export function exportData(query) {
return request({
url: "/system/dict/data/export",
method: "get",
params: query,
responseType: "arraybuffer",
});
}
/** 修改字典类型*/
export function updateType(data: any) {
const businessId = data.businessId;
......@@ -66,6 +126,15 @@ export function updateType(data: any) {
headers: {},
});
}
// 新增字典数据
export function addData(data) {
return request({
url: "/system/dict/data/add",
method: "post",
data: data,
headers: {},
});
}
/** 新增字典类型*/
export function addType(data: any) {
return request({
......@@ -87,7 +156,13 @@ export function getDictTypeForm(dictId: number): AxiosPromise<DictTypeForm> {
method: "get",
});
}
// 4.查询字典数据详细
export function getData(dictCode) {
return request({
url: "/system/dict/data/detail/" + dictCode,
method: "get",
});
}
/**
* 新增字典类型
*
......@@ -124,6 +199,14 @@ export function deleteDictTypes(dictId: string) {
method: "delete",
});
}
/** 删除字典数据*/
export function delData(dictCode) {
return request({
url: "/system/dict/data/deleteLogical/" + dictCode,
method: "delete",
headers: {},
});
}
/**
* 获取字典类型的数据项
......
......@@ -71,7 +71,39 @@ export interface DictTypePageVO {
*/
createDate: Date;
}
/**
* 字典类型数据分页对象
*/
export interface DictTypeDataPageVO {
/**
* 字典编码
*/
businessId: number;
/**
* 字典标签
*/
dictLabel: string;
/**
* 字典键值
*/
dictValue: string;
/**
* 字典排序
*/
dictSort: string | number;
/**
* 状态
*/
flag: string | number;
/**
* 备注
*/
remarks: string | number;
/**
* 创建时间
*/
createDate: any;
}
/**
* 字典分页项类型声明
*/
......@@ -110,7 +142,35 @@ export interface DictTypeForm {
flag?: string | number;
}
/**
* 字典表单类型数据声明
*/
export interface DictTypeDataForm {
/**
* 字典类型ID
*/
businessId?: number | undefined;
/**
* 字典类型
*/
dictType?: number | string;
/**
* 参数标签
*/
dictLabel?: number | string;
/**
* 参数键值
*/
dictValue?: number | string;
/**
* 参数排序
*/
dictSort?: number | string;
/**
* 备注
*/
remarks?: string;
}
/**
* 字典查询参数
*/
......
......@@ -48,9 +48,6 @@ export const constantRoutes: RouteRecordRaw[] = [
meta: {
title: "字典数据",
icon: "",
affix: true,
keepAlive: true,
alwaysShow: false,
hidden: true,
},
},
......
This diff is collapsed.
......@@ -749,7 +749,6 @@ onMounted(() => {
:disabled="importData.isUploading"
:auto-upload="false"
ref="uploadRef"
action=""
drag
:limit="1"
:file-list="importData.fileList"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment