瀏覽代碼

我的历史测试UI绘制

曹冬冬 5 年之前
父節點
當前提交
139437efdd

文件差異過大導致無法顯示
+ 212 - 197
src/components/Element/audio.vue


+ 147 - 142
src/components/HeaderEdit.vue

@@ -1,39 +1,27 @@
 <template>
   <header class="header">
-    <button class="reset-btn"
-            @click="goback"><i class="el-icon-arrow-left"></i>返回作品</button>
+    <button class="reset-btn" @click="goback"><i class="el-icon-arrow-left"></i>返回作品</button>
     <div class="next_return">
       <span class="return" title="撤销" @click="revocation" :style="`opacity:${operationList.length>1?'1':'.3'}`"></span>
       <span class="next" title="恢复" @click="recover" :style="`opacity:${nextList.length>0?'1':'.3'}`"></span>
-
-
     </div>
-
-    <el-button @click="grid"
-               class="preview "
-               type="primary"
-               style="margin-left: 50px;">网格参考线</el-button>
-
-
+    <el-button @click="grid" class="preview " type="primary" style="margin-left: 50px;">网格参考线</el-button>
     <div class="right-panel">
-      <el-button @click="deploy"
-                 class="preview"
-                 type="primary"
-                 :loading="loading">预览</el-button>
+      <el-button @click="deploy" class="preview" type="primary" :loading="loading">预览</el-button>
       <!--<el-button @click="psd"-->
-                 <!--class="preview"-->
-                 <!--type="primary"-->
-                 <!--:loading="loading" style="margin-right: 20px">PSD导入</el-button>-->
+      <!--class="preview"-->
+      <!--type="primary"-->
+      <!--:loading="loading" style="margin-right: 20px">PSD导入</el-button>-->
       <!--<el-upload-->
-        <!--class="upload-demo"-->
-        <!--:action="`${appConst}/api/pages/psd`"-->
-        <!--accept="A/.psd"-->
-        <!--:on-change="uploadFn">-->
-        <!--<el-button size="small" type="primary">psd文件导入</el-button>-->
-        <!--<div slot="tip" class="el-upload__tip">只能上传psd文件</div>-->
+      <!--class="upload-demo"-->
+      <!--:action="`${appConst}/api/pages/psd`"-->
+      <!--accept="A/.psd"-->
+      <!--:on-change="uploadFn">-->
+      <!--<el-button size="small" type="primary">psd文件导入</el-button>-->
+      <!--<div slot="tip" class="el-upload__tip">只能上传psd文件</div>-->
       <!--</el-upload>-->
       <form id="upload" enctype='multipart/form-data'>
-        <input type="hidden" id="itemId"/>
+        <input type="hidden" id="itemId" />
         <input type="file" id="psdFile" name="image" @change="uploadFn">
 
       </form>
@@ -42,29 +30,29 @@
 </template>
 
 <script>
-import tools from '../util/tools'
-import api from '../api/editor'
-var time=null
+import tools from "../util/tools";
+import api from "../api/editor";
+var time = null;
 export default {
   props: {
     goback: Function
   },
-  data () {
+  data() {
     return {
       loading: false,
-      operationList:[],
-      nextList:[]
-    }
+      operationList: [],
+      nextList: []
+    };
   },
-  beforeCreate(){
-    window.revocationFlag=false
+  beforeCreate() {
+    window.revocationFlag = false;
   },
-  destroyed(){
-    this.operationList=[];
-    this.nextList=[];
+  destroyed() {
+    this.operationList = [];
+    this.nextList = [];
   },
-  mounted:function(){
-    var that=this;
+  mounted: function() {
+    var that = this;
     /*var fn=function(e) {
       if (90 == e.keyCode && e.ctrlKey)
       {
@@ -78,110 +66,128 @@ export default {
     document.removeEventListener("keydown",fn)
     document.addEventListener("keydown",fn)*/
   },
-  computed:{
-    obj:function () {
-      return JSON.stringify(this.$store.state.editor.editorPage)
+  computed: {
+    obj: function() {
+      return JSON.stringify(this.$store.state.editor.editorPage);
     },
-    operationFlag:function () {
-      return this.$store.state.user.operationFlag
+    operationFlag: function() {
+      return this.$store.state.user.operationFlag;
     }
   },
-  watch:{
-    obj:function (v) {
-      var that=this;
-      if(!revocationFlag){
-        if(that.operationList.length==0){
+  watch: {
+    obj: function(v) {
+      var that = this;
+      if (!revocationFlag) {
+        if (that.operationList.length == 0) {
           that.operationList.push(v);
         }
-        return
+        return;
       }
-      window.hasSaveFlag=false;
-      clearTimeout(time)
-      time=setTimeout(function () {
-        if(that.operationFlag){
-          that.nextList=[];
+      window.hasSaveFlag = false;
+      clearTimeout(time);
+      time = setTimeout(function() {
+        if (that.operationFlag) {
+          that.nextList = [];
           that.operationList.push(v);
         }
-      },500)
+      }, 500);
     }
   },
   methods: {
     notempty(arrays) {
-      for(var i=0; i<arrays.length; i++){
-        if(arrays[i] == "" || arrays[i] == null || typeof(arrays[i]) == "undefined"){
-          arrays.splice(i,1);
+      for (var i = 0; i < arrays.length; i++) {
+        if (
+          arrays[i] == "" ||
+          arrays[i] == null ||
+          typeof arrays[i] == "undefined"
+        ) {
+          arrays.splice(i, 1);
           i--;
-        }else {
-          this.$store.dispatch("addElement",arrays[i])
+        } else {
+          this.$store.dispatch("addElement", arrays[i]);
         }
       }
       return arrays;
     },
-    uploadFn(e){
-      var that=this;
-      var form = document.getElementById('upload'),
-      formData = new FormData(form);
-      document.getElementById('itemId').innerText = this.$route.query.itemId
+    uploadFn(e) {
+      var that = this;
+      var form = document.getElementById("upload"),
+        formData = new FormData(form);
+      document.getElementById("itemId").innerText = this.$route.query.itemId;
       // this.$store.dispatch('uploadPsd', formData)
       const loading = this.$loading({
         lock: true,
-        text: 'psd解析中...',
-        spinner: 'el-icon-loading',
-        background: 'rgba(0, 0, 0, 0.7)'
+        text: "psd解析中...",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)"
       });
       try {
-        api.uploadPsd(formData).then(function (res) {
-          loading.close()
-          var res=res;
-          that.$store.state.editor.editorPage.elements=[];
-          that.notempty(res['pages'][0].elements)
-          // that.$store.state.editor.editorPage.elements=res['pages'][0].elements
-          that.$store.state.editor.editorTheme.title=res['title']
-          that.$store.state.editor.editorTheme.description=res['description']
-          that.$store.state.editor.editorTheme.canvasHeight=Number(res['canvasHeight'])
-          that.$store.state.editor.editorTheme.canvasWidth=res['canvasWidth']
-        }).catch(function(err){
-          loading.close()
-          that.$message.error("psd文件解析失败")
-        })
-      }catch (e) {
-        loading.close()
-        that.$message.error("psd文件解析失败")
+        api
+          .uploadPsd(formData)
+          .then(function(res) {
+            loading.close();
+            var res = res;
+            that.$store.state.editor.editorPage.elements = [];
+            that.notempty(res["pages"][0].elements);
+            // that.$store.state.editor.editorPage.elements=res['pages'][0].elements
+            that.$store.state.editor.editorTheme.title = res["title"];
+            that.$store.state.editor.editorTheme.description =
+              res["description"];
+            that.$store.state.editor.editorTheme.canvasHeight = Number(
+              res["canvasHeight"]
+            );
+            that.$store.state.editor.editorTheme.canvasWidth =
+              res["canvasWidth"];
+          })
+          .catch(function(err) {
+            loading.close();
+            that.$message.error("psd文件解析失败");
+          });
+      } catch (e) {
+        loading.close();
+        that.$message.error("psd文件解析失败");
       }
       form.reset();
     },
-    revocation(){
-      if(this.operationList.length<2){
+    // 撤销
+    revocation() {
+      if (this.operationList.length < 2) {
         return false;
       }
-      if(!revocationFlag){
+      if (!revocationFlag) {
         return false;
       }
-      revocationFlag=false
-        var str=this.operationList.splice(this.operationList.length-1,1)
-        this.nextList.push(str[0])
-      this.$store.state.editor.editorPage.elements=JSON.parse(this.operationList[this.operationList.length-1]).elements
-      setTimeout(function () {
-        revocationFlag=true
-      },400)
-
-    },//撤销
-    recover(){
-      if(this.nextList.length==0){
+      revocationFlag = false;
+      var str = this.operationList.splice(this.operationList.length - 1, 1);
+      this.nextList.push(str[0]);
+      this.$store.state.editor.editorPage.elements = JSON.parse(
+        this.operationList[this.operationList.length - 1]
+      ).elements;
+      setTimeout(function() {
+        revocationFlag = true;
+      }, 400);
+    }, //撤销
+    // 恢复
+    recover() {
+      if (this.nextList.length == 0) {
         return false;
       }
-      if(!revocationFlag){
+      if (!revocationFlag) {
         return false;
       }
-      revocationFlag=false
-      this.$store.state.editor.editorPage.elements=JSON.parse(this.nextList[this.nextList.length-1]).elements
-      this.operationList.push(this.nextList.splice(this.nextList.length-1,1)[0])
-      setTimeout(function () {
-        revocationFlag=true
-      },400)
-
-    },//恢复
-    deploy () {
+      revocationFlag = false;
+      this.$store.state.editor.editorPage.elements = JSON.parse(
+        this.nextList[this.nextList.length - 1]
+      ).elements;
+      this.operationList.push(
+        this.nextList.splice(this.nextList.length - 1, 1)[0]
+      );
+      setTimeout(function() {
+        revocationFlag = true;
+      }, 400);
+    }, //恢复
+    // 预览
+    deploy() {
       // this.loading = true
       /*this.$store.dispatch('saveTheme', tools.vue2json(this.$store.state.editor.editorTheme)).then(() => {
         // setTimeout(() => {
@@ -192,44 +198,42 @@ export default {
         this.loading = false
       })*/
 
-
       if (!window.hasSaveFlag) {
-        this.$confirm('您确定不保存直接预览吗?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          window.hasSaveFlag = false;
-          this.$emit('saveThemeSuccess')
-        }).catch(() => {
-
+        this.$confirm("您确定不保存直接预览吗?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
         })
+          .then(() => {
+            window.hasSaveFlag = false;
+            this.$emit("saveThemeSuccess");
+          })
+          .catch(() => {});
       } else {
-        this.$emit('saveThemeSuccess')
+        this.$emit("saveThemeSuccess");
       }
-
     },
-    grid(){
+    grid() {
       //网格
       if (!this.$store.state.editor.gridTempField) {
         this.$store.state.editor.gridTempField = true;
       } else {
-        this.$store.state.editor.gridTempField  = false;
+        this.$store.state.editor.gridTempField = false;
       }
     },
-    psd(){
-      var that=this;
-      axios.get("../../static/json.json").then(function (res) {
-        var res=res.data;
-        that.$store.state.editor.editorTheme.title=res['title']
-        that.$store.state.editor.editorTheme.description=res['description']
-        that.$store.state.editor.editorTheme.canvasHeight=res['canvasHeight']
-        that.$store.state.editor.editorTheme.canvasWidth=res['canvasWidth']
-        that.$store.state.editor.editorPage.elements=res['pages'][0].elements
-      })
+    psd() {
+      var that = this;
+      axios.get("../../static/json.json").then(function(res) {
+        var res = res.data;
+        that.$store.state.editor.editorTheme.title = res["title"];
+        that.$store.state.editor.editorTheme.description = res["description"];
+        that.$store.state.editor.editorTheme.canvasHeight = res["canvasHeight"];
+        that.$store.state.editor.editorTheme.canvasWidth = res["canvasWidth"];
+        that.$store.state.editor.editorPage.elements = res["pages"][0].elements;
+      });
     }
   }
-}
+};
 </script>
 
 <style lang="less" scoped>
@@ -254,21 +258,22 @@ export default {
     padding-right: 15px;
     flex-direction: row-reverse;
   }
-  .next_return{
+  .next_return {
     display: inline-block;
     margin-left: 33%;
-    span{
+    span {
       display: inline-block;
       width: 30px;
       height: 24px;
-
     }
-    .return{
-      background: url("../../static/img/button_return.png") no-repeat center center /100% 100%;
+    .return {
+      background: url("../../static/img/button_return.png") no-repeat center
+        center / 100% 100%;
     }
-    .next{
+    .next {
       margin-left: 50px;
-      background: url("../../static/img/button_next.png") no-repeat center center /100% 100%;
+      background: url("../../static/img/button_next.png") no-repeat center
+        center / 100% 100%;
     }
   }
 }

文件差異過大導致無法顯示
+ 246 - 200
src/components/Page.vue


+ 39 - 39
src/routers.js

@@ -4,47 +4,47 @@
 import Vue from 'vue'
 import Router from 'vue-router'
 Vue.use(Router)
-const router =new Router({
-    routes:[{
-      path: '/',
-      name: 'index',
-      component: require('./views/h5editor/themeList.vue')
-    }, {
-      path: '/login',
-      name: 'login',
-      component: require('./views/user/login')
-    }, {
-      path: '/register',
-      name: 'register',
-      component: require('./views/user/register')
-    }, {
-      path: '/h5editor',
-      name: 'h5editor',
-      component: require('./views/h5editor/index.vue')
-    }, {
-      path: '/spaeditor',
-      name: 'spaeditor',
-      component: require('./views/spaeditor/index.vue')
-    }, {
-      path: '/themeList',
-      name: 'themeList',
-      component: require('./views/h5editor/themeList.vue')
-    }, {
-      path: '/spaList',
-      name: 'spaList',
-      component: require('./views/spaeditor/themeList.vue')
-    }, {
-      path: '/about',
-      name: 'about',
-      component: require('./views/user/about.vue')
-    }]
-  })
-router.beforeEach((to, from, next)=> {
-  if((from.name=='spaeditor'||from.name=='h5editor')&&!window.hasSaveFlag){
-    if(window.confirm('请确保已经将修改的内容保存,否则页面将丢失。是否确认退出编辑?')){
+const router = new Router({
+  routes: [{
+    path: '/',
+    name: 'myHistoryTest',
+    component: require('./views/myHistoryTest/myHistoryTest.vue')
+  }, {
+    path: '/login',
+    name: 'login',
+    component: require('./views/user/login')
+  }, {
+    path: '/register',
+    name: 'register',
+    component: require('./views/user/register')
+  }, {
+    path: '/h5editor',
+    name: 'h5editor',
+    component: require('./views/h5editor/index.vue')
+  }, {
+    path: '/spaeditor',
+    name: 'spaeditor',
+    component: require('./views/spaeditor/index.vue')
+  }, {
+    path: '/themeList',
+    name: 'themeList',
+    component: require('./views/h5editor/themeList.vue')
+  }, {
+    path: '/spaList',
+    name: 'spaList',
+    component: require('./views/spaeditor/themeList.vue')
+  }, {
+    path: '/about',
+    name: 'about',
+    component: require('./views/user/about.vue')
+  }]
+})
+router.beforeEach((to, from, next) => {
+  if ((from.name == 'spaeditor' || from.name == 'h5editor') && !window.hasSaveFlag) {
+    if (window.confirm('请确保已经将修改的内容保存,否则页面将丢失。是否确认退出编辑?')) {
       next()
     }
-  }else {
+  } else {
     next()
   }
 })

文件差異過大導致無法顯示
+ 800 - 745
src/views/h5editor/index.vue


+ 240 - 213
src/views/h5editor/overview.vue

@@ -1,14 +1,19 @@
 <template>
   <div class="overview">
+    <!-- 顶部tag -->
     <div class="clearfix">
       <span class="panel" :class="{ active: viewState === 0 }" @click="function () { viewState = 0 }">页面</span>
       <span class="panel" :class="{ active: viewState === 1 }" @click="function () { viewState = 1 }">图层</span>
     </div>
+    <!-- 页面 -->
     <ul class="list custom-scrollbar" style="z-index: 1;">
       <li v-for="(page,index) in pages">
-        <div class="page" :class="{ active: page === editingPage }" :style="{ width: 131 + 8 + 'px', height: (131 / canvasWidth) * canvasHeight + 34 + 'px' }" @click="setEditingPage(page,index)">
+        <div class="page" :class="{ active: page === editingPage }"
+          :style="{ width: 131 + 8 + 'px', height: (131 / canvasWidth) * canvasHeight + 34 + 'px' }"
+          @click="setEditingPage(page,index)">
           <Page :isOverView="true" class="content" :hideFoot="index == (pages.length-1)?false:true"
-                :style="{ width: canvasWidth + 'px', height: canvasHeight + 'px', transform: 'scale(' + 131 / canvasWidth +')',backgroundColor: bodyBackgroundColor }" :elements="page.elements" type="see" />
+            :style="{ width: canvasWidth + 'px', height: canvasHeight + 'px', transform: 'scale(' + 131 / canvasWidth +')',backgroundColor: bodyBackgroundColor }"
+            :elements="page.elements" type="see" />
           <div class="icons clearfix">
             <i class="icon el-icon-delete" @click="delPage(page)" v-show="index"></i>
             <i class="icon el-icon-document" @click="copyPage(page)"></i>
@@ -16,254 +21,276 @@
         </div>
       </li>
     </ul>
-    <div class="list custom-scrollbar" style="z-index: 2;" v-show="viewState === 1" :class="{ dragging: dragState === 1 }">
+    <!-- 图层 -->
+    <div class="list custom-scrollbar" style="z-index: 2;" v-show="viewState === 1"
+      :class="{ dragging: dragState === 1 }">
       <ul>
         <li v-for="layer in layersNoBg">
-          <div class="layer" :class="{ active: editingLayer === layer}" @click="setEditingLayer($event, layer)" @mousedown="moveLayer">
+          <div class="layer" :class="{ active: editingLayer === layer}" @click="setEditingLayer($event, layer)"
+            @mousedown="moveLayer">
             <span class="thumb" :style="{ backgroundImage: 'url(' + layer.imgSrc + ')' }"></span>{{ layer.type }}
           </div>
         </li>
       </ul>
-      <div v-for="layer in layersBg" class="layer" :class="{ active: editingLayer === layer}" @click="setEditingLayer($event, layer)">
+      <div v-for="layer in layersBg" class="layer" :class="{ active: editingLayer === layer}"
+        @click="setEditingLayer($event, layer)">
         <span class="thumb" :style="{ backgroundImage: 'url(' + layer.imgSrc + ')' }"></span>{{ layer.type }}
       </div>
     </div>
+    <!-- 添加按钮 -->
     <button class="add el-icon-plus" @click="addPage"></button>
   </div>
 </template>
 <script>
-  import Page from './../../components/Page'
-  import AppConst from '../../util/appConst'
-  export default {
-    data () {
-      return {
-        viewState: 0,
-        dragState: 0,
-        http: AppConst.BACKEND_DOMAIN,
-        canvasWidth: 750,
-        canvasHeight: 1334,
-        bodyBackgroundColor: 'rgba(255,255,255,0)',
-      }
+import Page from "./../../components/Page";
+import AppConst from "../../util/appConst";
+export default {
+  data() {
+    return {
+      viewState: 0,
+      dragState: 0,
+      http: AppConst.BACKEND_DOMAIN,
+      canvasWidth: 750,
+      canvasHeight: 1334,
+      bodyBackgroundColor: "rgba(255,255,255,0)"
+    };
+  },
+  computed: {
+    vxEditor() {
+      return this.$store.state["editor"];
     },
-    computed: {
-      vxEditor () {
-        return this.$store.state['editor']
-      },
-      pages () {
-        this.bodyBackgroundColor = this.$store.state.editor.editorTheme.bodyBackgroundColor || 'rgba(255,255,255,0)'
-        return this.vxEditor['editorTheme']['pages']
-      },
-      editingPage () {
-        return this.vxEditor['editorPage']
-      },
-      layers () {
-        return this.editingPage['elements']
-      },
-      layersNoBg () {
-        return this.layers && this.layers.filter(v => v['type'] !== 'bg').reverse()
-      },
-      layersBg () {
-        return this.layers && this.layers.filter(v => v['type'] === 'bg')
-      },
-      editingLayer () {
-        return this.vxEditor['editorElement']
-      }
+    pages() {
+      this.bodyBackgroundColor =
+        this.$store.state.editor.editorTheme.bodyBackgroundColor ||
+        "rgba(255,255,255,0)";
+      return this.vxEditor["editorTheme"]["pages"];
     },
-    methods: {
-      moveLayer (downEvent) {
-        let height = 30
-        let timer = null
-        let layer = downEvent.target
-        let li = layer.parentNode
-        let parent = li.parentNode
-        let liLen = parent.childNodes.length
-        let startTop = li.offsetTop
-        let startIndex = Math.round(startTop / height)
-        let targetIndex = null
-        let placeholder = document.createElement('li')
-        placeholder.style = 'height: ' + height + 'px; background-color: #d6d6d6'
-        let move = (moveEvent) => {
-          if (!timer) {
-            // 被拖动的层
-            let top = moveEvent.clientY - downEvent.clientY + startTop
-            layer.setAttribute('data-moving', true)
-            layer.style.top = top + 'px'
-            this.dragState = 1
-            // 占位层
-            let nowIndex = Math.round(top / height)
-            nowIndex = nowIndex <= 0 ? 0 : nowIndex > liLen - 1 ? liLen - 1 : nowIndex
-            if (targetIndex !== nowIndex) {
-              (targetIndex || targetIndex === 0) && parent.removeChild(placeholder)
-              targetIndex = nowIndex
-              parent.insertBefore(placeholder, parent.childNodes[nowIndex + (startIndex >= targetIndex ? 0 : 1)])
-            }
-            // timer负责减少onmousemove对客户端的负担
-            timer = setTimeout(() => {
-              timer = null
-            }, 20)
-          }
-        }
-        let up = (upEvent) => {
-          if (layer.getAttribute('data-moving')) {
-            layer.removeAttribute('data-moving')
-            layer.style.top = ''
-            parent.removeChild(placeholder)
-            this.layersNoBg[startIndex]['zindex'] = this.layersNoBg[targetIndex]['zindex'] + (targetIndex > startIndex ? -0.5 : 0.5)
-            this.updateLayersSort()
+    editingPage() {
+      return this.vxEditor["editorPage"];
+    },
+    layers() {
+      return this.editingPage["elements"];
+    },
+    layersNoBg() {
+      return (
+        this.layers && this.layers.filter(v => v["type"] !== "bg").reverse()
+      );
+    },
+    layersBg() {
+      return this.layers && this.layers.filter(v => v["type"] === "bg");
+    },
+    editingLayer() {
+      return this.vxEditor["editorElement"];
+    }
+  },
+  methods: {
+    moveLayer(downEvent) {
+      let height = 30;
+      let timer = null;
+      let layer = downEvent.target;
+      let li = layer.parentNode;
+      let parent = li.parentNode;
+      let liLen = parent.childNodes.length;
+      let startTop = li.offsetTop;
+      let startIndex = Math.round(startTop / height);
+      let targetIndex = null;
+      let placeholder = document.createElement("li");
+      placeholder.style = "height: " + height + "px; background-color: #d6d6d6";
+      let move = moveEvent => {
+        if (!timer) {
+          // 被拖动的层
+          let top = moveEvent.clientY - downEvent.clientY + startTop;
+          layer.setAttribute("data-moving", true);
+          layer.style.top = top + "px";
+          this.dragState = 1;
+          // 占位层
+          let nowIndex = Math.round(top / height);
+          nowIndex =
+            nowIndex <= 0 ? 0 : nowIndex > liLen - 1 ? liLen - 1 : nowIndex;
+          if (targetIndex !== nowIndex) {
+            (targetIndex || targetIndex === 0) &&
+              parent.removeChild(placeholder);
+            targetIndex = nowIndex;
+            parent.insertBefore(
+              placeholder,
+              parent.childNodes[nowIndex + (startIndex >= targetIndex ? 0 : 1)]
+            );
           }
-          document.removeEventListener('mousemove', move)
-          document.removeEventListener('mouseup', up)
-          this.dragState = 0
+          // timer负责减少onmousemove对客户端的负担
+          timer = setTimeout(() => {
+            timer = null;
+          }, 20);
         }
-        if (liLen > 1) {
-          document.addEventListener('mousemove', move)
-          document.addEventListener('mouseup', up)
+      };
+      let up = upEvent => {
+        if (layer.getAttribute("data-moving")) {
+          layer.removeAttribute("data-moving");
+          layer.style.top = "";
+          parent.removeChild(placeholder);
+          this.layersNoBg[startIndex]["zindex"] =
+            this.layersNoBg[targetIndex]["zindex"] +
+            (targetIndex > startIndex ? -0.5 : 0.5);
+          this.updateLayersSort();
         }
-      },
-      copyPage (page) {
-        this.bodyBackgroundColor = this.$store.state.editor.editorTheme.bodyBackgroundColor || 'rgba(255,255,255,0)'
-        this.$store.dispatch('copyPage', page)
-      },
-      delPage (page) {
-        this.$store.dispatch('delPage', page)
-      },
-      addPage () {
-        this.bodyBackgroundColor = this.$store.state.editor.editorTheme.bodyBackgroundColor || 'rgba(255,255,255,0)'
-        this.$store.dispatch('addPage')
-      },
-      setEditingPage (page) {
-        this.bodyBackgroundColor = this.$store.state.editor.editorTheme.bodyBackgroundColor || 'rgba(255,255,255,0)'
-        this.$store.dispatch('setEditorPage', page)
-      },
-      setEditingLayer (event, layer) {
-        this.$store.dispatch('setEditorElement', layer)
-      },
-      updateLayersSort () {
-        this.$store.dispatch('sortElementsByZindex')
+        document.removeEventListener("mousemove", move);
+        document.removeEventListener("mouseup", up);
+        this.dragState = 0;
+      };
+      if (liLen > 1) {
+        document.addEventListener("mousemove", move);
+        document.addEventListener("mouseup", up);
       }
     },
-    components: { Page }
-  }
+    copyPage(page) {
+      this.bodyBackgroundColor =
+        this.$store.state.editor.editorTheme.bodyBackgroundColor ||
+        "rgba(255,255,255,0)";
+      this.$store.dispatch("copyPage", page);
+    },
+    delPage(page) {
+      this.$store.dispatch("delPage", page);
+    },
+    addPage() {
+      this.bodyBackgroundColor =
+        this.$store.state.editor.editorTheme.bodyBackgroundColor ||
+        "rgba(255,255,255,0)";
+      this.$store.dispatch("addPage");
+    },
+    setEditingPage(page) {
+      this.bodyBackgroundColor =
+        this.$store.state.editor.editorTheme.bodyBackgroundColor ||
+        "rgba(255,255,255,0)";
+      this.$store.dispatch("setEditorPage", page);
+    },
+    setEditingLayer(event, layer) {
+      this.$store.dispatch("setEditorElement", layer);
+    },
+    updateLayersSort() {
+      this.$store.dispatch("sortElementsByZindex");
+    }
+  },
+  components: { Page }
+};
 </script>
 <style lang="less" scoped>
-  .overview {
-    position: relative;
-    border-right: 1px solid #d6d6d6;
+.overview {
+  position: relative;
+  border-right: 1px solid #d6d6d6;
+  background-color: #ececec;
+  height: 100%;
+  .panel {
+    float: left;
+    line-height: 40px;
+    width: 50%;
+    text-align: center;
+    background-color: #d6d6d6;
+    cursor: pointer;
+    &.active {
+      background-color: transparent;
+    }
+  }
+  .list {
     background-color: #ececec;
-    height: 100%;
-    .panel {
-      float: left;
-      line-height: 40px;
-      width: 50%;
-      text-align: center;
-      background-color: #d6d6d6;
-      cursor: pointer;
-      &.active {
-        background-color: transparent;
+    position: absolute;
+    top: 40px;
+    bottom: 50px;
+    width: 100%;
+    overflow-y: auto;
+    overflow-x: hidden;
+  }
+  .dragging:before {
+    content: "";
+    position: absolute;
+    top: 0;
+    right: 0;
+    bottom: 0;
+    left: 0;
+    z-index: 10;
+  }
+  .page {
+    position: relative;
+    border-color: transparent;
+    border-style: solid;
+    border-width: 4px 4px 30px;
+    margin: 10px;
+    &.active {
+      border-color: #18ccc0;
+      .icons {
+        display: block;
       }
     }
-    .list {
-      background-color: #ececec;
-      position: absolute;
-      top: 40px;
-      bottom: 50px;
-      width: 100%;
-      overflow-y: auto;
-      overflow-x: hidden;
-    }
-    .dragging:before {
+    &:before {
       content: "";
       position: absolute;
       top: 0;
-      right: 0;
-      bottom: 0;
       left: 0;
-      z-index: 10;
+      bottom: 0;
+      right: 0;
+      z-index: 2;
     }
-    .page {
+    .content {
+      transform-origin: left top;
+      background-color: #fff;
+      overflow: hidden;
       position: relative;
-      border-color: transparent;
-      border-style: solid;
-      border-width: 4px 4px 30px;
-      margin: 10px;
-      &.active {
-        border-color: #18ccc0;
-        .icons {
-          display: block;
-        }
-      }
-      &:before {
-        content: "";
-        position: absolute;
-        top: 0;
-        left: 0;
-        bottom: 0;
-        right: 0;
-        z-index: 2;
-      }
-      .content {
-        transform-origin: left top;
-        background-color: #fff;
-        overflow: hidden;
-        position: relative;
-      }
-      .icons {
-        position: absolute;
-        bottom: -1.5em;
-        right: 0.5em;
-        display: none;
-        width: 100%;
-        color: #fff;
-        .icon {
-          float: right;
-          margin-left: 1em;
-          opacity: 0.5;
-          cursor: pointer;
-          &:hover {
-            opacity: 1;
-          }
-        }
-      }
     }
-    .layer {
-      padding-left: 20px;
-      height: 30px;
-      line-height: 30px;
-      border-bottom: 1px solid #d6d6d6;
-      cursor: pointer;
-      &[data-moving] {
-        background-color: #d6d6d6;
-        position: absolute;
-        width: 100%;
-      }
-      &:hover {
-        background-color: #d6d6d6;
-      }
-      &.active {
-        background-color: #18ccc0;
-        color: #fff;
-      }
-      .thumb {
-        display: inline-block;
-        width: 15px;
-        height: 15px;
-        margin-right: 1em;
-        background: white center no-repeat;
-        background-size: cover;
+    .icons {
+      position: absolute;
+      bottom: -1.5em;
+      right: 0.5em;
+      display: none;
+      width: 100%;
+      color: #fff;
+      .icon {
+        float: right;
+        margin-left: 1em;
+        opacity: 0.5;
+        cursor: pointer;
+        &:hover {
+          opacity: 1;
+        }
       }
     }
-    .add {
-      border: none;
+  }
+  .layer {
+    padding-left: 20px;
+    height: 30px;
+    line-height: 30px;
+    border-bottom: 1px solid #d6d6d6;
+    cursor: pointer;
+    &[data-moving] {
+      background-color: #d6d6d6;
       position: absolute;
-      bottom: 0;
-      height: 50px;
-      line-height: 50px;
       width: 100%;
-      left: 0;
-      background-color: #373f42;
-      text-align: center;
+    }
+    &:hover {
+      background-color: #d6d6d6;
+    }
+    &.active {
+      background-color: #18ccc0;
       color: #fff;
-      cursor: pointer;
     }
+    .thumb {
+      display: inline-block;
+      width: 15px;
+      height: 15px;
+      margin-right: 1em;
+      background: white center no-repeat;
+      background-size: cover;
+    }
+  }
+  .add {
+    border: none;
+    position: absolute;
+    bottom: 0;
+    height: 50px;
+    line-height: 50px;
+    width: 100%;
+    left: 0;
+    background-color: #373f42;
+    text-align: center;
+    color: #fff;
+    cursor: pointer;
   }
+}
 </style>

+ 59 - 0
src/views/myHistoryTest/myHistoryTest.html

@@ -0,0 +1,59 @@
+<div class="page">
+  <!-- 头部 -->
+  <div class="header">
+    <div class="logo">
+      <img class="logo-img" src="" alt="">调研宝</div>
+    <div class="right">
+      <div class="operational-data">去“看板”查看测试运营数据</div>
+      <div class="userinfo">用户名 <i class="el-icon-caret-bottom"></i></div>
+    </div>
+  </div>
+  <!-- 工具栏 -->
+  <div class="history-tools">
+    <div class="left">
+      <el-dropdown>
+        <el-button type="primary">所属项目 <i class="el-icon-caret-bottom icon-right"></i>
+        </el-button>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item>黄金糕黄金糕黄金糕</el-dropdown-item>
+          <el-dropdown-item>狮子头</el-dropdown-item>
+          <el-dropdown-item>螺蛳粉</el-dropdown-item>
+          <el-dropdown-item>双皮奶</el-dropdown-item>
+          <el-dropdown-item>蚵仔煎</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+      <el-dropdown>
+        <el-button type="primary">更新时间 <i class="el-icon-caret-bottom icon-right"></i>
+        </el-button>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item>黄金糕黄金糕黄金糕</el-dropdown-item>
+          <el-dropdown-item>狮子头</el-dropdown-item>
+          <el-dropdown-item>螺蛳粉</el-dropdown-item>
+          <el-dropdown-item>双皮奶</el-dropdown-item>
+          <el-dropdown-item>蚵仔煎</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+    </div>
+    <div class="right">
+      <el-button type="primary" icon="el-icon-circle-plus-outline">创建测试</el-button>
+    </div>
+  </div>
+  <!-- 列表 -->
+  <div class="test-list">
+    <div class="item" v-for="(item,index) in lists">
+      <div class="tools">
+        <el-button type="success" icon="el-icon-check" circle></el-button>
+        <el-button type="info" icon="el-icon-message" circle></el-button>
+        <el-button type="warning" icon="el-icon-star-off" circle></el-button>
+        <el-button type="danger" icon="el-icon-delete" circle style="margin-left: 30px;"></el-button>
+      </div>
+      <img class="item-img" src="" alt="">
+      <div class="title">定制你的家具香气</div>
+      <div class="desc">无锡WIII</div>
+      <div class="bottom">
+        <span>共21题</span>
+        <span>1天前</span>
+      </div>
+    </div>
+  </div>
+</div>

+ 27 - 0
src/views/myHistoryTest/myHistoryTest.js

@@ -0,0 +1,27 @@
+export default {
+  data() {
+    return {
+      cities: [{
+        value: 'Beijing',
+        label: '北京'
+      }, {
+        value: 'Shanghai',
+        label: '上海'
+      }, {
+        value: 'Nanjing',
+        label: '南京'
+      }, {
+        value: 'Chengdu',
+        label: '成都'
+      }, {
+        value: 'Shenzhen',
+        label: '深圳'
+      }, {
+        value: 'Guangzhou',
+        label: '广州'
+      }],
+      value: '',
+      lists: [{ index: 0 }, { index: 1 }, { index: 2 }, { index: 3 }, { index: 4 }, { index: 5 }, { index: 6 }, { index: 7 }, { index: 8 }, { index: 9 }, { index: 10 }, { index: 11 }, { index: 12 }, { index: 13 }, { index: 14 }, { index: 15 }, { index: 16 }, { index: 17 }, { index: 18 }, { index: 19 }]
+    }
+  }
+}

+ 156 - 0
src/views/myHistoryTest/myHistoryTest.scss

@@ -0,0 +1,156 @@
+.page {
+  padding: 60px 0px;
+  width: 100%;
+  background: rgba(237,239,247,1);
+}
+.header {
+  z-index: 1;
+  position:fixed;
+  top: 0px;
+  width: 100%;
+  height: 60px;
+  box-shadow: 0 2px 8px 0 rgba(62,67,116,0.10);
+  border-bottom: 0;
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  align-items:center;
+  padding: 0px 50px;
+  .logo{
+    display: flex;
+    flex-direction: row;
+    line-height: 30px;
+    .logo-img {
+      width: 30px;
+      height: 30px;
+      background: red;
+      margin-right: 6px;
+      border-radius: 15px;
+    }
+  }
+  .right{
+    display: flex;
+    flex-direction: row;
+    .operational-data {
+      width: 240px;
+      height: 34px;
+      background: #E6EDFF;
+      border-radius: 17px;
+      font-size: 16px;
+      color: #4E5DFF;
+      line-height: 34px;
+      text-align: center;
+      margin-right: 46px;
+    }
+    .userinfo {
+      width: 132px;
+      height: 34px;
+      line-height: 34px;
+      text-align: center;
+      margin-right: 22px;
+    }
+  }
+}
+
+.history-tools {
+  width: 1180px;
+  height: 64px;
+  margin: 0 auto;
+  margin-top: 20px;
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  align-items:center;
+  .left {
+    .el-button{
+      padding: 7px 20px;
+      position: relative
+    }
+    .el-button--primary{
+      width: 220px;
+      border-radius: 17px;
+      font-size: 14px;
+      color: #4E5DFF;
+      background-color: #fff;
+      border-color: #fff;
+    }
+    .icon-right {
+      position: absolute;
+      right: 10px;
+    }
+  }
+  .right {
+    .el-button{
+      padding: 6px 20px;
+    }
+    .el-button--primary{
+      width: 220px;
+      border-radius: 17px;
+      font-size: 16px;
+      font-weight: 350;
+      color: #fff;
+      background-color: #4E5DFF;;
+      border-color: #4E5DFF;;
+    }
+  }
+}
+.test-list {
+  width: 1180px;
+  margin: 0 auto;
+  display: flex;
+  flex-direction: row;
+  flex-wrap: wrap;
+  .item {
+    position: relative;
+    width: 220px;
+    height: 270px;
+    background: #FFFFFF;
+    box-shadow: 0 5px 11px 0 rgba(78,93,255,0.14);
+    border-radius: 6px;
+    margin: 15px 8px;
+    border-radius: 10px;
+    display: flex;
+    flex-direction: column;
+    color: rgba(159,167,186,1);
+    .tools {
+      display: none;
+      position:absolute;
+      top: 10px;
+      width: 100%;
+      padding-left: 10px;
+      .el-button.is-circle {
+        padding: 8px;
+      }
+    }
+    .item-img {
+      width: 100%;
+      height: 50%;
+    }
+    .title {
+      flex-grow: 2;
+      margin: 10px;
+      font-size: 18px;
+      color: rgba(55,55,55,1);
+    }
+    .desc {
+      margin: 10px;
+      font-size: 14px;
+    }
+    .bottom {
+      margin: 0px 10px 10px;
+      font-size: 14px;
+      display: flex;
+      flex-direction: row;
+      justify-content: space-between;
+    }
+  }
+  .item:hover{
+    box-shadow: 0 5px 11px 0 rgba(0,0,0,0.44);
+    .tools {
+      display: block;
+    }
+    .title {
+      color: #4E5DFF;
+    }
+  }  
+}

+ 7 - 0
src/views/myHistoryTest/myHistoryTest.vue

@@ -0,0 +1,7 @@
+<template src='./myHistoryTest.html'>
+</template>
+<script src="./myHistoryTest.js">
+</script>
+<style scoped lang="scss">
+@import "./myHistoryTest.scss";
+</style>