From f37c144e46e052c0b446d214e4d6dd844508a546 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Mon, 10 Jul 2023 17:10:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E9=AA=8C=E9=9D=A2=E6=9D=BF=E6=8B=96?= =?UTF-8?q?=E6=8B=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TestPanel.vue | 80 ++++++++++++++++++++++++++++-------- src/config/index.js | 8 +++- src/views/Home.vue | 2 +- 3 files changed, 71 insertions(+), 19 deletions(-) diff --git a/src/components/TestPanel.vue b/src/components/TestPanel.vue index 2e1e940..e4ff4a7 100644 --- a/src/components/TestPanel.vue +++ b/src/components/TestPanel.vue @@ -2,7 +2,7 @@
+ v-show="pannelVisible">
@@ -194,8 +194,10 @@ -
-
+
+ +
{ - console.log("🚀 ~ file: TestPanel.vue:746 ~ document.querySelector ~ e:", e) - var x = e.clientX - el.offsetLeft - var y = e.clientY - el.offsetTop - var left = 0 - var top = 0 + const drag = e => { + e.stopPropagation && e.stopPropagation() + e.preventDefault && e.preventDefault() + e.cancelBubble = true + e.returnValue = false + let x = e.clientX - el.offsetLeft + let y = e.clientY - el.offsetTop + let left = 0 + let top = 0 document.onmousemove = function (eve) { + left = eve.clientX - x + top = eve.clientY - y + // // 左 + // if (left <= gap) { + // left = 0 + // } + + // if (left >= parent.offsetWidth - el.offsetWidth - gap - 35) { //大于整个盒子的宽度-小盒子的宽度 + // left = parent.offsetWidth - el.offsetWidth - 35 + // } + // // 上 + // if (top <= gap) top = 0 + el.style.left = left + 'px' + el.style.top = top + 'px' + } + document.onmouseup = e => { + document.onmousemove = null + document.onmouseup = null + } + } + document.querySelector('#header').onmousedown = drag + + + const toggle = document.querySelector('#toggle') + const drag1 = e => { + e.stopPropagation && e.stopPropagation() + e.preventDefault && e.preventDefault() + e.cancelBubble = true + e.returnValue = false + + let timer = setTimeout(this.togglePannel, 200) + + let x = e.clientX - el.offsetLeft + let y = e.clientY - el.offsetTop + + let left = 0 + let top = 0 + + document.onmousemove = function (eve) { + clearTimeout(timer) left = eve.clientX - x top = eve.clientY - y // 左 - if (left <= gap) { - left = 0 - } + // if (left <= gap) left = 0 + // const offsetWidth = this.pannelVisible ? el.offsetWidth : 0 + // if (left >= parent.offsetWidth - offsetWidth - gap - 35) { //大于整个盒子的宽度-小盒子的宽度 + // left = parent.offsetWidth - offsetWidth - 35 + // } - if (left >= parent.offsetWidth - el.offsetWidth - gap - 35) { //大于整个盒子的宽度-小盒子的宽度 - left = parent.offsetWidth - el.offsetWidth - 35 - } // 上 - if (top <= gap) top = 0 + // if (top <= gap) top = 0 el.style.left = left + 'px' el.style.top = top + 'px' } @@ -947,6 +991,7 @@ export default { document.onmouseup = null } } + document.querySelector('#toggle').onmousedown = drag1 } } }; @@ -1158,7 +1203,7 @@ export default { top: 200px; bottom: 20px; left: 0; - width: 85%; + width: 0; height: 0; .toggle-panel { position: absolute; @@ -1172,6 +1217,7 @@ export default { } &.active { position: fixed; + width: 85%; height: 70%; .toggle-panel { top: 38%; diff --git a/src/config/index.js b/src/config/index.js index af087bf..9e82727 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -5,7 +5,7 @@ const isDev = process.env.NODE_ENV === 'development' //是否本地 const isHh = url.includes('10.196.131.73') //是否是河海版本 const isPro = url.includes('occupationlab.com') //是否职站生产 const isZxy = url.includes('izhixinyun.com') //是否智信云 - +let vscodeUrl = 'https://vscode.izhixinyun.com' let host = location.origin + '/' let bankPath = `${location.origin}/banksystem` // 银行系统 // 121.37.12.51 | 192.168.31.151 @@ -15,9 +15,11 @@ if (isDev) { host = 'http://121.37.12.51:9000/' // host = 'https://occupationlab.com/' bankPath = `http://${location.hostname}:8093` + vscodeUrl = 'http://121.37.12.51:8088/?folder=/home/coder' } else if (isPro) { host = 'https://occupationlab.com/' bankPath = `https://www.huorantech.cn/banksystem` + vscodeUrl = 'https://vscode.occupationlab.com/' } const systemId = Cookie.get('admin-systemId') export default { @@ -50,6 +52,10 @@ export default { * 银行系统 **/ bankPath, + /** + * vscode地址 + **/ + vscodeUrl, /** * @description 长时间未操作,自动退出登录时间 */ diff --git a/src/views/Home.vue b/src/views/Home.vue index dff7d9d..a2b1271 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -62,7 +62,7 @@ @cache="leavePage">