jinx 11 mesiacov pred
rodič
commit
1a4d795c6f

+ 3 - 3
packages/qjkankan-editor/src/Store/modules/base.js

@@ -29,7 +29,7 @@ export default {
           },
           workBackgroundMusic: {
             fodderId: "",
-            id: 0,
+            id: null,
             name: "",
             ossPath: "",
             workId: "",
@@ -70,7 +70,7 @@ export default {
             logoChange: false,
             workId: "",
           },
-          workOpeningAnimationd: {
+          workOpeningAnimation: {
             id: 0,
             isShowOpeningAnimation: false,
             openingAnimationType: 0,
@@ -86,7 +86,7 @@ export default {
             remindTime: 0,
             workId: "",
           },
-          workCustomButton: [
+          workCustomButtonList: [
             {
               id: 0,
               isShow: 0,

+ 34 - 0
packages/qjkankan-editor/src/Store/modules/hotspot.js

@@ -0,0 +1,34 @@
+import Vue from "vue";
+import { i18n } from "@/lang";
+import { workHot_save } from "@/api";
+import { $waiting } from "@/components/shared/loading";
+let vue = new Vue();
+export default {
+  namespaced: true,
+  state() {
+    return {};
+  },
+  getters: {
+    currentScene: (state) => state.currentScene,
+  },
+  mutations: {
+    setData(state, payload) {
+      this.commit("base/initbaseInfo");
+      // state.baseInfo = payload;
+      for (let key in state.baseInfo) {
+        if (payload[key]) {
+          state.baseInfo[key] = payload[key];
+        }
+      }
+    },
+  },
+  actions: {
+    save({ commit, state, rootState }, payload) {
+      workHot_save(
+        payload,
+        () => {},
+        () => {}
+      );
+    },
+  },
+};

+ 4 - 0
packages/qjkankan-editor/src/Store/modules/index.js

@@ -2,9 +2,13 @@ import scene from "./scene";
 import tags from "./tags";
 import notice from "./notice";
 import base from "./base";
+import screen from "./screen";
+import hotspot from "./hotspot";
 export default {
   scene,
   tags,
   notice,
   base,
+  screen,
+  hotspot,
 };

+ 47 - 0
packages/qjkankan-editor/src/Store/modules/screen.js

@@ -0,0 +1,47 @@
+import Vue from "vue";
+import { i18n } from "@/lang";
+import { visual_save } from "@/api";
+import { $waiting } from "@/components/shared/loading";
+let vue = new Vue();
+export default {
+  namespaced: true,
+  state() {
+    return {
+      currentScene: {
+        // customMask: initCustomMask,
+        // initVisual: initVisual,
+      },
+    };
+  },
+  getters: {
+    currentScene: (state) => state.currentScene,
+  },
+  mutations: {
+    setData(state, payload) {
+      this.commit("base/initbaseInfo");
+      // state.baseInfo = payload;
+      for (let key in state.baseInfo) {
+        if (payload[key]) {
+          state.baseInfo[key] = payload[key];
+        }
+      }
+    },
+  },
+  actions: {
+    save({ commit, state, rootState }) {
+      visual_save(
+        state.baseInfo,
+        () => {
+          vue.$msg.success(i18n.t("gather.save_done"));
+          // document.title = this.info.name;
+          document.title = state.baseInfo.work.name || i18n.t("gather.no_title");
+          $waiting.hide();
+          // this.getInfo();
+          // this.$store.commit("UpdateIsShowState", true);
+          this.commit("TakeInfoSnapShotAtSave");
+        },
+        () => {}
+      );
+    },
+  },
+};

+ 20 - 14
packages/qjkankan-editor/src/api/index.js

@@ -526,14 +526,7 @@ export function checkWork(data, ok, no) {
     visit = 1111;
   }
   console.log("checkWork", data);
-  return http.get(
-    `${URL_FILL}/web/common/checkWork/${number()}${
-      visit ? "?visit=" + visit : ""
-    }`,
-    data,
-    ok,
-    no
-  );
+  return http.get(`${URL_FILL}/web/common/checkWork/${number()}${visit ? "?visit=" + visit : ""}`, data, ok, no);
 }
 
 /**
@@ -953,12 +946,7 @@ export function getCamWorksList(data, ok, no) {
  * @param {*} no
  */
 export function exchangeId(data, ok, no) {
-  return http.postJson(
-    `${URL_FILL}/web/common/getIdInfo`,
-    data,
-    ok,
-    no
-  );
+  return http.postJson(`${URL_FILL}/web/common/getIdInfo`, data, ok, no);
 }
 /**
  * 获取作品信息
@@ -976,3 +964,21 @@ export function saveBaseWorkInfo(data, ok, no) {
   return http.postJson(`${URL_FILL}/work/edit/base/save`, data, ok, no);
   // return http.postJson(`http://192.168.0.41:8002/qjkankan/work/edit/base/save`, data, ok, no);
 }
+/**
+ * 保存视角
+ */
+
+export function visual_save(data, ok, no) {
+  !data.workId && (data.workId = number());
+  return http.postJson(`${URL_FILL}/work/edit/visual/save`, data, ok, no);
+  // return http.postJson(`http://192.168.0.41:8002/qjkankan/work/edit/base/save`, data, ok, no);
+}
+/**
+ * 保存视角
+ */
+
+export function workHot_save(data, ok, no) {
+  !data.workId && (data.workId = number());
+  return http.postJson(`${URL_FILL}/work/edit/workHot/save`, data, ok, no);
+  // return http.postJson(`http://192.168.0.41:8002/qjkankan/work/edit/base/save`, data, ok, no);
+}

+ 37 - 99
packages/qjkankan-editor/src/framework/EditorHead.vue

@@ -1,38 +1,20 @@
 <template>
   <header class="app-head" app-border dir-bottom>
-    <a
-      class="app-head-back"
-      :href="`./material.html?lang=${$lang}&from=${routerForm}#/works`"
-    >
+    <a class="app-head-back" :href="`./material.html?lang=${$lang}&from=${routerForm}#/works`">
       <i class="iconfont icon-editor_return"></i>
       {{ back_myworks }}
     </a>
     <span class="app-head-title">{{ info.name }}</span>
-    <div
-      class="app-head-save ui-button deepcancel app-head-view"
-      @click="onView"
-      :class="{ disable: !canLoad || isEditing }"
-    >
+    <div class="app-head-save ui-button deepcancel app-head-view" @click="onView" :class="{ disable: !canLoad || isEditing }">
       <i class="iconfont icon-editor_play"></i>
       {{ preview }}
     </div>
 
-    <div
-      class="ui-button submit app-head-save"
-      @click="onSave"
-      :class="{ disable: !canLoad || isEditing }"
-    >
+    <div class="ui-button submit app-head-save" @click="onSave" :class="{ disable: !canLoad || isEditing }">
       <i class="iconfont icon-editor_save"></i>
       {{ savetips }}
     </div>
-    <preview
-      v-if="info"
-      :key="Math.random()"
-      :name="info.name"
-      :show="showPreview"
-      :ifr="`./show.html?id=${info.id}&lang=${$lang}&rnd=${Math.random()}`"
-      @close="showPreview = false"
-    />
+    <preview v-if="info" :key="Math.random()" :name="info.name" :show="showPreview" :ifr="`./show.html?id=${info.id}&lang=${$lang}&rnd=${Math.random()}`" @close="showPreview = false" />
   </header>
 </template>
 <script>
@@ -89,12 +71,7 @@ export default {
   },
   methods: {
     checkParams() {
-      if (
-        !this.info.name &&
-        !this.info.icon &&
-        !this.info.description &&
-        this.info.scenes.length <= 0
-      ) {
+      if (!this.info.name && !this.info.icon && !this.info.description && this.info.scenes.length <= 0) {
         this.$alert({
           content: this.$i18n.t("gather.nothing_edit"),
           ok: () => {
@@ -162,19 +139,13 @@ export default {
       }
 
       if (this.info.firstScene) {
-        this.info.firstScene = this.info.scenes.find(
-          (item) => item.sceneCode == this.info.firstScene.sceneCode
-        );
+        this.info.firstScene = this.info.scenes.find((item) => item.sceneCode == this.info.firstScene.sceneCode);
       }
       const scenes = this.info.scenes;
       // debugger
       if (scenes && scenes.length > 0) {
         scenes.forEach((scene, index) => {
-          if (
-            scene.someData &&
-            scene.someData.hotspots &&
-            scene.someData.hotspots.length > 0
-          ) {
+          if (scene.someData && scene.someData.hotspots && scene.someData.hotspots.length > 0) {
             this.lockHotspotResourceTree(index, scene.someData.hotspots);
           }
         });
@@ -182,34 +153,19 @@ export default {
       //开场校验
       if (this.info.coverInfo.isShowCover === 1) {
         if (this.info.coverInfo.coverSelect === "videoAndImg") {
-          if (
-            !this.info.coverInfo.coverPc ||
-            !this.info.coverInfo.coverMo ||
-            !this.info.coverInfo.videoPc ||
-            !this.info.coverInfo.videoMo
-          ) {
+          if (!this.info.coverInfo.coverPc || !this.info.coverInfo.coverMo || !this.info.coverInfo.videoPc || !this.info.coverInfo.videoMo) {
             this.$msg.warning(this.$i18n.t("gather.converinfo_no_valid"));
             return false;
           }
         }
         if (this.info.coverInfo.coverSelect === "video") {
-          if (
-            !this.info.coverInfo.videoPc ||
-            !this.info.coverInfo.videoMo ||
-            this.info.coverInfo.videoPc == "" ||
-            this.info.coverInfo.videoMo == ""
-          ) {
+          if (!this.info.coverInfo.videoPc || !this.info.coverInfo.videoMo || this.info.coverInfo.videoPc == "" || this.info.coverInfo.videoMo == "") {
             this.$msg.warning(this.$i18n.t("gather.converinfo_no_valid"));
             return false;
           }
         }
         if (this.info.coverInfo.coverSelect === "img") {
-          if (
-            !this.info.coverInfo.coverPc ||
-            !this.info.coverInfo.coverMo ||
-            this.info.coverInfo.coverPc == "" ||
-            this.info.coverInfo.coverMo == ""
-          ) {
+          if (!this.info.coverInfo.coverPc || !this.info.coverInfo.coverMo || this.info.coverInfo.coverPc == "" || this.info.coverInfo.coverMo == "") {
             this.$msg.warning(this.$i18n.t("gather.converinfo_no_valid"));
             return false;
           }
@@ -237,20 +193,15 @@ export default {
 
         switch (item.hotspotType) {
           case "image":
-            fodderId = target.image
-              .reduce((p, c) => p.concat(c["id"]), [])
-              .map((i) => i);
+            fodderId = target.image.reduce((p, c) => p.concat(c["id"]), []).map((i) => i);
             target.fodderId = fodderId;
             break;
           case "audio":
             target.fodderId = [target.audio.id].map((i) => i);
             break;
           case "imageText":
-            fodderId = target.imageTextInfo.imageList
-              .reduce((p, c) => p.concat(c["id"]), [])
-              .map((i) => i);
-            target.imageTextInfo.audio.id &&
-              fodderId.push(target.imageTextInfo.audio.id);
+            fodderId = target.imageTextInfo.imageList.reduce((p, c) => p.concat(c["id"]), []).map((i) => i);
+            target.imageTextInfo.audio.id && fodderId.push(target.imageTextInfo.audio.id);
             target.fodderId = fodderId;
             break;
           case "video":
@@ -277,22 +228,24 @@ export default {
         });
         $waiting.show();
 
-        saveWorks(
-          {
-            password: this.info.password,
-            someData: { ...this.info, status: 1 },
-          },
-          () => {
-            this.$msg.success(this.$i18n.t("gather.save_done"));
-            // document.title = this.info.name;
-            document.title = this.info.name || this.$i18n.t("gather.no_title");
-            $waiting.hide();
-            // this.getInfo();
-            // this.$store.commit("UpdateIsShowState", true);
-            this.$store.commit("TakeInfoSnapShotAtSave");
-          },
-          () => {}
-        );
+        // console.error(this.$router.name)
+        this.$store.dispatch(`${this.$route.name}/save`)
+        // saveWorks(
+        //   {
+        //     password: this.info.password,
+        //     someData: { ...this.info, status: 1 },
+        //   },
+        //   () => {
+        //     this.$msg.success(this.$i18n.t("gather.save_done"));
+        //     // document.title = this.info.name;
+        //     document.title = this.info.name || this.$i18n.t("gather.no_title");
+        //     $waiting.hide();
+        //     // this.getInfo();
+        //     // this.$store.commit("UpdateIsShowState", true);
+        //     this.$store.commit("TakeInfoSnapShotAtSave");
+        //   },
+        //   () => {}
+        // );
       }
     },
     getInfo() {
@@ -312,38 +265,23 @@ export default {
                 let firstScene = "";
 
                 if (data.firstScene) {
-                  firstScene = data.scenes.find(
-                    (item) => item.sceneCode == data.firstScene.sceneCode
-                  );
+                  firstScene = data.scenes.find((item) => item.sceneCode == data.firstScene.sceneCode);
                 }
 
                 //判断列表里是否有全景图
-                if (
-                  data.scenes.some((item) => item.type == "pano") &&
-                  firstScene &&
-                  firstScene.type == "4dkk"
-                ) {
+                if (data.scenes.some((item) => item.type == "pano") && firstScene && firstScene.type == "4dkk") {
                   console.log(this.currentScene.sceneCode);
                   //如果当前有选中场景,则激活选中场景,无则显示第一个全景图
-                  firstScene = this.currentScene.sceneCode
-                    ? this.currentScene
-                    : data.scenes.find((item) => item.type == "pano");
+                  firstScene = this.currentScene.sceneCode ? this.currentScene : data.scenes.find((item) => item.type == "pano");
                 }
 
                 console.log(firstScene, "firstScene");
-                this.$store.commit(
-                  "scene/setCurrentScene",
-                  firstScene || data.scenes[0]
-                );
+                this.$store.commit("scene/setCurrentScene", firstScene || data.scenes[0]);
 
                 // 查询初始场景的所在1级分组
-                let catalog = data.catalogs.find(
-                  (item) => item.id == this.currentScene.category
-                );
+                let catalog = data.catalogs.find((item) => item.id == this.currentScene.category);
                 data.catalogRoot.forEach((item) => {
-                  let temp =
-                    item.children &&
-                    item.children.find((sub) => sub == catalog.id);
+                  let temp = item.children && item.children.find((sub) => sub == catalog.id);
                   if (temp) {
                     this.$store.commit("scene/setCurrentCatalogRoot", item);
                     return;

+ 27 - 30
packages/qjkankan-editor/src/pages/Edit.vue

@@ -25,34 +25,33 @@ export default {
     },
   },
   async beforeMount() {
-    const id = browser.urlQueryValue('id');
-    const lang = browser.urlQueryValue("lang") || 'zh'
-    const token = browser.urlQueryValue('token');
+    const id = browser.urlQueryValue("id");
+    const lang = browser.urlQueryValue("lang") || "zh";
+    const token = browser.urlQueryValue("token");
     const res = await exchangeId({
-      id: id
-    })
+      id: id,
+    });
 
     if (token) {
-      localStorage.setItem('token', token)
+      localStorage.setItem("token", token);
     }
 
-
-    const { id: resID, num, calcStatus } = res.data
-    const isCam = String(num).length > 0
-    let urlRes = `./edit.html?id=${resID}&lang=${lang}#/base`
+    const { id: resID, num, calcStatus } = res.data;
+    const isCam = String(num).length > 0;
+    let urlRes = `./edit.html?id=${resID}&lang=${lang}#/base`;
     if (isCam) {
-      urlRes = `./edit.html?id=${resID}&lang=${lang}&from=cam#/base`
+      urlRes = `./edit.html?id=${resID}&lang=${lang}&from=cam#/base`;
     }
     if (calcStatus === 0) {
       this.$alert({
-        content: this.$i18n.t('material.works.calcing'),
+        content: this.$i18n.t("material.works.calcing"),
       });
-      return
+      return;
     }
-    console.log('res', urlRes)
+    console.log("res", urlRes);
     location.replace(urlRes);
-  //检验是不是该用户作品
-  checkWork({
+    //检验是不是该用户作品
+    checkWork({
       val: 1,
     }).then((res) => {
       if (res.data) {
@@ -75,25 +74,23 @@ export default {
       this.$store.commit("UpdateIsShowState", true);
       OnlineDetector.valid();
     });
-
   },
   mounted() {
     document.title = this.$i18n.t("gather.editpage_name");
     window.store = this.$store;
 
-  
-    window.addEventListener(
-      "beforeunload",
-      (e) => {
-        if (this.isInfoChangedSinceSave) {
-          e.preventDefault();
-          e.returnValue = "您有未保存的修改,仍要离开?"; // 如今的浏览器不会显示这条信息了。
-        }
-      },
-      {
-        capture: true,
-      }
-    );
+    // window.addEventListener(
+    //   "beforeunload",
+    //   (e) => {
+    //     if (this.isInfoChangedSinceSave) {
+    //       e.preventDefault();
+    //       e.returnValue = "您有未保存的修改,仍要离开?"; // 如今的浏览器不会显示这条信息了。
+    //     }
+    //   },
+    //   {
+    //     capture: true,
+    //   }
+    // );
     this.$store.dispatch("notice/getNotice");
   },
 };

+ 2 - 2
packages/qjkankan-editor/src/views/base/autoCruiseSettings.vue

@@ -4,7 +4,7 @@
     <br>
     <div class="switch-wrapper">
       <span class="label">{{enter_auto}}</span>
-      <Switcher :value="info.isAuto" @change="onSwitcherChange"></Switcher>
+      <Switcher :value="info.work.isAuto" @change="onSwitcherChange"></Switcher>
     </div>
   </div>
 </template>
@@ -36,7 +36,7 @@ export default {
   },
   methods: {
     onSwitcherChange(data) {
-      this.info.isAuto = data
+      this.info.work.isAuto = data
     }
   }
 }

+ 11 - 11
packages/qjkankan-editor/src/views/base/backgroundMusicSettings.vue

@@ -2,14 +2,14 @@
   <div class="background-music-settings">
     <span class="title">{{set_bgm}}</span>
     <br>
-    <button v-if="!(info && info.backgroundMusic && info.backgroundMusic.name)" @click="onClickMusicSelectionBtn">
+    <button v-if="!(info && info.workBackgroundMusic && info.workBackgroundMusic.name)" @click="onClickMusicSelectionBtn">
       <i class="iconfont icon-editor_add"></i>
       {{add_audio}}
     </button>
     <template v-else>
       <div class="music-display" @click.self="onClickCurrentMusic">
-        <Audio ref="my-audio" class="audio-control" :backgroundColor="'#1A1B1D'" :myAudioUrl="info.backgroundMusic.ossPath"></Audio>
-        <div class="name" v-title="info.backgroundMusic.name" @click="onClickCurrentMusic">{{info.backgroundMusic.name}}</div>
+        <Audio ref="my-audio" class="audio-control" :backgroundColor="'#1A1B1D'" :myAudioUrl="info.workBackgroundMusic.ossPath"></Audio>
+        <div class="name" v-title="info.workBackgroundMusic.name" @click="onClickCurrentMusic">{{info.workBackgroundMusic.name}}</div>
         <i class="iconfont icon-editor_list_delete" @click.stop="onClickDeleteMusicBtn"></i>
       </div>
       <button @click="onClickMusicSelectionBtn">
@@ -61,15 +61,15 @@ export default {
       this.isShowSelectionWindow = true
     },
     onClickDeleteMusicBtn() {
-      this.info.backgroundMusic.id = null
-      this.info.backgroundMusic.name = null
-      this.info.backgroundMusic.ossPath = null
+      this.info.workBackgroundMusic.id = null
+      this.info.workBackgroundMusic.name = null
+      this.info.workBackgroundMusic.ossPath = null
     },
     handleSubmitFromMaterialSelector(selected) {
       this.isShowSelectionWindow = false
-      this.info.backgroundMusic.id = selected[0].id
-      this.info.backgroundMusic.name = selected[0].name
-      this.info.backgroundMusic.ossPath = selected[0].ossPath
+      this.info.workBackgroundMusic.fodderId = selected[0].id
+      this.info.workBackgroundMusic.name = selected[0].name
+      this.info.workBackgroundMusic.ossPath = selected[0].ossPath
     },
     onClickCurrentMusic() {
       if (this.$refs['my-audio']) {
@@ -78,8 +78,8 @@ export default {
     }
   },
   mounted() {
-    if (!this.info.backgroundMusic) {
-      this.info.backgroundMusic = {
+    if (!this.info.workBackgroundMusic) {
+      this.info.workBackgroundMusic = {
         id: '',
         name: '',
         ossPath: '',

+ 24 - 24
packages/qjkankan-editor/src/views/base/customButtonSettings.vue

@@ -10,7 +10,7 @@
     <br />
 
     <div
-      v-for="(item, index) of info.customButton"
+      v-for="(item, index) of info.workCustomButtonList"
       :key="index"
       class="button-setting-item"
       :class="{ expand: expandStatus[index] }"
@@ -240,9 +240,9 @@ export default {
     },
     //1.3.1后用这个过滤中文Key
     // eslint-disable-next-line vue/return-in-computed-property
-    customButton() {
-      if (this.info.customButton && this.info.customButton.length > 0) {
-        return Array.from(this.info.customButton).map((item) => {
+    workCustomButtonList() {
+      if (this.info.workCustomButtonList && this.info.workCustomButtonList.length > 0) {
+        return Array.from(this.info.workCustomButtonList).map((item) => {
           if (item.type == "电话") {
             item.type = "phone";
           }
@@ -279,8 +279,8 @@ export default {
       }
     },
     buttonValueTips() {
-      if (this.customButton) {
-        return this.customButton.map((item) => {
+      if (this.workCustomButtonList) {
+        return this.workCustomButtonList.map((item) => {
           if (item.type === "phone") {
             return i18n.t("edit_settings.phone");
           } else if (item.type === "link") {
@@ -308,7 +308,7 @@ export default {
       handler(newValue) {
         console.log("editingInfo.type", newValue);
         const item = this.buttonTypeList.find((i) => i.id === newValue);
-        const current = this.info.customButton[this.editingButtonIdx];
+        const current = this.info.workCustomButtonList[this.editingButtonIdx];
         console.log("current.name", current.name);
         if (current.name.length === 0) {
           this.editingInfo.name = item.label;
@@ -320,9 +320,9 @@ export default {
   },
 
   beforeMount() {
-    if (!this.info.customButton) {
+    if (!this.info.workCustomButtonList) {
       // 这是在v1.2版之前创建的作品,还没设置过自定义按钮,所以还没有customButton字段
-      this.info.customButton = [
+      this.info.workCustomButtonList = [
         {
           type: "phone",
           name: i18n.t("customButton.phone"),
@@ -340,10 +340,10 @@ export default {
       ];
     }
 
-    if (!this.info.customButton[0].openMethod) {
+    if (!this.info.workCustomButtonList[0].openMethod) {
       // 这是在v1.3版之前创建的作品,还没设置过自定义按钮的打开方式。
-      this.info.customButton[0].openMethod = "_self";
-      this.info.customButton[1].openMethod = "_self";
+      this.info.workCustomButtonList[0].openMethod = "_self";
+      this.info.workCustomButtonList[1].openMethod = "_self";
     }
   },
   mounted() {
@@ -369,10 +369,10 @@ export default {
     },
     onRequestForEdit(index) {
       this.editingButtonIdx = index;
-      this.editingInfo.type = this.customButton[index].type;
-      this.editingInfo.name = this.customButton[index].name;
-      this.editingInfo.value = this.customButton[index].value;
-      this.editingInfo.openMethod = this.customButton[index].openMethod;
+      this.editingInfo.type = this.workCustomButtonList[index].type;
+      this.editingInfo.name = this.workCustomButtonList[index].name;
+      this.editingInfo.value = this.workCustomButtonList[index].value;
+      this.editingInfo.openMethod = this.workCustomButtonList[index].openMethod;
       this.isEditing = true;
     },
     checkButtonName(name) {
@@ -405,32 +405,32 @@ export default {
       ) {
         return;
       }
-      this.info.customButton[this.editingButtonIdx].type =
+      this.info.workCustomButtonList[this.editingButtonIdx].type =
         this.editingInfo.type;
-      this.info.customButton[this.editingButtonIdx].name =
+      this.info.workCustomButtonList[this.editingButtonIdx].name =
         this.editingInfo.name;
-      this.info.customButton[this.editingButtonIdx].value =
+      this.info.workCustomButtonList[this.editingButtonIdx].value =
         this.editingInfo.value;
       if (this.editingInfo.type === "link") {
-        this.info.customButton[this.editingButtonIdx].openMethod =
+        this.info.workCustomButtonList[this.editingButtonIdx].openMethod =
           this.editingInfo.openMethod;
       }
       this.$msg.success(i18n.t("gather.success"));
       this.isEditing = false;
     },
     onRequestForShow(index) {
-      if (!this.checkButtonName(this.info.customButton[index].name)) {
+      if (!this.checkButtonName(this.info.workCustomButtonList[index].name)) {
         return;
       }
       if (
         !this.checkButtonValue(
-          this.info.customButton[index].value,
-          this.info.customButton[index].type
+          this.info.workCustomButtonList[index].value,
+          this.info.workCustomButtonList[index].type
         )
       ) {
         return;
       }
-      this.info.customButton[index].isShow = true;
+      this.info.workCustomButtonList[index].isShow = true;
     },
   },
 };

+ 10 - 10
packages/qjkankan-editor/src/views/base/customLogoSettings.vue

@@ -4,11 +4,11 @@
     <br />
     <div class="switch-wrapper">
       <span class="label">{{ $i18n.t(`edit_settings.show_logo`) }}</span>
-      <Switcher :value="info.isLogo" @change="onSwitcherChange"></Switcher>
+      <Switcher :value="info.workLogo.isLogo" @change="onSwitcherChange"></Switcher>
     </div>
-    <div class="bottom" :class="{ disabled: !info.isLogo }">
+    <div class="bottom" :class="{ disabled: !info.workLogo.isLogo }">
       <SelectedImage
-        :imgSrc="info.logo"
+        :imgSrc="info.workLogo.logo"
         :defaultImgSrc="
           require(`@/assets/images/default/logo_white_${$lang}.svg`)
         "
@@ -70,7 +70,7 @@ export default {
   },
   methods: {
     onSwitcherChange(data) {
-      this.info.isLogo = data;
+      this.info.workLogo.isLogo = data;
     },
     onClickSelectingPicBtn() {
       this.isShowSelectionWindow = true;
@@ -88,15 +88,15 @@ export default {
       // })
     },
     handleSubmitFromMaterialSelector(selected) {
-      this.info.logo = selected[0].icon;
-      this.info.logoId = selected[0].id;
-      this.info.logoChange = true;
+      this.info.workLogo.logo = selected[0].icon;
+      this.info.workLogo.logoId = selected[0].id;
+      this.info.workLogo.logoChange = true;
       this.isShowSelectionWindow = false;
     },
     onClickCancelCustomLogo() {
-      this.info.logo = "";
-      this.info.logoId = "";
-      this.info.logoChange = false;
+      this.info.workLogo.logo = "";
+      this.info.workLogo.logoId = "";
+      this.info.workLogo.logoChange = false;
     },
   },
   mounted() {},

+ 8 - 8
packages/qjkankan-editor/src/views/base/openingAnimationSettings.vue

@@ -4,7 +4,7 @@
     <br />
     <div class="switch-wrapper">
       <span class="label">{{ $i18n.t("edit_settings.opening_animation_show") }}</span>
-      <Switcher :value="info.workOpeningAnimationd.isShowOpeningAnimation" @change="onSwitcherChange"></Switcher>
+      <Switcher :value="info.workOpeningAnimation.isShowOpeningAnimation" @change="onSwitcherChange"></Switcher>
     </div>
     <div class="btns-and-video">
       <div class="btn-wrapper">
@@ -12,14 +12,14 @@
           v-for="item of openingTypeList"
           :key="item"
           class="opening-selection-btn"
-          :class="{ 'active-opening-type': info.workOpeningAnimationd.openingAnimationType === item }"
-          @click="info.workOpeningAnimationd.openingAnimationType = item"
+          :class="{ 'active-opening-type': info.workOpeningAnimation.openingAnimationType === item }"
+          @click="info.workOpeningAnimation.openingAnimationType = item"
         >
           {{ $i18n.t(`baseSetting.opa${item}`) }}
         </button>
       </div>
       <div class="video-wrapper">
-        <video ref="opvideo" :src="require(`@/assets/videos/opa${fallbackOpeningAnimationType(info.workOpeningAnimationd.openingAnimationType)}_x264.mp4`)" autoplay loop></video>
+        <video ref="opvideo" :src="require(`@/assets/videos/opa${fallbackOpeningAnimationType(info.workOpeningAnimation.openingAnimationType)}_x264.mp4`)" autoplay loop></video>
         <i v-if="playing" @click="bofang" class="iconfont iconshow_playback"></i>
       </div>
     </div>
@@ -76,16 +76,16 @@ export default {
       this.$refs.opvideo.play();
     },
     onSwitcherChange(data) {
-      this.info.workOpeningAnimationd.isShowOpeningAnimation = data;
+      this.info.workOpeningAnimation.isShowOpeningAnimation = data;
     },
   },
   mounted() {
-    if (this.info.workOpeningAnimationd.isShowOpeningAnimation === undefined) {
+    if (this.info.workOpeningAnimation.isShowOpeningAnimation === undefined) {
       this.$set(this.info, "isShowOpeningAnimation", false);
     }
     if (
-      !this.info.workOpeningAnimationd.openingAnimationType ||
-      (typeof this.info.workOpeningAnimationd.openingAnimationType === "string" && this.info.workOpeningAnimationd.openingAnimationType.match(/[\u3400-\u9FBF]/))
+      !this.info.workOpeningAnimation.openingAnimationType ||
+      (typeof this.info.workOpeningAnimation.openingAnimationType === "string" && this.info.workOpeningAnimation.openingAnimationType.match(/[\u3400-\u9FBF]/))
     ) {
       this.$set(this.info, "openingAnimationType", this.openingTypeList[0]);
     }

+ 4 - 4
packages/qjkankan-editor/src/views/base/passwordSettings.vue

@@ -7,7 +7,7 @@
         :type="canSee ? 'text' : 'password'"
         :placeholder="$i18n.t(`edit_settings.password_placeholder`)"
         :maxlength="20"
-        v-model="info.password"
+        v-model="info.work.password"
         autocomplete="new-password"
         @keydown.enter="onInputEnter"
       >
@@ -35,10 +35,10 @@ export default {
     })
   },
   watch: {
-    'info.password': {
+    'info.work.password': {
       handler(v) {
-        console.log(123);
-        this.info.password = v.replace(/[^\w]/g, '').replace(/_/g, '')
+        console.error(213123)
+        this.info.work.password = v.replace(/[^\w]/g, '').replace(/_/g, '')
       }
     }
   },

+ 7 - 3
packages/qjkankan-editor/src/views/hotspot/EditPanel.vue

@@ -531,10 +531,12 @@ export default {
       __krfn.utils.edithotspot(krpano, data);
     },
     handleSceneSelect(data) {
+     
       this.hotspot.secne = {
         ...data,
         someData: {},
       };
+  
     },
     onHotSpotTypeChange(data) {
       this.hotspot.hotspotType = data.id;
@@ -656,9 +658,11 @@ export default {
       // this.$getKrpano().set(`hotspot[${data.name}].url`, data.img);
     },
     save() {
-      this.$store.commit("SetHotspot", this.hotspot);
-      this.$emit("close");
-      this.$emit("save", this.hotspot);
+      // this.$store.commit("SetHotspot", this.hotspot);
+      // this.$emit("close");
+      // this.$emit("save", this.hotspot);
+      console.error(this.hotspot)
+      this.$store.dispatch('hotspot/save',this.hotspot)
     },
     onSwitcherChange(val) {
       console.log("onSwitcherChange", val);

+ 22 - 82
packages/qjkankan-editor/src/views/hotspot/HotSpotList.vue

@@ -2,10 +2,7 @@
   <div class="hot-spot-list" app-border dir-left>
     <div class="title">
       {{ $i18n.t("hotspot.add_hotspot") }}
-      <i
-        class="iconfont icon-help_i tool-tip-for-editor"
-        v-tooltip="$i18n.t('hotspot.hotspot_tips')"
-      />
+      <i class="iconfont icon-help_i tool-tip-for-editor" v-tooltip="$i18n.t('hotspot.hotspot_tips')" />
     </div>
 
     <template v-if="currentScene.type !== '4dkk'">
@@ -24,13 +21,7 @@
         >
           <img class="icon" :src="item.icon" alt="" draggable="false" />
           <div class="type-name">{{ item.name }}</div>
-          <img
-            v-if="item.isExperience"
-            class="exp-tag"
-            :src="experience_icon"
-            alt=""
-            draggable="false"
-          />
+          <img v-if="item.isExperience" class="exp-tag" :src="experience_icon" alt="" draggable="false" />
         </li>
       </ul>
 
@@ -40,27 +31,12 @@
       </div>
       <div class="hots">
         <ul v-if="someData.hotspots.length > 0">
-          <li
-            v-for="(item, key) in someData.hotspots"
-            :key="key"
-            @click="open(item)"
-          >
+          <li v-for="(item, key) in someData.hotspots" :key="key" @click="open(item)">
             <img class="hot-spot-thumb" :src="item.img" alt="" />
-            <span class="hot-spot-title" v-title="item.hotspotTitle">{{
-              item.hotspotTitle
-            }}</span>
-            <i
-              class="iconfont icon-editor_list_delete icon-delete"
-              v-tooltip="$i18n.t('hotspot.delete')"
-              @click.stop="deleIndex = key"
-            />
+            <span class="hot-spot-title" v-title="item.hotspotTitle">{{ item.hotspotTitle }}</span>
+            <i class="iconfont icon-editor_list_delete icon-delete" v-tooltip="$i18n.t('hotspot.delete')" @click.stop="deleIndex = key" />
             <div class="deletion-confirm-wrap">
-              <div
-                class="deletion-confirm"
-                :class="deleIndex == key ? 'show' : 'hide'"
-                v-clickoutside="clickoutside"
-                @click.stop="deleteHot(item)"
-              >
+              <div class="deletion-confirm" :class="deleIndex == key ? 'show' : 'hide'" v-clickoutside="clickoutside" @click.stop="deleteHot(item)">
                 {{ $i18n.t("hotspot.delete") }}
               </div>
             </div>
@@ -75,12 +51,7 @@
 
     <div class="goto-4dkk-tip" v-if="currentScene.type === '4dkk'">
       <div class="img-wrap">
-        <img
-          class=""
-          src="@/assets/images/default/goto-4dage.png"
-          alt=""
-          draggable="false"
-        />
+        <img class="" src="@/assets/images/default/goto-4dage.png" alt="" draggable="false" />
         <div class="tip-text">
           {{ $i18n.t("screen.goto_4dkk_edit_tips") }}
         </div>
@@ -90,14 +61,7 @@
       </button>
     </div>
 
-    <EditPanel
-      class="adding-hotspot-panel"
-      v-if="showPanel"
-      :editTitle="editTitle"
-      :show="showPanel"
-      @save="save"
-      @close="close"
-    />
+    <EditPanel class="adding-hotspot-panel" v-if="showPanel" :editTitle="editTitle" :show="showPanel" @save="save" @close="close" />
   </div>
 </template>
 
@@ -175,9 +139,7 @@ export default {
   },
   mounted() {
     this.$bus.on("updateHotSpotHV", (data) => {
-      let hptarget = this.someData.hotspots.find(
-        (item) => item.name.toLowerCase() == data.hpname.toLowerCase()
-      );
+      let hptarget = this.someData.hotspots.find((item) => item.name.toLowerCase() == data.hpname.toLowerCase());
       if (hptarget) {
         console.log("hptarget", hptarget);
         hptarget.ath = data.ath;
@@ -186,9 +148,7 @@ export default {
     });
 
     this.$bus.on("openHotspot", (data) => {
-      let idx = this.someData.hotspots.findIndex(
-        (item) => item.name.toLowerCase() == data.toLowerCase()
-      );
+      let idx = this.someData.hotspots.findIndex((item) => item.name.toLowerCase() == data.toLowerCase());
       // console.log(data);
       if (data == this.hotspot.name) {
         // window.__krfn.utils.looktohotspot(this.$getKrpano(), this.hotspot.name);
@@ -197,10 +157,7 @@ export default {
         }
         return;
       }
-      if (
-        this.editTitle == "新增" ||
-        this.editTitle == this.$i18n.t("hotspot.add")
-      ) {
+      if (this.editTitle == "新增" || this.editTitle == this.$i18n.t("hotspot.add")) {
         if (this.showPanel) {
           return this.$confirm({
             content: this.$i18n.t("hotspot.close_dialog"),
@@ -227,9 +184,7 @@ export default {
         if (data.type == "edit") {
           this.deleteKRHotspot(data.data);
           this.$bus.emit("addhotspot", data.data);
-          let idx = this.someData.hotspots.findIndex(
-            (item) => item.name == data.data.name
-          );
+          let idx = this.someData.hotspots.findIndex((item) => item.name == data.data.name);
           this.someData.hotspots[idx] = data.data;
         } else {
           this.deleteKRHotspot(data.data);
@@ -239,9 +194,7 @@ export default {
     },
 
     updateInfo() {
-      let iidx = this.info.scenes.findIndex(
-        (item) => this.currentScene.sceneCode == item.sceneCode
-      );
+      let iidx = this.info.scenes.findIndex((item) => this.currentScene.sceneCode == item.sceneCode);
       if (iidx > -1) {
         this.info.scenes[iidx] = {
           ...this.currentScene,
@@ -253,9 +206,7 @@ export default {
       let HV = window.__krfn.utils.getHotspotHV(this.$getKrpano(), data.name);
       data.ath = HV.ath;
       data.atv = HV.atv;
-      let idx = this.someData.hotspots.findIndex(
-        (item) => item.name === data.name
-      );
+      let idx = this.someData.hotspots.findIndex((item) => item.name === data.name);
       if (idx <= -1) {
         this.someData.hotspots.push(data);
       } else {
@@ -267,12 +218,9 @@ export default {
 
       // window.g_hotspotCurrentScale = mapFontSize[data.fontSize] || 1;
 
-      window.g_hotspotCurrentScale =
-        Math.ceil((data.fontSize * 10) / 12) / 10 || 1;
+      window.g_hotspotCurrentScale = Math.ceil((data.fontSize * 10) / 12) / 10 || 1;
       console.log("g_hotspotCurrentScale", g_hotspotCurrentScale);
-      let iidx = this.info.scenes.findIndex(
-        (item) => this.currentScene.sceneCode == item.sceneCode
-      );
+      let iidx = this.info.scenes.findIndex((item) => this.currentScene.sceneCode == item.sceneCode);
       if (iidx > -1) {
         this.info.scenes[iidx] = {
           ...this.currentScene,
@@ -289,24 +237,19 @@ export default {
       this.deleteKRHotspot(data);
       this.currentScene.someData = this.someData;
       this.updateInfo();
-      this.$msg.success(
-        this.$i18n.t("hotspot.delete") + this.$i18n.t("hotspot.success")
-      );
+      this.$msg.success(this.$i18n.t("hotspot.delete") + this.$i18n.t("hotspot.success"));
     },
     open(data) {
       let hotspotData = null;
+
       if (data.isAdd) {
+        console.error(this.currentScene);
         this.editTitle = this.$i18n.t("hotspot.add");
         hotspotData = {
           hotspotType: data.hotspotType, // 热点类型,切换场景、图片、视频、音频、链接、文本等等
-
+          navigationId: this.currentScene.id,
           hotspotIconType: "system_icon", // 热点图标的类型,系统图标(system_icon)、自定义图片(custom_image)、序列帧(serial_frame)、个性标签(personalized_tag)
-          img:
-            this.$config.getStaticResource("/panoassets/images/hotspot/icon/") +
-            `img_doticon_${String(data.idxInSystemIconList).padStart(
-              2,
-              "0"
-            )}.svg`, // 热点图标类型为系统图标时,图标在展时段使用的url
+          img: this.$config.getStaticResource("/panoassets/images/hotspot/icon/") + `img_doticon_${String(data.idxInSystemIconList).padStart(2, "0")}.svg`, // 热点图标类型为系统图标时,图标在展时段使用的url
           icontype: "icon" + data.idxInSystemIconList, // 热点图标类型为系统图标时,图标的id
           customIconInfo: {
             // 热点图标类型为自定义图标时,图标的数据
@@ -367,10 +310,7 @@ export default {
         };
 
         this.$bus.emit("addhotspot", hotspotData);
-        this.$getKrpano().set(
-          "layer[tooltip_" + hotspotData.name + "].visible",
-          true
-        );
+        this.$getKrpano().set("layer[tooltip_" + hotspotData.name + "].visible", true);
         // debugger;
         setTimeout(() => {
           this.$store.commit("tags/setIsConfirmingPosi", hotspotData.name);

+ 7 - 6
packages/qjkankan-editor/src/views/material/works/list.vue

@@ -257,12 +257,13 @@ export default {
     },
     add() {
       // 新建作品,弹窗让用户给作品选择素材。
-      $waiting.show();
-      addWorks({}, (res) => {
-        $waiting.hide();
-        this.newWorkId = res.data.id;
-        this.isShowMaterialSelector = true;
-      });
+      // $waiting.show();
+      // addWorks({}, (res) => {
+      //   $waiting.hide();
+      //   this.newWorkId = res.data.id;
+      //   this.isShowMaterialSelector = true;
+      // });
+      this.isShowMaterialSelector = true;
     },
     handleSubmitFromMaterialSelector(selected) {
       $waiting.show();