From f446ac43876682a1c0eaa80e20db9f3c02025b50 Mon Sep 17 00:00:00 2001 From: AN <1983933789@qq.com> Date: Thu, 24 Apr 2025 22:22:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?chore:=20=E4=BF=AE=E6=94=B9=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=EF=BC=8C=E5=88=97=E8=A1=A8=E5=A4=B4=E9=83=A8=E6=8F=92?= =?UTF-8?q?=E6=A7=BD=E6=96=B9=E5=BC=8F=E6=B7=BB=E5=8A=A0=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/java/VelocityUtils.java | 2 +- src/components/custom/dict-tag.vue | 6 ++-- src/views/monitor/oper-log/index.vue | 47 ++++++++++++++-------------- src/views/system/config/index.vue | 41 ++++++++++++++---------- src/views/system/dept/index.vue | 25 ++++++++------- src/views/system/dict/type/index.vue | 35 +++++++++++---------- src/views/system/tenant/index.vue | 43 +++++++++++-------------- 7 files changed, 100 insertions(+), 99 deletions(-) diff --git a/docs/java/VelocityUtils.java b/docs/java/VelocityUtils.java index a64bcd63..73290c75 100644 --- a/docs/java/VelocityUtils.java +++ b/docs/java/VelocityUtils.java @@ -62,7 +62,7 @@ public class VelocityUtils { velocityContext.put("BusinessName", StringUtils.capitalize(genTable.getBusinessName())); velocityContext.put("businessName", genTable.getBusinessName()); velocityContext.put("business_name", StrUtil.toUnderlineCase(genTable.getBusinessName())); - velocityContext.put("business-name", StrUtil.toUnderlineCase(genTable.getBusinessName())); + velocityContext.put("business-name", StrUtil.toSymbolCase(genTable.getBusinessName(),'-')); velocityContext.put("businessname", StrUtil.toSymbolCase(genTable.getBusinessName(), ' ')); velocityContext.put("basePackage", getPackagePrefix(packageName)); velocityContext.put("packageName", packageName); diff --git a/src/components/custom/dict-tag.vue b/src/components/custom/dict-tag.vue index 894d4f06..cf8464e4 100644 --- a/src/components/custom/dict-tag.vue +++ b/src/components/custom/dict-tag.vue @@ -10,7 +10,7 @@ interface Props { value?: string[] | number[] | string | number; dictCode?: string; immediate?: boolean; - dictData?: Api.System.DictData[]; + dictData?: Api.System.DictData; [key: string]: any; } @@ -25,7 +25,7 @@ const attrs = useAttrs() as TagProps; const dictTagData = computed(() => { if (props.dictData) { - return props.dictData; + return [props.dictData]; } // 避免 props.value 为 0 时,无法触发 if (props.dictCode && isNotNull(props.value)) { @@ -42,7 +42,7 @@ const dictTagData = computed(() => { ) { Date: Thu, 24 Apr 2025 22:23:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E5=AF=B9=E6=8E=A5oss?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/elegant/imports.ts | 1 + src/router/elegant/routes.ts | 9 + src/router/elegant/transform.ts | 1 + src/service/api/system/config.ts | 8 + src/service/api/system/oss.ts | 18 ++ src/typings/api/system.api.d.ts | 27 +++ src/typings/elegant-router.d.ts | 2 + src/utils/common.ts | 6 + src/views/system/oss/index.vue | 227 ++++++++++++++++++++ src/views/system/oss/modules/oss-search.vue | 72 +++++++ 10 files changed, 371 insertions(+) create mode 100644 src/service/api/system/oss.ts create mode 100644 src/views/system/oss/index.vue create mode 100644 src/views/system/oss/modules/oss-search.vue diff --git a/src/router/elegant/imports.ts b/src/router/elegant/imports.ts index 90a75bbc..29b71b19 100644 --- a/src/router/elegant/imports.ts +++ b/src/router/elegant/imports.ts @@ -32,6 +32,7 @@ export const views: Record Promise import("@/views/system/dict/type/index.vue"), system_menu: () => import("@/views/system/menu/index.vue"), system_notice: () => import("@/views/system/notice/index.vue"), + system_oss: () => import("@/views/system/oss/index.vue"), system_post: () => import("@/views/system/post/index.vue"), system_tenant: () => import("@/views/system/tenant/index.vue"), system_user: () => import("@/views/system/user/index.vue"), diff --git a/src/router/elegant/routes.ts b/src/router/elegant/routes.ts index cca82f82..2f9938ff 100644 --- a/src/router/elegant/routes.ts +++ b/src/router/elegant/routes.ts @@ -202,6 +202,15 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.system_notice' } }, + { + name: 'system_oss', + path: '/system/oss', + component: 'view.system_oss', + meta: { + title: 'system_oss', + i18nKey: 'route.system_oss' + } + }, { name: 'system_post', path: '/system/post', diff --git a/src/router/elegant/transform.ts b/src/router/elegant/transform.ts index dcc5979e..a80a503a 100644 --- a/src/router/elegant/transform.ts +++ b/src/router/elegant/transform.ts @@ -182,6 +182,7 @@ const routeMap: RouteMap = { "system_dict_type": "/system/dict/type", "system_menu": "/system/menu", "system_notice": "/system/notice", + "system_oss": "/system/oss", "system_post": "/system/post", "system_tenant": "/system/tenant", "system_user": "/system/user", diff --git a/src/service/api/system/config.ts b/src/service/api/system/config.ts index 836b1791..c8548f1a 100644 --- a/src/service/api/system/config.ts +++ b/src/service/api/system/config.ts @@ -43,6 +43,14 @@ export function fetchBatchDeleteConfig(configIds: CommonType.IdType[]) { }); } +/** 根据Key获取值 */ +export function fetchGetConfigByKey(configKey: string) { + return request({ + url: `/system/config/configKey/${configKey}`, + method: 'get' + }); +} + /** 刷新缓存 */ export function fetchRefreshCache() { return request({ diff --git a/src/service/api/system/oss.ts b/src/service/api/system/oss.ts new file mode 100644 index 00000000..f8e0f39d --- /dev/null +++ b/src/service/api/system/oss.ts @@ -0,0 +1,18 @@ +import { request } from '@/service/request'; + +/** 获取文件管理列表 */ +export function fetchGetOssList(params?: Api.System.OssSearchParams) { + return request({ + url: '/resource/oss/list', + method: 'get', + params + }); +} + +/** 批量删除文件管理 */ +export function fetchBatchDeleteOss(ossIds: CommonType.IdType[]) { + return request({ + url: `/resource/oss/${ossIds.join(',')}`, + method: 'delete' + }); +} diff --git a/src/typings/api/system.api.d.ts b/src/typings/api/system.api.d.ts index 2a39c2cd..148c4ff1 100644 --- a/src/typings/api/system.api.d.ts +++ b/src/typings/api/system.api.d.ts @@ -612,5 +612,32 @@ declare namespace Api { | 'wechat_mp' | 'wechat_enterprise' | 'gitlab'; + + /** oss */ + type Oss = Common.CommonRecord<{ + /** 对象存储主键 */ + ossId: CommonType.IdType; + /** 租户编号 */ + tenantId: CommonType.IdType; + /** 文件名 */ + fileName: string; + /** 原名 */ + originalName: string; + /** 后缀名 */ + fileSuffix: string; + /** 文件预览 */ + url: string; + /** 服务商 */ + service: string; + /** 创建者 */ + createByName: string; + }>; + + /** oss search params */ + type OssSearchParams = CommonType.RecordNullable< + Pick & Api.Common.CommonSearchParams + >; + /** oss list */ + type OssList = Api.Common.PaginatingQueryRecord; } } diff --git a/src/typings/elegant-router.d.ts b/src/typings/elegant-router.d.ts index af5788cd..3ebcb8cc 100644 --- a/src/typings/elegant-router.d.ts +++ b/src/typings/elegant-router.d.ts @@ -36,6 +36,7 @@ declare module "@elegant-router/types" { "system_dict_type": "/system/dict/type"; "system_menu": "/system/menu"; "system_notice": "/system/notice"; + "system_oss": "/system/oss"; "system_post": "/system/post"; "system_tenant": "/system/tenant"; "system_user": "/system/user"; @@ -115,6 +116,7 @@ declare module "@elegant-router/types" { | "system_dict_type" | "system_menu" | "system_notice" + | "system_oss" | "system_post" | "system_tenant" | "system_user" diff --git a/src/utils/common.ts b/src/utils/common.ts index d7e9133c..231eb366 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -85,6 +85,12 @@ export function isNull(value: any) { return value === undefined || value === null || value === '' || value === 'undefined' || value === 'null'; } +/** 判断是否为图片类型 */ +export function isImage(suffix: string) { + const imgSuffixList = ['.jpg', '.jpeg', '.png', '.gif', '.webp']; + return imgSuffixList.includes(suffix.toLowerCase()); +} + /** * 构造树型结构数据 * diff --git a/src/views/system/oss/index.vue b/src/views/system/oss/index.vue new file mode 100644 index 00000000..e95830ec --- /dev/null +++ b/src/views/system/oss/index.vue @@ -0,0 +1,227 @@ + + + + + diff --git a/src/views/system/oss/modules/oss-search.vue b/src/views/system/oss/modules/oss-search.vue new file mode 100644 index 00000000..56be83e6 --- /dev/null +++ b/src/views/system/oss/modules/oss-search.vue @@ -0,0 +1,72 @@ + + + + +