From e9653ebcbc4dae46eecdba2d48c488cd4483f17b Mon Sep 17 00:00:00 2001 From: john <409225776@qq.com> Date: Sun, 16 Aug 2026 09:01:34 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat(RemoteSelect):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=BF=9C=E7=A8=8B=E6=90=9C=E7=B4=A2=E9=80=89=E6=8B=A9=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/RemoteSelect/index.vue | 147 ++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 src/components/RemoteSelect/index.vue diff --git a/src/components/RemoteSelect/index.vue b/src/components/RemoteSelect/index.vue new file mode 100644 index 00000000..b185a14f --- /dev/null +++ b/src/components/RemoteSelect/index.vue @@ -0,0 +1,147 @@ + + + From 1e1dc1e89d77730eb9459b358c7881ab1a993ccd Mon Sep 17 00:00:00 2001 From: john <409225776@qq.com> Date: Sun, 16 Aug 2026 11:15:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat(dict):=20=E6=B7=BB=E5=8A=A0=E5=AD=97?= =?UTF-8?q?=E5=85=B8=E7=94=9F=E6=88=90=E6=9E=9A=E4=B8=BE=E7=B1=BB=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/dict/data/types.ts | 2 ++ src/api/system/dict/type/index.ts | 31 ++++++++++++++++++++++++- src/views/system/dict/index.vue | 38 ++++++++++++++++++++++++++++--- 3 files changed, 67 insertions(+), 4 deletions(-) diff --git a/src/api/system/dict/data/types.ts b/src/api/system/dict/data/types.ts index e4abb9ba..6e2113e2 100644 --- a/src/api/system/dict/data/types.ts +++ b/src/api/system/dict/data/types.ts @@ -12,6 +12,7 @@ export interface DictDataVO extends BaseEntity { listClass: ElTagType; dictSort: number; remark: string; + enumName: string; } export interface DictDataForm { @@ -23,4 +24,5 @@ export interface DictDataForm { listClass: ElTagType; dictSort: number; remark: string; + enumName: string; } diff --git a/src/api/system/dict/type/index.ts b/src/api/system/dict/type/index.ts index ca69c59a..1c6362ce 100644 --- a/src/api/system/dict/type/index.ts +++ b/src/api/system/dict/type/index.ts @@ -1,6 +1,9 @@ import type { PageResult } from '@/api/types'; -import type { AxiosPromise } from '@/utils/api-types'; +import errorCode from '@/utils/errorCode'; import request from '@/utils/request'; +import type { AxiosPromise } from '@/utils/api-types'; +import { blobValidate } from '@/utils/ruoyi'; +import { saveBlob } from '@/utils/save'; import type { DictTypeForm, DictTypeQuery, DictTypeVO } from './types'; // 查询字典类型列表 @@ -61,3 +64,29 @@ export function optionselect(): AxiosPromise { method: 'get' }); } + +// 生成字典枚举类压缩包 +export function genEnum(dictTypes: string[]) { + const loading = ElLoading.service({ + text: '正在下载数据,请稍候', + background: 'rgba(0, 0, 0, 0.7)' + }); + return request({ + url: '/system/dict/type/genEnum', + method: 'post', + data: dictTypes, + responseType: 'blob' + }) + .then(async (data: any) => { + if (blobValidate(data)) { + const blob = new Blob([data], { type: 'application/zip' }); + saveBlob(blob, 'dict_enum.zip'); + } else { + const resText = await new Blob([data]).text(); + const rspObj = JSON.parse(resText); + const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']; + ElMessage.error(errMsg); + } + }) + .finally(() => loading.close()); +} diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue index 8b7f84ae..0f713510 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -81,6 +81,17 @@ > 导出 + + 生成枚举 + + @@ -386,6 +398,9 @@ > + + + @@ -403,17 +418,21 @@