b8917a94 by renchao@pashanhoo.com

style:上传

1 parent e4ec2bfe
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-07-31 15:12:08
* @LastEditTime: 2023-07-31 15:43:30
-->
<template>
<div class="rlPopup">
......@@ -23,7 +23,7 @@
<div class="thumb-wrap">
<div class="thumb-wrap-button">
<el-button type="primary" @click="clickImage" v-if="previewImg.imgList.length>0">(放大) 显示(缩小)</el-button>
<el-upload class="fileUpdate" ref="upload" action="" :show-file-list="false" :multiple="true" :auto-upload="false"
<el-upload class="fileUpdate" ref="upload" :key="key" action="" :show-file-list="false" :multiple="true" :auto-upload="false"
:on-change="handleChange"
accept=".JPG, .PNG, .JPEG,.jpg, .png, .jpeg" :before-upload="beforeUpload">
<el-button icon="el-icon-upload" type="primary" v-if="ableOperation">上传</el-button>
......@@ -70,6 +70,7 @@
},
data () {
return {
key: 0,
isScan: false,
// 打开高拍仪
scanTitle: '打开高拍仪',
......@@ -249,20 +250,23 @@
let length = fileList.length;
this.maxFileLength = Math.max(length, this.maxFileLength)
var formData = new FormData();
let num = 0
setTimeout(() => {
if (this.maxFileLength !== length) {
return
}
let num = 0
fileList.forEach(item => {
if (!['image/jpeg', 'image/png', 'image/jpg', 'image/gif'].includes(item.raw.type)) {
num++
} else {
formData.append('file', item.raw)
}
formData.append('file', item.raw)
})
if (num >= 1) {
this.$message.error("请选择jpeg/png/jpg/bmp/gif格式的图片后重试")
return
// 移除不支持的文件类型
this.key++
return;
}
formData.append("bsmSj", this.previewImg.bsmSj);
formData.append("bsmSlsq", this.previewImg.bsmSlsq);
......
......@@ -161,7 +161,7 @@
watch: {
'formData.data': {
handler: function (val, oldVal) {
this.tableData = val
this.tableData = _.cloneDeep(val)
},
immediate: true,
deep: true
......