
<template>
<div class="app-container road-sprinkler-workload">
<div class="window-box">
<div class="equipmentName">
<div class="video-tag-list">
<div class="video-tag-btn" v-for="(item,index) in equipmentType.slice(0,2)" :key="index">{{item}}</div>
<div class="video-tag-arrow">
<i id="textI" class="cameraName iconfont icon-xiangxia"></i>
</div>
</div>
</div>
<div class="video-tag-list video-drop video-drop-down">
<div class="video-tag-btn" v-for="(item1,index1) in equipmentType.slice(2,equipmentType.length)" :key="index1">{{item1}}</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "HelloWorld",
data() {
return {
equipmentType: ["道", "域", "业"],
videoDrop: false,
};
},
created() {
this.info();
},
methods: {
info() {
this.$nextTick(() => {
if (this.equipmentType.length > 2) {
let arrow = document.getElementsByClassName("video-tag-arrow");
let down = document.getElementsByClassName(`video-drop`);
let downBtn = down[down.length - 1];
let arrowBtn = arrow[arrow.length - 1];
this.videoDrop = false;
downBtn.style.display = "none";
arrowBtn.style.background = "#fff";
if (arrow.length) {
if (!arrowBtn.onclick) {
arrowBtn.onclick = () => {
this.videoDrop = !this.videoDrop;
if (this.videoDrop) {
downBtn.style.display = "grid";
arrowBtn.style.background = "#f90000";
arrowBtn.style.transform = "rotate(180deg)";
arrowBtn.style.color = "#fff";
} else {
downBtn.style.display = "none";
arrowBtn.style.background = "#fff";
arrowBtn.style.color = "#909399";
arrowBtn.style.transform = "rotate(360deg)";
}
};
}
}
}
});
},
},
};
</script>
<style scoped>
.window-box {
position: relative;
background-size: 100% 100%;
}
.type {
display: flex;
height: 32px;
line-height: 32px;
}
.typeItem {
background: #006eff;
color: #fff;
border-radius: 50000px;
padding: 0 14px;
margin-left: 10px;
}
.equipmentName {
height: 40px;
line-height: 40px;
color: #606266;
font-size: 14px;
display: flex;
align-items: center;
padding: 0 16px;
}
.equipmentTypeName {
background: #f90000;
border-radius: 50000px;
display: block;
height: 26px;
line-height: 26px;
padding: 0 12px;
color: #fff;
margin-left: 14px;
}
.video-tag-list {
display: flex;
align-items: center;
justify-content: right;
width: 194px;
}
.video-tag-btn {
min-width: 74px;
height: 26px;
background: #f90000;
border-radius: 13px;
color: #ffffff;
font-size: 12px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 10px;
}
.video-tag-arrow {
width: 18px;
height: 18px;
background: #f90000;
border-radius: 3px;
border: 1px solid #d8dce6;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.video-tag-arrow i {
font-size: 7px;
}
.video-tag-arrow:hover {
background: #f90000 !important;
}
.video-tag-arrow:hover i {
color: #fff;
}
.video-tag-arrow i {
margin-top: 1px;
}
.video-drop-down {
position: absolute;
z-index: 24;
left: 16px;
top: 50px;
width: 198px;
background: #ffffff;
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.1);
border-radius: 10px;
display: none;
grid-template-columns: repeat(2, 1fr);
box-sizing: border-box;
padding: 18px 10px 10px 18px;
}
.video-drop-down .video-tag-btn {
margin-bottom: 10px;
}
</style>