Commit e667fb72 authored by rockyl's avatar rockyl

发布自动保存

parent c81bbbaa
...@@ -155,36 +155,7 @@ ...@@ -155,36 +155,7 @@
this.$refs.dialogsDialog.show(); this.$refs.dialogsDialog.show();
break; break;
case 'pack': case 'pack':
const loading = this.$loading({ await this.pack();
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();
break; break;
case 'undo': case 'undo':
this.$store.commit('undoRedo', 1); this.$store.commit('undoRedo', 1);
...@@ -214,6 +185,39 @@ ...@@ -214,6 +185,39 @@
break; 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() { backToHome() {
this.$router.replace({name: 'home'}); 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