From 676a9411a6c0d618473bb56ff4411338c9896bc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E7=BA=A2=E4=B8=BD?= <1181930680@qq.com> Date: Thu, 11 Jul 2024 15:17:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=97=E5=85=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/data/dictionary.ts | 128 ++++++++ src/views/data/dictionary/columns.ts | 13 + .../dictionary/columnsItem.ts} | 10 +- src/views/data/dictionary/dictItem.vue | 127 ++++++++ src/views/data/dictionary/edit.vue | 118 ++++++++ src/views/data/dictionary/editItem.vue | 123 ++++++++ src/views/data/dictionary/index.vue | 151 ++++++++++ src/views/system/dictionary/CreateModal.vue | 139 --------- src/views/system/dictionary/dictionary.vue | 277 ------------------ 9 files changed, 663 insertions(+), 423 deletions(-) create mode 100644 src/api/data/dictionary.ts create mode 100644 src/views/data/dictionary/columns.ts rename src/views/{system/dictionary/columns.ts => data/dictionary/columnsItem.ts} (55%) create mode 100644 src/views/data/dictionary/dictItem.vue create mode 100644 src/views/data/dictionary/edit.vue create mode 100644 src/views/data/dictionary/editItem.vue create mode 100644 src/views/data/dictionary/index.vue delete mode 100644 src/views/system/dictionary/CreateModal.vue delete mode 100644 src/views/system/dictionary/dictionary.vue diff --git a/src/api/data/dictionary.ts b/src/api/data/dictionary.ts new file mode 100644 index 0000000..5c38b2e --- /dev/null +++ b/src/api/data/dictionary.ts @@ -0,0 +1,128 @@ +import { http } from '@/utils/http/axios'; + +/** + * @description: 字典列表 + */ +export function getDictList(params?) { + return http.request({ + url: '/dict/page', + method: 'GET', + params, + }); +} +/** + * @description: 根据ID获取详情 + */ +export function getDictDetail(id) { + return http.request({ + url: '/dict/detail/'+id, + method: 'get', + }); +} +/** + * @description: 刷新缓存 + */ +export function refreshCache() { + return http.request({ + url: '/dict/refreshCache', + method: 'get', + }); +} +/** + * @description: 添加字典 + */ +export function dictAdd(data:any) { + return http.request({ + url: '/dict/add', + method: 'POST', + data, + }); +} +/** + * @description: 更新字典 + */ +export function dictUpdate(data:any) { + return http.request({ + url: '/dict/update', + method: 'PUT', + data + }); +} +/** + * @description: 删除字典 + */ +export function dictDelete(id) { + return http.request({ + url: '/dict/delete/'+id, + method: 'DELETE', + }); +} +/** + * @description: 批量删除字典 + */ +export function dictBatchDelete(data:any) { + return http.request({ + url: '/dict/batchDelete', + method: 'DELETE', + data + }); +} + +/** + * @description: 字典项列表 + */ +export function getDictItemList(params?) { + return http.request({ + url: '/dict/item/page', + method: 'GET', + params, + }); +} +/** + * @description: 根据ID获取详情 + */ +export function getDictItemDetail(id) { + return http.request({ + url: '/dict/item/detail/'+id, + method: 'get', + }); +} +/** + * @description: 添加字典项 + */ +export function dictItemAdd(data:any) { + return http.request({ + url: '/dict/item/add', + method: 'POST', + data, + }); +} +/** + * @description: 更新字典项 + */ +export function dictItemUpdate(data:any) { + return http.request({ + url: '/dict/item/update', + method: 'PUT', + data + }); +} +/** + * @description: 删除字典项 + */ +export function dictItemDelete(id) { + return http.request({ + url: '/dict/item/delete/'+id, + method: 'DELETE', + }); +} +/** + * @description: 批量删除字典项 + */ +export function dictItemBatchDelete(data:any) { + return http.request({ + url: '/dict/item/batchDelete', + method: 'DELETE', + data + }); +} \ No newline at end of file diff --git a/src/views/data/dictionary/columns.ts b/src/views/data/dictionary/columns.ts new file mode 100644 index 0000000..42459c8 --- /dev/null +++ b/src/views/data/dictionary/columns.ts @@ -0,0 +1,13 @@ +export const columns = [ + { + type: 'selection', + }, + { + label: '字典名称', + prop: 'name', + }, + { + label: '字典编码', + prop: 'code', + }, +]; diff --git a/src/views/system/dictionary/columns.ts b/src/views/data/dictionary/columnsItem.ts similarity index 55% rename from src/views/system/dictionary/columns.ts rename to src/views/data/dictionary/columnsItem.ts index 343d95f..c401773 100644 --- a/src/views/system/dictionary/columns.ts +++ b/src/views/data/dictionary/columnsItem.ts @@ -4,18 +4,14 @@ export const columns = [ }, { label: '字典名称', - prop: 'label', + prop: 'name', }, { - label: '字典值', + label: '字典项值', prop: 'value', }, { label: '排序', - prop: 'order', - }, - { - label: '创建时间', - prop: 'create_date', + prop: 'sort', }, ]; diff --git a/src/views/data/dictionary/dictItem.vue b/src/views/data/dictionary/dictItem.vue new file mode 100644 index 0000000..6a9c1b2 --- /dev/null +++ b/src/views/data/dictionary/dictItem.vue @@ -0,0 +1,127 @@ + + + + + + + + + + + + + 查询 + 新建 + 删除 + + + + + + + + + + diff --git a/src/views/data/dictionary/edit.vue b/src/views/data/dictionary/edit.vue new file mode 100644 index 0000000..37b5e2c --- /dev/null +++ b/src/views/data/dictionary/edit.vue @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + 取消 + + 确定 + + + + + + diff --git a/src/views/data/dictionary/editItem.vue b/src/views/data/dictionary/editItem.vue new file mode 100644 index 0000000..027aa2a --- /dev/null +++ b/src/views/data/dictionary/editItem.vue @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + 取消 + + 确定 + + + + + + diff --git a/src/views/data/dictionary/index.vue b/src/views/data/dictionary/index.vue new file mode 100644 index 0000000..7ed2c7b --- /dev/null +++ b/src/views/data/dictionary/index.vue @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + 查询 + + + + 刷新缓存 + 新建 + 删除 + + + + + + + + + + + + + + + + + + diff --git a/src/views/system/dictionary/CreateModal.vue b/src/views/system/dictionary/CreateModal.vue deleted file mode 100644 index 0788dbb..0000000 --- a/src/views/system/dictionary/CreateModal.vue +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/src/views/system/dictionary/dictionary.vue b/src/views/system/dictionary/dictionary.vue deleted file mode 100644 index c31c510..0000000 --- a/src/views/system/dictionary/dictionary.vue +++ /dev/null @@ -1,277 +0,0 @@ - - - - - - - - - - 新建 - 编辑 - 删除 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 查询 - 新建 - 删除 - - - - - - - - - - 您确认要删除,{{ rowKeysName }} ? - - - - - - - - -
您确认要删除,{{ rowKeysName }} ?