Commit 1b117ff2 by 张立顺

代码体积

1 parent dbdcbbe5
This file is too large to display.
......@@ -14,15 +14,18 @@
<div class="tab">
<div v-for="(item, index) in menuList" :key="index">
<template v-if="item.tabName == 'business' && item.isShow">
<div class="tab-item first-tab" :class="currentMenu == item.tabName ? 'active' : ''" @click.prevent="jump(item.tabName)">
<div class="tab-item first-tab" :class="currentMenu == item.tabName ? 'active' : ''"
@click.prevent="jump(item.tabName)">
<div class="tab-title">{{ firstTab.label }}</div>
<img class="arrow-down" @click.stop="openSelect" src="@/assets/images/title-arrow.png" alt="">
<SelectBox :isShow="isShow" @clickOutside="clickOutside" :dataList="item.children" :boxWidth="'16.94vw'" isObject @selectVal="selectVal"></SelectBox>
</div>
<img class="arrow-down" @click.stop="openSelect" src="@/assets/images/title-arrow.png" alt="">
<SelectBox :isShow="isShow" @clickOutside="clickOutside" :dataList="item.children" :boxWidth="'16.94vw'"
isObject @selectVal="selectVal"></SelectBox>
</div>
</template>
<template v-else>
<div v-show="item.isShow" class="tab-item other-tab" :class="currentMenu == item.tabName ? 'active' : ''" @click="jump(item.tabName)">
<div class="tab-name">{{item.label}}</div>
<div v-show="item.isShow" class="tab-item other-tab" :class="currentMenu == item.tabName ? 'active' : ''"
@click="jump(item.tabName)">
<div class="tab-name">{{ item.label }}</div>
</div>
</template>
</div>
......@@ -33,7 +36,7 @@
<img class="arrow-down" @click.stop="openSelect" src="@/assets/images/title-arrow.png" alt="">
<SelectBox :isShow="isShow" @clickOutside="clickOutside" :dataList="dataList" :boxWidth="'16.94vw'" isObject @selectVal="selectVal"></SelectBox>
</div> -->
<!-- <div class="tab-item other-tab" :class="currentMenu == 'operational' ? 'active' : ''" @click="jump('operational')">
<!-- <div class="tab-item other-tab" :class="currentMenu == 'operational' ? 'active' : ''" @click="jump('operational')">
<div class="tab-name">运营数据</div>
</div>
<div class="tab-item other-tab" :class="currentMenu == 'interior' ? 'active' : ''" @click="jump('interior')">
......@@ -69,6 +72,7 @@ export default {
created() {
const { menuList, $roleAuth, $role } = this
const permissions = $roleAuth[$role]
console.log(permissions, 'permissions')
menuList.forEach(menu => {
if (menu.children) {
menu.children = menu.children.filter(child => {
......@@ -124,6 +128,7 @@ export default {
box-sizing: border-box;
padding: 0 26px 0 24px;
justify-content: space-between;
.view-title {
font-weight: 600;
font-size: 24px;
......@@ -131,16 +136,20 @@ export default {
letter-spacing: 8px;
text-align: center;
}
.time {
text-align: right;
font-size: 14px;
color: #ffffff;
.top {
justify-content: flex-end;
.now {
width: 11.2vw;
}
}
.icon {
width: 14px;
height: 14px;
......@@ -148,11 +157,13 @@ export default {
}
}
}
.tab {
display: flex;
// align-items: center;
color: #FFFFFF;
font-size: 16px;
&-item {
position: relative;
display: flex;
......@@ -166,21 +177,25 @@ export default {
border-image: linear-gradient(90deg, #074989, #30DCFF, #074989) 1;
background-image: linear-gradient(180deg, #001948 0%, #00223C 99%);
cursor: pointer;
.tab-title {
max-width: 18.61vw;
}
}
.first-tab {
position: relative;
width: 16.94vw;
box-sizing: border-box;
justify-content: flex-start;
padding-left: 1.39vw;
&.active {
background-image: url('../assets/images/first-tab-bg.png');
background-repeat: no-repeat;
background-size: 100% 100%;
border: none;
.tab-title {
color: #5894FF;
background-image: -webkit-linear-gradient(left, #24D8FF, #7787FF);
......@@ -188,6 +203,7 @@ export default {
-webkit-text-fill-color: transparent;
}
}
.arrow-down {
position: absolute;
top: 50%;
......@@ -198,14 +214,17 @@ export default {
height: 2.22vh;
}
}
.other-tab{
.other-tab {
width: 7.22vw;
box-sizing: border-box;
&.active {
background-image: url('../assets/images/other-tab-bg.png');
background-repeat: no-repeat;
background-size: 100% 100%;
border: none;
.tab-name {
color: #5894FF;
background-image: -webkit-linear-gradient(left, #24D8FF, #7787FF);
......@@ -214,5 +233,4 @@ export default {
}
}
}
}
</style>
}</style>
......@@ -11,6 +11,11 @@ const DefaultData = {
yearList: ['2023', '2022'],
menuList: [
{
label: '汽车全生命周期场景图',
tabName: 'lifecycleOfCar',
value: 'lifecycleOfCar'
},
{
tabName: 'business',
children: [
{
......@@ -45,6 +50,11 @@ const DefaultData = {
tabName: 'interior',
value: 'interior'
}
// {
// label: '汽车全生命周期场景图',
// tabName: 'lifecycleOfCar',
// value: 'lifecycleOfCar'
// }
],
directionTimer: 3000,
delayTimer: 3000
......
<template>
<!-- 汽车全生命周期场景图 -->
<div class="entireLifecycleOfCarCon">
</div>
</template>
<script>
export default {
name: 'EntireLifecycleOfCar',
components: {
},
data() {
return {
}
},
created() {
},
mounted() {
},
methods: {
}
}
</script>
<style></style>
<!--
* @Description:
* @Description:
* @Author: huyue
* @Date: 2023-07-04 13:55:35
* @LastEditors: huyue
......@@ -53,6 +53,8 @@ export default {
case 'business':
sname = 'ViewSolar'
break
case 'lifecycleOfCar':
sname = 'viewEntireLifecycleOfCar'
// default:
// sname = 'ViewSolar'
}
......@@ -77,6 +79,5 @@ export default {
}
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>
<template>
<!-- 汽车全生命周期场景图 -->
<div class="view-content">
<!-- <div class="scene">
<div class="carousel">
<div class="carousel__cell">1</div>
<div class="carousel__cell">2</div>
<div class="carousel__cell">3</div>
<div class="carousel__cell">4</div>
<div class="carousel__cell">5</div>
<div class="carousel__cell">6</div>
<div class="carousel__cell">7</div>
</div>
</div> -->
<!-- <div class="carousel-options">
<p>
<label>
Cells
<input class="cells-range" type="range" min="3" max="15" value="9" />
</label>
</p>
<p>
<button class="previous-button">Previous</button>
<button class="next-button">Next</button>
</p>
<p>
Orientation:
<label>
<input type="radio" name="orientation" value="horizontal" checked />
horizontal
</label>
<label>
<input type="radio" name="orientation" value="vertical" />
vertical
</label>
</p>
</div> -->
</div>
</template>
<script>
export default {
name: 'ViewEntireLifecycleOfCar',
components: {
},
data() {
return {
}
},
created() {
},
mounted() {
var carousel = document.querySelector('.carousel')
var cells = carousel.querySelectorAll('.carousel__cell')
var cellCount // cellCount set from cells-range input value
var selectedIndex = 0
var cellWidth = carousel.offsetWidth
var cellHeight = carousel.offsetHeight
var isHorizontal = true
var rotateFn = isHorizontal ? 'rotateY' : 'rotateX'
var radius, theta
// console.log( cellWidth, cellHeight );
function rotateCarousel() {
var angle = theta * selectedIndex * -1
carousel.style.transform = 'translateZ(' + -radius + 'px) ' +
rotateFn + '(' + angle + 'deg)'
}
var prevButton = document.querySelector('.previous-button')
prevButton.addEventListener('click', function () {
selectedIndex--
rotateCarousel()
})
var nextButton = document.querySelector('.next-button')
nextButton.addEventListener('click', function () {
selectedIndex++
rotateCarousel()
})
var cellsRange = document.querySelector('.cells-range')
cellsRange.addEventListener('change', changeCarousel)
cellsRange.addEventListener('input', changeCarousel)
function changeCarousel() {
cellCount = cellsRange.value
theta = 360 / cellCount
var cellSize = isHorizontal ? cellWidth : cellHeight
radius = Math.round((cellSize / 2) / Math.tan(Math.PI / cellCount))
for (var i = 0; i < cells.length; i++) {
var cell = cells[i]
if (i < cellCount) {
// visible cell
cell.style.opacity = 1
var cellAngle = theta * i
cell.style.transform = rotateFn + '(' + cellAngle + 'deg) translateZ(' + radius + 'px) ' + `translateZ (100px)`
} else {
// hidden cell
cell.style.opacity = 0
cell.style.transform = 'none'
}
}
rotateCarousel()
}
var orientationRadios = document.querySelectorAll('input[name="orientation"]');
(function () {
for (var i = 0; i < orientationRadios.length; i++) {
var radio = orientationRadios[i]
radio.addEventListener('change', onOrientationChange)
}
})()
function onOrientationChange() {
var checkedRadio = document.querySelector('input[name="orientation"]:checked')
isHorizontal = checkedRadio.value == 'horizontal'
rotateFn = isHorizontal ? 'rotateY' : 'rotateX'
changeCarousel()
}
// set initials
onOrientationChange()
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.view-content {
width: 100%;
height: 100%;
box-sizing: border-box;
position: relative;
padding: 1.78vh 1.67vw;
background-image: url(../../../assets/images/viewEntireLifecycleOfCar/bg.png);
background-size: 100% 100%;
gap: 0 16px;
.top-tab {
margin-bottom: 1.78vh;
height: 5vh;
}
}
* {
box-sizing: border-box;
}
body {
font-family: sans-serif;
text-align: center;
}
.scene {
border: 1px solid #CCC;
margin: 40px 0;
position: relative;
width: 210px;
height: 140px;
margin: 80px auto;
perspective: 1000px;
}
.carousel {
width: 100%;
height: 100%;
position: absolute;
transform: translateZ(-288px);
transform-style: preserve-3d;
transition: transform 1s;
}
.carousel__cell {
position: absolute;
// width: 520px;
width: 260px;
height: 230px;
left: 10px;
top: 10px;
border: 2px solid black;
line-height: 230px;
font-size: 80px;
font-weight: bold;
color: white;
text-align: center;
background-image: url(../../../assets/images/viewEntireLifecycleOfCar/horseRaceLampItemBg.png);
background-size: 100% 100%;
transition: transform 1s, opacity 1s;
}
.carousel__cell:nth-child(9n+1) {
background: hsla(0, 100%, 50%, 0.8);
}
.carousel__cell:nth-child(9n+2) {
background: hsla(40, 100%, 50%, 0.8);
}
.carousel__cell:nth-child(9n+3) {
background: hsla(80, 100%, 50%, 0.8);
}
.carousel__cell:nth-child(9n+4) {
background: hsla(120, 100%, 50%, 0.8);
}
.carousel__cell:nth-child(9n+5) {
background: hsla(160, 100%, 50%, 0.8);
}
.carousel__cell:nth-child(9n+6) {
background: hsla(200, 100%, 50%, 0.8);
}
.carousel__cell:nth-child(9n+7) {
background: hsla(240, 100%, 50%, 0.8);
}
.carousel__cell:nth-child(9n+8) {
background: hsla(280, 100%, 50%, 0.8);
}
.carousel__cell:nth-child(9n+0) {
background: hsla(320, 100%, 50%, 0.8);
}
.carousel__cell:nth-child(1) {
transform: rotateY(0deg) translateZ(288px) translateY(200px);
}
.carousel__cell:nth-child(2) {
// transform: rotateY(40deg) translateZ(288px);
left: 250px;
transform: rotateY(35deg) translateZ(150px) translateY(150px) skewY(-5deg) scaleX(-1.5);
;
}
.carousel__cell:nth-child(3) {
left: 200px;
// translateX(200px)
transform: rotateY(102deg) translateZ(288px) skewY(-8deg) scaleX(-1.5);
}
.carousel__cell:nth-child(4) {
left: 125px;
transform: rotateY(153deg) translateZ(288px) translateY(-50px) skewY(-2deg) scaleX(-1.2);
}
.carousel__cell:nth-child(5) {
left: 80px;
transform: rotateY(204deg) translateZ(288px) translateY(-50px) skewY(2deg) scaleX(-1.2);
}
.carousel__cell:nth-child(6) {
left: -40px;
transform: rotateY(255deg) translateZ(288px) skewY(8deg) scaleX(-1.5);
}
.carousel__cell:nth-child(7) {
transform: rotateY(306deg) translateZ(288px) translateY(150px) skewY(5deg) scaleX(-1.5);
}
// .carousel__cell:nth-child(8) {
// transform: rotateY(280deg) translateZ(288px);
// }
// .carousel__cell:nth-child(9) {
// transform: rotateY(320deg) translateZ(288px);
// }
.carousel-options {
display: none;
text-align: center;
position: relative;
z-index: 2;
background: hsla(0, 0%, 100%, 0.8);
}
</style>
......@@ -22,8 +22,9 @@ export default {
.tagcloud {
width: 16vw;
height: 16vw;
background-image: url(../../assets/images/hot-words-bg.png);
background-image: url(../../../assets/images/hot-words-bg.png);
background-size: 100%;
span {
color: #5894FF;
background-image: -webkit-linear-gradient(left, #0185F9, #53FAFF);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!