From 4e6f18dfa08e2f2f4f02aaa1b8e8e51852b7a9a1 Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期五, 13 三月 2026 17:46:03 +0800
Subject: [PATCH] 考点核验
---
src/views/main/components/UploadBtn.vue | 20 +++++++++++++++-----
1 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/src/views/main/components/UploadBtn.vue b/src/views/main/components/UploadBtn.vue
index 42bf5fa..7e92fdd 100644
--- a/src/views/main/components/UploadBtn.vue
+++ b/src/views/main/components/UploadBtn.vue
@@ -38,7 +38,7 @@
<template v-if="listType=='picture-card'">
<el-image
ref="previewImg"
- :src="file.url"
+ :src="file.url.includes('http') ? file.url : $qxueyou.qxyRes + file.url"
:initial-index="initialPreviewImgIndex"
:preview-src-list="filterPreviewImgList"
>
@@ -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}绫诲瀷鏂囦欢`
@@ -167,7 +177,7 @@
file: UploadRequestOptions.file,
directory: ''
}
- this.$axios.post('/infra/file/upload', data, {
+ this.$axios.post('/infra/file/exam/upload', data, {
headers: { 'Content-Type': "multipart/form-data" }
}).then(res => {
let index = this.list.findIndex(ele => ele.uid == data.file.uid)
--
Gitblit v1.8.0