From c89ba258bcea60f6bb7c6bceb782495b7e1a1a40 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期三, 11 十二月 2024 11:20:59 +0800
Subject: [PATCH] 用户管理过滤掉已禁用部门(IB5H7F)
---
src/components/FileUpload/index.vue | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/components/FileUpload/index.vue b/src/components/FileUpload/index.vue
index 10ee19f..0d19c5e 100644
--- a/src/components/FileUpload/index.vue
+++ b/src/components/FileUpload/index.vue
@@ -100,19 +100,18 @@
function handleBeforeUpload(file) {
// 鏍℃鏂囦欢绫诲瀷
if (props.fileType.length) {
- let fileExtension = "";
- if (file.name.lastIndexOf(".") > -1) {
- fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
- }
- const isTypeOk = props.fileType.some((type) => {
- if (file.type.indexOf(type) > -1) return true;
- if (fileExtension && fileExtension.indexOf(type) > -1) return true;
- return false;
- });
+ const fileName = file.name.split('.');
+ const fileExt = fileName[fileName.length - 1];
+ const isTypeOk = props.fileType.indexOf(fileExt) >= 0;
if (!isTypeOk) {
- proxy.$modal.msgError(`鏂囦欢鏍煎紡涓嶆纭�, 璇蜂笂浼�${props.fileType.join("/")}鏍煎紡鏂囦欢!`);
+ proxy.$modal.msgError(`鏂囦欢鏍煎紡涓嶆纭紝璇蜂笂浼�${props.fileType.join("/")}鏍煎紡鏂囦欢!`);
return false;
}
+ }
+ // 鏍℃鏂囦欢鍚嶆槸鍚﹀寘鍚壒娈婂瓧绗�
+ if (file.name.includes(',')) {
+ proxy.$modal.msgError('鏂囦欢鍚嶄笉姝g‘锛屼笉鑳藉寘鍚嫳鏂囬�楀彿!');
+ return false;
}
// 鏍℃鏂囦欢澶у皬
if (props.fileSize) {
@@ -170,10 +169,11 @@
// 鑾峰彇鏂囦欢鍚嶇О
function getFileName(name) {
+ // 濡傛灉鏄痷rl閭d箞鍙栨渶鍚庣殑鍚嶅瓧 濡傛灉涓嶆槸鐩存帴杩斿洖
if (name.lastIndexOf("/") > -1) {
return name.slice(name.lastIndexOf("/") + 1);
} else {
- return "";
+ return name;
}
}
--
Gitblit v1.9.3