fix: 🐛 修复ts类型警告

This commit is contained in:
ray
2024-10-18 22:55:46 +08:00
parent 8b6ab8883e
commit ec54e8c3b0
3 changed files with 7 additions and 6 deletions

View File

@@ -225,10 +225,8 @@ watch(
* 限制用户上传文件的大小 * 限制用户上传文件的大小
*/ */
function handleBeforeUpload(file: UploadRawFile) { function handleBeforeUpload(file: UploadRawFile) {
if (file.size > props.uploadMaxSize) { if (file.size > props.maxSize) {
ElMessage.warning( ElMessage.warning("上传文件不能大于" + props.maxSize + "M");
"上传文件不能大于" + Math.trunc(props.uploadMaxSize / 1024 / 1024) + "M"
);
return false; return false;
} }
uploadPercent.value = 0; uploadPercent.value = 0;

View File

@@ -699,7 +699,10 @@ async function handleOpenDialog(tableName: string) {
currentTableName.value = tableName; currentTableName.value = tableName;
// 获取字典数据 // 获取字典数据
DictAPI.getList().then((data) => { DictAPI.getList().then((data) => {
dictOptions.value = data; dictOptions.value = data.map((item) => ({
label: item.name,
value: item.dictCode,
}));
loading.value = true; loading.value = true;
GeneratorAPI.getGenConfig(tableName) GeneratorAPI.getGenConfig(tableName)
.then((data) => { .then((data) => {

View File

@@ -1,5 +1,5 @@
import UserAPI from "@/api/system/user"; 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 { UserPageQuery } from "@/api/system/user";
import type { IContentConfig } from "@/components/CURD/types"; import type { IContentConfig } from "@/components/CURD/types";