Просмотр исходного кода

Merge branch 'dev' of http://face3d.4dage.com:7005/chenzhiguang/qjkankan_v1.1.1 into dev

tremble 2 лет назад
Родитель
Сommit
8c97b072b7

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

@@ -85,7 +85,9 @@ export default {
     },
     setMetaData(state, payload) {
       state.metadata = payload;
-      document.title = payload.name || '无标题'
+      if (location.href.includes('show.html')) {
+        document.title = payload.name || '无标题'
+      }
     },
   },
 };

+ 22 - 10
packages/qjkankan-editor/src/components/materialSelectorForEditor.vue

@@ -42,7 +42,7 @@
         <span class="table-head" v-for="(item,i) in tableHeadersForImage" :key="i">{{item.name}}</span>
       </div>
       <div
-        v-if="imageListRealLength !== 0 || hasMoreImageData"
+        v-if="imageListLocalLength !== 0 || hasMoreImageData"
         class="table-body"
         v-infinite-scroll="requestMoreImageData"
         :infinite-scroll-disabled="!hasMoreImageData || isRequestingMoreImageData"
@@ -144,7 +144,7 @@
         <span class="table-head" v-for="(item,i) in tableHeadersForPano" :key="i">{{item.name}}</span>
       </div>
       <div
-        v-if="panoListRealLength !== 0 || hasMorePanoData"
+        v-if="panoListLocalLength !== 0 || hasMorePanoData"
         class="table-body"
         v-infinite-scroll="requestMorePanoData"
         :infinite-scroll-disabled="!hasMorePanoData || isRequestingMorePanoData"
@@ -225,7 +225,7 @@
         </div>
       </div>
       <!-- 无数据时的提示 -->
-      <div v-if="panoList.length === 0 && !hasMorePanoData" class="no-data">
+      <div v-else class="no-data">
         <div v-if="latestUsedSearchKey">
           <img :src="require('@/assets/images/default/empty_04_search.png')" alt="">
           <span>{{'未搜索到结果~'}}</span>
@@ -247,7 +247,7 @@
         <span class="table-head" v-for="(item,i) in tableHeadersForAudio" :key="i">{{item.name}}</span>
       </div>
       <div
-        v-if="audioListRealLength !== 0 || hasMoreAudioData"
+        v-if="audioListLocalLength !== 0 || hasMoreAudioData"
         class="table-body"
         v-infinite-scroll="requestMoreAudioData"
         :infinite-scroll-disabled="!hasMoreAudioData || isRequestingMoreAudioData"
@@ -359,7 +359,7 @@
         </div>
       </div>
       <!-- 无数据时的提示 -->
-      <div v-if="audioList.length === 0 && !hasMoreAudioData" class="no-data">
+      <div v-else class="no-data">
         <div v-if="latestUsedSearchKey">
           <img :src="require('@/assets/images/default/empty_04_search.png')" alt="">
           <span>{{'未搜索到结果~'}}</span>
@@ -381,7 +381,7 @@
         <span class="table-head" v-for="(item,i) in tableHeadersForVideo" :key="i">{{item.name}}</span>
       </div>
       <div
-        v-if="videoListRealLength !== 0 || hasMoreVideoData"
+        v-if="videoListLocalLength !== 0 || hasMoreVideoData"
         class="table-body"
         v-infinite-scroll="requestMoreVideoData"
         :infinite-scroll-disabled="!hasMoreVideoData || isRequestingMoreVideoData"
@@ -473,7 +473,7 @@
       </div>
 
       <!-- 无数据时的提示 -->
-      <div v-if="videoList.length === 0 && !hasMoreVideoData" class="no-data">
+      <div v-else class="no-data">
         <div v-if="latestUsedSearchKey">
           <img :src="require('@/assets/images/default/empty_04_search.png')" alt="">
           <span>{{'未搜索到结果~'}}</span>
@@ -497,7 +497,7 @@
       <div
         v-if="scene3DList.length !== 0 || hasMore3DData"
         class="table-body"
-        v-infinite-scroll="requestMorePanoData"
+        v-infinite-scroll="requestMore3DData"
         :infinite-scroll-disabled="!hasMore3DData || isRequestingMore3DData"
       >
         <div class="table-body-row" v-for="(item,i) in scene3DList" :key="i" @click="onClickRow">
@@ -519,7 +519,7 @@
         </div>
       </div>
       <!-- 无数据时的提示 -->
-      <div v-if="scene3DList.length === 0 && !hasMore3DData" class="no-data">
+      <div v-else class="no-data">
         <div v-if="latestUsedSearchKey">
           <img :src="require('@/assets/images/default/empty_04_search.png')" alt="">
           <span>{{'未搜索到结果~'}}</span>
@@ -793,21 +793,33 @@ export default {
         return item.status === 'SUCCESS'
       }).length
     },
+    imageListLocalLength() {
+      return this.imageList.length + this.uploadStatusListImage.length
+    },
     panoListRealLength() {
-      return this.imageList.length + this.uploadStatusListPano.filter((item) => {
+      return this.panoList.length + this.uploadStatusListPano.filter((item) => {
         return item.status === 'SUCCESS'
       }).length
     },
+    panoListLocalLength() {
+      return this.panoList.length + this.uploadStatusListPano.length
+    },
     audioListRealLength() {
       return this.audioList.length + this.uploadStatusListAudio.filter((item) => {
         return item.status === 'SUCCESS'
       }).length
     },
+    audioListLocalLength() {
+      return this.audioList.length + this.uploadStatusListAudio.length
+    },
     videoListRealLength() {
       return this.videoList.length + this.uploadStatusListVideo.filter((item) => {
         return item.status === 'SUCCESS'
       }).length
     },
+    videoListLocalLength() {
+      return this.videoList.length + this.uploadStatusListVideo.length
+    },
     needLongPolling() {
       return this.uploadStatusListPano.some((item) => {
         return item.status === 'LOADING' && item.ifKnowProgress === false

+ 16 - 4
packages/qjkankan-editor/src/components/materialSelectorForManageCenter.vue

@@ -63,7 +63,7 @@
         <span class="table-head" v-for="(item,i) in tableHeadersForPano" :key="i">{{item.name}}</span>
       </div>
       <div
-        v-if="panoListRealLength !== 0 || hasMorePanoData"
+        v-if="panoListLocalLength !== 0 || hasMorePanoData"
         class="table-body"
         v-infinite-scroll="requestMorePanoData"
         :infinite-scroll-disabled="!hasMorePanoData || isRequestingMorePanoData"
@@ -146,7 +146,7 @@
         </div>
       </div>
       <!-- 无数据时的提示 -->
-      <div v-if="panoList.length === 0 && !hasMorePanoData" class="no-data">
+      <div v-else class="no-data">
         <div v-if="latestUsedSearchKey">
           <img :src="require('@/assets/images/default/empty_04_search.png')" alt="">
           <span>{{'未搜索到结果~'}}</span>
@@ -166,7 +166,7 @@
       <div
         v-if="scene3DList.length !== 0 || hasMore3DData"
         class="table-body"
-        v-infinite-scroll="requestMorePanoData"
+        v-infinite-scroll="requestMore3DData"
         :infinite-scroll-disabled="!hasMore3DData || isRequestingMore3DData"
       >
         <div class="table-body-row" v-for="(item,i) in scene3DList" :key="i">
@@ -189,7 +189,7 @@
         </div>
       </div>
       <!-- 无数据时的提示 -->
-      <div v-if="scene3DList.length === 0 && !hasMore3DData" class="no-data">
+      <div v-else class="no-data">
         <div v-if="latestUsedSearchKey">
           <img :src="require('@/assets/images/default/empty_04_search.png')" alt="">
           <span>{{'未搜索到结果~'}}</span>
@@ -467,21 +467,33 @@ export default {
         return item.status === 'SUCCESS'
       }).length
     },
+    imageListLocalLength() {
+      return this.imageList.length + this.uploadStatusListImage.length
+    },
     panoListRealLength() {
       return this.panoList.length + this.uploadStatusListPano.filter((item) => {
         return item.status === 'SUCCESS'
       }).length
     },
+    panoListLocalLength() {
+      return this.panoList.length + this.uploadStatusListPano.length
+    },
     audioListRealLength() {
       return this.audioList.length + this.uploadStatusListAudio.filter((item) => {
         return item.status === 'SUCCESS'
       }).length
     },
+    audioListLocalLength() {
+      return this.audioList.length + this.uploadStatusListAudio.length
+    },
     videoListRealLength() {
       return this.videoList.length + this.uploadStatusListVideo.filter((item) => {
         return item.status === 'SUCCESS'
       }).length
     },
+    videoListLocalLength() {
+      return this.videoList.length + this.uploadStatusListVideo.length
+    },
     needLongPolling() {
       return this.uploadStatusListPano.some((item) => {
         return item.status === 'LOADING' && item.ifKnowProgress === false

+ 1 - 0
packages/qjkankan-editor/src/framework/play/pano/index.vue

@@ -173,6 +173,7 @@ export default {
   width: 100%;
   height: 100%;
   position: relative;
+  overflow: hidden;
 
   #pano {
     width: 100%;

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

@@ -7,7 +7,6 @@
         :type="canSee ? 'text' : 'password'"
         placeholder="请输入访问密码,限20位"
         :maxlength="20"
-        oninput="value=value.replace(/[^\a-\z\A-\Z0-9\~!@#$%^&*]/g,'')"
         v-model="info.password"
         autocomplete="new-password"
         @keydown.enter="onInputEnter"
@@ -34,6 +33,14 @@ export default {
       info:'info'
     })
   },
+  watch: {
+    'info.password': {
+      handler(v) {
+        console.log(123);
+        this.info.password = v.replace(/[^\w]/g, '').replace(/_/g, '')
+      }
+    }
+  },
   methods: {
     onInputEnter(e) {
       e.target.blur()

+ 64 - 15
packages/qjkankan-editor/src/views/navigation/groupSettings.vue

@@ -111,6 +111,13 @@ export default {
       renameTarget.sceneTitle = newName
     },
     onDeleteScene(sceneId) {
+      if (this.info.scenes.length === 1) {
+        this.$alert({
+          title: '删除场景',
+          content: '请至少保留一个场景',
+        })
+        return
+      }
       const deleteTargetIdx = this.info.scenes.findIndex((item) => {
         return item.id === sceneId
       })
@@ -136,6 +143,57 @@ export default {
       }
     },
     onDeleteGroup(groupId, groupLevel) {
+      try {
+        if (
+          (groupLevel === 1 && this.info.catalogRoot.length === 1) ||
+          (groupLevel === 2 && this.info.catalogs.length === 1)
+        ) {
+          this.$alert({
+            content: "请至少保留一个分组",
+          })
+          return
+        }
+
+        if (groupLevel === 1 && this.info.catalogRoot.length !== 1) {
+          const targetGroupIdx = this.info.catalogRoot.findIndex((groupLevel1) => {
+            return groupLevel1.id === groupId
+          })
+          if (targetGroupIdx < 0) {
+            throw('没有找到要删除的一级分组!')
+          }
+          const groupLevel2List = this.info.catalogRoot[targetGroupIdx].children
+          // 检查是否所有场景都(间接)属于该一级分组
+          if (
+            this.info.scenes.every((scene) => {
+              return groupLevel2List.some(groupLevel2Id => {
+                return groupLevel2Id === scene.category
+              })
+            })
+          ) {
+            this.$alert({
+              content: "请至少保留一个场景",
+            })
+            return
+          }
+        }
+         
+        if (groupLevel === 2 && this.info.catalogs.length !== 1) {
+          // 检查是否所有场景都属于该二级分组
+          if (this.info.scenes.every((scene) => {
+            return scene.category === groupId
+          })) {
+            this.$alert({
+              content: "请至少保留一个场景",
+            })
+            return
+          }
+        }
+      } catch(e) {
+        console.error(e);
+        this.$msg.error('删除失败')
+        return
+      }
+
       const deleteGroupLevel2 = (groupId) => {
         // 要删除的二级分组在catalogRoot[x].children中的索引
         let targetGroupIdxLevel2 = null
@@ -191,15 +249,6 @@ export default {
       const backup = deepClone(this.info)
       try {
         if (groupLevel === 1) {
-          if (this.info.catalogRoot.length === 1) {
-            return this.$alert({
-              content: "请至少保留一个分组",
-              ok: () => {
-                return
-              },
-            })
-          }
-
           const targetGroupIdx = this.info.catalogRoot.findIndex((groupLevel1) => {
             return groupLevel1.id === groupId
           })
@@ -227,12 +276,12 @@ export default {
       }
     },
     delFirstScene(){
-        if (this.info.firstScene) {
-          let firIdx = this.info.scenes.find(item=>{
-            return item.sceneCode == this.info.firstScene.sceneCode
-          });
-          !firIdx&&(this.info.firstScene='')
-        }
+      if (this.info.firstScene) {
+        let firIdx = this.info.scenes.find(item=>{
+          return item.sceneCode == this.info.firstScene.sceneCode
+        });
+        !firIdx&&(this.info.firstScene='')
+      }
     },
   },
   mounted() {