{"remainingRequest":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/thread-loader/dist/cjs.js!/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/babel-loader/lib/index.js!/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/eslint-loader/index.js??ref--13-0!/data/jenkins/workspace/test-v5inweb-5.x-vue/src/assets/js/directive.js","dependencies":[{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/src/assets/js/directive.js","mtime":1739760944276},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/babel.config.js","mtime":1739760943855},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/babel-loader/lib/index.js","mtime":315532800000},{"path":"/data/jenkins/workspace/test-v5inweb-5.x-vue/node_modules/eslint-loader/index.js","mtime":499162500000}],"contextDependencies":[],"result":["// Vue自定义指令\n\n// dialog可以拖来拖去\nvar directive = function directive(Vue) {\n Vue.directive('drag2anywhere', {\n // 当被绑定的元素插入到 DOM 中时……\n inserted: function inserted(el) {\n el.style.overflow = 'hidden';\n var target = el.childNodes[0];\n var targetHeader = target.childNodes[0];\n var isOnclick = false;\n var mouseX;\n var mouseY;\n var objX;\n var objY;\n targetHeader.onmousedown = function (event) {\n isOnclick = true;\n target.style.cursor = 'move';\n target.style.left = target.offsetLeft + 'px'; // 先记录之前的位置\n target.style.top = target.offsetTop + 'px'; // 先记录之前的位置\n target.style.margin = '0'; // 去掉margin\n mouseX = event.clientX;\n mouseY = event.clientY;\n objX = parseInt(target.style.left || target.offsetLeft);\n objY = parseInt(target.style.top || target.offsetTop);\n document.onmousemove = null; // 解绑监听鼠标拖动事件\n document.onmousemove = function (event) {\n // 监听鼠标拖动事件\n if (isOnclick) {\n event = event || window.event;\n target.style.left = parseInt(event.clientX - mouseX + objX) + 'px';\n target.style.top = parseInt(event.clientY - mouseY + objY) + 'px';\n }\n };\n };\n targetHeader.onmouseup = function (event) {\n // 松开鼠标\n isOnclick = false;\n target.style.cursor = 'default';\n };\n }\n });\n};\nexport default directive;",null]}