{"remainingRequest":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/thread-loader/dist/cjs.js!/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/babel-loader/lib/index.js!/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/eslint-loader/index.js??ref--13-0!/data/jenkins/workspace/badp-bcxin-web-5.x-vue/src/utils/directives.js","dependencies":[{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/src/utils/directives.js","mtime":1725957645733},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/babel.config.js","mtime":1725957645200},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/babel-loader/lib/index.js","mtime":315532800000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/eslint-loader/index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.regexp.replace\";\nimport \"core-js/modules/es7.array.includes\";\nimport \"core-js/modules/es6.string.includes\";\nimport \"core-js/modules/es6.number.constructor\";\nimport Vue from \"vue\";\n\n// v-dialogDrag: 弹窗拖拽\nVue.directive(\"dialogDrag\", {\n //属性名称dialogDrag,前面加v- 使用\n bind: function bind(el, binding, vnode, oldVnode) {\n // if (!binding.value) return\n var dialogHeaderEl = el.querySelector(\".el-dialog__header\");\n var dragDom = el.querySelector(\".el-dialog\");\n //dialogHeaderEl.style.cursor = 'move';\n dialogHeaderEl.style.cssText += \";cursor:move;\";\n dragDom.style.cssText += \";top:0px;\";\n dragDom.style.cssText += \";left:0px;\";\n dialogHeaderEl.onselectstart = new Function(\"return false\"); //清除选择头部文字效果\n // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);\n var sty = function () {\n if (window.document.currentStyle) {\n return function (dom, attr) {\n return dom.currentStyle[attr];\n };\n } else {\n return function (dom, attr) {\n return getComputedStyle(dom, false)[attr];\n };\n }\n }();\n dialogHeaderEl.onmousedown = function (e) {\n // 鼠标按下,计算当前元素距离可视区的距离\n var disX = e.clientX - dialogHeaderEl.offsetLeft;\n var disY = e.clientY - dialogHeaderEl.offsetTop;\n var screenWidth = document.body.clientWidth; // body当前宽度\n var screenHeight = document.documentElement.clientHeight; // 可见区域高度(应为body高度,可某些环境下无法获取)\n\n var dragDomWidth = dragDom.offsetWidth; // 对话框宽度\n var dragDomheight = dragDom.offsetHeight; // 对话框高度\n\n var minDragDomLeft = dragDom.offsetLeft + Number(dragDomWidth / 2.3);\n var maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth + Number(dragDomWidth / 2.3);\n var minDragDomTop = dragDom.offsetTop;\n var maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomheight + Number(dragDomheight / 2.3);\n\n // 获取到的值带px 正则匹配替换\n var styL = sty(dragDom, \"left\");\n var styT = sty(dragDom, \"top\");\n\n // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px\n if (styL.includes(\"%\")) {\n styL = +document.body.clientWidth * (+styL.replace(/\\%/g, \"\") / 100);\n styT = +document.body.clientHeight * (+styT.replace(/\\%/g, \"\") / 100);\n } else {\n styL = +styL.replace(/\\px/g, \"\");\n styT = +styT.replace(/\\px/g, \"\");\n }\n document.onmousemove = function (e) {\n // 通过事件委托,计算移动的距离\n var left = e.clientX - disX;\n var top = e.clientY - disY;\n\n // 边界处理\n if (-left > minDragDomLeft + dragDomWidth / 2.3) {\n left = -(minDragDomLeft + dragDomWidth / 2.3);\n } else if (left > maxDragDomLeft + dragDomWidth / 2.3) {\n left = maxDragDomLeft + dragDomWidth / 2.3;\n }\n if (-top > minDragDomTop) {\n top = -minDragDomTop;\n } else if (top > maxDragDomTop + Number(dragDomheight / 2.3)) {\n top = maxDragDomTop + Number(dragDomheight / 2.3);\n }\n\n // 移动当前元素\n dragDom.style.cssText += \";left:\".concat(left + styL, \"px;top:\").concat(top + styT, \"px;\");\n };\n document.onmouseup = function (e) {\n document.onmousemove = null;\n document.onmouseup = null;\n };\n };\n }\n});\n\n// v-dialogDragWidth: 弹窗宽度拖大 拖小\nVue.directive(\"dialogDragWidth\", {\n bind: function bind(el, binding, vnode, oldVnode) {\n var dragDom = binding.value.$el.querySelector(\".el-dialog\");\n el.onmousedown = function (e) {\n // 鼠标按下,计算当前元素距离可视区的距离\n var disX = e.clientX - el.offsetLeft;\n document.onmousemove = function (e) {\n e.preventDefault(); // 移动时禁用默认事件\n\n // 通过事件委托,计算移动的距离\n var l = e.clientX - disX;\n dragDom.style.width = \"\".concat(l, \"px\");\n };\n document.onmouseup = function (e) {\n document.onmousemove = null;\n document.onmouseup = null;\n };\n };\n }\n});",null]}