|
|
@ -2,7 +2,7 @@ |
|
|
|
<div :class="['panel', {active: pannelVisible}]" |
|
|
|
<div :class="['panel', {active: pannelVisible}]" |
|
|
|
id="panel"> |
|
|
|
id="panel"> |
|
|
|
<el-container class="scrollbar" |
|
|
|
<el-container class="scrollbar" |
|
|
|
v-if="pannelVisible"> |
|
|
|
v-show="pannelVisible"> |
|
|
|
<el-header id="header"> |
|
|
|
<el-header id="header"> |
|
|
|
<div class="panel-header"> |
|
|
|
<div class="panel-header"> |
|
|
|
<div class="project"> |
|
|
|
<div class="project"> |
|
|
@ -194,8 +194,10 @@ |
|
|
|
</el-container> |
|
|
|
</el-container> |
|
|
|
</el-container> |
|
|
|
</el-container> |
|
|
|
|
|
|
|
|
|
|
|
<div :class="['toggle-panel', {active: pannelVisible}]"> |
|
|
|
<div :class="['toggle-panel', {active: pannelVisible}]" |
|
|
|
<div @click="togglePannel"> |
|
|
|
id="toggle"> |
|
|
|
|
|
|
|
<!-- <div @click="togglePannel"> --> |
|
|
|
|
|
|
|
<div> |
|
|
|
<img :src="require(`@/assets/images/system/${$config.defaultSystem}/left.png`)" |
|
|
|
<img :src="require(`@/assets/images/system/${$config.defaultSystem}/left.png`)" |
|
|
|
alt |
|
|
|
alt |
|
|
|
class="c-p" |
|
|
|
class="c-p" |
|
|
@ -919,26 +921,68 @@ export default { |
|
|
|
const el = document.querySelector('#panel') |
|
|
|
const el = document.querySelector('#panel') |
|
|
|
let gap = 10 // 缝隙:小于缝隙时,则吸附 |
|
|
|
let gap = 10 // 缝隙:小于缝隙时,则吸附 |
|
|
|
let parent = document.body |
|
|
|
let parent = document.body |
|
|
|
document.querySelector('#header').onmousedown = e => { |
|
|
|
const drag = e => { |
|
|
|
console.log("🚀 ~ file: TestPanel.vue:746 ~ document.querySelector ~ e:", e) |
|
|
|
e.stopPropagation && e.stopPropagation() |
|
|
|
var x = e.clientX - el.offsetLeft |
|
|
|
e.preventDefault && e.preventDefault() |
|
|
|
var y = e.clientY - el.offsetTop |
|
|
|
e.cancelBubble = true |
|
|
|
var left = 0 |
|
|
|
e.returnValue = false |
|
|
|
var top = 0 |
|
|
|
let x = e.clientX - el.offsetLeft |
|
|
|
|
|
|
|
let y = e.clientY - el.offsetTop |
|
|
|
|
|
|
|
let left = 0 |
|
|
|
|
|
|
|
let top = 0 |
|
|
|
|
|
|
|
|
|
|
|
document.onmousemove = function (eve) { |
|
|
|
document.onmousemove = function (eve) { |
|
|
|
left = eve.clientX - x |
|
|
|
left = eve.clientX - x |
|
|
|
top = eve.clientY - y |
|
|
|
top = eve.clientY - y |
|
|
|
// 左 |
|
|
|
// // 左 |
|
|
|
if (left <= gap) { |
|
|
|
// if (left <= gap) { |
|
|
|
left = 0 |
|
|
|
// left = 0 |
|
|
|
} |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
if (left >= parent.offsetWidth - el.offsetWidth - gap - 35) { //大于整个盒子的宽度-小盒子的宽度 |
|
|
|
// if (left >= parent.offsetWidth - el.offsetWidth - gap - 35) { //大于整个盒子的宽度-小盒子的宽度 |
|
|
|
left = parent.offsetWidth - el.offsetWidth - 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 |
|
|
|
|
|
|
|
// const offsetWidth = this.pannelVisible ? el.offsetWidth : 0 |
|
|
|
|
|
|
|
// if (left >= parent.offsetWidth - offsetWidth - gap - 35) { //大于整个盒子的宽度-小盒子的宽度 |
|
|
|
|
|
|
|
// left = parent.offsetWidth - offsetWidth - 35 |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
// 上 |
|
|
|
// 上 |
|
|
|
if (top <= gap) top = 0 |
|
|
|
// if (top <= gap) top = 0 |
|
|
|
el.style.left = left + 'px' |
|
|
|
el.style.left = left + 'px' |
|
|
|
el.style.top = top + 'px' |
|
|
|
el.style.top = top + 'px' |
|
|
|
} |
|
|
|
} |
|
|
@ -947,6 +991,7 @@ export default { |
|
|
|
document.onmouseup = null |
|
|
|
document.onmouseup = null |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
document.querySelector('#toggle').onmousedown = drag1 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
@ -1158,7 +1203,7 @@ export default { |
|
|
|
top: 200px; |
|
|
|
top: 200px; |
|
|
|
bottom: 20px; |
|
|
|
bottom: 20px; |
|
|
|
left: 0; |
|
|
|
left: 0; |
|
|
|
width: 85%; |
|
|
|
width: 0; |
|
|
|
height: 0; |
|
|
|
height: 0; |
|
|
|
.toggle-panel { |
|
|
|
.toggle-panel { |
|
|
|
position: absolute; |
|
|
|
position: absolute; |
|
|
@ -1172,6 +1217,7 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
&.active { |
|
|
|
&.active { |
|
|
|
position: fixed; |
|
|
|
position: fixed; |
|
|
|
|
|
|
|
width: 85%; |
|
|
|
height: 70%; |
|
|
|
height: 70%; |
|
|
|
.toggle-panel { |
|
|
|
.toggle-panel { |
|
|
|
top: 38%; |
|
|
|
top: 38%; |
|
|
|