字典类型 CRUD

This commit is contained in:
2024-10-31 14:53:29 +08:00
parent b452636c37
commit b207bc0e68
26 changed files with 386 additions and 279 deletions

View File

@@ -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[] = [
{

View 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)
}

View File

@@ -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) => {

View File

@@ -1,7 +1,25 @@
import type { ReqPage } from "@/api/interface";
import type { ReqPage, ResPage } from '@/api/interface'
export namespace Dict {
/**
* CRUD需要申明一下几个对象
* 1?
* 2id查询返回的对象
* 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> {
}
}