Commit e667fb72 authored by rockyl's avatar rockyl

发布自动保存

parent c81bbbaa
......@@ -155,36 +155,7 @@
this.$refs.dialogsDialog.show();
break;
case 'pack':
const loading = this.$loading({
lock: true,
text: this.$t('Packing'),
});
try{
const {tplUrl} = await this.packProject();
this.$message({
message: this.$t('Pack project successfully'),
type: 'success',
duration: 1000,
});
this.$confirm(this.$t('Pack project successfully'), this.$t('Alert'), {
confirmButtonText: this.$t('Open in new tab'),
cancelButtonText: this.$t('Close'),
type: 'warning'
}).then(() => {
setTimeout(()=>{
window.open(tplUrl, 'blank');
}, 500);
}).catch(() => {
});
}catch (e) {
this.$message({
message: this.$t('Pack project failed'),
type: 'error',
duration: 1000,
});
}
loading.close();
await this.pack();
break;
case 'undo':
this.$store.commit('undoRedo', 1);
......@@ -214,6 +185,39 @@
break;
}
},
async pack(){
const loading = this.$loading({
lock: true,
text: this.$t('Packing'),
});
try{
await this.saveProject();
const {tplUrl} = await this.packProject();
this.$message({
message: this.$t('Pack project successfully'),
type: 'success',
duration: 1000,
});
this.$confirm(this.$t('Pack project successfully'), this.$t('Alert'), {
confirmButtonText: this.$t('Open in new tab'),
cancelButtonText: this.$t('Close'),
type: 'warning'
}).then(() => {
setTimeout(()=>{
window.open(tplUrl, 'blank');
}, 500);
}).catch(() => {
});
}catch (e) {
this.$message({
message: this.$t('Pack project failed'),
type: 'error',
duration: 1000,
});
}
loading.close();
},
backToHome() {
this.$router.replace({name: 'home'});
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment