Merge remote-tracking branch 'origin/master'

main
liu.shiyi 1 year ago
commit ce354e7513

@ -191,6 +191,7 @@ export default {
value: 'verticalAround' value: 'verticalAround'
} }
], ],
initialCoverPicture: '',
appInfo: '', appInfo: '',
saveLoading: false, saveLoading: false,
createdImgLoading: false, createdImgLoading: false,
@ -222,6 +223,7 @@ export default {
} }
}, },
mounted () { mounted () {
this.initialCoverPicture = this.pageInfo.coverPicture || ''
this.$refs.zoomInput.$el.addEventListener('mousewheel', this.handleMouseWheel) this.$refs.zoomInput.$el.addEventListener('mousewheel', this.handleMouseWheel)
}, },
beforeDestroy () { beforeDestroy () {
@ -460,7 +462,8 @@ export default {
pageInfo.coverPicture = dataUrl pageInfo.coverPicture = dataUrl
} }
} else { } else {
pageInfo.coverPicture = '' this.$message.warning('保存封面失败,将使用上次保存的封面')
pageInfo.coverPicture = this.initialCoverPicture
} }
const res = await saveScreen(pageInfo) const res = await saveScreen(pageInfo)
this.$message.success('保存成功') this.$message.success('保存成功')

@ -172,6 +172,7 @@ export default {
props: {}, props: {},
data () { data () {
return { return {
initialCoverPicture: '',
form: { form: {
name: '', name: '',
coverPicture: '', coverPicture: '',
@ -237,6 +238,7 @@ export default {
const type = this.$route.query.type const type = this.$route.query.type
if (code) { if (code) {
getBizComponentInfo(code).then(data => { getBizComponentInfo(code).then(data => {
this.initialCoverPicture = data.coverPicture || ''
if (type && type === 'g2plot') { if (type && type === 'g2plot') {
this.form = { this.form = {
...data, ...data,
@ -370,7 +372,8 @@ export default {
this.form.coverPicture = dataUrl this.form.coverPicture = dataUrl
} }
} else { } else {
this.form.coverPicture = '' this.$message.warning('保存封面失败,将使用上次保存的封面')
this.form.coverPicture = this.initialCoverPicture
} }
updateBizComponent(this.form).then(() => { updateBizComponent(this.form).then(() => {
this.$message({ this.$message({

Loading…
Cancel
Save