From ccf2565e1dcd2532a9d60370eb19e338210994e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=B0=B8=E6=98=A5?= Date: Thu, 4 Dec 2025 23:16:29 +0800 Subject: [PATCH] =?UTF-8?q?feat-wip(components):=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=AD=97=E5=85=B8=E7=9B=B8=E5=85=B3=E9=A1=B5=E9=9D=A2=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.test | 2 +- src/locales/langs/en-us.ts | 8 +- src/locales/langs/zh-cn.ts | 8 +- src/service/api/sys/core/dictionary.ts | 10 ++ src/typings/app.d.ts | 6 + src/typings/components.d.ts | 2 + src/views/sys/core/dictionary/index.vue | 5 - .../modules/dictionary-operate-dialog.vue | 59 ++++++++++ .../modules/dictionary-operate-drawer.vue | 103 +++++++++++++----- 9 files changed, 167 insertions(+), 36 deletions(-) create mode 100644 src/views/sys/core/dictionary/modules/dictionary-operate-dialog.vue diff --git a/.env.test b/.env.test index b0347e13..5962ca66 100644 --- a/.env.test +++ b/.env.test @@ -1,5 +1,5 @@ # backend service base url, test environment -VITE_SERVICE_BASE_URL=http://localhost:8080 +VITE_SERVICE_BASE_URL=http://192.168.1.7:8080 # other backend service base url, test environment VITE_OTHER_SERVICE_BASE_URL=`{ diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index c66b1dd8..33a8c83d 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -332,7 +332,13 @@ const local: App.I18n.Schema = { } }, item: { - title: 'Item' + title: 'Item', + fields: { + name: 'Name', + code: 'Code', + sort: 'Sort', + description: 'Description' + } } } }, diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index 0be2af72..603fcea2 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -328,7 +328,13 @@ const local: App.I18n.Schema = { } }, item: { - title: '字典项' + title: '字典项', + fields: { + name: '名称', + code: '代码', + sort: '排序', + description: '描述' + } } } }, diff --git a/src/service/api/sys/core/dictionary.ts b/src/service/api/sys/core/dictionary.ts index 7b75ef84..63d463a2 100644 --- a/src/service/api/sys/core/dictionary.ts +++ b/src/service/api/sys/core/dictionary.ts @@ -43,3 +43,13 @@ export function fetchDictionaryDeleteBatch(ids: string[]) { } }); } + +export function fetchTreeDictionaryItem(dictionaryId: string) { + return request({ + url: '/dictionaryItem/tree', + method: 'post', + data: { + dictionaryId + } + }); +} diff --git a/src/typings/app.d.ts b/src/typings/app.d.ts index 509219da..3cdee59e 100644 --- a/src/typings/app.d.ts +++ b/src/typings/app.d.ts @@ -575,6 +575,12 @@ declare namespace App { }; item: { title: string; + fields: { + name: string; + code: string; + sort: string; + description: string; + }; }; }; }; diff --git a/src/typings/components.d.ts b/src/typings/components.d.ts index fbf95912..12e7abd0 100644 --- a/src/typings/components.d.ts +++ b/src/typings/components.d.ts @@ -63,6 +63,7 @@ declare module 'vue' { NFormItemGi: typeof import('naive-ui')['NFormItemGi'] NGi: typeof import('naive-ui')['NGi'] NGrid: typeof import('naive-ui')['NGrid'] + NHr: typeof import('naive-ui')['NHr'] NInput: typeof import('naive-ui')['NInput'] NInputGroup: typeof import('naive-ui')['NInputGroup'] NInputNumber: typeof import('naive-ui')['NInputNumber'] @@ -154,6 +155,7 @@ declare global { const NFormItemGi: typeof import('naive-ui')['NFormItemGi'] const NGi: typeof import('naive-ui')['NGi'] const NGrid: typeof import('naive-ui')['NGrid'] + const NHr: typeof import('naive-ui')['NHr'] const NInput: typeof import('naive-ui')['NInput'] const NInputGroup: typeof import('naive-ui')['NInputGroup'] const NInputNumber: typeof import('naive-ui')['NInputNumber'] diff --git a/src/views/sys/core/dictionary/index.vue b/src/views/sys/core/dictionary/index.vue index 7f54f348..f0726cd5 100644 --- a/src/views/sys/core/dictionary/index.vue +++ b/src/views/sys/core/dictionary/index.vue @@ -82,9 +82,6 @@ const { columns, columnChecks, data, loading, getData, getDataByPage, mobilePagi align: 'center', render: row => (
- handleOpenChildren(row.id)}> - {$t('common.children')} - edit(row.id)}> {$t('common.edit')} @@ -122,8 +119,6 @@ function handleDelete(id: string) { function edit(id: string) { handleEdit(id); } - -function handleOpenChildren(_: string) {}