新增部门选人v2基础页面

This commit is contained in:
WenG 2022-05-04 23:31:32 +08:00
parent ba4cf8af77
commit be8b600b0a

View File

@ -0,0 +1,303 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
html,body{margin: 0; padding: 0;}
.container {
padding: 0px;
height: 100%;
width: 500px;
}
.container .top {
border-top: 1px;
border-right: 1px;
border-bottom: 0;
border-left: 1px;
border-style: solid;
border-color: silver;
padding: 5px;
}
.container .top .selected-user {
border: 1px dotted silver;
line-height: 30px;
padding: 5px;
overflow: hidden;
}
.container .top .selected-user .list {
width: 498px;
height: 60px;
overflow-y: scroll;
overflow-x: hidden;
}
.container .center {
border: 1px solid silver;
height: 40px;
overflow: hidden;
}
.container .center .list {
padding: 5px;
line-height: 30px;
height: 50px;
white-space: nowrap;
overflow-x: scroll;
overflow-y: hidden;
}
.container .center .list span::after {
content: '>';
}
.container .center .list span:last-child::after {
content: ''
}
.container .bottom {
font-size: 0;
}
.container .bottom .left {
display: inline-block;
width: 198px;
border-top: 0;
border-right: 1px;
border-bottom: 1px;
border-left: 1px;
border-style: solid;
border-color: silver;
overflow: hidden;
}
.container .bottom .left .list {
width: 216px;
height: 300px;
overflow-y: scroll;
overflow-x: hidden;
}
.container .bottom .left .list div {
font-size: 18px;
padding: 5px;
line-height: 30px;
border-top: 0;
border-right: 1px;
border-bottom: 1px;
border-left: 0;
border-style: dotted;
border-color: silver;
}
.container .bottom .left .list div:last-child {
border-bottom: 0;
}
.container .bottom .right {
display: inline-block;
width: 299px;
border-top: 0;
border-right: 1px;
border-bottom: 1px;
border-left: 0px;
border-style: solid;
border-color: silver;
overflow: hidden;
}
.container .bottom .right .list {
width: 316px;
height: 300px;
overflow-y: scroll;
overflow-x: hidden;
}
.container .bottom .right .list .user-item {
padding: 5px;
border-bottom: 1px dotted silver;
}
.container .bottom .right .list .user-item .avatar {
display: inline-block;
width: 40px;
height: 40px;
}
.container .bottom .right .list .user-item .avatar img {
width: 100%;
height: 100%;
}
.container .bottom .right .list .user-item .info {
display: inline-block;
font-size: 14px;
line-height: 20px;
vertical-align: top;
margin-left: 5px;
}
.container .bottom .right .list .user-item .info div {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
width: 244px;
}
.container .bottom .right .list .user-item .checked {
display: none;
}
.container .bottom .right .list .active {
background: #f1f1f1;
position: relative;
}
.container .bottom .right .list .active .checked {
position: absolute;
display: block;
top: 12px;
right: 12px;
width: 25px;
height: 25px;
background: black;
}
</style>
</head>
<body>
<div class="container">
<div class="top">
<div class="selected-user">
<div class="list">
<button>asdfasdfasdfasdfasdfasdfasdfasdfas1</button>
<button>asdfasdfasdfasdfasdfasdfasdfasdfas1</button>
<button>asdfasdfasdfasdfasdfasdfasdfasdfas1</button>
<button>asdfasdfasdfasdfasdfasdfasdfasdfas1</button>
<button>asdfasdfasdfasdfasdfasdfasdfasdfas1</button>
<button>6</button>
<button>7</button>
<button>8</button>
<button>9</button>
<button>10</button>
</div>
</div>
</div>
<div class="center">
<div class="list">
<span>1级部门</span>
<span>2级部门</span>
<span>3级部门</span>
<span>4级部门</span>
<span>4级部门</span>
<span>4级部门</span>
<span>4级部门</span>
<span>4级部门</span>
<span>4级部门</span>
<span>4级部门</span>
<span>4级部门</span>
<span>4级部门</span>
<span>4级部门</span>
<span>4级部门</span>
<span>4级部门</span>
<span>4级部门</span>
<span>4级部门</span>
</div>
</div>
<div class="bottom">
<div class="left">
<div class="list">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
</div>
</div>
<div class="right">
<div class="list">
<div class="user-item">
<div class="avatar">
<img src="123"/>
</div>
<div class="info">
<div class="username">管理员admin</div>
<div class="phone">18688888888</div>
</div>
<div class="checked"></div>
</div>
<div class="user-item active">
<div class="avatar">
<img src="123"/>
</div>
<div class="info">
<div class="username">管理员admin</div>
<div class="phone">18688888888</div>
</div>
<div class="checked"></div>
</div>
</div>
</div>
</div>
</div>
<script>
var winWidth = window.innerWidth;
var winHeight = window.innerHeight;
var containerWidth = winWidth +'px';
var containerTopSselectedUserListWidth = (winWidth - 2) + 'px';
var containerBottomLeftWidth = (winWidth * (2 / 5) - 2) +'px';
var containerBottomLeftListWidth = (winWidth * (2 / 5) + 16) +'px';
var containerBottomLeftListHeight = (winHeight - 126) +'px';
var containerBottomRightWidth = (winWidth * (3 / 5) - 1) +'px';
var containerBottomRightListWidth = (winWidth * (3 / 5) + 16) +'px';
var containerBottomRightListHeight = (winHeight - 126) +'px';
var containerBottomRightListUserItemInfoDivWidth = (winWidth * (3 / 5) - 56) +'px';
// 初始化整体样式
function initStyle() {
document.querySelectorAll('.container').forEach(function(item) {
item.style.width = containerWidth;
});
document.querySelectorAll('.container .top .selected-user .list').forEach(function(item) {
item.style.width = containerTopSselectedUserListWidth;
});
document.querySelectorAll('.container .bottom .left').forEach(function(item) {
item.style.width = containerBottomLeftWidth;
});
document.querySelectorAll('.container .bottom .left .list').forEach(function(item) {
item.style.width = containerBottomLeftListWidth;
item.style.height = containerBottomLeftListHeight;
});
document.querySelectorAll('.container .bottom .right').forEach(function(item) {
item.style.width = containerBottomRightWidth;
});
document.querySelectorAll('.container .bottom .right .list').forEach(function(item) {
item.style.width = containerBottomRightListWidth;
item.style.height = containerBottomRightListHeight;
});
}
// 初始化用户列表样式
function initUserListStyle() {
document.querySelectorAll('.container .bottom .right .list .user-item .info div').forEach(function(item) {
item.style.width = containerBottomRightListUserItemInfoDivWidth;
});
}
initStyle();
initUserListStyle();
</script>
</body>
</html>