拉伸宽度

ds1.0
fanluyan 2 years ago
parent be63d7a1a7
commit 450d02ef6a

@ -53,6 +53,7 @@
</span> --> </span> -->
</el-tree> </el-tree>
</div> </div>
<div class="resize" title="收缩侧边栏"></div>
<!-- 带参数的中心内容右侧参数区 --> <!-- 带参数的中心内容右侧参数区 -->
<div class="picSetBox"> <div class="picSetBox">
<div class="swiperBox" v-loading="loadingpic"> <div class="swiperBox" v-loading="loadingpic">
@ -293,7 +294,9 @@ export default {
return storetermid; return storetermid;
}, },
}, },
mounted() {}, mounted() {
this.dragControllerDiv();
},
created() { created() {
this.getLineTreeList(); this.getLineTreeList();
this.getDateTime(); this.getDateTime();
@ -802,7 +805,49 @@ export default {
// this.$router.push({ path: "/realTimeSearch" }); // this.$router.push({ path: "/realTimeSearch" });
// // sessionStorage.setItem("keyPath", " realTimeSearch"); // // sessionStorage.setItem("keyPath", " realTimeSearch");
// }, // },
dragControllerDiv() {
var resize = document.getElementsByClassName("resize");
var left = document.getElementsByClassName("sideBar");
var mid = document.getElementsByClassName("picSetBox");
var box = document.getElementsByClassName("monitor-container");
for (let i = 0; i < resize.length; i++) {
//
resize[i].onmousedown = function (e) {
//
resize[i].style.background = "#128071";
var startX = e.clientX;
resize[i].left = resize[i].offsetLeft;
//
document.onmousemove = function (e) {
var endX = e.clientX;
var moveLen = resize[i].left + (endX - startX); // endx-startx=resize[i].left+=
var maxT = box[i].clientWidth - resize[i].offsetWidth; // - =
if (moveLen < 290) moveLen = 290; // 32px
if (moveLen > maxT - 600) moveLen = maxT - 600; //150px
resize[i].style.left = moveLen; //
for (let j = 0; j < left.length; j++) {
left[j].style.width = moveLen + "px";
mid[j].style.width = box[i].clientWidth - moveLen - 3 + "px";
}
};
//
document.onmouseup = function (evt) {
//
resize[i].style.background = "#dcdfe6";
document.onmousemove = null;
document.onmouseup = null;
resize[i].releaseCapture && resize[i].releaseCapture(); //ReleaseCapture()
};
resize[i].setCapture && resize[i].setCapture(); //线
return false;
};
}
},
}, },
destroyed() { destroyed() {
clearInterval(this.treetimer); clearInterval(this.treetimer);
this.treetimer = null; this.treetimer = null;
@ -831,7 +876,7 @@ export default {
border-radius: 4px; border-radius: 4px;
.sideBar { .sideBar {
width: 300px; width: 300px;
border-right: 1px solid @border-color-base; //border-right: 1px solid @border-color-base;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 16px 0px; padding: 16px 0px;
@ -865,6 +910,20 @@ export default {
color: #d3d3d3; color: #d3d3d3;
} }
} }
/*拖拽区div样式*/
.resize {
cursor: col-resize;
float: left;
position: relative;
background-color: #dcdfe6;
width: 3px;
height: 100%;
/*拖拽区鼠标悬停样式*/
&:hover {
background-color: #169e8c;
}
}
.picSetBox { .picSetBox {
display: flex; display: flex;
width: 100%; width: 100%;
@ -872,6 +931,7 @@ export default {
//background: #fcc; //background: #fcc;
flex: 1; flex: 1;
overflow: hidden; overflow: hidden;
border-left: 1px solid @border-color-base;
.swiperBox { .swiperBox {
-webkit-box-flex: 1; -webkit-box-flex: 1;
-ms-flex: 1; -ms-flex: 1;

Loading…
Cancel
Save