Commit 5163a1e3 by 王志慧

Merge branch 'yc_v1.0.0' of http://192.168.3.233:8090/saas/scrm-micro-charge into yc_v1.0.0

2 parents fab05077 97102229
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<input type="file" ref="uploadImg" class="upload-img" style="opacity: 0" accept=".jpg, .jpeg, .png" @change="e => handleImgChange(e)" /> <input type="file" ref="uploadImg" class="upload-img" style="opacity: 0" accept=".jpg, .jpeg, .png" @change="e => handleImgChange(e)" />
</div> </div>
</template> </template>
<el-dialog class="image-dialog" :visible.sync="dialogVisibleImg" width="50%"> <el-dialog class="image-dialog" :visible.sync="dialogVisibleImg" :append-to-body="true" width="50%">
<img :src="dialogSrc" width="100%" v-if="dialogType == 'img'" /> <img :src="dialogSrc" width="100%" v-if="dialogType == 'img'" />
<!-- <video width="100%" autoplay controls :src="dialogSrc" v-else></video> --> <!-- <video width="100%" autoplay controls :src="dialogSrc" v-else></video> -->
</el-dialog> </el-dialog>
...@@ -81,25 +81,31 @@ export default { ...@@ -81,25 +81,31 @@ 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
if (res) { .pictureUpload({ file: fileUrl, compress: this.picOptions.compress || 0 })
this.$notify({ .then(res => {
title: '提示', if (res) {
message: '图片上传成功', this.$notify({
type: 'success' title: '提示',
}) message: '图片上传成功',
this.imageUrlArr.push(res) type: 'success'
this.$emit('change', { arr: this.imageUrlArr, key: this.picOptions.key, index: this.index }) })
} this.imageUrlArr.push(res)
e.target.value = '' this.$emit('change', { arr: this.imageUrlArr, key: this.picOptions.key, index: this.index })
this.$refs.uploadImg.value = '' }
}) e.target.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 => {
...@@ -640,7 +651,7 @@ export default { ...@@ -640,7 +651,7 @@ export default {
}, },
async addParkingPlaceFn() { async addParkingPlaceFn() {
await this.getRadarList() await this.getRadarList()
this.parkingPlaceVisible = true this.openParkingDialog()
}, },
async updateParkingPlaceFn(row) { async updateParkingPlaceFn(row) {
await this.getRadarList(row.radarId) await this.getRadarList(row.radarId)
...@@ -648,6 +659,10 @@ export default { ...@@ -648,6 +659,10 @@ export default {
this.basicForm[key] = row[key] this.basicForm[key] = row[key]
} }
this.basicForm.merchantId = this.basicForm.merchantId ? this.basicForm.merchantId + '' : '' this.basicForm.merchantId = this.basicForm.merchantId ? this.basicForm.merchantId + '' : ''
this.openParkingDialog()
},
openParkingDialog() {
this.$refs.parkingPlaceRef?.$refs?.formRef?.clearValidate()
this.parkingPlaceVisible = true this.parkingPlaceVisible = true
}, },
handleOk() { handleOk() {
...@@ -680,7 +695,6 @@ export default { ...@@ -680,7 +695,6 @@ export default {
parkingRemark: '' parkingRemark: ''
} }
this.parkingPlaceVisible = false this.parkingPlaceVisible = false
this.$refs.parkingPlaceRef?.$refs?.formRef?.clearValidate()
}, },
setTableFinishFun() { setTableFinishFun() {
this.$refs.infoTableRef.data.length ? (this.$refs.infoTableRef.tableHeightValues = '') : this.$refs.infoTableRef.setTableHeightFun() this.$refs.infoTableRef.data.length ? (this.$refs.infoTableRef.tableHeightValues = '') : this.$refs.infoTableRef.setTableHeightFun()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!