字典类型 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

@@ -30,9 +30,9 @@ export interface ReqPage {
* 分页响应参数
*/
export interface ResPage<T> {
list: T[];
pageNum: number;
pageSize: number;
records: T[];
current: number;
size: number;
total: number;
}

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> {
}
}

View File

@@ -7,20 +7,20 @@ import http from '@/api'
*/
// 用户登录
export const loginApi = (params: Login.ReqLoginForm) => {
// return http.post<Login.ResLogin>(`${rePrefix}/login`, params, { loading: false })
return http.post<Login.ResLogin>(`/Register1`, params, { loading: false })
return http.post<Login.ResLogin>(`${rePrefix}/login`, params, { loading: false })
// return http.post<Login.ResLogin>(`/Register1`, params, { loading: false })
}
// 获取菜单列表
export const getAuthMenuListApi = () => {
// return http.get<Menu.MenuOptions[]>(`${rePrefix}/menu/list`, {}, { loading: false })
return http.post<Menu.MenuOptions[]>(`/Register2`, {}, { loading: false })
return http.get<Menu.MenuOptions[]>(`${rePrefix}/menu/list`, {}, { loading: false })
// return http.post<Menu.MenuOptions[]>(`/Register2`, {}, { loading: false })
}
// 获取按钮权限
export const getAuthButtonListApi = () => {
// return http.get<Login.ResAuthButtons>(`${rePrefix}/auth/buttons`, {}, { loading: false })
return http.post<Login.ResAuthButtons>(`/Register3`, {}, { loading: false })
return http.get<Login.ResAuthButtons>(`${rePrefix}/auth/buttons`, {}, { loading: false })
// return http.post<Login.ResAuthButtons>(`/Register3`, {}, { loading: false })
}
// 用户退出登录