Browse Source

涌益咨询侧边栏fix

jwyu 1 year ago
parent
commit
64c307293b
1 changed files with 26 additions and 0 deletions
  1. 26 0
      src/views/dataEntry_manage/thirdBase/YyzxData.vue

+ 26 - 0
src/views/dataEntry_manage/thirdBase/YyzxData.vue

@@ -115,6 +115,32 @@ import { yongyiInterface } from "@/api/api.js";
 export default {
   name: "Yyzx",
   components: { lzTable },
+  directives: {
+    drag(el, bindings) {
+      el.onmousedown = function (e) {
+        var init = e.clientX;
+        // console.log(init);
+        var box = $('#box')[0];
+        // console.log(box.clientWidth)
+        let total_wid = box.offsetWidth;
+        var left = $('#left')[0];
+        var right = $('#right')[0];
+        var initWidth = left.offsetWidth;
+        document.onmousemove = function (e) {
+          var end = e.clientX;
+          var newWidth = end - init + initWidth;
+          left.style.width = newWidth + 'px';
+          right.style.width = newWidth > 320 ? total_wid - newWidth + 'px' : total_wid - 320 + 'px';
+        };
+        document.onmouseup = function () {
+          document.onmousemove = document.onmouseup = null;
+          e.releaseCapture && e.releaseCapture();
+        };
+        e.setCapture && e.setCapture();
+        return false;
+      };
+    }
+  }, 
   data() {
     return {
       isLeftWrapShow:true,