字典类型 CRUD
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { type Dict } from "@/api/system/dict/interface";
|
||||
import { type Dict } from "@/api/system/dictionary/interface";
|
||||
|
||||
export const dictTypeList: Dict.ResDictType[] = [
|
||||
{
|
||||
24
frontend/src/api/system/dictionary/dictType/index.ts
Normal file
24
frontend/src/api/system/dictionary/dictType/index.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import http from '@/api'
|
||||
import { type Dict } from '@/api/system/dictionary/interface'
|
||||
|
||||
//获取字典类型
|
||||
export const getDictTypeList = (params: Dict.ReqDictTypeParams) => {
|
||||
return http.post(`/dictType/list`, params)
|
||||
}
|
||||
|
||||
//添加字典类型
|
||||
export const addDictType = (params: Dict.ResDictType) => {
|
||||
return http.post(`/dictType/add`, params)
|
||||
}
|
||||
|
||||
//编辑字典类型
|
||||
export const updateDictType = (params: Dict.ResDictType) => {
|
||||
return http.post(`/dictType/update`, params)
|
||||
}
|
||||
|
||||
//删除字典类型
|
||||
export const deleteDictType = (params: string[]) => {
|
||||
return http.post(`/dictType/delete`, params)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import http from "@/api";
|
||||
import { ADMIN as rePrefix } from "@/api/config/serviceName";
|
||||
import { type Dict } from "@/api/system/dict/interface";
|
||||
import { type Dict } from "@/api/system/dictionary/interface";
|
||||
|
||||
//获取字典类型
|
||||
export const getDictTypeList = (params: Dict.ReqDictTypeParams) => {
|
||||
@@ -1,7 +1,25 @@
|
||||
import type { ReqPage } from "@/api/interface";
|
||||
import type { ReqPage, ResPage } from '@/api/interface'
|
||||
|
||||
export namespace Dict {
|
||||
|
||||
|
||||
/**
|
||||
* 一个单表的CRUD需要申明一下几个对象
|
||||
* 1、表格分页查询对象,字段:查询字段?、页码、每页条数;
|
||||
* 2、新增、修改、根据id查询返回的对象;
|
||||
* 3、表格查询分页返回的对象;
|
||||
*/
|
||||
|
||||
/**
|
||||
* 字典类型表格分页查询参数
|
||||
*/
|
||||
export interface ReqDictTypeParams extends ReqPage{
|
||||
name?: string; // 名称
|
||||
code?: string; // 编码
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典类型新增、修改、根据id查询返回的对象
|
||||
*/
|
||||
export interface ResDictType {
|
||||
id: string; // 字典类型表Id
|
||||
name: string; // 名称
|
||||
@@ -17,10 +35,27 @@ export namespace Dict {
|
||||
updateTime?: string | null; // 更新时间
|
||||
}
|
||||
|
||||
export interface ReqDictTypeParams extends ReqPage{
|
||||
|
||||
/**
|
||||
* 字典类型表格查询分页返回的对象;
|
||||
*/
|
||||
export interface ResDictTypePage extends ResPage<ResDictType> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 字典数据表格分页查询参数
|
||||
*/
|
||||
export interface ReqDictDataParams extends ReqPage{
|
||||
typeId: string; // 类型id 必填
|
||||
name?: string; // 名称
|
||||
code?: string; // 编码
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典数据新增、修改、根据id查询返回的对象
|
||||
*/
|
||||
export interface ResDictData {
|
||||
id: string; // 字典数据表Id
|
||||
typeId: string; // 字典类型表Id
|
||||
@@ -37,7 +72,11 @@ export namespace Dict {
|
||||
updateTime?: string | null; // 更新时间
|
||||
}
|
||||
|
||||
export interface ReqDictDataParams extends ReqPage{
|
||||
/**
|
||||
* 字典数据表格查询分页返回的对象;
|
||||
*/
|
||||
export interface ResDictDataPage extends ResPage<ResDictData> {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user