|
@@ -6,7 +6,7 @@
|
|
|
position: absolute;
|
|
|
width: 344px;
|
|
|
height: 466px;
|
|
|
- min-height: 164px !important;
|
|
|
+ min-height: 165px !important;
|
|
|
"
|
|
|
:style="{
|
|
|
zIndex: fixWindowMessage.zIndex,
|
|
@@ -155,7 +155,7 @@ export default {
|
|
|
top: 0,
|
|
|
bottom: '10px',
|
|
|
right: 0,
|
|
|
- left: '120px',
|
|
|
+ left: '220px',
|
|
|
// widgetZindexIsMax: false,
|
|
|
progrecssFirstClick: {
|
|
|
lastY: 0,
|
|
@@ -277,12 +277,11 @@ export default {
|
|
|
PortaSelectPosition,
|
|
|
},
|
|
|
mounted() {
|
|
|
- // this.$bus.on("changeFixWindowZIndex", this.changeFixWindowZIndex);
|
|
|
this.$bus.on("showOrHiddenWidgetItem", this.showOrHiddenWidgetItem);
|
|
|
this.$bus.on("changeThumbHeight", this.changeThumbHeight);
|
|
|
this.$bus.on("showOrHiddenWidget", this.showOrHiddenWidget);
|
|
|
this.$bus.on("changeWidgetPosition", this.changeWidgetPosition);
|
|
|
- // this.$bus.on('dialogWindowZIndexIsMax',this.dialogWindowZIndexIsMax)
|
|
|
+ this.$bus.on('closeWidgetItem',this.closeWidgetItem)
|
|
|
this.fixWindowMessage = this.fixWindowData;
|
|
|
let el = document.querySelector(".v-widget-window .ps__thumb-y");
|
|
|
let el1 = document.querySelector(
|
|
@@ -292,24 +291,31 @@ export default {
|
|
|
el1.addEventListener("mouseup", this.mouseupWidgetHeader);
|
|
|
let el2 = document.querySelector(".v-widget-window .v-widget-list");
|
|
|
let el3 = document.querySelector(".v-widget-window .ps__rail-y");
|
|
|
+ let el4 = document.querySelector(".v-widget-window");
|
|
|
if (el2.offsetHeight > el3.offsetHeight) {
|
|
|
- this.bottom = "0";
|
|
|
+ this.top = 0;
|
|
|
+ this.bottom = 0;
|
|
|
this.thumbYDisplay = "block";
|
|
|
this.thumbYHeight = "calc((100vh - 52px) / 2)";
|
|
|
}
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.left = 0
|
|
|
+ this.right = '10px'
|
|
|
+ },400)
|
|
|
window.addEventListener("resize", (e) => {
|
|
|
if (el2.offsetHeight > el3.offsetHeight) {
|
|
|
- this.bottom = "0";
|
|
|
this.thumbYDisplay = "block";
|
|
|
this.thumbYHeight = "calc((100vh - 52px) / 2)";
|
|
|
} else {
|
|
|
this.thumbYDisplay = "none";
|
|
|
}
|
|
|
+ let left = document.documentElement.clientWidth - el4.offsetWidth
|
|
|
+ if(left >= 0 && left < el4.offsetWidth){
|
|
|
+ this.left = left + 'px'
|
|
|
+ }else if(left < 0) {
|
|
|
+ this.left = 0
|
|
|
+ }
|
|
|
});
|
|
|
- setTimeout(()=>{
|
|
|
- this.left = 0
|
|
|
- this.right = '10px'
|
|
|
- },0)
|
|
|
},
|
|
|
methods: {
|
|
|
//点击固定窗口
|
|
@@ -325,7 +331,6 @@ export default {
|
|
|
let el = document.querySelector(".v-widget-window .ps__thumb-y");
|
|
|
let el1 = document.querySelector(".v-widget-window");
|
|
|
el.addEventListener("mousemove", this.moveProgress);
|
|
|
-
|
|
|
if (el.style.top && el.style.top.includes("px")) {
|
|
|
let top = parseInt(el.style.top.replace("px", ""));
|
|
|
this.progrecssFirstClick.thumbStyletop = top;
|
|
@@ -363,6 +368,7 @@ export default {
|
|
|
(el2.offsetHeight - el1.offsetHeight) /
|
|
|
(el1.offsetHeight - el.offsetHeight)
|
|
|
) * moveY;
|
|
|
+ console.log(moveY)
|
|
|
el.style.top = moveY + "px";
|
|
|
el2.style.top = moveY2 + "px";
|
|
|
el.addEventListener("mouseup", this.mouseupProgress);
|
|
@@ -380,13 +386,12 @@ export default {
|
|
|
let el = document.querySelector(".v-widget-window .ps__thumb-y");
|
|
|
let el1 = document.querySelector(".v-widget-window .ps__rail-y");
|
|
|
let el2 = document.querySelector(".v-widget-window .ps--active-y");
|
|
|
- // if(! this.widgetListIsBottom){
|
|
|
let moveY =
|
|
|
((el1.offsetHeight - el.offsetHeight) /
|
|
|
(e.target.scrollHeight - el2.offsetHeight)) *
|
|
|
e.target.scrollTop;
|
|
|
el.style.top = moveY + e.target.scrollTop + "px";
|
|
|
- // }
|
|
|
+ console.log(moveY,el.style.top)
|
|
|
},
|
|
|
// 点击勾选小窗口的加号
|
|
|
selectWidgetItem() {
|
|
@@ -394,10 +399,6 @@ export default {
|
|
|
},
|
|
|
// 点击小窗口选择框的每一项
|
|
|
showOrHiddenWidgetItem(obj) {
|
|
|
- let widgetItemArray = document.querySelectorAll(
|
|
|
- ".v-widget-window .v-widget-item"
|
|
|
- );
|
|
|
- Array.from(widgetItemArray)[obj.index].className = obj.cls;
|
|
|
this.portalDetail.detailMessageList[obj.index].cls = obj.cls1;
|
|
|
this.portalDetail.detailMessageList.forEach((item, index) => {
|
|
|
if (item.cls && item.cls.includes("active") && index !== 0) {
|
|
@@ -409,20 +410,25 @@ export default {
|
|
|
changeThumbHeight(selectedNum) {
|
|
|
let el1 = document.querySelector(".v-widget-window .v-widget-list");
|
|
|
let el2 = document.querySelector(".v-widget-window .ps__rail-y");
|
|
|
- if (selectedNum > 2) {
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ if (el1.offsetHeight > el2.offsetHeight) {
|
|
|
if (selectedNum >= 6) {
|
|
|
selectedNum = 6;
|
|
|
}
|
|
|
this.thumbYDisplay = "block";
|
|
|
- this.thumbYHeight = (7 - selectedNum) * 70 + "px";
|
|
|
+ if(el2.offsetHeight > (7 - selectedNum) * 70){
|
|
|
+ this.thumbYHeight = (7 - selectedNum) * 70 + "px";
|
|
|
+ }else{
|
|
|
+ this.thumbYHeight = "calc((100vh - 52px) / 2)";
|
|
|
+ }
|
|
|
} else {
|
|
|
this.thumbYDisplay = "none";
|
|
|
}
|
|
|
- if (el2.offsetHeight < 424 && el1.offsetHeight > el2.offsetHeight) {
|
|
|
- this.thumbYDisplay = "block";
|
|
|
- this.thumbYHeight = "calc((100vh - 52px) / 2)";
|
|
|
- }
|
|
|
- this.selectedNum = selectedNum;
|
|
|
+ this.selectedNum = selectedNum;
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
},
|
|
|
//点击固定窗口头部
|
|
|
mousedownWidgetHeader(e) {
|
|
@@ -446,20 +452,21 @@ export default {
|
|
|
el2.style.display = "none";
|
|
|
// X轴
|
|
|
let moveX = e.pageX - this.widgetFirstClick.layerX;
|
|
|
+ if (moveX > this.widgetFirstClick.screenX - el1.offsetWidth) {
|
|
|
+ moveX = this.widgetFirstClick.screenX - el1.offsetWidth;
|
|
|
+ }
|
|
|
if (moveX < 0) {
|
|
|
moveX = 0;
|
|
|
}
|
|
|
- if (moveX > this.widgetFirstClick.screenX - el1.style.width) {
|
|
|
- moveX = this.widgetFirstClick.screenX - el1.style.width;
|
|
|
- }
|
|
|
// Y轴
|
|
|
let moveY = e.pageY - this.widgetFirstClick.layerY;
|
|
|
+ if (moveY > this.widgetFirstClick.screenY - el1.offsetHeight) {
|
|
|
+ moveY = this.widgetFirstClick.screenY - el1.offsetHeight;
|
|
|
+ }
|
|
|
if (moveY < 0) {
|
|
|
moveY = 0;
|
|
|
}
|
|
|
- if (moveY > this.widgetFirstClick.screenY - el1.style.height) {
|
|
|
- moveY = this.widgetFirstClick.screenY - el1.style.height;
|
|
|
- }
|
|
|
+
|
|
|
this.left = moveX + "px";
|
|
|
this.top = moveY + "px";
|
|
|
if (!el1.className.includes(" move")) {
|
|
@@ -559,6 +566,14 @@ export default {
|
|
|
this.$bus.emit("fixWindowZIndexMax", true);
|
|
|
}
|
|
|
},
|
|
|
+ // 关闭widgetItem
|
|
|
+ closeWidgetItem(title){
|
|
|
+ this.portalDetail.detailMessageList.forEach(item=>{
|
|
|
+ if(item.title === title){
|
|
|
+ item.cls = item.cls.replace('v-menu-item-select-selected selected','')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
//节流函数
|
|
|
throttle(fn, time, e) {
|
|
|
var lastTime = 0;
|