Jelajahi Sumber

编辑器:点击保存后不重新走初始化流程

任一存 2 tahun lalu
induk
melakukan
85856c1bcd

+ 1 - 1
packages/qjkankan-editor/src/Store/index.js

@@ -24,7 +24,7 @@ const store = new Vuex.Store({
     allVrlist: [],
     activeItem: '',
     isEditing: false,
-    isShow: false,
+    isShow: false, // 是否正常显示编辑器页面。如果发现作品不属于当前用户,就不能正常显示。
 
     uploadStatusListAudio: [],
     uploadStatusListImage: [],

+ 25 - 29
packages/qjkankan-editor/src/framework/EditorHead.vue

@@ -78,16 +78,6 @@ export default {
         });
         return false;
       }
-      // if (this.info.scenes.length <= 0 && this.isShow) {
-      //   this.$alert({
-      //     content: "至少添加一个场景才保存/预览,请前往“场景导航”添加",
-      //     forceOK: true,
-      //     ok: () => {
-      //       this.$router.push({ path: "/navigation" });
-      //     },
-      //   });
-      //   return false;
-      // }
       return true;
     },
     onView() {
@@ -111,23 +101,28 @@ export default {
         () => {
           this.$msg.success(this.$i18n.t('gather.save_done'));
           document.title = this.info.name;
-          this.getInfo().then((res) => {
-            // getInfo里调用了后端接口,底层用了jquery的网络请求方法,为啥会导致promise嵌套没有展平,res拿到的不是promise 对象的resolve值而是promise对象本身????
-            res.then(() => {
-              this.$store.commit("UpdateIsShowState", true);
-              $waiting.hide()
-              setTimeout(() => {
-                if (this.info.scenes.length <= 0 && this.isShow) {
-                  return this.$alert({
-                    content: this.$i18n.t('gather.at_least_one_scene'),
-                  });
-                }
-                this.showPreview = true;
-              }, 500);
-            })
-          });
-
-
+          // this.getInfo().then((res) => {
+          //   // getInfo里调用了后端接口,底层用了jquery的网络请求方法,为啥会导致promise嵌套没有展平,res拿到的不是promise 对象的resolve值而是promise对象本身????
+          //   res.then(() => {
+          //     this.$store.commit("UpdateIsShowState", true);
+          //     $waiting.hide()
+          //     setTimeout(() => {
+          //       if (this.info.scenes.length <= 0 && this.isShow) {
+          //         return this.$alert({
+          //           content: this.$i18n.t('gather.at_least_one_scene'),
+          //         });
+          //       }
+          //       this.showPreview = true;
+          //     }, 500);
+          //   })
+          // });
+          $waiting.hide()
+          if (this.info.scenes.length <= 0 && this.isShow) {
+            return this.$alert({
+              content: this.$i18n.t('gather.at_least_one_scene'),
+            });
+          }
+          this.showPreview = true;
         }
       );
     },
@@ -165,8 +160,9 @@ export default {
         () => {
           this.$msg.success(this.$i18n.t('gather.save_done'));
           document.title = this.info.name;
-          this.getInfo();
-          this.$store.commit("UpdateIsShowState", true);
+          $waiting.hide()
+          // this.getInfo();
+          // this.$store.commit("UpdateIsShowState", true);
           this.$store.commit("TakeInfoSnapShotAtSave")
         },
         () => { }