2020-01-17 16:50:17 +08:00
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
@import './chart-table.scss';
|
2020-01-03 17:17:09 +08:00
|
|
|
</style>
|
|
|
|
|
<template>
|
2020-02-19 21:33:54 +08:00
|
|
|
<div class="chart-table" :id="'chartTableDiv'+chartIndex" v-show="divFirstShow">
|
2020-02-21 17:32:59 +08:00
|
|
|
<loading :ref="'localLoading'+chartIndex"></loading>
|
|
|
|
|
<!--
|
2020-02-19 21:33:54 +08:00
|
|
|
<div v-show="showLoading" class="el-loading-mask" style="background-color: rgba(0, 0, 0, 0);">
|
|
|
|
|
<div class="el-loading-spinner">
|
|
|
|
|
<img width="42px" height="42px" src="../../assets/img/loading.gif"/>
|
|
|
|
|
<p class="el-loading-text loading-font">loading</p>
|
|
|
|
|
</div>
|
2020-01-20 11:56:32 +08:00
|
|
|
</div>
|
2020-02-21 17:32:59 +08:00
|
|
|
-->
|
2020-02-19 21:33:54 +08:00
|
|
|
<div class="clearfix">
|
|
|
|
|
<div class="table-title" v-show="firstShow">
|
|
|
|
|
{{data.title}}
|
2020-01-17 16:50:17 +08:00
|
|
|
</div>
|
2020-02-22 18:44:01 +08:00
|
|
|
<div class="nz-btn-group nz-btn-group-light edit button-panel-height" v-show="firstShow">
|
2020-02-19 21:33:54 +08:00
|
|
|
<button type="button" @click="refreshChart" style="padding: 6px 14px 5px 14px;" class="nz-btn nz-btn-size-large nz-btn-style-light"><i style="font-size: 16px;" class="global-active-color el-icon-refresh-right"></i></button><button
|
2020-02-22 18:44:01 +08:00
|
|
|
@click="editChart" type="button" class="nz-btn nz-btn-size-large nz-btn-style-light" ><i class="nz-icon nz-icon-edit"></i></button><button
|
2020-02-19 21:33:54 +08:00
|
|
|
@click="removeChart" type="button" class="nz-btn nz-btn-size-large nz-btn-style-light"><i class="el-icon-delete"></i></button><button
|
|
|
|
|
@click="showAllScreen" type="button" class="nz-btn nz-btn-size-large nz-btn-style-light"><i class="el-icon-full-screen"></i></button>
|
|
|
|
|
</div>
|
|
|
|
|
|
2020-01-03 17:17:09 +08:00
|
|
|
</div>
|
2020-02-19 21:33:54 +08:00
|
|
|
<div class="mt-10" v-cloak v-show="firstShow">
|
2020-03-06 20:54:44 +08:00
|
|
|
<el-table class="nz-table" :id="'tableContainer'+chartIndex" ref="tableContainer" :height="350" :data="seriesItem" border tooltip-effect="light" v-cloak v-scrollBar:el-table>
|
2020-03-04 20:30:25 +08:00
|
|
|
<!-- <el-table-column sortable :show-overflow-tooltip="true" prop="metric" :label="$t('dashboard.panel.chartTableColumn.metric')" ></el-table-column>-->
|
|
|
|
|
<!-- <el-table-column sortable :show-overflow-tooltip="true" prop="label" :label="$t('dashboard.panel.chartTableColumn.label')" ></el-table-column>-->
|
|
|
|
|
<el-table-column sortable prop="time" :label="$t('dashboard.panel.chartTableColumn.time')" width="145" ></el-table-column>
|
|
|
|
|
<el-table-column sortable prop="element" :show-overflow-tooltip="true" :label="$t('dashboard.panel.chartTableColumn.element')" >
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
{{ scope.row.element.alias?scope.row.element.alias:scope.row.element.element}}
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2020-02-07 19:57:39 +08:00
|
|
|
<el-table-column sortable prop="value" :label="$t('dashboard.panel.chartTableColumn.value')" ></el-table-column>
|
2020-01-17 16:50:17 +08:00
|
|
|
</el-table>
|
2020-02-19 21:33:54 +08:00
|
|
|
</div>
|
|
|
|
|
<!--全屏-->
|
2020-03-06 20:54:44 +08:00
|
|
|
<el-dialog class="nz-dialog table-chart-dialog" :title="$t('dashboard.panel.view')" :visible.sync="screenModal" width="96%" @close="screenModal = false;" >
|
2020-02-19 21:33:54 +08:00
|
|
|
<div slot="title">
|
|
|
|
|
<span class="nz-dialog-title">{{data.title}}</span>
|
|
|
|
|
<div class="float-right panel-calendar dialog-tool">
|
|
|
|
|
<el-date-picker prefix-icon=" " size="mini" class="nz-dashboard-picker" ref="calendar" format="yyyy/MM/dd HH:mm" @change="dateChange" v-model="searchTime" type="datetimerange" :picker-options="pickerOptions" :range-separator="$t('dashboard.panel.to')" :start-placeholder="$t('dashboard.panel.startTime')" :end-placeholder="$t('dashboard.panel.endTime')" align="right">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
<!--<button @click="refreshChart" type="button" class="nz-btn nz-btn-size-normal nz-btn-style-light"><i style="font-size: 14px;" class="el-icon-refresh-right"></i></button>-->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2020-03-06 21:53:04 +08:00
|
|
|
<el-table style="margin-top: 10px;" class="nz-table" height="100%" :data="seriesItemScreen" border tooltip-effect="light" v-scrollBar:el-table>
|
2020-03-04 20:30:25 +08:00
|
|
|
<!-- <el-table-column sortable :show-overflow-tooltip="true" prop="metric" :label="$t('dashboard.panel.chartTableColumn.metric')" ></el-table-column>-->
|
|
|
|
|
<!-- <el-table-column sortable :show-overflow-tooltip="true" prop="label" :label="$t('dashboard.panel.chartTableColumn.label')" ></el-table-column>-->
|
|
|
|
|
<el-table-column sortable prop="time" :label="$t('dashboard.panel.chartTableColumn.time')" width="145" ></el-table-column>
|
|
|
|
|
<el-table-column sortable prop="element" :show-overflow-tooltip="true" :label="$t('dashboard.panel.chartTableColumn.element')" >
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
{{ scope.row.element.alias?scope.row.element.alias:scope.row.element.element}}
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2020-02-19 21:33:54 +08:00
|
|
|
<el-table-column sortable prop="value" :label="$t('dashboard.panel.chartTableColumn.value')" ></el-table-column>
|
|
|
|
|
|
|
|
|
|
</el-table>
|
2020-02-21 17:32:59 +08:00
|
|
|
<loading :ref="'localLoadingScreen'+chartIndex"></loading>
|
|
|
|
|
<!--
|
2020-02-19 21:33:54 +08:00
|
|
|
<div v-show="showLoadingScreen" class="el-loading-mask" style="background-color: rgba(0, 0, 0, 0);">
|
|
|
|
|
<div class="el-loading-spinner">
|
|
|
|
|
<img width="42px" height="42px" src="../../assets/img/loading.gif"/>
|
|
|
|
|
<p class="el-loading-text loading-font">loading</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2020-02-21 17:32:59 +08:00
|
|
|
-->
|
2020-02-19 21:33:54 +08:00
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
2020-01-03 17:17:09 +08:00
|
|
|
</template>
|
2020-01-17 16:50:17 +08:00
|
|
|
|
2020-01-03 17:17:09 +08:00
|
|
|
<script>
|
|
|
|
|
import bus from '../../libs/bus';
|
2020-02-19 21:33:54 +08:00
|
|
|
import {Loading} from 'element-ui';
|
2020-02-21 17:32:59 +08:00
|
|
|
import loading from "../common/loading";
|
2020-01-03 17:17:09 +08:00
|
|
|
|
|
|
|
|
export default {
|
2020-01-17 16:50:17 +08:00
|
|
|
name: 'chartTable',
|
2020-02-21 17:32:59 +08:00
|
|
|
components: {
|
|
|
|
|
'loading': loading,
|
|
|
|
|
},
|
2020-01-17 16:50:17 +08:00
|
|
|
props: {
|
|
|
|
|
// 看板id
|
|
|
|
|
panelId: {
|
|
|
|
|
type: Number,
|
|
|
|
|
default: 0,
|
|
|
|
|
},
|
2020-02-19 21:33:54 +08:00
|
|
|
editChartId: {
|
|
|
|
|
type: String,
|
|
|
|
|
default: 'editChartId',
|
|
|
|
|
},
|
|
|
|
|
chartIndex:{
|
|
|
|
|
type: Number,
|
|
|
|
|
default: 0,
|
|
|
|
|
}
|
2020-01-03 17:17:09 +08:00
|
|
|
},
|
2020-01-17 16:50:17 +08:00
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
data: {}, // 该图表信息,chartItem
|
|
|
|
|
seriesItem: [], // 保存信息
|
2020-02-19 21:33:54 +08:00
|
|
|
seriesItemScreen:[],//全屏数据
|
2020-01-17 16:50:17 +08:00
|
|
|
images: '',
|
2020-02-19 21:33:54 +08:00
|
|
|
//toolbox: false,
|
|
|
|
|
loading:Object,
|
2020-01-17 16:50:17 +08:00
|
|
|
items: {
|
|
|
|
|
metric_name: [], // 每条数据列名称
|
|
|
|
|
xAxis: [],
|
|
|
|
|
theData: [], // series数据组
|
|
|
|
|
},
|
|
|
|
|
panelIdInner: '', // 看板id=panelId,原写作chart,由set_data获取
|
|
|
|
|
firstLoad: false, // 是否第一次加载
|
2020-02-21 17:32:59 +08:00
|
|
|
//showLoading:true,
|
|
|
|
|
//showLoadingScreen:false,
|
2020-02-19 21:33:54 +08:00
|
|
|
//showTable:true,
|
2020-01-17 16:50:17 +08:00
|
|
|
chartType: 'table', // 图表类型
|
|
|
|
|
screenModal: false,
|
|
|
|
|
// 查询数据使用
|
|
|
|
|
filter: {
|
|
|
|
|
start_time: '',
|
|
|
|
|
end_time: '',
|
|
|
|
|
},
|
|
|
|
|
stableFilter: {}, // 保存数据使用,初始化起止时间,单图or多图等
|
|
|
|
|
firstShow: false, // 默认不显示操作按钮,
|
2020-02-19 21:33:54 +08:00
|
|
|
divFirstShow:false,
|
|
|
|
|
//tableLoading: false,
|
2020-03-04 20:30:25 +08:00
|
|
|
columns: [
|
|
|
|
|
// {
|
|
|
|
|
// title: 'metric',
|
|
|
|
|
// key: 'metric',
|
|
|
|
|
// width: 200,
|
|
|
|
|
// sortable: true,
|
|
|
|
|
// }, {
|
|
|
|
|
// title: 'Label', //tag
|
|
|
|
|
// key: 'name',
|
|
|
|
|
// minWidth: 200,
|
|
|
|
|
// sortable: true,
|
|
|
|
|
// }
|
|
|
|
|
{
|
|
|
|
|
title:'Element',
|
|
|
|
|
key:'element',
|
|
|
|
|
sortable: true
|
|
|
|
|
}
|
|
|
|
|
, {
|
2020-01-17 16:50:17 +08:00
|
|
|
title: '采集时间',
|
|
|
|
|
key: 'time',
|
|
|
|
|
width: 160,
|
|
|
|
|
render: (h, params) => h('span', bus.timeFormate(params.row.time, 'yyyy-MM-dd hh:mm:ss')),
|
|
|
|
|
}, {
|
|
|
|
|
title: '数值',
|
|
|
|
|
key: 'value',
|
|
|
|
|
width: 160,
|
|
|
|
|
sortable: true,
|
|
|
|
|
render: (h, params) => h('span', this.getNumStr(params.row.value)),
|
|
|
|
|
}],
|
2020-02-19 21:33:54 +08:00
|
|
|
searchTime: [new Date().setHours(new Date().getHours() - 1), new Date()],//全屏显示的时间
|
2020-01-17 16:50:17 +08:00
|
|
|
oldSearchTime: [],
|
|
|
|
|
pickerOptions: {
|
|
|
|
|
shortcuts: [{
|
|
|
|
|
text: this.$t("dashboard.panel.recOne"),
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const end = new Date();
|
|
|
|
|
const start = new Date();
|
|
|
|
|
start.setHours(start.getHours() - 1);
|
|
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
text: this.$t("dashboard.panel.recFour"),
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const end = new Date();
|
|
|
|
|
const start = new Date();
|
|
|
|
|
start.setHours(start.getHours() - 4);
|
|
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
text: this.$t("dashboard.panel.recOneDay"),
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const end = new Date();
|
|
|
|
|
const start = new Date();
|
|
|
|
|
start.setDate(start.getDate() - 1);
|
|
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
text: this.$t("dashboard.panel.yesterday"),
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const start = new Date();
|
|
|
|
|
const end = new Date();
|
|
|
|
|
start.setDate(start.getDate() - 1);
|
|
|
|
|
start.setHours(0);
|
|
|
|
|
start.setMinutes(0);
|
|
|
|
|
start.setSeconds(0);
|
|
|
|
|
end.setDate(end.getDate() - 1);
|
|
|
|
|
end.setHours(23);
|
|
|
|
|
end.setMinutes(59);
|
|
|
|
|
end.setSeconds(59);
|
|
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
text: this.$t("dashboard.panel.recSevenDay"),
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const end = new Date();
|
|
|
|
|
const start = new Date();
|
|
|
|
|
start.setDate(start.getDate() - 7);
|
|
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
text: this.$t("dashboard.panel.recOneMonth"),
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const end = new Date();
|
|
|
|
|
const start = new Date();
|
|
|
|
|
start.setDate(start.getDate() - 30);
|
|
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
text: this.$t("dashboard.panel.curMonth"),
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const end = new Date();
|
|
|
|
|
const start = new Date();
|
|
|
|
|
start.setDate(1);
|
|
|
|
|
start.setHours(0);
|
|
|
|
|
start.setMinutes(0);
|
|
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
text: this.$t("dashboard.panel.lastMonth"),
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const end = new Date();
|
|
|
|
|
const start = new Date();
|
|
|
|
|
start.setDate(1);
|
|
|
|
|
start.setMonth(start.getMonth() - 1);
|
|
|
|
|
end.setDate(0);
|
|
|
|
|
start.setStart();
|
|
|
|
|
end.setEnd();
|
|
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
|
|
}
|
|
|
|
|
}]
|
|
|
|
|
},
|
|
|
|
|
};
|
2020-01-03 17:17:09 +08:00
|
|
|
},
|
2020-01-17 16:50:17 +08:00
|
|
|
computed: {},
|
|
|
|
|
watch: {},
|
|
|
|
|
methods: {
|
2020-02-19 21:33:54 +08:00
|
|
|
startLoading(area){
|
|
|
|
|
if(area==='screen'){
|
2020-02-21 17:32:59 +08:00
|
|
|
//this.showLoadingScreen = true;
|
|
|
|
|
this.$refs['localLoadingScreen'+this.chartIndex].startLoading();
|
2020-02-19 21:33:54 +08:00
|
|
|
}else {
|
2020-02-21 17:32:59 +08:00
|
|
|
//this.showLoading = true;
|
|
|
|
|
this.$refs['localLoading'+this.chartIndex].startLoading();
|
2020-02-19 21:33:54 +08:00
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
//this.loading = this.$loading({
|
|
|
|
|
this.loading = Loading.service({
|
|
|
|
|
lock:true,
|
|
|
|
|
text:'loading',
|
|
|
|
|
background:'rgba(0,0,0,0)',
|
|
|
|
|
customClass:'loading-font',
|
|
|
|
|
//fullscreen: false,
|
|
|
|
|
target:document.getElementById('chartTableDiv')
|
|
|
|
|
})
|
|
|
|
|
*/
|
|
|
|
|
},
|
|
|
|
|
endLoading(area){
|
|
|
|
|
if(area==='screen'){
|
2020-02-21 17:32:59 +08:00
|
|
|
//this.showLoadingScreen = false;
|
|
|
|
|
this.$refs['localLoadingScreen'+this.chartIndex].endLoading();
|
2020-02-19 21:33:54 +08:00
|
|
|
}else {
|
2020-02-21 17:32:59 +08:00
|
|
|
//this.showLoading = false;
|
|
|
|
|
this.$refs['localLoading'+this.chartIndex].endLoading();
|
2020-02-19 21:33:54 +08:00
|
|
|
}
|
|
|
|
|
},
|
2020-01-21 10:35:45 +08:00
|
|
|
clearData(){
|
|
|
|
|
},
|
2020-02-19 21:33:54 +08:00
|
|
|
showLoad(chartItem) {
|
|
|
|
|
//设置高度 chart-table
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
const chartBox = document.getElementById('chartTableDiv'+this.chartIndex);
|
|
|
|
|
let height = chartItem.height;
|
|
|
|
|
if(height<200){
|
|
|
|
|
height = 200;
|
|
|
|
|
}
|
|
|
|
|
chartBox.style.height = `${height-25}px`;
|
|
|
|
|
const tableBox = document.getElementById('tableContainer'+this.chartIndex);
|
|
|
|
|
tableBox.style.height = `${height-75}px`;
|
|
|
|
|
});
|
|
|
|
|
this.startLoading();
|
|
|
|
|
this.divFirstShow = true;
|
|
|
|
|
//this.tableLoading = true;
|
2020-01-17 16:50:17 +08:00
|
|
|
},
|
|
|
|
|
// 展示图表编辑区
|
2020-02-19 21:33:54 +08:00
|
|
|
/*
|
2020-01-17 16:50:17 +08:00
|
|
|
showTool() {
|
|
|
|
|
this.toolbox = !this.toolbox;
|
|
|
|
|
},
|
2020-02-19 21:33:54 +08:00
|
|
|
*/
|
|
|
|
|
// 重新请求数据 刷新操作-local
|
2020-01-17 16:50:17 +08:00
|
|
|
refreshChart() {
|
2020-02-19 21:33:54 +08:00
|
|
|
this.startLoading();
|
|
|
|
|
this.firstShow = false;
|
2020-01-17 16:50:17 +08:00
|
|
|
this.$emit('on-refresh-data', this.data.id);
|
|
|
|
|
},
|
|
|
|
|
// 编辑图表
|
|
|
|
|
editChart() {
|
|
|
|
|
this.$emit('on-edit-chart-block', this.data.id);
|
|
|
|
|
},
|
|
|
|
|
// 删除该图表
|
|
|
|
|
removeChart() {
|
|
|
|
|
this.$emit('on-remove-chart-block', this.data.id);
|
|
|
|
|
},
|
2020-02-19 21:33:54 +08:00
|
|
|
//全屏时间条件查询
|
2020-01-17 16:50:17 +08:00
|
|
|
dateChange(time) {
|
2020-02-19 21:33:54 +08:00
|
|
|
//this.filter.start_time = bus.timeFormate(this.searchTime[0], 'yyyy-MM-dd hh:mm:ss');
|
|
|
|
|
//this.filter.end_time = bus.timeFormate(this.searchTime[1], 'yyyy-MM-dd hh:mm:ss');
|
|
|
|
|
//this.showTable = false;
|
|
|
|
|
this.seriesItemScreen = [];
|
|
|
|
|
for(let i=0;i<8;i++){
|
|
|
|
|
this.seriesItemScreen.push({//表格数据
|
2020-03-04 20:30:25 +08:00
|
|
|
// label: '',//label
|
|
|
|
|
// metric: '',//metric列
|
|
|
|
|
element:'',
|
2020-02-19 21:33:54 +08:00
|
|
|
time: '',//采集时间
|
|
|
|
|
value: '',//数值
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
this.startLoading('screen');
|
|
|
|
|
//this.tableLoading = true;
|
|
|
|
|
//this.firstShow = false;
|
2020-01-17 16:50:17 +08:00
|
|
|
this.$emit('on-search-data', this.data.id, this.searchTime);
|
|
|
|
|
},
|
|
|
|
|
// 全屏查看
|
|
|
|
|
showAllScreen() {
|
|
|
|
|
// 初始化同步时间
|
2020-02-19 21:33:54 +08:00
|
|
|
//this.searchTime = this.oldSearchTime;
|
|
|
|
|
//alert(JSON.stringify(this.oldSearchTime));
|
|
|
|
|
this.searchTime = [];
|
|
|
|
|
this.searchTime[0] = this.oldSearchTime[0];//将列表的查询时间复制给全屏的查询时间
|
|
|
|
|
this.searchTime[1] = this.oldSearchTime[1];
|
|
|
|
|
this.seriesItemScreen = this.seriesItem;
|
2020-01-17 16:50:17 +08:00
|
|
|
this.screenModal = true;
|
2020-02-19 21:33:54 +08:00
|
|
|
//this.startLoading('screen');
|
|
|
|
|
//this.endLoading('screen');
|
2020-01-17 16:50:17 +08:00
|
|
|
},
|
|
|
|
|
// 设置数据, filter区分
|
2020-02-19 21:33:54 +08:00
|
|
|
setData(chartItem, seriesItem, panelId, filter,area) {
|
|
|
|
|
if(area==='showFullScreen'){//全屏按时间查询
|
|
|
|
|
this.data = chartItem;
|
|
|
|
|
this.searchTime[0] = filter.start_time;//将列表的查询时间复制给全屏的查询时间
|
|
|
|
|
this.searchTime[1] = filter.end_time;
|
|
|
|
|
this.seriesItemScreen = seriesItem;
|
|
|
|
|
this.endLoading('screen');
|
|
|
|
|
}else{
|
|
|
|
|
//设置高度 chart-table
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
const chartBox = document.getElementById('chartTableDiv'+this.chartIndex);
|
|
|
|
|
let height = chartItem.height;
|
|
|
|
|
if(height<200){
|
|
|
|
|
height = 200;
|
|
|
|
|
}
|
|
|
|
|
chartBox.style.height = `${height-25}px`;
|
|
|
|
|
const tableBox = document.getElementById('tableContainer'+this.chartIndex);
|
|
|
|
|
tableBox.style.height = `${height-75}px`;
|
|
|
|
|
});
|
|
|
|
|
this.divFirstShow = true;
|
|
|
|
|
|
|
|
|
|
this.firstShow = true; // 展示操作按键
|
|
|
|
|
|
|
|
|
|
this.panelIdInner = panelId;
|
|
|
|
|
this.data = chartItem;
|
|
|
|
|
this.seriesItem = seriesItem;
|
|
|
|
|
this.seriesItemScreen = seriesItem;
|
|
|
|
|
if (filter) { // 保存数据,用于同步时间
|
|
|
|
|
this.searchTime[0] = filter.start_time;//将列表的查询时间复制给全屏的查询时间
|
|
|
|
|
this.searchTime[1] = filter.end_time;
|
|
|
|
|
this.oldSearchTime[0] = this.searchTime[0];
|
|
|
|
|
this.oldSearchTime[1] = this.searchTime[1];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.endLoading();
|
|
|
|
|
//this.showTable = true;
|
|
|
|
|
//this.tableLoading = false;
|
2020-01-17 16:50:17 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 获取格式
|
|
|
|
|
getNumStr(num) {
|
|
|
|
|
if (num) {
|
|
|
|
|
if (num >= 1000) {
|
|
|
|
|
const kbNum = num / 1000;
|
|
|
|
|
if (kbNum >= 1000) {
|
|
|
|
|
const mbNum = kbNum / 1000;
|
2020-02-19 21:33:54 +08:00
|
|
|
if (mbNum >= 1000) {
|
2020-01-17 16:50:17 +08:00
|
|
|
const gbNum = mbNum / 1000;
|
2020-02-19 21:33:54 +08:00
|
|
|
if (gbNum >= 1000) {
|
2020-01-17 16:50:17 +08:00
|
|
|
const tbNum = gbNum / 1000;
|
2020-02-19 21:33:54 +08:00
|
|
|
if (tbNum >= 1000) {
|
2020-01-17 16:50:17 +08:00
|
|
|
const pbNum = tbNum / 1000;
|
|
|
|
|
return `${pbNum.toFixed(2)}PB`;
|
|
|
|
|
}
|
|
|
|
|
return `${tbNum.toFixed(2)}TB`;
|
|
|
|
|
}
|
|
|
|
|
return `${gbNum.toFixed(2)}GB`;
|
|
|
|
|
}
|
|
|
|
|
return `${mbNum.toFixed(2)}MB`;
|
|
|
|
|
}
|
|
|
|
|
return `${kbNum.toFixed(2)}KB`;
|
2020-01-03 17:17:09 +08:00
|
|
|
}
|
2020-01-17 16:50:17 +08:00
|
|
|
return num.toFixed(2);
|
2020-01-03 17:17:09 +08:00
|
|
|
}
|
2020-01-17 16:50:17 +08:00
|
|
|
return num;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.firstLoad = false;
|
2020-01-03 17:17:09 +08:00
|
|
|
},
|
2020-01-17 16:50:17 +08:00
|
|
|
beforeDestroy() {},
|
2020-01-03 17:17:09 +08:00
|
|
|
};
|
|
|
|
|
</script>
|