Selaa lähdekoodia

feat(program): add the return operation after saving successfully

Casper Dai 3 vuotta sitten
vanhempi
sitoutus
e71db103ad

+ 1 - 0
src/main.js

@@ -21,6 +21,7 @@ import {
 
 function startApp () {
   document.body.setAttribute('version', __VERSION__)
+  window.name = `msr${Date.now()}`
 
   Vue.use(Element)
   Vue.prototype.$keycloak = keycloak

+ 9 - 0
src/views/bigscreen/ast/Designer.vue

@@ -791,6 +791,15 @@ export default {
         this.$nextTick(() => {
           this._save().finally(() => {
             this.loading = false
+            if (window.opener) {
+              this.$confirm(
+                '返回节目列表?',
+                '保存成功'
+              ).then(() => {
+                window.open('javascript:;', window.opener.name)
+                window.close()
+              })
+            }
           })
         })
       })

+ 0 - 3
src/views/bigscreen/ast/core/base.js

@@ -87,9 +87,6 @@ export default {
     this.checkRatio()
     window.addEventListener('resize', this.checkRatio)
   },
-  beforeDestroy () {
-    window.removeEventListener('resize', this.checkRatio)
-  },
   methods: {
     toggleMute () {
       this.muted = !this.muted

+ 0 - 1
src/views/bigscreen/ast/index.vue

@@ -38,7 +38,6 @@ export default {
     }
   },
   beforeRouteLeave (to, from, next) {
-    window.close()
     next(false)
   },
   methods: {