9 changed files with 106 additions and 187 deletions
@ -1,54 +1,34 @@ |
|||||||
import { DictParams, DictResult, Dict } from '../entity/dict'; |
/** |
||||||
|
* 提供api模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致 |
||||||
|
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved. |
||||||
|
* author entfrm开发团队-王翔 |
||||||
|
*/ |
||||||
|
import type { DictParams, Dict, DictResult } from '/@/api/platform/system/entity/dict'; |
||||||
import { defHttp } from '/@/utils/http/axios'; |
import { defHttp } from '/@/utils/http/axios'; |
||||||
import {isDef} from "/@/utils/is"; |
|
||||||
|
|
||||||
enum Api { |
enum Api { |
||||||
List = '/system_proxy/system/dict/list', |
list = '/system_proxy/system/dict/list', |
||||||
GetById = '/system_proxy/system/dict', |
add = '/system_proxy/system/dict/save', |
||||||
Save = '/system_proxy/system/dict/save', |
get = '/system_proxy/system/dict', |
||||||
Update = '/system_proxy/system/dict/update', |
edit = '/system_proxy/system/dict/update', |
||||||
Remove = '/system_proxy/system/dict/remove', |
del = '/system_proxy/system/dict/remove', |
||||||
ChangeStatus = '/system_proxy/system/dict/changeStatus' |
changeStatus='/system_proxy/system/dict/changeStatus' |
||||||
} |
} |
||||||
|
|
||||||
|
/** 查询配置列表 */ |
||||||
|
export const listDict = (params?: Partial<DictParams>) => defHttp.get<DictResult>({ url: Api.list, params }, { isReturnResultResponse: true }); |
||||||
|
|
||||||
|
/** 新增配置 */ |
||||||
|
export const addDict = (params: Partial<Dict>) => defHttp.post({ url: Api.add, data: params }); |
||||||
|
|
||||||
/** |
/** 修改配置 */ |
||||||
* 条件查询字典数据列表 |
export const editDict = (params: Partial<Dict>) => defHttp.put({ url: Api.edit, data: params }); |
||||||
* @param params |
|
||||||
*/ |
|
||||||
export const list = (params: DictParams) => |
|
||||||
defHttp.get({url: Api.List, params}); |
|
||||||
|
|
||||||
/** |
|
||||||
* 修改或新增 |
|
||||||
* @param params |
|
||||||
*/ |
|
||||||
export const set = (params: Dict) => { |
|
||||||
if (isDef(params.id)) { |
|
||||||
return defHttp.put({url: Api.Update, params}); |
|
||||||
} else { |
|
||||||
return defHttp.post({url: Api.Save, params}); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/** |
/** 查询配置详细 */ |
||||||
* 通过id获取 |
export const getDict = (id: string) => defHttp.get<Dict>({ url: `${Api.get}/${id}` }); |
||||||
* @param params |
|
||||||
*/ |
|
||||||
export const getById = (params: { id: string }) => |
|
||||||
defHttp.get({url: Api.GetById + `/${params.id}`}); |
|
||||||
|
|
||||||
/** |
/** 删除配置 */ |
||||||
* 删除字典数据 |
export const delDict = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` }); |
||||||
* @param params |
|
||||||
*/ |
|
||||||
export const remove = (params: {id: string}) => |
|
||||||
defHttp.delete({url: Api.Remove + `/${params.id}` }); |
|
||||||
|
|
||||||
/** |
/** 修改字典状态 */ |
||||||
* 修改状态 |
export const changeStatus = (id: string, status: string) => defHttp.put({ url: Api.changeStatus, data: { id: id, status: status } }); |
||||||
* @param params |
|
||||||
*/ |
|
||||||
export const changeStatus = (params: Dict) => |
|
||||||
defHttp.get({url: Api.ChangeStatus, params}); |
|
||||||
|
@ -1,61 +1,34 @@ |
|||||||
import {DictDataParams, DictDataResult, DictData} from '../entity/dictData'; |
/** |
||||||
import {defHttp} from '/@/utils/http/axios'; |
* 提供api模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致 |
||||||
import {isDef} from "/@/utils/is"; |
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved. |
||||||
|
* author entfrm开发团队-王翔 |
||||||
|
*/ |
||||||
|
import type { DictDataParams, DictData, DictDataResult } from '/@/api/platform/system/entity/dictData'; |
||||||
|
import { defHttp } from '/@/utils/http/axios'; |
||||||
|
|
||||||
enum Api { |
enum Api { |
||||||
List = '/system_proxy/system/dictData/list', |
list = '/system_proxy/system/dictData/list', |
||||||
GetById = '/system_proxy/system/dictData', |
add = '/system_proxy/system/dictData/save', |
||||||
GetByData = '/system_proxy/system/dictData/getDictData', |
get = '/system_proxy/system/dictData', |
||||||
GetByDictType = '/system_proxy/system/dictData/dictType', |
edit = '/system_proxy/system/dictData/update', |
||||||
Save = '/system_proxy/system/dictData/save', |
del = '/system_proxy/system/dictData/remove', |
||||||
Update = '/system_proxy/system/dictData/update', |
getByDictType = '/system_proxy/system/dictData/dictType' |
||||||
Remove = '/system_proxy/system/dictData/remove' |
|
||||||
|
|
||||||
} |
} |
||||||
|
|
||||||
/** |
/** 查询字典数据列表 */ |
||||||
* 条件查询字典数据列表 |
export const listDictData = (params?: Partial<DictDataParams>) => defHttp.get<DictDataResult>({ url: Api.list, params }, { isReturnResultResponse: true }); |
||||||
* @param params |
|
||||||
*/ |
|
||||||
export const list = (params: DictDataParams) => |
|
||||||
defHttp.get({url: Api.List, params}); |
|
||||||
|
|
||||||
/** |
/** 新增字典数据 */ |
||||||
* 修改或新增 |
export const addDictData = (params: Partial<DictData>) => defHttp.post({ url: Api.add, data: params }); |
||||||
* @param params |
|
||||||
*/ |
|
||||||
export const set = (params: DictData) => { |
|
||||||
if (isDef(params.id)) { |
|
||||||
return defHttp.put({url: Api.Update, params}); |
|
||||||
} else { |
|
||||||
return defHttp.post({url: Api.Save, params}); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/** |
/** 修改字典数据 */ |
||||||
* 通过id获取 |
export const editDictData = (params: Partial<DictData>) => defHttp.put({ url: Api.edit, data: params }); |
||||||
* @param params |
|
||||||
*/ |
|
||||||
export const getById = (params: { id: string }) => |
|
||||||
defHttp.get({url: Api.GetById + `/${params.id}`}); |
|
||||||
|
|
||||||
/** |
/** 查询字典数据详细 */ |
||||||
* 通过type和value查询 |
export const getDictData = (id: string) => defHttp.get<DictData>({ url: `${Api.get}/${id}` }); |
||||||
* @param params |
|
||||||
*/ |
|
||||||
export const getByData = (params: {dataType: string, value: string}) => |
|
||||||
defHttp.get({url: Api.GetByData, params}); |
|
||||||
|
|
||||||
/** |
/** 删除字典数据 */ |
||||||
* 获取字典数据通过字典类型 |
export const delDictData = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` }); |
||||||
* @param params |
|
||||||
*/ |
|
||||||
export const getByDictType = (params: {dictType: string}) => |
|
||||||
defHttp.get({url: Api.GetByDictType + `/${params.dictType}`}) |
|
||||||
|
|
||||||
/** |
/** 根据字典类型查询字典数据 */ |
||||||
* 删除字典数据 |
export const getDataByDictType = (dictType: string) => defHttp.get<DictData[]>({ url: `${Api.getByDictType}/${dictType}` }); |
||||||
* @param params |
|
||||||
*/ |
|
||||||
export const remove = (params: {id: string}) => |
|
||||||
defHttp.delete({url: Api.Remove + `/${params.id}` }); |
|
||||||
|
@ -1,12 +0,0 @@ |
|||||||
import { LogParams, LogListGetResultModel } from '../entity/logModel'; |
|
||||||
import { defHttp } from '/@/utils/http/axios'; |
|
||||||
|
|
||||||
enum Api { |
|
||||||
LogList = '/mate-system/log/page', |
|
||||||
LogEmpty = '/mate-system/log/empty', |
|
||||||
} |
|
||||||
|
|
||||||
export const getLogListByPage = (params: LogParams) => |
|
||||||
defHttp.get<LogListGetResultModel>({ url: Api.LogList, params }); |
|
||||||
|
|
||||||
export const logEmpty = () => defHttp.post({ url: Api.LogEmpty }); |
|
@ -1,32 +1,25 @@ |
|||||||
/** |
/** |
||||||
* @program: kicc-ui |
* @program: kicc-ui |
||||||
* @description: 文件上传实体类 |
* @description: 字典实体类 |
||||||
* 类型定义 |
* 类型定义 |
||||||
* @author: entfrm开发团队-王翔 |
* @author: entfrm开发团队-王翔 |
||||||
* @create: 2022/4/8 |
* @create: 2022/4/8 |
||||||
*/ |
*/ |
||||||
import {CommonEntity, Page, R} from '/@/api/model'; |
import { R } from '/#/axios'; |
||||||
|
import { CommonEntity, Page } from '/@/api/common/data/entity'; |
||||||
|
|
||||||
// 定义查询参数
|
/** 字典查询参数 */ |
||||||
export type DictParams = Page & { |
export type DictParams = Page & Dict; |
||||||
id?:string; |
|
||||||
name?:string; |
|
||||||
type?:string; |
|
||||||
isSys?:string; |
|
||||||
status?:string; |
|
||||||
|
|
||||||
}; |
/** 字典对象 */ |
||||||
|
export interface Dict extends CommonEntity { |
||||||
|
id: string; |
||||||
// 定义字典对象
|
name: string; |
||||||
export interface Dict extends CommonEntity{ |
type: string; |
||||||
id:string; |
isSys: string; |
||||||
name:string; |
status: string; |
||||||
type:string; |
[key: string]: any; |
||||||
isSys:string; |
|
||||||
status:string; |
|
||||||
} |
} |
||||||
|
|
||||||
|
/** 字典响应对象 */ |
||||||
// 根据字典对象生成响应模型
|
export type DictResult = R<Dict[]>; |
||||||
export type DictResult = R<Dict>; |
|
||||||
|
@ -1,30 +1,25 @@ |
|||||||
/** |
/** |
||||||
* @program: kicc-ui |
* @program: kicc-ui |
||||||
* @description: 文件上传实体类 |
* @description: 字典数据实体类 |
||||||
* 类型定义 |
* 类型定义 |
||||||
* @author: entfrm开发团队-王翔 |
* @author: entfrm开发团队-王翔 |
||||||
* @create: 2022/4/8 |
* @create: 2022/4/8 |
||||||
*/ |
*/ |
||||||
import {CommonEntity, Page, R} from '/@/api/model'; |
import { R } from '/#/axios'; |
||||||
|
import { CommonEntity, Page } from '/@/api/common/data/entity'; |
||||||
|
|
||||||
// 定义查询参数
|
/** 字典数据查询参数 */ |
||||||
export type DictDataParams = Page & { |
export type DictDataParams = Page & DictData; |
||||||
id?: string; |
|
||||||
dictType?: string; |
|
||||||
label?: string; |
|
||||||
value?: string; |
|
||||||
sort?: string; |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
|
/** 字典数据对象 */ |
||||||
export interface DictData extends CommonEntity { |
export interface DictData extends CommonEntity { |
||||||
id: string; |
id: string; |
||||||
dictType: string; |
dictType: string; |
||||||
label: string; |
label: string; |
||||||
value: string; |
value: string; |
||||||
sort: number; |
sort: number; |
||||||
|
[key: string]: any; |
||||||
} |
} |
||||||
|
|
||||||
// 根据字典对象生成响应模型
|
/** 字典数据响应对象 */ |
||||||
export type DictDataResult = R<DictData>; |
export type DictDataResult = R<DictData[]>; |
||||||
|
Loading…
Reference in new issue