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

编辑器-基础:删除冗余代码

任一存 3 лет назад
Родитель
Сommit
399f26fd21
3 измененных файлов с 20 добавлено и 261 удалено
  1. 0 10
      src/views/base/Setting.vue
  2. 20 246
      src/views/base/Toolbar.vue
  3. 0 5
      src/views/base/index.vue

+ 0 - 10
src/views/base/Setting.vue

@@ -1,10 +0,0 @@
-<template>
-  <!-- 编辑器-基础-右侧栏 -->
-  <ul class="view-setting" app-border dir-left></ul>  
-</template>
-
-<script>
-export default {
-  name: "baseSetting"
-}
-</script>

+ 20 - 246
src/views/base/Toolbar.vue

@@ -9,16 +9,6 @@
             <img :src="info.icon || require('@/assets/images/default/img_cover_default_2.png')" alt="" />
             <button class="ui-button submit setting-cover-btn" @click="onClickSettingCover">设置封面</button>
           </div>
-          <!-- <div class="upload-btn">
-            <button class="ui-button submit" @click="selectHandle('image')">选择图片</button>
-            <button class="ui-button submit" @click="addScene">全景封面
-              <div>
-                <div class="remark">
-                  选择全景图封面做为作品封面
-                </div>
-              </div>
-            </button>
-          </div> -->
           <div class="ui-remark">512*512px,支持jpg/png格式</div>
         </div>
         <div class="uc-r">
@@ -77,34 +67,12 @@
         @submit="handleSubmitFromTable2"
       />
     </div>
-
-    <div class="dialog" style="z-index: 2000" v-if="isShowSelect">
-      <Table
-        :list="list"
-        :tabHeader="$MAPTABLEHEADER[type]"
-        @updateList="updateList"
-        @cancle="isShowSelect = false"
-        title="选择素材"
-        @changeCurrent="changeCurrent"
-        :paging="paging"
-        :hideAll="true"
-        @submit="handleSelect"
-      />
-    </div>
-
-    <div class="dialog" style="z-index: 2000" v-if="isShowScene">
-      <Select
-        @cancle="isShowScene = false"
-        :title="'选择素材'"
-        @submit="handleSelect"
-      >
-      </Select>
-    </div>
   </div>
 </template>
 
 <script>
-import { getMaterialList} from "@/api";
+import { mapGetters } from "vuex";
+import Table2 from "@/components/tableSelect2";
 import OpeningTipSettings from '@/views/base/openingTipSettings.vue'
 import OpeningAnimationSettings from '@/views/base/openingAnimationSettings.vue'
 import PasswordSettings from "@/views/base/passwordSettings.vue";
@@ -113,18 +81,10 @@ import BackgroundMusicSettings from "@/views/base/backgroundMusicSettings.vue";
 import CustomLogoSettings from "@/views/base/customLogoSettings.vue";
 import CustomMaskSettings from "@/views/base/customMaskSettings.vue";
 import CustomButtonSettings from "@/views/base/customButtonSettings.vue";
-import Table from "@/components/tableSelect";
-import Table2 from "@/components/tableSelect2";
-import Select from "@/components/select";
-import { changeByteUnit } from '@/utils/file'
-
-import { mapGetters } from "vuex";
 
 export default {
   components: {
-    Table,
     Table2,
-    Select,
     OpeningTipSettings,
     OpeningAnimationSettings,
     PasswordSettings,
@@ -136,36 +96,7 @@ export default {
   },
   data() {
     return {
-      type:'',
-      settings:[{
-        name:"开场提示",
-        id:"opening"
-      },{
-        name:"自定义LOGO",
-        id:"logo"
-      },{
-        name:"访问密码",
-        id:"password"
-      },{
-        name:"自动巡游",
-        id:"xy"
-      }],
-      dataURL: "",
-      isShowScene:false, // 显示全景图片选择窗口
-      isShowSelect:false, // 显示普通图片选择窗口
       isShowSettingCoverWindow: false,
-      list:[],
-      key:'',
-      clickFrom:'', // 来自“选择图片”:base。来自“全景封面”:scene。来自右侧的“选择图片”:editPanel
-      paging: {
-        pageSize: 8,
-        pageNum: 1,
-        total: 0,
-        showSize: 4,
-        current: 1
-      },
-      select:'',
-
       tabs: [
         '开场提示',
         '开场动画',
@@ -177,11 +108,11 @@ export default {
         '自定义按钮',
       ],
       activeTab: '开场提示',
-    };
-   },
+    }
+  },
   computed: {
     ...mapGetters({
-      info:'info'
+      info: 'info'
     }),
     titleLength() {
       return this.info?.name?.length || '0'
@@ -190,78 +121,14 @@ export default {
       return this.info?.description?.length || '0'
     },
   },
-  mounted(){
-
+  mounted() {
   },
-  watch:{
-    "paging.pageNum": function () {
-      this.isShowSelect && this.getMaterialListProxy();
-    },
-    isShowSelect(newVal){
-      if (!newVal) {
-        this.paging.pageNum = 1
-        this.key = ''
-      }
-    }
+  watch: {
   },
   methods: {
-    addScene(){
-      this.clickFrom = 'scene'
-      this.isShowScene = true
-    },
-    changeCurrent(data){
-      this.paging.pageNum = data;
-    },
-    updateList(data) {
-      this.key = data;
-      this.getMaterialListProxy();
-    },
-    handleSelect(data){
-      if (this.clickFrom == 'scene') {
-        this.info.icon = data.icon
-        this.isShowScene = false
-      } else {
-        this.clickFrom == 'editpanel'?  this.select = data[0].icon :this.info.icon = data[0].icon
-        this.isShowSelect = false
-      }
-      setTimeout(() => {
-        this.select = ''
-      });
-    },
-    getMaterialListProxy() {
-      getMaterialList(
-        {
-          pageNum: this.paging.pageNum,
-          pageSize: this.paging.pageSize,
-          searchKey: this.key,
-          type:this.type
-        },
-        (data) => {
-          this.paging.pageNum = data.data.pageNum;
-          this.paging.pageSize = data.data.pageSize;
-          this.paging.total = data.data.total;
-
-          this.list = data.data.list.map(i=>{
-            i.isUse = i.fileSize>600 ?'1':'0'
-            i.fileSize = changeByteUnit(Number(i.fileSize))
-            i.createTime = i.createTime.substring(0,i.createTime.length-3)
-            i.updateTime = i.updateTime.substring(0,i.updateTime.length-3)
-            return i
-          })
-
-        }
-      );
-    },
     onClickSettingCover() {
       this.isShowSettingCoverWindow = true
     },
-    // 点击各种选择素材按钮后调用这个
-    selectHandle(type, from='base'){
-      this.clickFrom = from
-      this.type = type
-      this.isShowSelect = true
-      this.getMaterialListProxy()
-    },
     handleSubmitFromTable2(selected) {
       this.info.icon = selected[0].icon
       this.isShowSettingCoverWindow = false
@@ -271,7 +138,6 @@ export default {
 </script>
 
 <style lang="less" scoped>
-
 .main {
   position: fixed;
   width: 930px;
@@ -283,6 +149,19 @@ export default {
   display: flex;
   margin-bottom: 30px;
   .uc-l {
+    .preview {
+      overflow: hidden;
+      position: relative;
+      img {
+        height: 100%;
+      }
+      .setting-cover-btn {
+        position: absolute;
+        left: 50%;
+        transform: translateX(-50%);
+        bottom: 16px;
+      }
+    }
     .ui-remark{
       margin-top: 16px;
     }
@@ -356,111 +235,6 @@ export default {
   }
 }
 
-
-/* 
-.upload-btn {
-  display: flex;
-  width: 216px;
-  justify-content: space-between;
-  align-items: center;
-  margin-top: 15px;
-  .ui-button {
-    width: 48%;
-    min-width: 64px;
-    position: relative;
-    &:hover {
-    > div {
-        display: block;
-      }
-    }
-    > div {
-        cursor: default;
-        padding: 0 10px;
-        display: none;
-        z-index: 10000;
-        position: absolute;
-        left: 50%;
-        transform: translateX(-50%);
-        top: -46px;
-        background: rgba(0, 0, 0, 0.8); 
-        border-radius: 5px;
-        color: #fff;
-        pointer-events: none;
-        &::before{
-          border: 10px solid transparent;
-          border-top: 10px solid rgba(0, 0, 0, 0.8);
-          width: 0;
-          height: 0px;
-          content: "";
-          display: inline-block;
-          position: absolute;
-          bottom: -20px;
-          left: 50%;
-          transform: translateX(-50%);
-        }
-      .remark {
-          line-height: 2.5;
-      }
-    }
-  }
-}
- */
-.guide {
-  cursor: pointer;
-  position: relative;
-  &:hover {
-    > div {
-      display: block;
-    }
-  }
-  i {
-    color: #ababab;
-  }
-  > div {
-    cursor: default;
-    padding: 10px 18px;
-    display: none;
-    z-index: 10000;
-    position: fixed;
-    right: 0;
-    top: -90px;
-    width: 500px;
-    background: #161a1a;
-    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
-    border-radius: 5px;
-    overflow: hidden;
-    color: rgba(255, 255, 255, 0.5);
-    .remark {
-      line-height: 2.5;
-    }
-
-    .strong {
-      color: #fff;
-    }
-
-    .line {
-      width: 100%;
-      height: 1px;
-      background: rgba(255, 255, 255, 0.16);
-      margin: 10px 0;
-    }
-  }
-}
-
-.preview {
-  overflow: hidden;
-  position: relative;
-  img {
-    height: 100%;
-  }
-  .setting-cover-btn {
-    position: absolute;
-    left: 50%;
-    transform: translateX(-50%);
-    bottom: 16px;
-  }
-}
-
 menu {
   display: inline-block;
   width: 133px;

+ 0 - 5
src/views/base/index.vue

@@ -1,22 +1,17 @@
 <template>
   <!-- 编辑器-基础 -->
   <div>
-    <!-- 右侧 -->
-    <setting></setting>
-    <!-- 中间 -->
     <toolbar v-if="info"></toolbar>
   </div>
 </template>
 
 <script>
-import Setting from "./Setting";
 import Toolbar from "./Toolbar";
 import { mapGetters } from "vuex";
 
 export default {
   name: "EditorBase",
   components: {
-    Setting,
     Toolbar
   },
   computed: {