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

字典

parent cd0c2a66
...@@ -39,6 +39,23 @@ export function listType(query: any) { ...@@ -39,6 +39,23 @@ export function listType(query: any) {
params: query, 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) { export function selectDictType(dictType: any) {
return request({ return request({
...@@ -55,7 +72,50 @@ export function exportType(queryParams: DictTypeQuery) { ...@@ -55,7 +72,50 @@ export function exportType(queryParams: DictTypeQuery) {
responseType: "arraybuffer", 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) { export function updateType(data: any) {
const businessId = data.businessId; const businessId = data.businessId;
...@@ -66,6 +126,15 @@ export function updateType(data: any) { ...@@ -66,6 +126,15 @@ export function updateType(data: any) {
headers: {}, headers: {},
}); });
} }
// 新增字典数据
export function addData(data) {
return request({
url: "/system/dict/data/add",
method: "post",
data: data,
headers: {},
});
}
/** 新增字典类型*/ /** 新增字典类型*/
export function addType(data: any) { export function addType(data: any) {
return request({ return request({
...@@ -87,7 +156,13 @@ export function getDictTypeForm(dictId: number): AxiosPromise<DictTypeForm> { ...@@ -87,7 +156,13 @@ export function getDictTypeForm(dictId: number): AxiosPromise<DictTypeForm> {
method: "get", 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) { ...@@ -124,6 +199,14 @@ export function deleteDictTypes(dictId: string) {
method: "delete", method: "delete",
}); });
} }
/** 删除字典数据*/
export function delData(dictCode) {
return request({
url: "/system/dict/data/deleteLogical/" + dictCode,
method: "delete",
headers: {},
});
}
/** /**
* 获取字典类型的数据项 * 获取字典类型的数据项
......
...@@ -71,7 +71,39 @@ export interface DictTypePageVO { ...@@ -71,7 +71,39 @@ export interface DictTypePageVO {
*/ */
createDate: Date; 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 { ...@@ -110,7 +142,35 @@ export interface DictTypeForm {
flag?: string | number; 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[] = [ ...@@ -48,9 +48,6 @@ export const constantRoutes: RouteRecordRaw[] = [
meta: { meta: {
title: "字典数据", title: "字典数据",
icon: "", icon: "",
affix: true,
keepAlive: true,
alwaysShow: false,
hidden: true, hidden: true,
}, },
}, },
......
This diff is collapsed.
...@@ -749,7 +749,6 @@ onMounted(() => { ...@@ -749,7 +749,6 @@ onMounted(() => {
:disabled="importData.isUploading" :disabled="importData.isUploading"
:auto-upload="false" :auto-upload="false"
ref="uploadRef" ref="uploadRef"
action=""
drag drag
:limit="1" :limit="1"
:file-list="importData.fileList" :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