feat: 优化业务组件设计页面返回操作

main
wu.jian2 2 years ago
parent be270c52c2
commit dc9f7d0cd6

@ -237,17 +237,18 @@ export default {
backManagement () {
// 3
this.$confirm('确定返回主页面吗?未保存的配置将会丢失。', '提示', {
distinguishCancelAndClose: true,
confirmButtonText: '保存后离开页面',
cancelButtonText: '离开页面',
cancelButtonClass: 'cancel-btn',
cancelButtonColor: '#FF6F6F',
showCancelButton: true,
type: 'warning',
customClass: 'bs-el-message-box'
}).then(() => {
this.save(true)
}).catch(() => {
this.pageJump()
}).catch((action) => {
if (action === 'cancel') {
this.pageJump()
}
})
},
save (pageJump = false) {
@ -271,12 +272,17 @@ export default {
translateBlobToBase64(res, function (e) {
this.form.coverPicture = e.result
updateBizComponent(this.form)
.then((res) => {
that.$message.success('保存成功')
console.log(pageJump)
if (pageJump) {
this.pageJump()
}
.then(() => {
this.$message({
message: '保存成功',
type: 'success',
onClose: () => {
//
if (pageJump) {
this.pageJump()
}
}
})
})
.finally(() => {
that.loading = false
@ -287,11 +293,16 @@ export default {
this.form.coverPicture = dataUrl
updateBizComponent(this.form)
.then(() => {
console.log(1122)
this.$message.success('保存成功')
if (pageJump) {
this.pageJump()
}
this.$message({
message: '保存成功',
type: 'success',
onClose: () => {
//
if (pageJump) {
this.pageJump()
}
}
})
})
.finally(() => {
this.loading = false

Loading…
Cancel
Save