fix:修改chart比较的动画

This commit is contained in:
zhangyu
2021-03-31 17:19:40 +08:00
parent f085e6a67b
commit 52f825c87f

View File

@@ -60,7 +60,13 @@
} }
.compare-box{ .compare-box{
line-height: 50px; line-height: 50px;
margin-right: 20px; }
.compare-box .nz-icon-compare{
border-right: none;
}
.calendar{
width: 125px;
overflow: hidden;
} }
.nz-icon-compare{ .nz-icon-compare{
background: #FFFFFF; background: #FFFFFF;
@@ -69,19 +75,17 @@
padding: 6px 8px; padding: 6px 8px;
} }
.multiple-time-datepicker-enter-active { .multiple-time-datepicker-enter-active {
transform-origin: 100% 50%;
animation: bounce-in .6s; animation: bounce-in .6s;
} }
.multiple-time-datepicker-leave-active { .multiple-time-datepicker-leave-active {
transform-origin: 100% 50%;
animation: bounce-in .6s reverse; animation: bounce-in .6s reverse;
} }
@keyframes bounce-in { @keyframes bounce-in {
0% { 0% {
transform: scaleX(0); width: 0;
} }
100% { 100% {
transform: scale(1); width: 125px;
} }
} }
</style> </style>
@@ -109,59 +113,59 @@
<div class="multiple-time-box"> <div class="multiple-time-box">
<div :class="showDropdown?'compare-box':''"><i class="nz-icon nz-icon-compare" @click="changeShowDropdown" /></div> <div :class="showDropdown?'compare-box':''"><i class="nz-icon nz-icon-compare" @click="changeShowDropdown" /></div>
<transition name="multiple-time-datepicker"> <transition name="multiple-time-datepicker">
<div class="calendar top-tools" id="panel-calender" v-show="showDropdown"> <div ref="calendar" class="calendar top-tools" id="panel-calender" v-show="showDropdown">
<el-date-picker prefix-icon=" " size="mini" ref="calendar" <el-date-picker prefix-icon=" " size="mini" ref="calendar"
format="yyyy/MM/dd HH:mm:ss" class="panel-time-picker-hidden" @change="dateChange" v-model="startTime" type="datetime" format="yyyy/MM/dd HH:mm:ss" class="panel-time-picker-hidden" @change="dateChange" v-model="startTime" type="datetime"
popper-class="panel-time-picker-popper" popper-class="panel-time-picker-popper"
align="right"> align="right">
</el-date-picker> </el-date-picker>
<!-- <!--
<button type="button" style="border-radius: 1px 1px 1px 1px" @click="right()" v-show="isCustom" <button type="button" style="border-radius: 1px 1px 1px 1px" @click="right()" v-show="isCustom"
class="nz-btn nz-btn-size-normal nz-btn-style-light time-picker-button time-picker-right-button" > class="nz-btn nz-btn-size-normal nz-btn-style-light time-picker-button time-picker-right-button" >
<i style="font-size: 12px" class="el-icon-arrow-right"></i> <i style="font-size: 12px" class="el-icon-arrow-right"></i>
</button>--> </button>-->
<el-dropdown @command="timeChange" @visible-change="popoverClick" class="calendar-dropdown-title" ref="timePickerDropdown" trigger="click"> <el-dropdown @command="timeChange" @visible-change="popoverClick" class="calendar-dropdown-title" ref="timePickerDropdown" trigger="click">
<el-popover <el-popover
placement="bottom-end" placement="bottom-end"
min-width="120px" min-width="120px"
:visible-arrow="false" :visible-arrow="false"
:disabled="isPopoverDisabled" :disabled="isPopoverDisabled"
trigger="hover" trigger="hover"
popper-class="popper-z-index" popper-class="popper-z-index"
id="panel-calender-popover"> id="panel-calender-popover">
<template v-if="this.searchTime&&this.searchTime.length>1"> <template v-if="this.searchTime&&this.searchTime.length>1">
<el-row :gutter="10" class="calendar-popover"> <el-row :gutter="10" class="calendar-popover">
<el-col :span="24" class="calendar-popover-text">{{searchTime[0]}}</el-col> <el-col :span="24" class="calendar-popover-text">{{searchTime[0]}}</el-col>
</el-row> </el-row>
<el-row :gutter="10" class="calendar-popover"> <el-row :gutter="10" class="calendar-popover">
<el-col :span="24" class="calendar-popover-text">{{$t('dashboard.panel.to')}}</el-col> <el-col :span="24" class="calendar-popover-text">{{$t('dashboard.panel.to')}}</el-col>
</el-row> </el-row>
<el-row :gutter="10" class="calendar-popover"> <el-row :gutter="10" class="calendar-popover">
<el-col :span="24" class="calendar-popover-text">{{searchTime[1]}}</el-col> <el-col :span="24" class="calendar-popover-text">{{searchTime[1]}}</el-col>
</el-row> </el-row>
</template> </template>
<template v-else> <template v-else>
<div style="text-align: center;width: 100%;color: #909399;font-family: NotoSans !important;font-size: 12px !important;">{{$t("dashboard.panel.noDate")}}</div> <div style="text-align: center;width: 100%;color: #909399;font-family: NotoSans !important;font-size: 12px !important;">{{$t("dashboard.panel.noDate")}}</div>
</template> </template>
<div class="el-dropdown-link" slot="reference"> <div class="el-dropdown-link" slot="reference">
<i class="nz-icon nz-icon-time" style="width:20px;"></i> <i class="nz-icon nz-icon-time" style="width:20px;"></i>
<span class="panel-list-title" id="timePickerContent">{{showTime.text}}</span> <span class="panel-list-title" id="timePickerContent">{{showTime.text}}</span>
<span class="dropdown--suffix"> <span class="dropdown--suffix">
<i class="el-icon-arrow-down"></i> <i class="el-icon-arrow-down"></i>
</span> </span>
</div> </div>
</el-popover> </el-popover>
<el-dropdown-menu class="nz-dashboard-dropdown popper-z-index" slot="dropdown"> <el-dropdown-menu class="nz-dashboard-dropdown popper-z-index" slot="dropdown">
<!-- <el-dropdown-item >{{$t('dashboard.panel.customTimeRange')}}</el-dropdown-item> --> <!-- <el-dropdown-item >{{$t('dashboard.panel.customTimeRange')}}</el-dropdown-item> -->
<template v-for="(item, index) in timeData" > <template v-for="(item, index) in timeData" >
<el-dropdown-item v-if="item.id !== 12" :key="index" :class="showTime.id === item.id ? 'nz-dashboard-dropdown-bg' : ''" :command="item"> <el-dropdown-item v-if="item.id !== 12" :key="index" :class="showTime.id === item.id ? 'nz-dashboard-dropdown-bg' : ''" :command="item">
{{item.text}} {{item.text}}
</el-dropdown-item> </el-dropdown-item>
</template> </template>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</div> </div>
</transition> </transition>
</div> </div>
</template> </template>
@@ -428,10 +432,12 @@ export default {
this.showDropdown = !this.showDropdown this.showDropdown = !this.showDropdown
if (!this.showDropdown) { if (!this.showDropdown) {
this.searchTime = [] this.searchTime = []
this.showTime = this.nowTimeType = { setTimeout(() => {
id: 12, this.showTime = this.nowTimeType = {
text: this.$t('dashboard.panel.noDate') id: 12,
} text: this.$t('dashboard.panel.noDate')
}
}, 600)
this.$emit('change', this.searchTime) this.$emit('change', this.searchTime)
} else { } else {
this.searchTime = [] this.searchTime = []