2020-04-14 21:46:38 +08:00
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.loading-font{
|
|
|
|
|
color:#232f3e !important;
|
|
|
|
|
}
|
2020-12-21 15:09:38 +08:00
|
|
|
popper-z-index{
|
|
|
|
|
z-index: 3000 !important;
|
|
|
|
|
}
|
2020-04-14 21:46:38 +08:00
|
|
|
.calendar{
|
|
|
|
|
}
|
|
|
|
|
.nz-dashboard-dropdown-bg {
|
|
|
|
|
background: $global-text-color-active;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
.calendar-dropdown-title {
|
2021-03-05 14:27:11 +08:00
|
|
|
line-height:28px;
|
2020-04-14 21:46:38 +08:00
|
|
|
padding-left:5px;
|
|
|
|
|
margin-left:0px;
|
2020-04-24 17:00:56 +08:00
|
|
|
margin-top: 0px !important;
|
2020-04-14 21:46:38 +08:00
|
|
|
text-align:left;
|
2021-03-04 09:24:33 +08:00
|
|
|
border-radius:2px;
|
2020-10-22 10:08:58 +08:00
|
|
|
min-width:80px;
|
2021-03-05 14:27:11 +08:00
|
|
|
height:28px;
|
2020-04-14 21:46:38 +08:00
|
|
|
border:solid 1px #d8dce1;
|
|
|
|
|
white-space: nowrap;
|
2020-09-10 17:00:32 +08:00
|
|
|
overflow: hidden;
|
2020-04-14 21:46:38 +08:00
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
}
|
|
|
|
|
.el-dropdown-link {
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
.calendar-popover{
|
|
|
|
|
line-height:22px;
|
|
|
|
|
text-align:center;
|
|
|
|
|
}
|
2020-04-24 17:00:56 +08:00
|
|
|
.panel-time-picker-hidden{
|
2020-04-27 22:17:31 +08:00
|
|
|
width:0px !important;
|
2020-04-24 17:00:56 +08:00
|
|
|
padding:0px !important;
|
2020-04-27 22:17:31 +08:00
|
|
|
border:0px !important;
|
|
|
|
|
visibility: hidden !important;
|
2020-04-24 17:00:56 +08:00
|
|
|
}
|
|
|
|
|
.time-picker-button{
|
|
|
|
|
padding: 0 1px !important;
|
|
|
|
|
height:24px !important;
|
|
|
|
|
margin-top:0px !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.time-picker-left-button{
|
|
|
|
|
margin-right: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.time-picker-right-button{
|
|
|
|
|
margin-left: 4px;
|
|
|
|
|
}
|
|
|
|
|
.calendar-popover-text {}
|
|
|
|
|
</style>
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
.panel-time-picker-popper[x-placement^=bottom] .popper__arrow {
|
|
|
|
|
left: 85% !important;
|
|
|
|
|
}
|
|
|
|
|
.panel-time-picker-popper[x-placement^=bottom] {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.panel-time-picker-popper .el-date-table td.today span {
|
|
|
|
|
color: #FFF !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.panel-time-picker-popper .el-picker-panel__footer button:nth-child(1){
|
|
|
|
|
display:none;
|
|
|
|
|
}
|
2021-03-05 20:34:58 +08:00
|
|
|
|
|
|
|
|
.dropdown--suffix {
|
|
|
|
|
padding: 0 8px;
|
|
|
|
|
color: #aaa;
|
|
|
|
|
}
|
2020-04-14 21:46:38 +08:00
|
|
|
</style>
|
|
|
|
|
<template>
|
2020-04-17 08:15:13 +08:00
|
|
|
<div class="calendar top-tools" id="panel-calender">
|
2020-04-27 22:17:31 +08:00
|
|
|
<el-date-picker prefix-icon=" " class="panel-time-picker-hidden " size="mini" ref="calendar"
|
2020-04-24 19:57:04 +08:00
|
|
|
format="yyyy/MM/dd HH:mm:ss" @change="dateChange" v-model="searchTime" type="datetimerange"
|
2020-04-24 17:00:56 +08:00
|
|
|
popper-class="panel-time-picker-popper"
|
|
|
|
|
:range-separator="$t('dashboard.panel.to')"
|
|
|
|
|
:start-placeholder="$t('dashboard.panel.startTime')"
|
|
|
|
|
:end-placeholder="$t('dashboard.panel.endTime')" align="right">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
<!--
|
|
|
|
|
<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" >
|
|
|
|
|
<i style="font-size: 12px" class="el-icon-arrow-right"></i>
|
|
|
|
|
</button>-->
|
2020-12-14 20:25:24 +08:00
|
|
|
<el-dropdown @command="timeChange" @visible-change="popoverClick" class="calendar-dropdown-title" ref="timePickerDropdown" trigger="click">
|
2020-04-14 21:46:38 +08:00
|
|
|
<el-popover
|
|
|
|
|
placement="bottom-end"
|
2020-04-17 08:15:13 +08:00
|
|
|
min-width="120px"
|
|
|
|
|
:visible-arrow="false"
|
|
|
|
|
:disabled="isPopoverDisabled"
|
|
|
|
|
trigger="hover"
|
2020-12-21 15:09:38 +08:00
|
|
|
popper-class="popper-z-index"
|
2020-04-17 08:15:13 +08:00
|
|
|
id="panel-calender-popover">
|
2020-10-12 18:15:24 +08:00
|
|
|
<template v-if="this.searchTime&&this.searchTime.length>1">
|
|
|
|
|
<el-row :gutter="10" class="calendar-popover">
|
|
|
|
|
<el-col :span="24" class="calendar-popover-text">{{searchTime[0]}}</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row :gutter="10" class="calendar-popover">
|
|
|
|
|
<el-col :span="24" class="calendar-popover-text">{{$t('dashboard.panel.to')}}</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row :gutter="10" class="calendar-popover">
|
|
|
|
|
<el-col :span="24" class="calendar-popover-text">{{searchTime[1]}}</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</template>
|
|
|
|
|
<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>
|
|
|
|
|
</template>
|
2020-04-24 17:00:56 +08:00
|
|
|
<div class="el-dropdown-link" slot="reference">
|
2020-09-10 17:00:32 +08:00
|
|
|
<i class="nz-icon nz-icon-time" style="width:20px;"></i>
|
2020-04-24 17:00:56 +08:00
|
|
|
<span class="panel-list-title" id="timePickerContent">{{showTime.text}}</span>
|
2021-03-05 20:34:58 +08:00
|
|
|
<span class="dropdown--suffix">
|
|
|
|
|
<i class="el-icon-arrow-down"></i>
|
|
|
|
|
</span>
|
2020-04-24 17:00:56 +08:00
|
|
|
</div>
|
2020-04-14 21:46:38 +08:00
|
|
|
</el-popover>
|
2020-12-21 15:09:38 +08:00
|
|
|
<el-dropdown-menu class="nz-dashboard-dropdown popper-z-index" slot="dropdown">
|
2020-04-17 08:15:13 +08:00
|
|
|
<!-- <el-dropdown-item >{{$t('dashboard.panel.customTimeRange')}}</el-dropdown-item> -->
|
2020-10-12 18:15:24 +08:00
|
|
|
<template v-for="item in timeData" >
|
|
|
|
|
<el-dropdown-item :class="showTime.id==item.id?'nz-dashboard-dropdown-bg':''" :command="item" v-if="item.id != 12 || showEmpty">
|
|
|
|
|
{{item.text}}
|
|
|
|
|
</el-dropdown-item>
|
|
|
|
|
</template>
|
|
|
|
|
|
2020-04-14 21:46:38 +08:00
|
|
|
</el-dropdown-menu>
|
|
|
|
|
</el-dropdown>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import bus from '../../libs/bus';
|
|
|
|
|
|
|
|
|
|
export default {
|
2020-04-17 08:15:13 +08:00
|
|
|
name: "timePicker",
|
2020-04-14 21:46:38 +08:00
|
|
|
props: {
|
2020-10-12 18:15:24 +08:00
|
|
|
defaultPick:Number,
|
|
|
|
|
showEmpty:{default:false,type:Boolean}
|
2020-04-14 21:46:38 +08:00
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2020-04-17 08:15:13 +08:00
|
|
|
isPopoverDisabled:false,
|
2020-04-24 17:00:56 +08:00
|
|
|
isCustom:false,
|
2020-04-14 21:46:38 +08:00
|
|
|
searchTime:[
|
2020-09-07 11:43:45 +08:00
|
|
|
bus.timeFormate(bus.getOffsetTimezoneData(-1),'yyyy-MM-dd hh:mm:ss'),
|
|
|
|
|
bus.timeFormate(bus.getOffsetTimezoneData(),'yyyy-MM-dd hh:mm:ss')
|
2020-04-14 21:46:38 +08:00
|
|
|
],
|
|
|
|
|
showTime: {
|
2020-04-27 22:17:31 +08:00
|
|
|
id: 4,
|
|
|
|
|
text: this.$t("dashboard.panel.lastOneHour"),
|
2020-04-14 21:46:38 +08:00
|
|
|
},
|
|
|
|
|
timeData: [
|
2020-04-17 08:15:13 +08:00
|
|
|
{
|
|
|
|
|
id:0,
|
|
|
|
|
text:this.$t("dashboard.panel.customTimeRange"),
|
|
|
|
|
},
|
2020-10-12 18:15:24 +08:00
|
|
|
{
|
|
|
|
|
id:12,
|
|
|
|
|
text:this.$t("dashboard.panel.noDate"),
|
|
|
|
|
|
|
|
|
|
},
|
2020-04-14 21:46:38 +08:00
|
|
|
{
|
|
|
|
|
id:1,
|
|
|
|
|
text:this.$t("dashboard.panel.lastFiveMin"),
|
2020-04-17 08:15:13 +08:00
|
|
|
type:'minute',
|
|
|
|
|
value:5,
|
2020-04-14 21:46:38 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id:2,
|
|
|
|
|
text:this.$t("dashboard.panel.lastFifteenMin"),
|
2020-04-17 08:15:13 +08:00
|
|
|
type:'minute',
|
|
|
|
|
value:15,
|
2020-04-14 21:46:38 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id:3,
|
|
|
|
|
text:this.$t("dashboard.panel.lastThirtyMin"),
|
2020-04-17 08:15:13 +08:00
|
|
|
type:'minute',
|
|
|
|
|
value:30,
|
2020-04-14 21:46:38 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id:4,
|
|
|
|
|
text:this.$t("dashboard.panel.lastOneHour"),
|
2020-04-17 08:15:13 +08:00
|
|
|
type:'hour',
|
|
|
|
|
value:1,
|
2020-04-14 21:46:38 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id:5,
|
|
|
|
|
text:this.$t("dashboard.panel.lastThreeHour"),
|
2020-04-17 08:15:13 +08:00
|
|
|
type:'hour',
|
|
|
|
|
value:3,
|
2020-04-14 21:46:38 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id:6,
|
|
|
|
|
text:this.$t("dashboard.panel.lastSixHour"),
|
2020-04-17 08:15:13 +08:00
|
|
|
type:'hour',
|
|
|
|
|
value:6,
|
2020-04-14 21:46:38 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id:7,
|
|
|
|
|
text:this.$t("dashboard.panel.lastTwelveHour"),
|
2020-04-17 08:15:13 +08:00
|
|
|
type:'hour',
|
|
|
|
|
value:12,
|
2020-04-14 21:46:38 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id:8,
|
|
|
|
|
text:this.$t("dashboard.panel.lastTwentyFourHour"),
|
2020-04-17 08:15:13 +08:00
|
|
|
type:'hour',
|
|
|
|
|
value:24,
|
2020-04-14 21:46:38 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id:9,
|
|
|
|
|
text:this.$t("dashboard.panel.lastTwoDay"),
|
2020-04-17 08:15:13 +08:00
|
|
|
type:'date',
|
|
|
|
|
value:2,
|
2020-04-14 21:46:38 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id:10,
|
|
|
|
|
text:this.$t("dashboard.panel.lastSevenDay"),
|
2020-04-17 08:15:13 +08:00
|
|
|
type:'date',
|
|
|
|
|
value:7,
|
2020-04-14 21:46:38 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id:11,
|
|
|
|
|
text:this.$t("dashboard.panel.lastThirtyDay"),
|
2020-04-17 08:15:13 +08:00
|
|
|
type:'date',
|
|
|
|
|
value:30,
|
2020-04-14 21:46:38 +08:00
|
|
|
}
|
|
|
|
|
],
|
2020-10-20 17:03:15 +08:00
|
|
|
nowTimeType:{
|
|
|
|
|
id:4,
|
|
|
|
|
text:this.$t("dashboard.panel.lastOneHour"),
|
|
|
|
|
type:'hour',
|
|
|
|
|
value:1,
|
|
|
|
|
},
|
2020-04-14 21:46:38 +08:00
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
2020-04-24 17:00:56 +08:00
|
|
|
dateChange(val){
|
|
|
|
|
let startTime = bus.timeFormate(val[0], 'yyyy-MM-dd hh:mm:ss');
|
|
|
|
|
let endTime = bus.timeFormate(val[1], 'yyyy-MM-dd hh:mm:ss');
|
|
|
|
|
this.$set(this.searchTime, 0, startTime);
|
|
|
|
|
this.$set(this.searchTime, 1, endTime);
|
|
|
|
|
|
|
|
|
|
//let timerPicker = document.querySelector('#timePickerContent');
|
|
|
|
|
//timerPicker.innerText = this.searchTime[0]+" "+this.$t("dashboard.panel.to")+" "+this.searchTime[1];
|
|
|
|
|
this.$set(this.showTime, 'id', 0);
|
|
|
|
|
this.$set(this.showTime, 'text', this.searchTime[0]+" "+this.$t("dashboard.panel.to")+" "+this.searchTime[1]);
|
|
|
|
|
/*
|
|
|
|
|
let tipElementList = document.getElementsByClassName('calendar-popover-text');
|
|
|
|
|
if(tipElementList && tipElementList.length===3){
|
|
|
|
|
console.log('-0-0-0',tipElementList);
|
|
|
|
|
tipElementList[0].innerHTML = this.searchTime[0];
|
|
|
|
|
tipElementList[1].innerHTML = this.$t("dashboard.panel.to");
|
|
|
|
|
tipElementList[2].innerHTML = this.searchTime[1];
|
|
|
|
|
console.log('-0-0-2',tipElementList);
|
|
|
|
|
}*/
|
|
|
|
|
this.$emit('change', this.searchTime);
|
2020-04-17 08:15:13 +08:00
|
|
|
|
2020-04-24 17:00:56 +08:00
|
|
|
},
|
|
|
|
|
setCustomTime(timeGroup){
|
|
|
|
|
if(timeGroup.length===2){
|
|
|
|
|
this.$set(this.searchTime, 0, timeGroup[0]);
|
|
|
|
|
this.$set(this.searchTime, 1, timeGroup[1]);
|
|
|
|
|
|
2020-12-01 10:55:39 +08:00
|
|
|
this.nowTimeType={
|
|
|
|
|
id:4,
|
|
|
|
|
text:this.$t("dashboard.panel.lastOneHour"),
|
|
|
|
|
type:'hour',
|
|
|
|
|
value:1,
|
|
|
|
|
};
|
|
|
|
|
this.$set(this.showTime, 'id', this.nowTimeType.id);
|
|
|
|
|
this.$set(this.showTime, 'text', this.nowTimeType.text);
|
2020-04-24 17:00:56 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//left(){},
|
|
|
|
|
//right(){},
|
2020-12-01 10:55:39 +08:00
|
|
|
timeChange(val,from) {
|
2020-10-20 17:03:15 +08:00
|
|
|
this.nowTimeType=val;
|
2020-04-24 17:00:56 +08:00
|
|
|
this.$set(this.showTime, 'id', val.id);
|
|
|
|
|
this.$set(this.showTime, 'text', val.text);
|
2020-04-14 21:46:38 +08:00
|
|
|
if (!val) {
|
2020-04-24 17:00:56 +08:00
|
|
|
this.isCustom = false;
|
2020-04-14 21:46:38 +08:00
|
|
|
return false;
|
2020-04-17 08:15:13 +08:00
|
|
|
}else {
|
2020-04-24 17:00:56 +08:00
|
|
|
this.setSearchTime(val.type,val.value);
|
|
|
|
|
//let timerPicker = document.querySelector('#timePickerContent');
|
|
|
|
|
//timerPicker.innerText = val.text;
|
|
|
|
|
/*
|
|
|
|
|
let tipElementList = document.getElementsByClassName('calendar-popover-text');
|
|
|
|
|
if(tipElementList && tipElementList.length===3){
|
|
|
|
|
tipElementList[0].innerHTML = this.searchTime[0];
|
|
|
|
|
tipElementList[1].innerHTML = this.$t("dashboard.panel.to");
|
|
|
|
|
tipElementList[2].innerHTML = this.searchTime[1];
|
|
|
|
|
}*/
|
2020-04-17 08:15:13 +08:00
|
|
|
|
2020-04-24 17:00:56 +08:00
|
|
|
let id = val.id;
|
|
|
|
|
if(id===0){//custom
|
2020-12-01 10:55:39 +08:00
|
|
|
if(from==='chart'){
|
|
|
|
|
this.isCustom = false;
|
|
|
|
|
this.$emit('change', this.searchTime);
|
|
|
|
|
} else{
|
|
|
|
|
this.isCustom = true;
|
|
|
|
|
this.$refs.calendar.focus();
|
|
|
|
|
}
|
2020-04-17 08:15:13 +08:00
|
|
|
}else {
|
2020-04-24 17:00:56 +08:00
|
|
|
this.isCustom = false;
|
2020-10-12 18:15:24 +08:00
|
|
|
if(this.showEmpty&& id === 12){
|
|
|
|
|
this.searchTime=[]
|
|
|
|
|
}
|
2020-04-24 17:00:56 +08:00
|
|
|
this.$emit('change', this.searchTime);
|
2020-10-12 18:15:24 +08:00
|
|
|
|
2020-04-17 08:15:13 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
2020-05-21 09:03:30 +08:00
|
|
|
getCurrentTime(){
|
|
|
|
|
let timeTypeId = this.showTime.id;
|
|
|
|
|
if(timeTypeId===0){
|
|
|
|
|
return this.searchTime;
|
|
|
|
|
}else {
|
|
|
|
|
if(!timeTypeId){timeTypeId = 4;}
|
|
|
|
|
let currentTime = this.timeData.find(item => item.id === timeTypeId);
|
|
|
|
|
this.setSearchTime(currentTime.type,currentTime.value);
|
|
|
|
|
return this.searchTime;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
2020-04-17 08:15:13 +08:00
|
|
|
setSearchTime(type,val){
|
|
|
|
|
if(type==='minute'){
|
2020-04-24 17:00:56 +08:00
|
|
|
let startTime = bus.timeFormate(new Date(bus.computeTimezone(new Date().getTime())).setMinutes(new Date(bus.computeTimezone(new Date().getTime())).getMinutes() - val),'yyyy-MM-dd hh:mm:ss');
|
|
|
|
|
let endTime = bus.timeFormate(new Date(bus.computeTimezone(new Date().getTime())),'yyyy-MM-dd hh:mm:ss');
|
|
|
|
|
this.$set(this.searchTime, 0, startTime);
|
|
|
|
|
this.$set(this.searchTime, 1, endTime);
|
2020-04-29 22:52:21 +08:00
|
|
|
this.$set(this.searchTime, 2, val + "m");
|
2020-04-17 08:15:13 +08:00
|
|
|
}else if(type==='hour'){
|
2020-04-24 17:00:56 +08:00
|
|
|
let startTime = bus.timeFormate(new Date(bus.computeTimezone(new Date().getTime())).setHours(new Date(bus.computeTimezone(new Date().getTime())).getHours() - val),'yyyy-MM-dd hh:mm:ss');
|
|
|
|
|
let endTime = bus.timeFormate(new Date(bus.computeTimezone(new Date().getTime())),'yyyy-MM-dd hh:mm:ss');
|
|
|
|
|
this.$set(this.searchTime, 0, startTime);
|
|
|
|
|
this.$set(this.searchTime, 1, endTime);
|
2020-04-29 22:52:21 +08:00
|
|
|
this.$set(this.searchTime, 2, val + "h");
|
2020-04-17 08:15:13 +08:00
|
|
|
}else if(type==='date'){
|
2020-04-24 17:00:56 +08:00
|
|
|
let startTime = bus.timeFormate(new Date(bus.computeTimezone(new Date().getTime())).setDate(new Date(bus.computeTimezone(new Date().getTime())).getDate() - val),'yyyy-MM-dd hh:mm:ss');
|
|
|
|
|
let endTime = bus.timeFormate(new Date(bus.computeTimezone(new Date().getTime())),'yyyy-MM-dd hh:mm:ss');
|
|
|
|
|
this.$set(this.searchTime, 0, startTime);
|
|
|
|
|
this.$set(this.searchTime, 1, endTime);
|
2020-04-29 22:52:21 +08:00
|
|
|
this.$set(this.searchTime, 2, val + "d");
|
2020-04-17 08:15:13 +08:00
|
|
|
}
|
|
|
|
|
},
|
2020-04-24 19:57:04 +08:00
|
|
|
setCostomTime:function(costomTime){
|
|
|
|
|
this.searchTime=Object.assign(costomTime);
|
|
|
|
|
let val=Object.assign(this.timeData[0]);
|
|
|
|
|
this.$set(this.showTime, 'id', val.id);
|
|
|
|
|
this.$set(this.showTime, 'text', val.text);
|
|
|
|
|
},
|
2020-04-17 08:15:13 +08:00
|
|
|
popoverClick(val){
|
|
|
|
|
if(val){
|
|
|
|
|
this.isPopoverDisabled = true;
|
|
|
|
|
}else{
|
|
|
|
|
this.isPopoverDisabled = false;
|
2020-04-14 21:46:38 +08:00
|
|
|
}
|
|
|
|
|
},
|
2020-04-24 17:00:56 +08:00
|
|
|
},
|
2020-10-12 18:15:24 +08:00
|
|
|
created() {
|
|
|
|
|
},
|
|
|
|
|
watch:{
|
|
|
|
|
defaultPick:{
|
|
|
|
|
immediate:true,
|
|
|
|
|
handler(n,o){
|
|
|
|
|
if(n&&Number.isInteger(n)){
|
|
|
|
|
let showTime=this.timeData.find(item=>item.id == n);
|
|
|
|
|
if(showTime){
|
|
|
|
|
this.showTime = Object.assign({},showTime);
|
|
|
|
|
}
|
|
|
|
|
if(this.showEmpty&& this.defaultPick === 12){
|
|
|
|
|
this.searchTime=[]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-10-20 17:03:15 +08:00
|
|
|
},
|
2020-10-12 18:15:24 +08:00
|
|
|
},
|
2020-04-24 17:00:56 +08:00
|
|
|
mounted: function () {
|
|
|
|
|
/*
|
|
|
|
|
if(this.isCustom){
|
|
|
|
|
if(this.timeGroup.length===2){
|
|
|
|
|
this.$set(this.searchTime, 0, this.timeGroup[0]);
|
|
|
|
|
this.$set(this.searchTime, 1, this.timeGroup[1]);
|
|
|
|
|
|
|
|
|
|
this.$set(this.showTime, 'id', 0);
|
|
|
|
|
this.$set(this.showTime, 'text', this.searchTime[0]+" "+this.$t("dashboard.panel.to")+" "+this.searchTime[1]);
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
let timeObj = this.timeData.find((item)=>{return item.id===this.timeDataId});
|
|
|
|
|
this.$set(this.showTime, 'id', this.timeDataId);
|
|
|
|
|
this.$set(this.showTime, 'text', timeObj.text);
|
|
|
|
|
this.setSearchTime(timeObj.type,timeObj.value);
|
|
|
|
|
}*/
|
|
|
|
|
},
|
2020-04-14 21:46:38 +08:00
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|