qtsk-vue3 0.0.26 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@
|
|
3
3
|
<el-upload
|
4
4
|
class="upload-demo"
|
5
5
|
drag
|
6
|
-
accept=".xls,.xlsx
|
6
|
+
accept=".xls,.xlsx"
|
7
7
|
:name="name"
|
8
8
|
:limit="limit"
|
9
9
|
:file-list="fileListRef"
|
@@ -14,7 +14,7 @@
|
|
14
14
|
<Icons :type="'Plus'" :size="30"></Icons>
|
15
15
|
<div class="el-upload__text">
|
16
16
|
点击或者拖动文件到虚线框内上传
|
17
|
-
<p class="next-upload-drag-hint">支持xls,xlsx
|
17
|
+
<p class="next-upload-drag-hint">支持xls,xlsx类型的文件<br>单次上传不超过1000行,大小不超过5M</p>
|
18
18
|
</div>
|
19
19
|
</el-upload>
|
20
20
|
</div>
|
@@ -45,11 +45,11 @@ defineProps({
|
|
45
45
|
const fileListRef = ref([])
|
46
46
|
const emits = defineEmits(['successUpload'])
|
47
47
|
const beforeUpload = (file) => {
|
48
|
-
const isAllowedType = /\.(xls|xlsx
|
48
|
+
const isAllowedType = /\.(xls|xlsx)$/.test(file.name);
|
49
49
|
const isAllowedSize = file.size / 1024 / 1024 < 5;;
|
50
50
|
|
51
51
|
if (!isAllowedType) {
|
52
|
-
Message.error('只能上传xls/xlsx
|
52
|
+
Message.error('只能上传xls/xlsx文件!');
|
53
53
|
}
|
54
54
|
if (!isAllowedSize) {
|
55
55
|
Message.error('上传文件不能超过 5M');
|