{"remainingRequest":"D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\eslint-loader\\index.js??ref--13-0!D:\\jenkins\\workspace\\damDance-fvue\\src\\dialog.js","dependencies":[{"path":"D:\\jenkins\\workspace\\damDance-fvue\\src\\dialog.js","mtime":1696817248982},{"path":"D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\damDance-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\damDance-fvue\\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 Vue from 'vue'; // v-dialogDrag: 弹窗拖拽属性\n\nVue.directive('dialogDrag', {\n bind: function bind(el, binding, vnode, oldVnode) {\n var dialogHeaderEl = el.querySelector('.el-dialog__header');\n var dragDom = el.querySelector('.el-dialog');\n dialogHeaderEl.style.cssText += ';cursor:move;';\n dragDom.style.cssText += ';top:0px;'; // 获取原有属性\n\n var getStyle = 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\n dialogHeaderEl.onmousedown = function (e) {\n // 鼠标按下,计算当前元素距离可视区的距离\n var disX = e.clientX - dialogHeaderEl.offsetLeft;\n var disY = e.clientY - dialogHeaderEl.offsetTop;\n var dragDomWidth = dragDom.offsetWidth;\n var dragDomheight = dragDom.offsetHeight;\n var screenWidth = document.body.clientWidth;\n var screenHeight = document.body.clientHeight;\n var minDragDomLeft = dragDom.offsetLeft;\n var maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth;\n var minDragDomTop = dragDom.offsetTop;\n var maxDragDomTop = screenHeight - 200; // 获取到的值带px 正则匹配替换\n\n var styL = getStyle(dragDom, 'left');\n var styT = getStyle(dragDom, 'top');\n\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\n document.onmousemove = function (e) {\n // 通过事件委托,计算移动的距离\n var left = e.clientX - disX;\n var top = e.clientY - disY; // 边界处理\n // if (-(left) > minDragDomLeft) {\n // left = -minDragDomLeft\n // } else if (left > maxDragDomLeft) {\n // left = maxDragDomLeft\n // }\n\n if (-top > minDragDomTop) {\n top = -minDragDomTop;\n } else if (top > maxDragDomTop) {\n top = maxDragDomTop;\n } // 移动当前元素\n\n\n dragDom.style.cssText += \";left:\".concat(left + styL, \"px;top:\").concat(top + styT, \"px;\");\n vnode.child.$emit('dragDialog');\n };\n\n document.onmouseup = function () {\n document.onmousemove = null;\n document.onmouseup = null;\n };\n };\n }\n}); // v-dialogChange: 弹窗拉伸属性\n// Vue.directive('dialogChange', {\n// bind(el, binding, vnode, oldVnode) {\n// new Vue({}).$nextTick(() => {\n// // 自定义属性,判断是否可拉伸\n// if (!binding.value) return\n// const dragDom = el.querySelector('.el-dialog')\n// const dragDomBody = el.querySelector('.el-dialog__body')\n// dragDomBody.style.overflow = 'auto'\n// const minHeight = 300\n// const minWidth = 400\n// // 右下角设置一个图标点击拖拽缩放大小 这是类名为mouse\n// let dragMouse = document.querySelector('.mouse')\n// // 鼠标拖拽\n// dragMouse.onmousedown = (e) => {\n// // content区域\n// const content = dragDom.parentNode.parentNode.parentNode.parentNode\n// const disX = e.clientX - dragDom.offsetWidth\n// const disY = e.clientY - dragDom.offsetHeight\n// document.onmousemove = function (e) {\n// e.preventDefault() // 移动时禁用默认事件\n// // 通过事件委托,计算移动的距离e\n// let width = e.clientX - disX\n// let height = e.clientY - disY\n// if (width > content.offsetWidth && height < content.offsetHeight) {\n// if (height < minHeight) {\n// height = minHeight\n// }\n// dragDom.style.height = `${height}px`\n// // 减去头部高度\n// dragDomBody.style.height = `${height - 120}px`\n// } else if (width < content.offsetWidth && height > content.offsetHeight) {\n// if (width < minWidth) {\n// width = minWidth\n// }\n// dragDom.style.width = `${width}px`\n// } else if (width < content.offsetWidth && height < content.offsetHeight) {\n// if (height < minHeight) {\n// height = minHeight\n// }\n// if (width < minWidth) {\n// width = minWidth\n// }\n// dragDom.style.width = `${width}px`\n// dragDom.style.height = `${height}px`\n// // 减去头部高度\n// dragDomBody.style.height = `${height - 120}px`\n// }\n// }\n// document.onmouseup = function (e) {\n// document.onmousemove = null\n// document.onmouseup = null\n// }\n// return false\n// }\n// })\n// }\n// })",null]}