Browse Source

Merge branch 'master' of https://git.cocorobo.cn/CocoRoboLabs/pbl-teacher-table

zengyicheng 2 years ago
parent
commit
f235a1ee3e

+ 5 - 1
dist/index.html

@@ -25,4 +25,8 @@
       height: 100%;
       width: 100%;
       background: #e6eaf0;
-    }</style><link href=./static/css/app.7025d703645a9df023746a3580b19fd8.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.fed1de90e0941b3846db.js></script><script type=text/javascript src=./static/js/vendor.fab7effc7bf6d4290017.js></script><script type=text/javascript src=./static/js/app.877187f63f08c5e8f9aa.js></script></body></html>
+<<<<<<< HEAD
+    }</style><link href=./static/css/app.7025d703645a9df023746a3580b19fd8.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.fed1de90e0941b3846db.js></script><script type=text/javascript src=./static/js/vendor.fab7effc7bf6d4290017.js></script><script type=text/javascript src=./static/js/app.877187f63f08c5e8f9aa.js></script></body></html>
+=======
+    }</style><link href=./static/css/app.42685628340a071a7476e593a1eaaf27.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.ce85731d7c1d072ed0aa.js></script><script type=text/javascript src=./static/js/vendor.ec6917f8087437e124be.js></script><script type=text/javascript src=./static/js/app.173ae0cc484a1bac6450.js></script></body></html>
+>>>>>>> 8c4ea5ca8f25a4921b9759c76cfd3aec862e5356

File diff suppressed because it is too large
+ 1 - 0
dist/static/css/app.42685628340a071a7476e593a1eaaf27.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.42685628340a071a7476e593a1eaaf27.css.map


File diff suppressed because it is too large
+ 1 - 0
dist/static/css/app.7025d703645a9df023746a3580b19fd8.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/0.495dd6dd7e801967b64f.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/0.495dd6dd7e801967b64f.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/0.f867c3655b998d260981.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.173ae0cc484a1bac6450.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.173ae0cc484a1bac6450.js.map


+ 2 - 2
dist/static/js/manifest.fed1de90e0941b3846db.js → dist/static/js/manifest.ce85731d7c1d072ed0aa.js

@@ -1,2 +1,2 @@
-!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,c,a){for(var i,u,f,s=0,l=[];s<r.length;s++)u=r[s],t[u]&&l.push(t[u][0]),t[u]=0;for(i in c)Object.prototype.hasOwnProperty.call(c,i)&&(e[i]=c[i]);for(n&&n(r,c,a);l.length;)l.shift()();if(a)for(s=0;s<a.length;s++)f=o(o.s=a[s]);return f};var r={},t={4:0};function o(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,o){n=t[e]=[r,o]});n[2]=r;var c=document.getElementsByTagName("head")[0],a=document.createElement("script");a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=12e4,o.nc&&a.setAttribute("nonce",o.nc),a.src=o.p+"static/js/"+e+"."+{0:"f867c3655b998d260981",1:"a8d1c832d7ea6bc9a183"}[e]+".js";var i=setTimeout(u,12e4);function u(){a.onerror=a.onload=null,clearTimeout(i);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return a.onerror=a.onload=u,c.appendChild(a),r},o.m=e,o.c=r,o.d=function(e,n,r){o.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="./",o.oe=function(e){throw console.error(e),e}}([]);
-//# sourceMappingURL=manifest.fed1de90e0941b3846db.js.map
+!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,c,a){for(var i,u,f,s=0,l=[];s<r.length;s++)u=r[s],t[u]&&l.push(t[u][0]),t[u]=0;for(i in c)Object.prototype.hasOwnProperty.call(c,i)&&(e[i]=c[i]);for(n&&n(r,c,a);l.length;)l.shift()();if(a)for(s=0;s<a.length;s++)f=o(o.s=a[s]);return f};var r={},t={4:0};function o(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,o){n=t[e]=[r,o]});n[2]=r;var c=document.getElementsByTagName("head")[0],a=document.createElement("script");a.type="text/javascript",a.charset="utf-8",a.async=!0,a.timeout=12e4,o.nc&&a.setAttribute("nonce",o.nc),a.src=o.p+"static/js/"+e+"."+{0:"495dd6dd7e801967b64f",1:"a8d1c832d7ea6bc9a183"}[e]+".js";var i=setTimeout(u,12e4);function u(){a.onerror=a.onload=null,clearTimeout(i);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return a.onerror=a.onload=u,c.appendChild(a),r},o.m=e,o.c=r,o.d=function(e,n,r){o.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="./",o.oe=function(e){throw console.error(e),e}}([]);
+//# sourceMappingURL=manifest.ce85731d7c1d072ed0aa.js.map

File diff suppressed because it is too large
+ 1 - 0
dist/static/js/manifest.ce85731d7c1d072ed0aa.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.fed1de90e0941b3846db.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/vendor.ec6917f8087437e124be.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/vendor.ec6917f8087437e124be.js.map


+ 13 - 0
package-lock.json

@@ -10101,6 +10101,11 @@
         "is-plain-obj": "^1.0.0"
       }
     },
+    "sortablejs": {
+      "version": "1.10.2",
+      "resolved": "https://registry.npmmirror.com/sortablejs/-/sortablejs-1.10.2.tgz",
+      "integrity": "sha512-YkPGufevysvfwn5rfdlGyrGjt7/CRHwvRPogD/lC+TnvcN29jDpCifKP+rBqf+LRldfXSTh+0CGLcSg0VIxq3A=="
+    },
     "source-list-map": {
       "version": "2.0.1",
       "resolved": "https://registry.npm.taobao.org/source-list-map/download/source-list-map-2.0.1.tgz",
@@ -11313,6 +11318,14 @@
         "videojs-hotkeys": "^0.2.20"
       }
     },
+    "vuedraggable": {
+      "version": "2.24.3",
+      "resolved": "https://registry.npmmirror.com/vuedraggable/-/vuedraggable-2.24.3.tgz",
+      "integrity": "sha512-6/HDXi92GzB+Hcs9fC6PAAozK1RLt1ewPTLjK0anTYguXLAeySDmcnqE8IC0xa7shvSzRjQXq3/+dsZ7ETGF3g==",
+      "requires": {
+        "sortablejs": "1.10.2"
+      }
+    },
     "vuex": {
       "version": "3.6.2",
       "resolved": "https://registry.npm.taobao.org/vuex/download/vuex-3.6.2.tgz",

+ 1 - 0
package.json

@@ -22,6 +22,7 @@
     "vue-cookies": "^1.7.4",
     "vue-router": "^3.0.1",
     "vue-video-player": "^5.0.2",
+    "vuedraggable": "^2.24.3",
     "vuex": "^3.6.2",
     "wangeditor": "^4.6.14",
     "xlsx": "^0.16.9"

+ 88 - 2
src/components/pages/Grid.vue

@@ -20,12 +20,24 @@
       <el-button type="text">成员</el-button>
       <el-button type="text" v-if="RoomInfo.userid == userid" @click="dismiss">解散房间</el-button>
     </div>
+    <draggable
+      element="div"
+      v-model="data"
+      class="g_body"
+      @change="handleDraggableFormItemChange"
+      @end="dragEnd"
+      :move="checkMove"
+    >
     <div
       v-for="(item,index) in data"
       :key="index"
       class="g_box"
       @mouseover="pIndex = index"
       @mouseleave="pIndex = ''"
+      @dragstart="handleDragStart($event, index)"
+      @dragover.prevent="handleDragOver($event, index)"
+      @dragenter="handleDragEnter($event, index)"
+      @dragend="handleDragEnd($event, index)"
     >
       <div
         :class="{'left-popover':index<3,'right-popover':index==3,'top-popover':index>3,'visibleO':pIndex === index && item && (item.video || item.photo)}"
@@ -45,7 +57,7 @@
       </div>
       <div
         v-if="item && item.remarks"
-        :class="{'remark-right-popover':index>12 && index!=15,'remark-left-popover':index==15,'remark-bottom-popover':index<12,'visibleO':pIndex === index && item && item.remarks}"
+        :class="{'remark-right-popover':index>11 && index!=15,'remark-left-popover':index==15,'remark-bottom-popover':index<12,'visibleO':pIndex === index && item && item.remarks}"
       >
         <div class="Rbox" v-for="(x,y) in item.remarks" :key="y">
           <div v-if="x.remarks!=''" style="display:flex">
@@ -75,6 +87,7 @@
         @click="check(index,3)"
       ></el-image>
     </div>
+    </draggable>
     <el-dialog
       title="上传文件"
       :visible.sync="dialogVisible"
@@ -234,7 +247,12 @@
 
 <script>
 import Clipboard from "clipboard";
+import draggable from "vuedraggable";
 export default {
+  components: {
+    //调用组件
+    draggable,
+  },
   data() {
     return {
       timer: null,
@@ -284,9 +302,70 @@ export default {
         },
       },
       playerO: {},
+      dragging:null,
+      draggingE:null,
     };
   },
   methods: {
+    handleDragStart(e, items) {
+      this.dragging = items; //开始拖动时,暂时保存当前拖动的数据。
+      if(!this.data[items]){
+        return;
+      }
+    },
+    handleDragEnd(e, items) {
+      if(!this.data[this.dragging]){
+        return;
+      }
+       e.dataTransfer.effectAllowed = "move"; //为需要移动的元素设置dragstart事件
+      if (this.draggingE == this.dragging) return;
+      var newItems = [...JSON.parse(JSON.stringify(this.data))]; //拷贝一份数据进行交换操作。
+    
+      var src = newItems[this.dragging]; //获取数组下标
+      var dst = newItems[this.draggingE];
+      newItems[this.dragging] = dst
+      newItems[this.draggingE] = src
+      // newItems2.splice(dst, 0, ...newItems.splice(src, 1)); //交换位置
+      this.data = newItems;
+      this.updateRoomData();
+      this.dragging = null; //拖动结束后,清除数据
+      this.draggingE=null;
+    },
+    handleDragOver(e) {
+      e.dataTransfer.dropEffect = "move"; //在dragenter中针对放置目标来设置!
+    },
+    handleDragEnter(e, items) {
+      this.draggingE = items;
+      e.dataTransfer.effectAllowed = "move"; //为需要移动的元素设置dragstart事件
+      // if (items == this.dragging) return;
+      // var newItems = [...JSON.parse(JSON.stringify(this.data))]; //拷贝一份数据进行交换操作。
+      // var src = this.dragging; //获取数组下标
+      // var dst = items;
+      // newItems.splice(dst, 0, ...newItems.splice(src, 1)); //交换位置
+      // this.data = newItems;
+      // this.updateRoomData();
+    },
+    handleDraggableFormItemChange(val) {
+      // console.log(val);
+      // console.log(this.data[val.moved.newIndex]);
+      // console.log(this.data[val.moved.oldIndex]);
+    },
+    dragEnd(val) {
+      // if (this.data[val.newIndex].userid != this.userinfo.userid) {
+      //   this.$message.error("不是您上传的作品不能拖动哦");
+      //   return;
+      // }
+      // this.updateRoomData();
+    },
+    checkMove(evt) {
+      // console.log(evt);
+      // if (evt.draggedContext.element.userid != this.userinfo.userid) {
+      //   return false;
+      // } else {
+      //   return true;
+      // }
+      return false;
+    },
     copy() {
       this.copyText =
         this.$refs.inviteT.innerHTML +
@@ -436,7 +515,9 @@ export default {
             },
           ];
         }
-        this.data[this.gIndex].userid = this.userinfo ? this.userinfo.userid : this.userid;
+        this.data[this.gIndex].userid = this.userinfo
+          ? this.userinfo.userid
+          : this.userid;
       } else {
         if (!this.remarks) {
           this.$message.error("备注不能为空");
@@ -628,6 +709,8 @@ export default {
             this.data = JSON.parse(res.data[0][0].data);
             this.dialogVisible3 = false;
             this.dialogVisible2 = true;
+            // this.data.splice(0,1)
+            // this.updateRoomData()
             this.timer = setInterval(() => {
               this.selectRoom2(uid);
             }, 5000);
@@ -709,6 +792,7 @@ export default {
     for (var i = 0; i < 16; i++) {
       this.data.push("");
     }
+    this.data.push("")
     this.getUser();
     this.selectRoom(this.userid);
   },
@@ -732,6 +816,7 @@ export default {
   position: absolute;
   width: 50px;
   z-index: 1;
+  user-select: none;
 }
 .coin1 {
   top: 10px;
@@ -761,6 +846,7 @@ export default {
   justify-content: center;
   /* overflow: hidden; */
   position: relative;
+  user-select: none;
 }
 .photo_img {
   width: 100%;

Some files were not shown because too many files changed in this diff