Commit 271c13b0 by zhangquan

修复bug

1 parent e594304e
...@@ -81,13 +81,16 @@ export default { ...@@ -81,13 +81,16 @@ export default {
this.$message.error('最多上传9张图片') this.$message.error('最多上传9张图片')
return return
} }
this.$emit('beforeUpload')
reader.readAsDataURL(file) reader.readAsDataURL(file)
reader.onload = e => { reader.onload = e => {
const imgFile = e.target.result const imgFile = e.target.result
const arrBase64 = imgFile.split(',') const arrBase64 = imgFile.split(',')
const splitStr = file.name.split('.') const splitStr = file.name.split('.')
const fileUrl = splitStr[splitStr.length - 1] + '@' + arrBase64[1] const fileUrl = splitStr[splitStr.length - 1] + '@' + arrBase64[1]
this.$apis.common.pictureUpload({ file: fileUrl, compress: this.picOptions.compress || 0 }).then(res => { this.$apis.common
.pictureUpload({ file: fileUrl, compress: this.picOptions.compress || 0 })
.then(res => {
if (res) { if (res) {
this.$notify({ this.$notify({
title: '提示', title: '提示',
...@@ -100,6 +103,9 @@ export default { ...@@ -100,6 +103,9 @@ export default {
e.target.value = '' e.target.value = ''
this.$refs.uploadImg.value = '' this.$refs.uploadImg.value = ''
}) })
.finally(end => {
this.$emit('afterUpload', end)
})
} }
}, },
// 预览图文 // 预览图文
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<div class="upload-wrap"> <div class="upload-wrap">
<div class="upload-item" v-for="(item, index) in uploadList" :key="index"> <div class="upload-item" v-for="(item, index) in uploadList" :key="index">
<span class="label">{{ item.label }}</span> <span class="label">{{ item.label }}</span>
<glsx-preview :imageUrlArr="item.url" @change="changeChannelImg"></glsx-preview> <glsx-preview :imageUrlArr="item.url" @beforeUpload="beforeUpload" @afterUpload="afterUpload"></glsx-preview>
</div> </div>
</div> </div>
</GLDialog> </GLDialog>
...@@ -139,6 +139,7 @@ export default { ...@@ -139,6 +139,7 @@ export default {
isBatch: false, isBatch: false,
batchForm: { batchForm: {
isUpload: false, isUpload: false,
isUploding: false,
successCount: 0, successCount: 0,
failCount: 0, failCount: 0,
exportUrl: '', exportUrl: '',
...@@ -177,7 +178,7 @@ export default { ...@@ -177,7 +178,7 @@ export default {
{ {
type: 'el-button', type: 'el-button',
name: row => { name: row => {
return '图片上传' return '照片上传'
}, },
attrs: { attrs: {
type: 'text' type: 'text'
...@@ -528,6 +529,7 @@ export default { ...@@ -528,6 +529,7 @@ export default {
} }
this.batchForm = { this.batchForm = {
isUpload: false, isUpload: false,
isUploding: false,
successCount: 0, successCount: 0,
failCount: 0, failCount: 0,
exportUrl: '', exportUrl: '',
...@@ -558,6 +560,13 @@ export default { ...@@ -558,6 +560,13 @@ export default {
this.uploadVisible = true this.uploadVisible = true
}, },
uploadOk() { uploadOk() {
if (this.basicForm.isUploding) {
return this.$message({
message: '文件正在上传中,请稍后再提交',
type: 'error',
customClass: 'message-class'
})
}
let picList = [] let picList = []
this.uploadList.forEach(item => { this.uploadList.forEach(item => {
if (item.url[0]) { if (item.url[0]) {
...@@ -607,8 +616,11 @@ export default { ...@@ -607,8 +616,11 @@ export default {
} }
}) })
}, },
changeChannelImg(e) { beforeUpload(e) {
console.log(e, 'conpl') this.basicForm.isUploding = true
},
afterUpload() {
this.basicForm.isUploding = false
}, },
delParkingSpace(row) { delParkingSpace(row) {
this.$confirm('请再次确认是否要执行删除操作', '提示', { this.$confirm('请再次确认是否要执行删除操作', '提示', {
...@@ -628,7 +640,6 @@ export default { ...@@ -628,7 +640,6 @@ export default {
}) })
}, },
getRadarList(radarId) { getRadarList(radarId) {
console.log(1111)
let params = { pageNum: '1', pageSize: '1000', bindingStatus: 0 } let params = { pageNum: '1', pageSize: '1000', bindingStatus: 0 }
if (radarId) params.radarId = radarId if (radarId) params.radarId = radarId
this.$apis.parkingSpace.getRadarListApi(params).then(res => { this.$apis.parkingSpace.getRadarListApi(params).then(res => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!