|
@@ -752,28 +752,28 @@
|
|
|
this.setRemindText(res.data.message)
|
|
this.setRemindText(res.data.message)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- },
|
|
|
|
|
- update (e) {
|
|
|
|
|
- let file = e.target.files[0]
|
|
|
|
|
- if (file.size > 3 * 1024 * 1024) {
|
|
|
|
|
- this.setRemindText(`上传文件不得超过3M`)
|
|
|
|
|
- }
|
|
|
|
|
- let param = new FormData()
|
|
|
|
|
- param.append('file', file, file.name)
|
|
|
|
|
- param.append('chunk', '0')
|
|
|
|
|
- if (file.type === 'application/pdf') {
|
|
|
|
|
- this.setRemindText(`请选择有效图片进行上传`)
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- let config = {
|
|
|
|
|
- headers: {'Content-Type': 'multipart/form-data'}
|
|
|
|
|
- }
|
|
|
|
|
- this.$http.post('/api/images', param, config)
|
|
|
|
|
- .then(response => {
|
|
|
|
|
- this.MaterielItem.img = response.data[0].path
|
|
|
|
|
- this.cmpImg = response.data[0].path
|
|
|
|
|
- })
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ // update (e) {
|
|
|
|
|
+ // let file = e.target.files[0]
|
|
|
|
|
+ // if (file.size > 3 * 1024 * 1024) {
|
|
|
|
|
+ // this.setRemindText(`上传文件不得超过3M`)
|
|
|
|
|
+ // }
|
|
|
|
|
+ // let param = new FormData()
|
|
|
|
|
+ // param.append('file', file, file.name)
|
|
|
|
|
+ // param.append('chunk', '0')
|
|
|
|
|
+ // if (file.type === 'application/pdf') {
|
|
|
|
|
+ // this.setRemindText(`请选择有效图片进行上传`)
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
|
|
+ // let config = {
|
|
|
|
|
+ // headers: {'Content-Type': 'multipart/form-data'}
|
|
|
|
|
+ // }
|
|
|
|
|
+ // this.$http.post('/api/images', param, config)
|
|
|
|
|
+ // .then(response => {
|
|
|
|
|
+ // this.MaterielItem.img = response.data[0].path
|
|
|
|
|
+ // this.cmpImg = response.data[0].path
|
|
|
|
|
+ // })
|
|
|
|
|
+ // }
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
// 是否展示空数据
|
|
// 是否展示空数据
|