-
+
{{"返回"}}
- {{ $t('confirm') }}
+ {{ $t('confirm') }}
+
+
@@ -46,8 +48,10 @@
+
+ :before-upload="beforeAvatarUpload"
+ style="width:40%">
@@ -103,6 +108,8 @@ export default {
isAble: false,
meetTypeArr: [],
dailyTypeArr: [],
+ hideUpload: false,
+ pageDisabled: false,
// imgUrlArr: [],
uploadUrl: '',
loading: false,
@@ -141,9 +148,13 @@ export default {
}
},
created: function () {
- this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
+ // this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
+ this.uploadUrl = `http://219.146.91.110:10000/epdc-api/oss/file/uploadImg?token=${Cookies.get('token')}`
},
mounted () {
+ console.log('this.$route.query.disabled:' + this.$route.query.disabled)
+ this.pageDisabled = this.$route.query.disabled
+ this.hideUpload = this.$route.query.disabled
if (this.$route.query.id !== '' && this.$route.query.id != null) {
this.dataForm.id = this.$route.query.id
this.getInfo()
@@ -164,7 +175,7 @@ export default {
})
},
beforeAvatarUpload (file) {
- if (this.imgUrlArr.length === 9) {
+ if (this.dataForm.length === 9) {
this.$message.error('最多上传9张图片!')
return false
}
@@ -179,11 +190,16 @@ export default {
}
},
handleAvatarSuccess (res, file) {
+ console.log('res:')
+ console.log(res)
+ console.log('file:')
+ console.log(file)
this.loading = false
// this.imgUrlArr.push({ url: file.url, thumbnail: file.url, fileType: 1 })
- this.dataForm.images.push({ url: file.url, thumbnail: file.url, fileType: 1 })
+ this.dataForm.images.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 1 })
console.log('++++++新增后+++++++')
console.log(this.dataForm.images)
+ this.hideUpload = this.dataForm.images.length >= 9
},
handelError () {
this.loading = false
@@ -191,10 +207,11 @@ export default {
handleRemove (file, fileList) {
for (var i = 0; i < this.dataForm.images.length; i++) {
let item = this.dataForm.images[i]
- if (item.url === file) {
+ if (item.url === file.url) {
this.dataForm.images.splice(i, 1)
}
}
+ this.hideUpload = this.dataForm.images.length >= 9
console.log('++++++删除出后+++++++')
console.log(this.dataForm.images)
},
@@ -218,6 +235,10 @@ export default {
...this.dataForm,
...res.data
}
+ // 判断是否存在九张照片,九张照片隐藏上传操作按钮
+ if (!this.$route.query.disabled) {
+ this.hideUpload = this.dataForm.images.length >= 9
+ }
// 随手记下拉框赋值
this.getDailyTypeArrInfo('0')
}).catch(() => {})
@@ -298,3 +319,8 @@ export default {
}
}
+