fix: 已知问题修复,vxe-table 样式丢失和乱码

This commit is contained in:
Ray.Hao committed 2026-01-14 16:19:13 +08:00
1 parent c7b94be799
commit b45554d098
9 files changed
+39 -7343

No files matched your search

+1 -1
View File
@@ -73,7 +73,7 @@
"vue-draggable-plus": "^0.6.0", "vue-draggable-plus": "^0.6.0",
"vue-i18n": "^11.2.7", "vue-i18n": "^11.2.7",
"vue-router": "^4.6.4", "vue-router": "^4.6.4",
"vxe-table": "~4.17.33" "vxe-table": "~4.6.25"
}, },
"devDependencies": { "devDependencies": {
"@commitlint/cli": "^20.2.0", "@commitlint/cli": "^20.2.0",
-7304
View File
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -30,8 +30,8 @@ const size = computed(() => appStore.size as ComponentSize);
const showWatermark = computed(() => settingsStore.showWatermark); const showWatermark = computed(() => settingsStore.showWatermark);
const watermarkContent = appConfig.name; const watermarkContent = appConfig.name;
// 只有在启�?AI 助手且用户已登录时才显示 // 只有在启用 AI 助手且用户已登录时才显示
// 使用 userInfo 作为响应式依赖,当用户退出登录时会自动更�? // 使用 userInfo 作为响应式依赖,当用户退出登录时会自动更新
const enableAiAssistant = computed(() => { const enableAiAssistant = computed(() => {
const isEnabled = settingsStore.enableAiAssistant; const isEnabled = settingsStore.enableAiAssistant;
const isLoggedIn = userStore.userInfo && Object.keys(userStore.userInfo).length > 0; const isLoggedIn = userStore.userInfo && Object.keys(userStore.userInfo).length > 0;
+6 -6
View File
@@ -58,7 +58,7 @@ import type { FileInfo } from "@/types/api";
const props = defineProps({ const props = defineProps({
/** /**
* 请求携带的额外参�? * 请求携带的额外参数
*/ */
data: { data: {
type: Object, type: Object,
@@ -122,7 +122,7 @@ const modelValue = defineModel("modelValue", {
const fileList = ref([] as UploadFile[]); const fileList = ref([] as UploadFile[]);
// 监听 modelValue 转换用于显示�?fileList // 监听 modelValue 转换用于显示到 fileList
watch( watch(
modelValue, modelValue,
(value) => { (value) => {
@@ -142,7 +142,7 @@ watch(
); );
/** /**
* 上传前校�? * 上传前校验
*/ */
function handleBeforeUpload(file: UploadRawFile) { function handleBeforeUpload(file: UploadRawFile) {
// 限制文件大小 // 限制文件大小
@@ -194,7 +194,7 @@ function handleExceed() {
*/ */
const handleSuccess = (response: any, uploadFile: UploadFile, files: UploadFiles) => { const handleSuccess = (response: any, uploadFile: UploadFile, files: UploadFiles) => {
ElMessage.success("上传成功"); ElMessage.success("上传成功");
//只有当状态为success或者fail,代表文件上传全部完成了,失败也算完�? // 只有当状态为 success 或者 fail,代表文件上传全部完成了,失败也算完成
if ( if (
files.every((file: UploadFile) => { files.every((file: UploadFile) => {
return file.status === "success" || file.status === "fail"; return file.status === "success" || file.status === "fail";
@@ -203,7 +203,7 @@ const handleSuccess = (response: any, uploadFile: UploadFile, files: UploadFiles
const fileInfos = [] as FileInfo[]; const fileInfos = [] as FileInfo[];
files.map((file: UploadFile) => { files.map((file: UploadFile) => {
if (file.status === "success") { if (file.status === "success") {
//只取携带response的才是刚上传�? // 只取携带 response 的才是刚上传的
const res = file.response as FileInfo; const res = file.response as FileInfo;
if (res) { if (res) {
fileInfos.push({ name: res.name, url: res.url } as FileInfo); fileInfos.push({ name: res.name, url: res.url } as FileInfo);
@@ -251,7 +251,7 @@ function handleDownload(file: UploadUserFile) {
/** 获取一个不重复的id */ /** 获取一个不重复的id */
function getUid(): number { function getUid(): number {
// 时间戳左�?3位(相当于乘�?192�?+ 4位随机数 // 时间戳左移 13 位(相当于乘以 8192)+ 13 位随机数
return (Date.now() << 13) | Math.floor(Math.random() * 8192); return (Date.now() << 13) | Math.floor(Math.random() * 8192);
} }
</script> </script>
+6 -6
View File
@@ -68,7 +68,7 @@ const props = defineProps({
default: 10, default: 10,
}, },
/** /**
* 单个文件的最大允许大�? * 单个文件的最大允许大小
*/ */
maxFileSize: { maxFileSize: {
type: Number, type: Number,
@@ -84,7 +84,7 @@ const props = defineProps({
}); });
const previewVisible = ref(false); // 是否显示预览 const previewVisible = ref(false); // 是否显示预览
const previewImageIndex = ref(0); // 预览图片的索�? const previewImageIndex = ref(0); // 预览图片的索引
const modelValue = defineModel("modelValue", { const modelValue = defineModel("modelValue", {
type: [Array] as PropType<string[]>, type: [Array] as PropType<string[]>,
@@ -108,22 +108,22 @@ function handleRemove(imageUrl: string) {
} }
/** /**
* 上传前校�? * 上传前校验
*/ */
function handleBeforeUpload(file: UploadRawFile) { function handleBeforeUpload(file: UploadRawFile) {
// 校验文件类型:虽�?accept 属性限制了用户在文件选择器中可选的文件类型,但仍需在上传时再次校验文件实际类型,确保符�?accept 的规�? // 校验文件类型:虽然 accept 属性限制了用户在文件选择器中可选的文件类型,但仍需在上传时再次校验文件实际类型,确保符合 accept 的规则
const acceptTypes = props.accept.split(",").map((type) => type.trim()); const acceptTypes = props.accept.split(",").map((type) => type.trim());
// 检查文件格式是否符合 accept // 检查文件格式是否符合 accept
const isValidType = acceptTypes.some((type) => { const isValidType = acceptTypes.some((type) => {
if (type === "image/*") { if (type === "image/*") {
// 如果�?image/*,检�?MIME 类型是否�?"image/" 开�? // 如果是 image/*,检查 MIME 类型是否以 "image/" 开头
return file.type.startsWith("image/"); return file.type.startsWith("image/");
} else if (type.startsWith(".")) { } else if (type.startsWith(".")) {
// 如果是扩展名 (.png, .jpg),检查文件名是否以指定扩展名结尾 // 如果是扩展名 (.png, .jpg),检查文件名是否以指定扩展名结尾
return file.name.toLowerCase().endsWith(type); return file.name.toLowerCase().endsWith(type);
} else { } else {
// 如果是具体的 MIME 类型 (image/png, image/jpeg),检查是否完全匹�? // 如果是具体的 MIME 类型 (image/png, image/jpeg),检查是否完全匹配
return file.type === type; return file.type === type;
} }
}); });
+8 -8
View File
@@ -38,7 +38,7 @@ import type { FileInfo } from "@/types/api";
const props = defineProps({ const props = defineProps({
/** /**
* 请求携带的额外参�? * 请求携带的额外参数
*/ */
data: { data: {
type: Object, type: Object,
@@ -54,7 +54,7 @@ const props = defineProps({
default: "file", default: "file",
}, },
/** /**
* 最大文件大小(单位:M�? * 最大文件大小(单位:MB)
*/ */
maxFileSize: { maxFileSize: {
type: Number, type: Number,
@@ -62,7 +62,7 @@ const props = defineProps({
}, },
/** /**
* 上传图片格式,默认支持所有图�?image/*),指定格式示例:'.png,.jpg,.jpeg,.gif,.bmp' * 上传图片格式,默认支持所有图片 (image/*),指定格式示例:'.png,.jpg,.jpeg,.gif,.bmp'
*/ */
accept: { accept: {
type: String, type: String,
@@ -70,7 +70,7 @@ const props = defineProps({
}, },
/** /**
* 自定义样式,用于设置组件的宽度和高度等其他样�? * 自定义样式,用于设置组件的宽度和高度等其他样式
*/ */
style: { style: {
type: Object, type: Object,
@@ -92,19 +92,19 @@ const modelValue = defineModel("modelValue", {
* 限制用户上传文件的格式和大小 * 限制用户上传文件的格式和大小
*/ */
function handleBeforeUpload(file: UploadRawFile) { function handleBeforeUpload(file: UploadRawFile) {
// 校验文件类型:虽�?accept 属性限制了用户在文件选择器中可选的文件类型,但仍需在上传时再次校验文件实际类型,确保符�?accept 的规�? // 校验文件类型:虽然 accept 属性限制了用户在文件选择器中可选的文件类型,但仍需在上传时再次校验文件实际类型,确保符合 accept 的规则
const acceptTypes = props.accept.split(",").map((type) => type.trim()); const acceptTypes = props.accept.split(",").map((type) => type.trim());
// 检查文件格式是否符�?accept // 检查文件格式是否符合 accept
const isValidType = acceptTypes.some((type) => { const isValidType = acceptTypes.some((type) => {
if (type === "image/*") { if (type === "image/*") {
// 如果�?image/*,检�?MIME 类型是否�?"image/" 开�? // 如果是 image/*,检查 MIME 类型是否以 "image/" 开头
return file.type.startsWith("image/"); return file.type.startsWith("image/");
} else if (type.startsWith(".")) { } else if (type.startsWith(".")) {
// 如果是扩展名 (.png, .jpg),检查文件名是否以指定扩展名结尾 // 如果是扩展名 (.png, .jpg),检查文件名是否以指定扩展名结尾
return file.name.toLowerCase().endsWith(type); return file.name.toLowerCase().endsWith(type);
} else { } else {
// 如果是具体的 MIME 类型 (image/png, image/jpeg),检查是否完全匹�? // 如果是具体的 MIME 类型 (image/png, image/jpeg),检查是否完全匹配
return file.type === type; return file.type === type;
} }
}); });
+1 -1
View File
@@ -40,7 +40,7 @@ defineProps({
</style> </style>
<style lang="scss"> <style lang="scss">
// 顶部布局和混合布局的特殊处�? // 顶部布局和混合布局的特殊处理
.layout-top, .layout-top,
.layout-mix { .layout-mix {
.logo { .logo {
+11 -11
View File
@@ -101,7 +101,7 @@ const showTenantSelect = computed(() => {
if (tenantStore.tenantList.length === 0) { if (tenantStore.tenantList.length === 0) {
return false; return false;
} }
// 如果只有一个租户,也不显示(单租户模式,用户无感知�? // 如果只有一个租户,也不显示(单租户模式,用户无感知)
if (tenantStore.tenantList.length === 1) { if (tenantStore.tenantList.length === 1) {
return false; return false;
} }
@@ -128,20 +128,20 @@ function handleProfileClick() {
router.push({ name: "Profile" }); router.push({ name: "Profile" });
} }
// 根据主题和侧边栏配色方案选择样式�? // 根据主题和侧边栏配色方案选择样式类
const navbarActionsClass = computed(() => { const navbarActionsClass = computed(() => {
const { theme, sidebarColorScheme, layout } = settingStore; const { theme, sidebarColorScheme, layout } = settingStore;
// 暗黑主题下,所有布局都使用白色文�? // 暗黑主题下,所有布局都使用白色文字
if (theme === ThemeMode.DARK) { if (theme === ThemeMode.DARK) {
return "navbar-actions--white-text"; return "navbar-actions--white-text";
} }
// 明亮主题�? // 明亮主题下
if (theme === ThemeMode.LIGHT) { if (theme === ThemeMode.LIGHT) {
// 顶部布局和混合布局的顶部区域: // 顶部布局和混合布局的顶部区域:
// - 如果侧边栏是经典蓝色,使用白色文�? // - 如果侧边栏是经典蓝色,使用白色文字
// - 如果侧边栏是极简白色,使用深色文�? // - 如果侧边栏是极简白色,使用深色文字
if (layout === LayoutMode.TOP || layout === LayoutMode.MIX) { if (layout === LayoutMode.TOP || layout === LayoutMode.MIX) {
if (sidebarColorScheme === SidebarColor.CLASSIC_BLUE) { if (sidebarColorScheme === SidebarColor.CLASSIC_BLUE) {
return "navbar-actions--white-text"; return "navbar-actions--white-text";
@@ -155,7 +155,7 @@ const navbarActionsClass = computed(() => {
}); });
/** /**
* 退出登�? * 退出登录
*/ */
function logout() { function logout() {
ElMessageBox.confirm("确定注销并退出系统吗?", "提示", { ElMessageBox.confirm("确定注销并退出系统吗?", "提示", {
@@ -189,14 +189,14 @@ function handleSettingsClick() {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
min-width: 44px; /* 增加最小点击区域到44px,符合人机交互标�?*/ min-width: 44px; /* 增加最小点击区域到44px,符合人机交互标准 */
height: 44px; height: 44px;
padding: 0 8px; padding: 0 8px;
text-align: center; text-align: center;
cursor: pointer; cursor: pointer;
transition: all 0.3s; transition: all 0.3s;
// 确保子元素居�? // 确保子元素居中
> * { > * {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -262,7 +262,7 @@ function handleSettingsClick() {
} }
} }
// 白色文字样式(用于深色背景:暗黑主题、顶部布局、混合布局�? // 白色文字样式(用于深色背景:暗黑主题、顶部布局、混合布局等)
.navbar-actions--white-text { .navbar-actions--white-text {
.navbar-actions__item { .navbar-actions__item {
:deep([class^="i-svg:"]) { :deep([class^="i-svg:"]) {
@@ -298,7 +298,7 @@ function handleSettingsClick() {
} }
} }
// 深色文字样式(用于浅色背景:明亮主题下的左侧布局�? // 深色文字样式(用于浅色背景:明亮主题下的左侧布局等)
.navbar-actions--dark-text { .navbar-actions--dark-text {
.navbar-actions__item { .navbar-actions__item {
:deep([class^="i-svg:"]) { :deep([class^="i-svg:"]) {
+4 -4
View File
@@ -59,7 +59,7 @@
{{ `v${appConfig.version}` }} {{ `v${appConfig.version}` }}
</el-tag> </el-tag>
<el-tag v-if="tenantEnabled" type="success" size="small" effect="light" round> <el-tag v-if="tenantEnabled" type="success" size="small" effect="light" round>
多租�? 多租户
</el-tag> </el-tag>
</div> </div>
</div> </div>
@@ -102,8 +102,8 @@ let notificationInstance: ReturnType<typeof ElNotification> | null = null;
const showVoteNotification = () => { const showVoteNotification = () => {
notificationInstance = ElNotification({ notificationInstance = ElNotification({
title: "Gitee 2025 开源评选 · 诚邀支持", title: "2025 CSDN 博客之星评选,诚邀支持!",
message: `我正在参与 Gitee 2025 最受欢迎开源软件投票活动,欢迎支持!<br/><a href="https://gitee.com/activity/2025opensource?ident=I6VXEH" target="_blank" style="color: var(--el-color-primary); text-decoration: none; font-weight: 500;">点击投票</a>`, message: `文章整理了 youlai 全栈开源矩阵,并同步了 2026 路线图与年度计划。欢迎<strong> 点赞 / 收藏 </strong>支持~<br/><a href="https://blog.csdn.net/u013737132/article/details/156545189" target="_blank" rel="noopener noreferrer" style="color: var(--el-color-primary); text-decoration: none; font-weight: 500;">点击查看评选文章</a>`,
type: "success", type: "success",
position: "bottom-left", position: "bottom-left",
duration: 0, duration: 0,
@@ -200,7 +200,7 @@ onBeforeUnmount(() => {
} }
} }
/* 应用内暗黑主题下顶部设置面板的深色样�?*/ /* 应用内暗黑主题下顶部设置面板的深色样式 */
.dark .auth-view__toolbar { .dark .auth-view__toolbar {
background-color: rgba(24, 28, 43, 0.9); background-color: rgba(24, 28, 43, 0.9);
border-color: rgba(64, 128, 255, 0.35); border-color: rgba(64, 128, 255, 0.35);