iZaiZaiA 2 жил өмнө
parent
commit
5de8c4177a

+ 1 - 1
src/config/index.js

@@ -17,7 +17,7 @@ export default {
     statusWhiteList: [],    //http的status默认放行列表
     ossUrl: 'https://bladex-test-info.oss-cn-chengdu.aliyuncs.com', //oss地址
     smsPhone: '',  //测试接受短信验证码的手机号
-    dev_version: '202209301050',    //开发版本号
+    dev_version: '202209301105',    //开发版本号
     prod_host: 'http://47.110.251.215:8090',  //线上
     //dev_host: 'http://192.168.4.6', //黄键楠
     dev_host: 'http://192.168.0.118', //祝炜

+ 14 - 3
src/global/components/hc-drag-modal/index.vue

@@ -132,12 +132,23 @@ const dragModalResizeMouseDown = (event) => {
     event.preventDefault()
     event.stopPropagation()
     //获取相关dom元素
-    let dom = document.getElementById('drag-modal-' + uuid)
+    let body = document.body, dom = document.getElementById('drag-modal-' + uuid)
     let clientX = event.clientX, clientY = event.clientY;
     let offsetWidth = dom.offsetWidth, clientHeight = dom.clientHeight;
     document.onmousemove = (e) => {
-        widthVal.value = e.clientX - clientX + offsetWidth
-        heightVal.value = e.clientY - clientY + clientHeight
+        //拖拽时为了对宽和高 限制一下范围,定义两个变量
+        let W =  e.clientX - clientX + offsetWidth;
+        let H =  e.clientY - clientY + clientHeight;
+
+        if(body.offsetWidth - e.clientX < 0){
+            W = body.offsetWidth - parseInt(dom.style.marginLeft);
+        }
+        if(body.offsetHeight - e.clientY < 0){
+            H = body.offsetHeight - parseInt(dom.style.marginTop);
+        }
+
+        widthVal.value = W;// 拖拽后物体的宽
+        heightVal.value = H;// 拖拽后物体的高
     }
     document.onmouseup = () => {
         document.onmousemove = null;