From 737179a0ce34147269cccf288fecd0e7bb4c309b Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期三, 11 二月 2026 10:42:19 +0800
Subject: [PATCH] 成绩查询+个人中心
---
src/views/main/components/UploadBtn.vue | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/views/main/components/UploadBtn.vue b/src/views/main/components/UploadBtn.vue
index 42bf5fa..0df0c52 100644
--- a/src/views/main/components/UploadBtn.vue
+++ b/src/views/main/components/UploadBtn.vue
@@ -77,12 +77,14 @@
</template>
<script>
+import { getFileUrlName } from '@/utils/tool.js'
const pdf = 'application/pdf'
const xls = 'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
const doc = 'application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document'
const image = 'image/*'
const jpg = 'image/jpeg'
const png = 'image/png'
+const zip = 'application/zip,application/x-zip-compressed'
import { genFileId } from 'element-plus'
export default {
data() {
@@ -101,7 +103,7 @@
accept: {
type: Array,
default: () => {
- return ['pdf', 'xls', 'doc', 'image', 'jpg', 'png']
+ return ['pdf', 'xls', 'doc', 'image', 'jpg', 'png', 'zip']
}
},
limitFileCount: {
@@ -123,19 +125,26 @@
modelValue: {
handler: function() {
this.list = this.modelValue
+ this.list.forEach(ele => {
+ if (!ele.name) {
+ ele.name = getFileUrlName(ele.url)
+ }
+ })
},
+ immediate: true,
deep: true
},
list: {
handler: function(val) {
this.$emit('update:modelValue', val)
},
+ immediate: true,
deep: true
}
},
computed: {
acceptType() {
- let obj = { pdf, xls, doc, image, jpg, png }
+ let obj = { pdf, xls, doc, image, jpg, png, zip }
return this.accept.map(ele => obj[ele]).join(',')
},
tip() {
@@ -145,7 +154,8 @@
doc: 'WORD',
image: '鍥剧墖',
jpg: 'JPEG/JPG',
- png: 'PNG'
+ png: 'PNG',
+ zip: 'ZIP'
}
let tip = this.accept.map(ele => obj[ele]).join('銆�')
return `鏀寔${tip}绫诲瀷鏂囦欢`
--
Gitblit v1.8.0