From cc69aaecaf541eff57c9d8812df47576f9bb3e91 Mon Sep 17 00:00:00 2001 From: Charles7c Date: Thu, 11 Apr 2024 20:33:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/system/dict.ts | 54 +++++++ src/apis/system/index.ts | 1 + src/apis/system/type.ts | 35 +++++ src/views/system/dict/AddDictModal.vue | 99 ++++++++++++ src/views/system/dict/index.vue | 127 ++++++++++++++++ .../system/dict/item/AddDictItemModal.vue | 134 ++++++++++++++++ src/views/system/dict/item/index.vue | 143 ++++++++++++++++++ 7 files changed, 593 insertions(+) create mode 100644 src/apis/system/dict.ts create mode 100644 src/views/system/dict/AddDictModal.vue create mode 100644 src/views/system/dict/index.vue create mode 100644 src/views/system/dict/item/AddDictItemModal.vue create mode 100644 src/views/system/dict/item/index.vue diff --git a/src/apis/system/dict.ts b/src/apis/system/dict.ts new file mode 100644 index 0000000..e67499a --- /dev/null +++ b/src/apis/system/dict.ts @@ -0,0 +1,54 @@ +import http from '@/utils/http' +import type * as System from './type' + +const BASE_URL = '/system/dict' + +/** @desc 查询字典列表 */ +export function listDict(query: System.DictQuery) { + return http.get>(`${BASE_URL}`, query) +} + +/** @desc 查询字典详情 */ +export function getDict(id: string) { + return http.get(`${BASE_URL}/${id}`) +} + +/** @desc 新增字典 */ +export function addDict(data: any) { + return http.post(`${BASE_URL}`, data) +} + +/** @desc 修改字典 */ +export function updateDict(data: any, id: string) { + return http.put(`${BASE_URL}/${id}`, data) +} + +/** @desc 删除字典 */ +export function deleteDict(id: string) { + return http.del(`${BASE_URL}/${id}`) +} + +/** @desc 查询字典项列表 */ +export function listDictItem(query: System.DictItemQuery) { + return http.get>(`${BASE_URL}/item`, query) +} + +/** @desc 查询字典项详情 */ +export function getDictItem(id: string) { + return http.get(`${BASE_URL}/item/${id}`) +} + +/** @desc 新增字典项 */ +export function addDictItem(data: any) { + return http.post(`${BASE_URL}/item`, data) +} + +/** @desc 修改字典项 */ +export function updateDictItem(data: any, id: string) { + return http.put(`${BASE_URL}/item/${id}`, data) +} + +/** @desc 删除字典项 */ +export function deleteDictItem(id: string) { + return http.del(`${BASE_URL}/item/${id}`) +} diff --git a/src/apis/system/index.ts b/src/apis/system/index.ts index 236debc..6d49212 100644 --- a/src/apis/system/index.ts +++ b/src/apis/system/index.ts @@ -1,3 +1,4 @@ export * from './dept' export * from './log' +export * from './dict' export * from './storage' diff --git a/src/apis/system/type.ts b/src/apis/system/type.ts index 8de1008..d807ac3 100644 --- a/src/apis/system/type.ts +++ b/src/apis/system/type.ts @@ -56,6 +56,41 @@ export interface LogQuery{ status?: number } +/** 系统字典类型 */ +export interface DictResp { + id: string + name: string + code: string + isSystem: boolean + description: string + createUserString: string + createTime: string + updateUserString: string + updateTime: string +} +export interface DictQuery extends PageQuery { + description?: string +} +export type DictItemResp = { + id: string + label: string + value: string + color: string + sort: number + description: string + status: 1 | 2 + dictId: number + createUserString: string + createTime: string + updateUserString: string + updateTime: string +} +export interface DictItemQuery extends PageQuery { + description?: string + status?: number + dictId: string +} + /** 系统存储类型 */ export type StorageResp = { id: string diff --git a/src/views/system/dict/AddDictModal.vue b/src/views/system/dict/AddDictModal.vue new file mode 100644 index 0000000..1ec8ee6 --- /dev/null +++ b/src/views/system/dict/AddDictModal.vue @@ -0,0 +1,99 @@ + + + diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue new file mode 100644 index 0000000..36e616d --- /dev/null +++ b/src/views/system/dict/index.vue @@ -0,0 +1,127 @@ + + + + + diff --git a/src/views/system/dict/item/AddDictItemModal.vue b/src/views/system/dict/item/AddDictItemModal.vue new file mode 100644 index 0000000..1f41c39 --- /dev/null +++ b/src/views/system/dict/item/AddDictItemModal.vue @@ -0,0 +1,134 @@ + + + diff --git a/src/views/system/dict/item/index.vue b/src/views/system/dict/item/index.vue new file mode 100644 index 0000000..52bafd2 --- /dev/null +++ b/src/views/system/dict/item/index.vue @@ -0,0 +1,143 @@ + + + + +