perf: 优化detail折叠动画
This commit is contained in:
@@ -24,12 +24,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div ref="chartInfo" class="chart-info" :id="'chartInfoDiv' + chartIndex" v-cloak>
|
<div ref="chartInfo" class="chart-info" :id="'chartInfoDiv' + chartIndex" v-cloak>
|
||||||
<el-scrollbar style="height: 100%;width:100%;" ref="scrollbar" class="el-scrollbar-normal">
|
<el-scrollbar style="height: 100%;width:100%;" ref="scrollbar" class="el-scrollbar-normal">
|
||||||
<div v-for="(item, index) in detail" :key="index" style="padding: 0 15px;">
|
<div v-for="(item, index) in detail" :key="index" class="chart-sub">
|
||||||
<div class="chart-sub-title" @click="hideElement(index)">
|
<div class="chart-sub-title" @click="hideElement(index)">
|
||||||
<span><i :class="{'el-icon-caret-right': show.indexOf(index) == -1,'el-icon-caret-bottom': show.indexOf(index) > -1}"></i></span>
|
<span><i :class="{'el-icon-caret-right': show.indexOf(index) == -1,'el-icon-caret-bottom': show.indexOf(index) > -1}"></i></span>
|
||||||
<span>{{item.title}}</span>
|
<span>{{item.title}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="chart-sub-content" :class="{'init-no-animation': index == 0, 'fold-600': show.indexOf(index) == -1, 'unfold-600': show.indexOf(index) > -1}">
|
<el-collapse-transition>
|
||||||
|
<div class="chart-sub-content" v-show="show.indexOf(index) > -1">
|
||||||
<template v-for="(value, key, i) in item.data">
|
<template v-for="(value, key, i) in item.data">
|
||||||
|
|
||||||
<!-- endpoint-detail、asset、model的assetInfo的asset详情-->
|
<!-- endpoint-detail、asset、model的assetInfo的asset详情-->
|
||||||
@@ -194,6 +195,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
</el-collapse-transition>
|
||||||
</div>
|
</div>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1204,21 +1204,22 @@
|
|||||||
let step = bus.getStep(startTime, endTime);
|
let step = bus.getStep(startTime, endTime);
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
let query = chartInfo.elements[0].expression;
|
let query = chartInfo.elements[0].expression;
|
||||||
this.$get('/prom/api/v1/query_range?query='+query+"&start="+this.$stringTimeParseToUnix(startTime)+"&end="+this.$stringTimeParseToUnix(endTime)+'&step='+step).then(response => {
|
this.$get('/prom/api/v1/query_range?query='+query+"&start="+this.$stringTimeParseToUnix(startTime)+"&end="+this.$stringTimeParseToUnix(endTime)+'&step=5m').then(response => {
|
||||||
if (response.status === 'success') {
|
if (response.status === 'success') {
|
||||||
if (response.data.result) {
|
if (response.data.result) {
|
||||||
let series = {
|
let series = {
|
||||||
name: '',
|
name: '',
|
||||||
symbol: 'emptyCircle', //去掉点
|
symbol: 'emptyCircle', //去掉点
|
||||||
symbolSize: [2, 2],
|
symbolSize: 6,
|
||||||
smooth: 0.2, //曲线变平滑
|
smooth: 0.2, //曲线变平滑
|
||||||
showSymbol: false,
|
showSymbol: true,
|
||||||
data: [],
|
data: [],
|
||||||
type: "line",
|
type: "line",
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
width: 1,
|
width: 1,
|
||||||
opacity: 0.9
|
opacity: 0.9
|
||||||
},
|
},
|
||||||
|
label: {show: true},
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: function(params) {
|
color: function(params) {
|
||||||
if (params.data[1] == "1") {
|
if (params.data[1] == "1") {
|
||||||
|
|||||||
@@ -316,6 +316,13 @@
|
|||||||
.active-icon {
|
.active-icon {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
.chart-sub {
|
||||||
|
padding: 0 15px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
:last-of-type {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
.chart-sub-title {
|
.chart-sub-title {
|
||||||
background-color: #efefef;
|
background-color: #efefef;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
@@ -326,11 +333,7 @@
|
|||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
.chart-sub-content {
|
.chart-sub-content {
|
||||||
opacity: 0;
|
|
||||||
max-height: 0;
|
|
||||||
visibility: hidden;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-bottom: 5px;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
.content-item>div {
|
.content-item>div {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@@ -443,59 +446,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.init-no-animation {
|
|
||||||
opacity: 1;
|
|
||||||
max-height: 200px;
|
|
||||||
visibility: visible;
|
|
||||||
}
|
|
||||||
.fold-500 {
|
|
||||||
animation-name: fold-500; //该动画定义在main.scss里
|
|
||||||
animation-duration: 0.2s;
|
|
||||||
animation-iteration-count:1;
|
|
||||||
opacity: 0;
|
|
||||||
max-height: 0;
|
|
||||||
visibility: hidden;
|
|
||||||
}
|
|
||||||
.fold-600 {
|
|
||||||
animation-name: fold-600; //该动画定义在main.scss里
|
|
||||||
animation-duration: 0.2s;
|
|
||||||
animation-iteration-count:1;
|
|
||||||
opacity: 0;
|
|
||||||
max-height: 0;
|
|
||||||
visibility: hidden;
|
|
||||||
}
|
|
||||||
.fold-200 {
|
|
||||||
animation-name: fold-200; //该动画定义在main.scss里
|
|
||||||
animation-duration: 0.2s;
|
|
||||||
animation-iteration-count:1;
|
|
||||||
opacity: 0;
|
|
||||||
max-height: 0;
|
|
||||||
visibility: hidden;
|
|
||||||
}
|
|
||||||
.unfold-500 {
|
|
||||||
animation-name: unfold-500;
|
|
||||||
animation-duration: 0.2s;
|
|
||||||
animation-iteration-count:1;
|
|
||||||
opacity: 1;
|
|
||||||
max-height: 500px;
|
|
||||||
visibility: visible;
|
|
||||||
}
|
|
||||||
.unfold-600 {
|
|
||||||
animation-name: unfold-600;
|
|
||||||
animation-duration: 0.2s;
|
|
||||||
animation-iteration-count:1;
|
|
||||||
opacity: 1;
|
|
||||||
max-height: 600px;
|
|
||||||
visibility: visible;
|
|
||||||
}
|
|
||||||
.unfold-200 {
|
|
||||||
animation-name: unfold-200;
|
|
||||||
animation-duration: 0.2s;
|
|
||||||
animation-iteration-count:1;
|
|
||||||
opacity: 1;
|
|
||||||
max-height: 200px;
|
|
||||||
visibility: visible;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.chart-url {
|
.chart-url {
|
||||||
.url-container {
|
.url-container {
|
||||||
|
|||||||
Reference in New Issue
Block a user