tremble 4 лет назад
Родитель
Сommit
9751281261

+ 1 - 0
public/edit.html

@@ -9,6 +9,7 @@
     <link rel="stylesheet" href="<%= VUE_APP_STATIC_DIR %>/lib/iconfont/iconfont.css"/>
     <link rel="stylesheet" href="<%= VUE_APP_STATIC_DIR %>/lib/iconfontQJ/iconfont.css"/>
     <link rel="stylesheet" href="<%= VUE_APP_STATIC_DIR %>/lib/iconfontVR/iconfont.css"/>
+    <link rel="stylesheet" href="//at.alicdn.com/t/font_2410347_3sp3zd6hsff.css"/>
     <link rel="stylesheet" href="<%= VUE_APP_STATIC_DIR %>/lib/animate/animate.min.css"/>
     <link rel="stylesheet" href="<%= VUE_APP_STATIC_DIR %>/lib/mCustomScrollbar/jquery.mCustomScrollbar.min.css"/>
     <link rel="stylesheet" href="<%= VUE_APP_STATIC_DIR %>/lib/scrollbar/perfect-scrollbar.css"/>

+ 1 - 0
public/static/template/skin/vtourskin.xml

@@ -17,6 +17,7 @@
                    design_text_shadow="1"/> 
     <include url="%SWFPATH%/plugins/swipe_gallery.xml"/>
 	<include url="%SWFPATH%/plugins/showtext.xml" />
+    <autorotate enabled="false" waittime="1.0" speed="-3.0" horizon="0.0" tofov="120.0"/>
     <vtourskinxmlpath url="./"/>
     <include url="%SWFPATH%/plugins/tooltip.xml"/>
     <settings name="auto_thumbs" thumb_size="84" thumb_background_size="90" thumb_spacing="14" left="0" right="0"

+ 23 - 0
src/api/index.js

@@ -156,6 +156,29 @@ const URL_FILL =  config.urlFill
 }
 
 
+/**
+ * 重命名全景图
+ * @param {*} data 
+ * @param {*} ok 
+ * @param {*} no 
+ */
+ export function editPanoName(data, ok, no) {
+    return http.postJson(`${URL_FILL}/manage/scene/edit`, data, ok, no)
+}
+
+
+/**
+ * 重命名分组名称
+ * @param {*} data 
+ * @param {*} ok 
+ * @param {*} no 
+ */
+ export function editCatalogName(data, ok, no) {
+    return http.postJson(`${URL_FILL}/manage/catalog/edit`, data, ok, no)
+}
+
+
+
 
 /**
  * 保存初始画面

+ 1 - 0
src/assets/style/component.less

@@ -744,6 +744,7 @@ textarea:-ms-input-placeholder {
     font-size: 14px;
     margin: 20px;
     margin-bottom: 30px;
+    word-break: break-all;
   }
 }
 

+ 93 - 80
src/components/audio/index.vue

@@ -3,12 +3,12 @@
     <audio ref="audio">
       <source :src="myAudioUrl" type="audio/mp3" />
     </audio>
-     <div class="block" @click="myPlay">
-        <div :id="idleft" class="left"></div>
-        <div :id="idright" class="right"></div>
-        <div class="circle"></div>
-        <i class="iconfont iconbs_stop" :class="{'iconbs_play':myPlayTemp}"></i>
-      </div>
+    <div class="block" @click="myPlay">
+      <div :id="idleft" class="left"></div>
+      <div :id="idright" class="right"></div>
+      <div class="circle"></div>
+      <i class="iconfont iconbs_stop" :class="{ iconbs_play: myPlayTemp }"></i>
+    </div>
     <template v-if="showTime">
       <div class="audio-name">东澳海景介绍.mp3</div>
       <div class="audio-right">
@@ -25,81 +25,96 @@
 <script>
 export default {
   name: "myAudio",
-  props: ["myAudioUrl","showTime",'idleft','idright'],
+  props: ["myAudioUrl", "showTime", "idleft", "idright"],
   data() {
     return {
       audio: "",
       myPlayTemp: true,
-      progress: 0
+      progress: 0,
     };
   },
   mounted() {
     this.init();
   },
   methods: {
-    loadCircle(){
+    loadCircle() {
       let leftEl = document.querySelector(`#${this.idleft}`);
       let rightEl = document.querySelector(`#${this.idright}`);
       if (this.progress) {
-        if(this.progress > 0&&this.progress < 50) {
-            rightEl.style.transform = 'rotate(' + (3.6 * this.progress) + 'deg)'; 
-          } else {
-            rightEl.style.transform = 'rotate(0)';
-            rightEl.style.background = '#1FE4DC';
-            leftEl.style.transform = 'rotate(' + 3.6 * (this.progress - 50) + 'deg)';
-          }
-      }
-      else{
-            rightEl.style.transform = 'rotate(0deg)'; 
-            leftEl.style.transform =  'rotate(0deg)'; 
-            rightEl.style.background = '#333';
+        if (this.progress > 0 && this.progress < 50) {
+          rightEl.style.transform = "rotate(" + 3.6 * this.progress + "deg)";
+        } else {
+          rightEl.style.transform = "rotate(0)";
+          rightEl.style.background = "#1FE4DC";
+          leftEl.style.transform =
+            "rotate(" + 3.6 * (this.progress - 50) + "deg)";
+        }
+      } else {
+        rightEl.style.transform = "rotate(0deg)";
+        leftEl.style.transform = "rotate(0deg)";
+        rightEl.style.background = "#333";
       }
-
     },
     init() {
       this.audio = this.$refs.audio;
       this.audio.load();
       this.audio.pause();
       this.updateProgress();
+      this.$bus.on('pausedAudio',data=>{
+        if (this.audio == data) {
+          this.myPlayTemp = true;
+        }
+    })
     },
     // 点击播放/暂停图片时,控制音乐的播放与暂停
     myPlay() {
-      Array.from($('audio')).forEach(item => {
-        if (!item.paused) {
-         item.pause();
+      Array.from($("audio")).forEach((item) => {
+        if (this.audio != item) {
+          if (!item.paused) {
+            item.pause();
+            this.$bus.emit('pausedAudio',item)
+          }
         }
       });
 
-      if (this.audio.paused) {
-        // 开始播放当前点击的音频
-        this.audio.play();
-        this.myPlayTemp = false;
-      } else {
-        this.audio.pause();
-        this.myPlayTemp = true;
-      }
-      this.updateProgress();
+      setTimeout(() => {
+        if (this.audio.paused) {
+          // 开始播放当前点击的音频
+          this.audio.play();
+          this.myPlayTemp = false;
+        } else {
+          this.audio.pause();
+          this.myPlayTemp = true;
+        }
+        this.updateProgress();
+      });
     },
     // 更新进度条与当前播放时间
     updateProgress() {
       let value = this.audio.currentTime / this.audio.duration;
-      this.progress = value * 100
+      this.progress = value * 100;
       // 初始时间
-      this.$refs.audioCurTime && (this.$refs.audioCurTime.innerHTML = this.transTime(this.audio.currentTime))
+      this.$refs.audioCurTime &&
+        (this.$refs.audioCurTime.innerHTML = this.transTime(
+          this.audio.currentTime
+        ));
       // 总共时长
       let audioElement = new Audio(this.myAudioUrl);
-      this.loadCircle()
-      let self = this
+      this.loadCircle();
+      let self = this;
       audioElement.addEventListener("loadedmetadata", function () {
-        let duration2 = (audioElement.duration / 100).toFixed(2).replace('.',':');
-        self.$refs.duration&&(self.$refs.duration.innerHTML = self.formatTime(duration2))
+        let duration2 = (audioElement.duration / 100)
+          .toFixed(2)
+          .replace(".", ":");
+        self.$refs.duration &&
+          (self.$refs.duration.innerHTML = self.formatTime(duration2));
       });
     },
     // 播放结束时
     audioEnded() {
-      this.progress = 0
+      this.progress = 0;
       this.myPlayTemp = true;
-      this.loadCircle()
+      this.loadCircle();
     },
     // 播放时间换算
     transTime(value) {
@@ -137,31 +152,30 @@ export default {
         this.audio.currentTime = this.audio.duration * rate;
         this.updateProgress();
       }
-    }
+    },
   },
   watch: {
     audio: {
-      deep:true,
-      handler: function(newVal) {
-          console.log(newVal.paused);
-          let self = this;
-          self.audio.addEventListener(
-            "timeupdate",
-            function() {
-              self.updateProgress();
-            },
-            false
-          );
-          self.audio.addEventListener(
-            "ended",
-            function() {
-              self.audioEnded();
-            },
-            false
-          );
-        }
-    }
-  }
+      deep: true,
+      handler: function () {
+        let self = this;
+        self.audio.addEventListener(
+          "timeupdate",
+          function () {
+            self.updateProgress();
+          },
+          false
+        );
+        self.audio.addEventListener(
+          "ended",
+          function () {
+            self.audioEnded();
+          },
+          false
+        );
+      },
+    },
+  },
 };
 </script>
  
@@ -171,50 +185,49 @@ export default {
   margin-left: 4px;
   align-items: center;
 }
- 
-.audio-name{
-   font-size: 14px;
+
+.audio-name {
+  font-size: 14px;
 }
 
 .audio-right {
   width: 80%;
   height: 100%;
 }
- 
 
 .audio-time {
-  .hang{
+  .hang {
     display: inline-block;
     margin: 0 4px;
   }
 }
- 
+
 .audio-length-total {
   font-size: 12px;
 }
- 
+
 .audio-length-current {
   font-size: 12px;
 }
 
-@raduiW:26px;
-@pcolor:#333;
-@iconSize:10px;
-@rW:78%;
+@raduiW: 26px;
+@pcolor: #333;
+@iconSize: 10px;
+@rW: 78%;
 
 .block {
   position: relative;
   width: @raduiW;
   height: @raduiW;
-  background:#1FE4DC;
+  background: #1fe4dc;
   border-radius: 50%;
   cursor: pointer;
-  .iconfont{
+  .iconfont {
     top: 50%;
     left: 50%;
     right: unset;
     bottom: unset;
-    transform: translate(-50%,-50%);
+    transform: translate(-50%, -50%);
     font-size: @iconSize;
   }
 }
@@ -231,13 +244,13 @@ export default {
 .left {
   border-radius: 50%;
   background: @pcolor;
-  clip: rect(0, @raduiW/2, @raduiW, 0);
+  clip: rect(0, @raduiW / 2, @raduiW, 0);
 }
 
 .right {
   border-radius: 50%;
   background: @pcolor;
-  clip: rect(0, @raduiW, @raduiW, @raduiW/2);
+  clip: rect(0, @raduiW, @raduiW, @raduiW / 2);
 }
 
 .circle {

+ 6 - 1
src/components/tableSelect.vue

@@ -44,6 +44,9 @@
             <div v-if="sub.type=='image'" class="list-img">
               <img :src="item[sub.key]" alt="">
             </div>
+            <div class="audio" v-else-if="sub.type=='audio'" >
+              <v-audio :idleft="`_${$randomWord(true,8,8)}`" :idright="`_${$randomWord(true,8,8)}`" :myAudioUrl="item[sub.key]"></v-audio>
+          </div>
             <span v-else>{{item[sub.key]}}</span>
           </td>
         </tr>
@@ -78,6 +81,7 @@
 
 <script>
 import Paging from './paging'
+import vAudio from '@/components/audio'
 
 export default {
 props:{
@@ -119,7 +123,8 @@ props:{
   }
 },
   components:{
-    Paging
+    Paging,
+    vAudio
   },
   watch:{
     select(newVal){

+ 12 - 1
src/framework/Toolbar.vue

@@ -12,7 +12,7 @@
            :active="tabtowActive" :id="'subrand111'" :subId="'subrand111'">
         </tabList>
       <div class="pano-con clip-scroller">
-        <ul ref="clip">
+        <ul ref="clip" v-if="list.length>0">
           <li
             v-for="(item, i) in list"
             @click="activeItem = item"
@@ -33,6 +33,9 @@
             </div>
           </li>
         </ul>
+        <div class="no-record" v-else>
+          当前分组下暂无全景图
+        </div>
       </div>
     </div>
   </div>
@@ -226,6 +229,14 @@ export default {
       padding-right: 20px;
     }
   }
+
+  .no-record{
+    width: 100%;
+    height: 100%;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+  }
 }
 .unable {
   &::before {

+ 213 - 157
src/framework/show/index.vue

@@ -1,245 +1,301 @@
 <template>
   <div class="panocon">
-    <div id="pano"> </div>
+    <template v-if="showInfo">
+      <div id="pano"></div>
+      <div class="pano-logo" v-if="showInfo.logo && showInfo.isLogo">
+        <img :src="showInfo.logo" alt="" />
+      </div>
 
-    <div class="pano-logo" v-if="showInfo.logo&&showInfo.isLogo">
-      <img :src="showInfo.logo" alt="">
-    </div>
+      <div
+        class="oper-tips"
+        :class="{ hidetips: !showTips }"
+        v-if="showInfo.isRemind && showInfo.remindTime && !localRemind"
+      >
+        <img
+          :src="
+            showInfo.pcIcon ||
+            require('@/assets/images/default/show/img_tipspc_default.png')
+          "
+          alt=""
+        />
+      </div>
 
-    <div class="oper-tips" :class="{hidetips:!showTips}" v-if="showInfo.isRemind&&showInfo.remindTime">
-      <img :src="showInfo.pcIcon||require('@/assets/images/default/show/img_tipspc_default.png')" alt="">
-    </div>
+      <list v-if="canLoad" @select="handleSelect" :select="activeItem"></list>
+      <password
+        :bg="showInfo.icon"
+        :show="showPassword"
+        @submit="handlePassword"
+        @close="showPassword = false"
+      />
+      <popup :title="'简介'" :show="showIntro" @close="showIntro = false">
+        <div slot="content" class="introcon">
+          {{ showInfo.description || "暂无简介" }}
+        </div>
+      </popup>
 
-    <list v-if="canLoad" @select="handleSelect" :select="activeItem"></list>
-    <password :bg="showInfo.icon" :show='showPassword' @submit="handlePassword" @close="showPassword=false" />
-    <popup :title="'简介'" :show='showIntro' @close="showIntro=false" >
-      <div slot="content" class="introcon">
-        {{showInfo.description||'暂无简介'}}
-      </div>
-    </popup>
+      <preview
+        :item="currentHotspot"
+        :show="showPreview"
+        @close="showPreview = false"
+      />
 
-    <preview
-      :item="currentHotspot"
-      :show="showPreview"
-      @close="showPreview = false"
-    />
-    
-    <ul class="aside">
-      <li v-for="(item,i) in aside" :key="i">
-        <span @click="handleItem(item)">
-          <i class="iconfont" :class="item.icon"></i>
-        </span>
-      </li>
-    </ul>
+      <ul class="aside">
+        <li v-for="(item, i) in aside" :key="i">
+          <span @click="handleItem(item)">
+            <i class="iconfont" :class="item.icon"></i>
+          </span>
+        </li>
+      </ul>
+    </template>
+    <div class="hasDel" v-else>
+      <div>
+        <img :src="$noresult" alt="">
+        <p>作品已被删除</p>
+      </div>
+    </div>
   </div>
 </template>
 
 <script>
 import * as krfn from "@/core/index.js";
 import { getWebWorksInfo, checkPassword } from "@/api";
-import password from './popup/password'
-import preview from './popup/preview'
+import password from "./popup/password";
+import preview from "./popup/preview";
 
-import popup from './popup/'
+import popup from "./popup/";
 import { mapGetters } from "vuex";
 
-
 import list from "./list";
 
 let __krfn = krfn.default;
 
 export default {
-  components:{
-      list,
-      password,
-      popup,
-      preview
+  components: {
+    list,
+    password,
+    popup,
+    preview,
   },
   computed: {
     ...mapGetters({
-      showInfo:'showInfo',
-    })
+      showInfo: "showInfo",
+    }),
   },
-  data(){
+  data() {
     return {
-      showPreview:false,
-      showTips:true,
-      canLoad:false,
-      showPassword:false,
-      showIntro:false,
-      password:'',
-      activeItem:'',
-      someData:'',
-      currentHotspot:'',
-      list:[],
-      aside:[{
-        id:'about',
-        icon:'icontool_about'
-      },{
-        id:'vr',
-        icon:'icontool_vr'
-      },{
-        id:'full',
-        icon:'icontool_full',
-      }]
-    }
+      showPreview: false,
+      showTips: true,
+      canLoad: false,
+      showPassword: false,
+      showIntro: false,
+      localRemind: false,
+      password: "",
+      activeItem: "",
+      someData: "",
+      currentHotspot: "",
+      list: [],
+      aside: [
+        {
+          id: "about",
+          icon: "icontool_about",
+        },
+        {
+          id: "vr",
+          icon: "icontool_vr",
+        },
+        {
+          id: "full",
+          icon: "icontool_full",
+        },
+      ],
+    };
   },
-  methods:{
-    handleItem(data){
-      if (data.id=='about') {
-        this.showIntro = true
+  methods: {
+    handleItem(data) {
+      if (data.id == "about") {
+        this.showIntro = true;
       }
     },
-    handlePassword(data){
-      checkPassword({
-        password:data
-      },res=>{
-        if (res.code == 0) {
-          this.showPassword = false
-          this.canLoad = true
-        }
-        else{
-            return this.$alert({ content: '密码错误' })
+    handlePassword(data) {
+      checkPassword(
+        {
+          password: data,
+        },
+        (res) => {
+          if (res.code == 0) {
+            this.showPassword = false;
+            this.canLoad = true;
+          } else {
+            return this.$alert({ content: "密码错误" });
+          }
         }
-      })
+      );
     },
-    startLoad(){
-      this.canLoad = true
+    startLoad() {
+      this.canLoad = true;
     },
-    handleSelect(data){
-      this.activeItem = data
+    handleSelect(data) {
+      this.activeItem = data;
     },
-   
-    getSceneInfo(){
-      getWebWorksInfo({},data=>{
+
+    getSceneInfo() {
+      getWebWorksInfo({}, (data) => {
         this.$store.commit("SetShowInfo", data.data);
-      })
-    }
+      });
+    },
   },
-  watch:{
-    currentHotspot:{
-      deep:true,
-      handler:function (newVal) {
+  watch: {
+    currentHotspot: {
+      deep: true,
+      handler: function (newVal) {
         if (newVal) {
-          if (newVal.hotspotType=="link") {
-            window.open(newVal.hyperlink,'_blank')
-            return
+          if (newVal.hotspotType == "link") {
+            window.open(newVal.hyperlink, "_blank");
+            return;
           }
-          if (newVal.hotspotType=="scene") {
-            this.activeItem = newVal.secne
-            return
+          if (newVal.hotspotType == "scene") {
+            this.activeItem = newVal.secne;
+            return;
           }
-          this.showPreview = true
+          this.showPreview = true;
         }
+      },
+    },
+    canLoad(newVal) {
+      if (newVal) {
+        setTimeout(() => {
+          this.showTips = false;
+        }, this.showInfo.remindTime * 1000);
       }
     },
-    showInfo:{
-      deep:true,
-      immediate:true,
-      handler:function (newVal) {
+    showInfo: {
+      deep: true,
+      immediate: true,
+      handler: function (newVal) {
         if (newVal) {
-          setTimeout(() => {
-            this.showTips = false
-          }, this.showInfo.remindTime*1000);
-          newVal.isPassword?(this.showPassword = true):(this.startLoad())
+          if (localStorage.getItem("localRemind") == 1) {
+            this.localRemind = true;
+          } else {
+            if (newVal.isRemind) {
+              localStorage.setItem("localRemind", newVal.isRemind);
+            }
+          }
+          newVal.isPassword ? (this.showPassword = true) : this.startLoad();
+        } else {
+          console.log();
         }
-      }
+      },
     },
-    activeItem:{
+    activeItem: {
       handler(newVal) {
-        $('#pano').empty();
-        window.vrInitFn = ()=>{
-            var krpano = document.getElementById('krpanoSWFObject');
-            __krfn.utils.initHotspot(krpano,newVal&&newVal.someData,false);
-        }
-        window.vrViewFn = ()=>{
+        $("#pano").empty();
+        window.vrInitFn = () => {
+          var krpano = document.getElementById("krpanoSWFObject");
+          __krfn.utils.initHotspot(krpano, newVal && newVal.someData, false);
+        };
+        window.vrViewFn = () => {
           try {
-              let tmp = JSON.parse(newVal.initVisual)
-              var krpano = document.getElementById('krpanoSWFObject');
-              krpano.set('view.vlookat',tmp.vlookat);
-              krpano.set('view.hlookat',tmp.hlookat);
-            } catch (error) {
-              error
-            }
-        }
+            let tmp = JSON.parse(newVal.initVisual);
+            var krpano = document.getElementById("krpanoSWFObject");
+            krpano.set("view.vlookat", tmp.vlookat);
+            krpano.set("view.hlookat", tmp.hlookat);
+            krpano.set("autorotate.enabled", Boolean(this.showInfo.isAuto));
+          } catch (error) {
+            error;
+          }
+        };
         var settings = {
-          'events[skin_events].onxmlcomplete':'js(window.vrViewFn());',
-          'events[skin_events].onloadcomplete': 'js(window.vrInitFn());'
+          "events[skin_events].onxmlcomplete": "js(window.vrViewFn());",
+          "events[skin_events].onloadcomplete": "js(window.vrInitFn());",
         };
         if (newVal) {
-            removepano('#pano')
-            embedpano({
-              // xml: "%HTMLPATH%/static/template/tour.xml",
-              xml: `${this.$cdn}/720yun_fd_manage/${newVal.sceneCode}/vtour/tour.xml`,
-              swf: "%HTMLPATH%/static/template/tour.swf",
-              target: "pano",
-              html5: "auto",
-              mobilescale: 0.7,
-              vars:settings,
-              passQueryParameters: true,
-            });
-
+          removepano("#pano");
+          embedpano({
+            // xml: "%HTMLPATH%/static/template/tour.xml",
+            xml: `${this.$cdn}/720yun_fd_manage/${newVal.sceneCode}/vtour/tour.xml`,
+            swf: "%HTMLPATH%/static/template/tour.swf",
+            target: "pano",
+            html5: "auto",
+            mobilescale: 0.7,
+            vars: settings,
+            passQueryParameters: true,
+          });
         }
-       
-      }
-    }
+      },
+    },
   },
-  mounted(){
+  mounted() {
     window.__krfn = __krfn;
 
     this.$bus.on("clickHotspot", (data) => {
-      let someData = JSON.parse(this.activeItem.someData)
+      let someData = JSON.parse(this.activeItem.someData);
       let idx = someData.hotspots.findIndex((item) => item.name == data);
       this.currentHotspot = someData.hotspots[idx];
     });
-    this.getSceneInfo()
-
-    
-  }
-}
+    this.getSceneInfo();
+  },
+};
 </script>
 
 <style lang="less" scoped>
-.panocon{
+.panocon {
   width: 100%;
   height: 100%;
-  #pano{
+  .hasDel{
+    background: #fff;
+    width: 100%;
+    height: 100%;
+    position: relative;
+    >div{
+      position: absolute;
+      top: 50%;
+      left: 50%;
+      transform: translate(-50%,-50%);
+      color: #909090;
+      text-align: center;
+      font-size: 18px;
+      >p{
+        margin-top: 20px;
+      }
+    }
+  }
+  #pano {
     width: 100%;
     height: 100%;
   }
-  .pano-logo{
+  .pano-logo {
     position: absolute;
     top: 20px;
     left: 20px;
-    >img{
+    > img {
       max-width: 120px;
     }
   }
 
-  .oper-tips{
+  .oper-tips {
     position: absolute;
     top: 50%;
     left: 50%;
-    transform: translate(-50%,-50%);
+    transform: translate(-50%, -50%);
     transition: all 0.3s ease;
-    >img{
+    > img {
       max-width: 300px;
     }
   }
 
-  .hidetips{
+  .hidetips {
     display: none;
   }
 
-  .aside{
+  .aside {
     position: fixed;
     z-index: 999;
     right: 10px;
     top: 50%;
     transform: translateY(-50%);
-    >li{
+    > li {
       margin: 5px 0;
-      >span{
+      > span {
         width: 36px;
         height: 36px;
         display: inline-block;
@@ -249,16 +305,16 @@ export default {
         border-radius: 18px;
         position: relative;
         cursor: pointer;
-        >i{
+        > i {
           position: absolute;
           top: 50%;
           left: 50%;
-          transform: translate(-50%,-50%);
+          transform: translate(-50%, -50%);
         }
       }
     }
   }
-  .introcon{
+  .introcon {
     line-height: 20px;
   }
 }

+ 3 - 0
src/mixins/index.js

@@ -114,6 +114,9 @@ Vue.mixin({
                 instance.show = true
             })
         },
+        $isCacheId(id){
+          return String(id).indexOf("tmp") > -1
+        },
         $getStaticResource(url) {
             return config.getStaticResource(url)
         },

+ 1 - 1
src/views/base/EditPanel/opening.vue

@@ -57,7 +57,7 @@ export default {
         immediate:true,
         deep:true,
         handler:function (newVal) {
-          this.rang.value = newVal.remindTime || 0
+          this.rang.value = newVal.remindTime || 1
         }
       },
       select(newVal){

+ 2 - 2
src/views/base/EditPanel/password.vue

@@ -9,7 +9,7 @@
                 :type="cansee?'text':'password'"
                 class="ui-input"
                 placeholder="请输入访问密码,限20位"
-                :maxlength="15"
+                :maxlength="20"
                 v-model="info.password"
               />
             <i class="iconfont icon_eye" @click="cansee=!cansee" :class="{'iconedit_input_unvisible':!cansee}"></i>
@@ -33,7 +33,7 @@ export default {
     data(){
       return {
         password:'',
-        cansee:true
+        cansee:false
       }
     },
     methods:{

+ 46 - 0
src/views/hotspot/EditPanel.vue

@@ -123,6 +123,39 @@ import RangeItem from "@/components/rangeItem";
 import Combox from "@/components/shared/Combox";
 import { mapGetters } from "vuex";
 
+let HTMap = {
+  scene:{
+    key:'secne',
+    type:'Object',
+    errortxt:'请选择场景'
+  },
+  audio:{
+    key:'audio',
+    type:'String',
+    errortxt:'请选择音频'
+  },
+   video:{
+    key:'video',
+    type:'String',
+    errortxt:'请选择视频'
+  },
+   image:{
+    key:'image',
+    type:'Array',
+    errortxt:'请选择图片'
+  },
+  link:{
+    key:'hyperlink',
+    type:'String',
+    errortxt:'请输入超链接'
+  },
+  textarea:{
+    key:'textarea',
+    type:'String',
+    errortxt:'请输入文本'
+  }
+}
+
 export default {
   props: ['show','data','editTitle'],
   components:{
@@ -293,6 +326,19 @@ export default {
       krpano.set(`hotspot[${data.name}].url`,data.img)
     },
     save() {
+      let {img,hotspotTitle,hotspotType} = this.hotspot
+      let item = HTMap[hotspotType]
+    
+      if (!this.hotspot[item.key]||(item.type == 'Array'&&this.hotspot[item.key].length<=0)) {
+        return this.$alert({
+          content: `${item.errortxt}`,
+        });
+      }
+      if (!img||!hotspotTitle) {
+        return this.$alert({
+          content: "请完善热点信息",
+        });
+      }
       this.$store.commit("SetHotspot", this.hotspot);
       this.$emit("close");
       this.$emit("save",this.hotspot);

+ 5 - 1
src/views/hotspot/hotspotType/audio.vue

@@ -31,6 +31,7 @@
 <script>
 import { getMaterialList} from "@/api";
 import Table from "@/components/tableSelect";
+import { changeByteUnit } from '@/utils/file'
 
 export default {
   components:{Table},
@@ -81,7 +82,10 @@ export default {
           this.paging.pageNum = data.data.pageNum;
           this.paging.pageSize = data.data.pageSize;
           this.paging.total = data.data.total;
-          this.list =data.data.list
+          this.list = data.data.list.map(i=>{
+            i.fileSize = changeByteUnit(Number(i.fileSize))
+            return i
+          })
         }
       );
     },

+ 5 - 1
src/views/hotspot/hotspotType/image.vue

@@ -33,6 +33,7 @@
 <script>
 import { getMaterialList} from "@/api";
 import Table from "@/components/tableSelect";
+import { changeByteUnit } from '@/utils/file'
 
 export default {
   components:{Table},
@@ -84,7 +85,10 @@ export default {
           this.paging.pageNum = data.data.pageNum;
           this.paging.pageSize = data.data.pageSize;
           this.paging.total = data.data.total;
-          this.list =data.data.list
+          this.list = data.data.list.map(i=>{
+            i.fileSize = changeByteUnit(Number(i.fileSize))
+            return i
+          })
         }
       );
     },

+ 0 - 1
src/views/information/Setting.vue

@@ -97,7 +97,6 @@ export default {
       this.img = data ? data.icon :''
     })
     this.$bus.on('getInitScene',data=>{
-      
       this.img = data.icon
     })
   }

+ 5 - 7
src/views/information/Toolbar.vue

@@ -160,7 +160,6 @@ export default {
   },
   watch: {
     taboneActive: {
-      deep: true,
       handler: function (newVal) {
         if (newVal.children.length > 0) {
           this.tabtowActive = newVal.children[0];
@@ -177,7 +176,7 @@ export default {
             data: newVal,
           });
           if (newVal.children.length <= 0) {
-            String(newVal.id).indexOf("tmp") > -1
+            this.$isCacheId(newVal.id)
               ? this.$store.commit("SetVrList", [])
               : this.getTabSceneList(newVal.id);
           }
@@ -185,14 +184,13 @@ export default {
       },
     },
     tabtowActive: {
-      deep: true,
       handler: function (newVal) {
         this.$emit("catalog", {
           level: 2,
           data: newVal,
         });
         if (newVal) {
-          String(newVal.id).indexOf("tmp") > -1
+          this.$isCacheId(newVal.id)
             ? this.$store.commit("SetVrList", [])
             : this.getTabSceneList(newVal.id);
         }
@@ -256,7 +254,7 @@ export default {
       this.$confirm({
         content: "是否删除?",
         ok: () => {
-          if (String(item.id).indexOf("tmp") > -1) {
+          if (this.$isCacheId(item.id)) {
             if (type == "one") {
               let temp = this.temptablist.findIndex((ele) => {
                 return ele.id == item.id;
@@ -265,7 +263,7 @@ export default {
               this.$tips({ content: "删除成功", icon: "ok" });
             } else {
               let tempList =
-                String(this.taboneActive.id).indexOf("tmp") > -1
+                this.$isCacheId(this.taboneActive.id)
                   ? this.temptablist
                   : this.tablist;
               let parentIdx = tempList.findIndex((ele) => {
@@ -307,7 +305,7 @@ export default {
       this.getTabSceneList();
     });
     this.$bus.on("changeActive", (data) => {
-      console.log(data);
+      console.log('data',data);
       this.tablist.forEach((item) => {
         if (item.id == data.id) {
           this.taboneActive = item;

+ 50 - 37
src/views/information/index.vue

@@ -14,7 +14,7 @@
           <span>{{
             currentTabAtri.oper == "add"
               ? `新增${currentTabAtri.type == 1 ? "一" : "二"}级分组`
-              : "重命名"
+              : `重命名${currentTabAtri.type == 1 ? "一" : "二"}级分组`
           }}</span>
           <span @click="showAddGroup = false">
             <i class="iconfont icon_close"></i>
@@ -25,8 +25,8 @@
             <input
               class="ui-input"
               type="text"
-              maxlength="15"
-              placeholder="输入分组名,限15字"
+              maxlength="50"
+              placeholder="输入分组名,限50个字"
               v-model="currentTabAtri.name"
             />
           </div>
@@ -36,7 +36,7 @@
           <button class="ui-button cancel" @click="showAddGroup = false">
             取消
           </button>
-          <button :class="`ui-button submit`" @click="handleAddGroup()">
+          <button class="ui-button submit" :class="{disable:!currentTabAtri.name}" @click="handleAddGroup()">
             确定
           </button>
         </div>
@@ -67,7 +67,7 @@
           <button class="ui-button cancel" @click="showRename = false">
             取消
           </button>
-          <button :class="`ui-button submit`" @click="handleRename()">
+          <button class="ui-button submit" :class="{disable:!reNameItem.reName}" @click="handleRename()">
             确定
           </button>
         </div>
@@ -94,7 +94,12 @@
 import Setting from "./Setting";
 import Toolbar from "./Toolbar";
 import Popup from "@/components/shared/popup";
-import { getSceneList, getMaterialList } from "@/api";
+import {
+  getSceneList,
+  editPanoName,
+  editCatalogName,
+  getMaterialList,
+} from "@/api";
 import Table from "@/components/tableSelect";
 import { mapGetters } from "vuex";
 import { editTabName, savePanoToWorks } from "@/api";
@@ -177,15 +182,15 @@ export default {
       let catalog = this.activeCataLog;
       let catalog2 = this.activeCataLog2;
 
-      let cid = String(catalog.id).indexOf("tmp") > -1 ? null : catalog.id;
-      let cname = String(catalog.id).indexOf("tmp") > -1 ? catalog.name : null;
+      let cid = this.$isCacheId(catalog.id) ? null : catalog.id;
+      let cname = this.$isCacheId(catalog.id) ? catalog.name : null;
 
       let c2id =
         catalog2 &&
-        (String(catalog2.id).indexOf("tmp") > -1 ? null : catalog2.id);
+       (this.$isCacheId(catalog2.id) ? null : catalog2.id);
       let c2name =
         catalog2 &&
-        (String(catalog2.id).indexOf("tmp") > -1 ? catalog2.name : null);
+        (this.$isCacheId(catalog2.id) ? catalog2.name : null);
 
       let params = {
         catalogId: catalog2 ? c2id : cid,
@@ -249,16 +254,12 @@ export default {
       if (!this.reNameItem) {
         return this.$alert({ content: "请输入名字" });
       }
-      console.log(this.reNameItem);
-
-      // let temp =
-      savePanoToWorks(
-        [
-          {
-            id: this.reNameItem.id,
-            sceneTitle: this.reNameItem.reName,
-          },
-        ],
+
+      editPanoName(
+        {
+          id: this.reNameItem.id,
+          name: this.reNameItem.reName,
+        },
         () => {
           this.$tips({ content: "重命名成功", icon: "ok" });
           this.showRename = false;
@@ -276,11 +277,37 @@ export default {
       if (!this.currentTabAtri.name) {
         return this.$alert({ content: "请输入名字" });
       }
+
       let tmp = this.currentTabAtri.item;
 
+
+      if (this.currentTabAtri.oper == "edit") {
+        if (this.$isCacheId(tmp.id)) {
+          tmp.name= this.currentTabAtri.name
+          this.$tips({ content: "重命名成功", icon: "ok" });
+          this.showAddGroup = false;
+        }
+        else{
+          editCatalogName(
+            {
+              id: tmp.id,
+              name: this.currentTabAtri.name,
+            },
+            () => {
+              this.$tips({ content: "重命名成功", icon: "ok" });
+              this.showAddGroup = false;
+              this.$bus.emit("refresh");
+            }
+          );
+        }
+
+        return;
+      }
+
+
       let temp = {
         children: [],
-        id: "tmp" + Math.random(),
+        id: "tmp" + this.$randomWord(true,6,8),
         name: this.currentTabAtri.name,
         scenes: [],
       };
@@ -288,7 +315,7 @@ export default {
       if (this.currentTabAtri.type == 1) {
         this.temptablist.push(temp);
       } else {
-        if (String(tmp.parentId).indexOf("tmp") > -1) {
+        if (this.$isCacheId(tmp.parentId)) {
           this.temptablist.forEach((item) => {
             if (item.id == tmp.parentId) {
               item.children.push(temp);
@@ -310,8 +337,7 @@ export default {
                     this.$bus.emit("refresh");
                   }
                 );
-              }
-              else{
+              } else {
                 item.children.push(temp);
               }
             }
@@ -321,19 +347,6 @@ export default {
 
       this.$tips({ content: "操作成功", icon: "ok" });
       this.showAddGroup = false;
-
-      // editTabName(
-      //   {
-      //     id: tmp.id,
-      //     name: this.currentTabAtri.name,
-      //     parentId: tmp.parentId,
-      //   },
-      //   () => {
-      //     this.$tips({ content: "操作成功", icon: "ok" });
-      //     this.showAddGroup = false;
-      //     this.$bus.emit("refresh");
-      //   }
-      // );
     },
 
     onAddScene() {

+ 6 - 2
src/views/material/audio/index.vue

@@ -162,7 +162,6 @@ export default {
       ~index && this.uploadList.splice(index, 1)
     },
     del(item){
-      console.log(item);
       this.$confirm({
           content: "是否删除?",
           ok: () => {
@@ -181,6 +180,12 @@ export default {
           status:'上传中',
           name:item.name
         }
+        let tname= item.name.substring(0, item.name.lastIndexOf("."));
+         if (tname.length > 50) {
+          return this.$alert({
+              content: `“${item.name}”名称过长,请上传标题在50字以内的音频`
+            });
+        }
         this.uploadList.push(tmp)
         canUploadList.push(item)
       }
@@ -199,7 +204,6 @@ export default {
         p.length>0&&result.forEach(data => {
               let params = {}
               params['file'] = data.file
-              console.log('params',params);
               let promise = new Promise((resolve, reject) => {
                 uploadMaterial(params, TYPE, response => {
                   resolve(response);

+ 11 - 0
src/views/material/image/index.vue

@@ -182,6 +182,17 @@ export default {
           status:'上传中',
           name:item.name
         }
+        if (item.type.indexOf("jpeg") <= -1&&item.type.indexOf('png')<=-1) {
+          return this.$alert({
+              content: `“${item.name}”格式错误,请上传10MB以内、jpg/png格式的图片`
+          });
+        }
+        let tname= item.name.substring(0, item.name.lastIndexOf("."));
+         if (tname.length > 50) {
+          return this.$alert({
+              content: `“${item.name}”名称过长,请上传标题在50字以内的图片`
+            });
+        }
         this.uploadList.push(tmp)
         canUploadList.push(item)
       }

+ 11 - 2
src/views/material/pano/index.vue

@@ -146,7 +146,7 @@ import preview from "../popup/preview";
 import cover from "../popup/cover";
 import Paging from "../components/paging";
 import Upload from "@/components/shared/uploads/UploadMultiple";
-import { getImgWH } from "@/utils/file";
+import { getImgWH,changeByteUnit } from "@/utils/file";
 
 import {
   getMaterialList,
@@ -264,6 +264,12 @@ export default {
                     content: '请上传jpg格式的全景图'
                 });
         }
+        let tname= item.name.substring(0, item.name.lastIndexOf("."));
+         if (tname.length > 50) {
+          return this.$alert({
+              content: `“${item.name}”名称过长,请上传标题在50字以内的全景图片`
+            });
+        }
         this.uploadList.push(tmp);
         canUploadList.push(item);
       }
@@ -334,7 +340,10 @@ export default {
           type: TYPE,
         },
         (data) => {
-          this.list = data.data.list;
+          this.list = data.data.list.map(i=>{
+            i.fileSize = changeByteUnit(Number(i.fileSize))
+            return i
+          })
           this.paging.pageNum = data.data.pageNum;
           this.paging.pageSize = data.data.pageSize;
           this.paging.total = data.data.total;

+ 5 - 0
src/views/material/pano/pano.js

@@ -13,6 +13,11 @@ let data = [
     fontweight:'bold',
   },
   {
+    key: 'fileSize',
+    name: '大小',
+    en: '大小',
+  },
+  {
     key: 'createTime',
     name: '创建时间',
     en: '创建时间'

+ 11 - 0
src/views/material/video/index.vue

@@ -185,6 +185,17 @@ export default {
           status:'上传中',
           name:item.name
         }
+        if (item.type.indexOf("mp4") <= -1) {
+          return this.$alert({
+              content: `“${item.name}”格式错误,请上传200MB以内、mp4格式的视频`
+          });
+        }
+        let tname= item.name.substring(0, item.name.lastIndexOf("."));
+         if (tname.length > 50) {
+          return this.$alert({
+              content: `“${item.name}”名称过长,请上传标题在50字以内的视频`
+            });
+        }
         this.uploadList.push(tmp)
         canUploadList.push(item)
       }