From ec54e8c3b0920113bbf5e0af2a45d62e96b6983a Mon Sep 17 00:00:00 2001 From: ray <1490493387@qq.com> Date: Fri, 18 Oct 2024 22:55:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20:bug:=20=E4=BF=AE=E5=A4=8Dts=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Upload/FileUpload.vue | 6 ++---- src/views/codegen/index.vue | 5 ++++- src/views/demo/curd/config/content.ts | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/Upload/FileUpload.vue b/src/components/Upload/FileUpload.vue index 3ecca178..b847eff1 100644 --- a/src/components/Upload/FileUpload.vue +++ b/src/components/Upload/FileUpload.vue @@ -225,10 +225,8 @@ watch( * 限制用户上传文件的大小 */ function handleBeforeUpload(file: UploadRawFile) { - if (file.size > props.uploadMaxSize) { - ElMessage.warning( - "上传文件不能大于" + Math.trunc(props.uploadMaxSize / 1024 / 1024) + "M" - ); + if (file.size > props.maxSize) { + ElMessage.warning("上传文件不能大于" + props.maxSize + "M"); return false; } uploadPercent.value = 0; diff --git a/src/views/codegen/index.vue b/src/views/codegen/index.vue index 0a4def00..c15cd043 100644 --- a/src/views/codegen/index.vue +++ b/src/views/codegen/index.vue @@ -699,7 +699,10 @@ async function handleOpenDialog(tableName: string) { currentTableName.value = tableName; // 获取字典数据 DictAPI.getList().then((data) => { - dictOptions.value = data; + dictOptions.value = data.map((item) => ({ + label: item.name, + value: item.dictCode, + })); loading.value = true; GeneratorAPI.getGenConfig(tableName) .then((data) => { diff --git a/src/views/demo/curd/config/content.ts b/src/views/demo/curd/config/content.ts index 22ac11b0..3cb11ea8 100644 --- a/src/views/demo/curd/config/content.ts +++ b/src/views/demo/curd/config/content.ts @@ -1,5 +1,5 @@ import UserAPI from "@/api/system/user"; -import RoleAPI from "@/api/role"; +import RoleAPI from "@/api/system/role"; import type { UserPageQuery } from "@/api/system/user"; import type { IContentConfig } from "@/components/CURD/types";