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>
|
2020-03-11 18:48:05 +08:00
|
|
|
<style>
|
|
|
|
|
.max-width-90{
|
|
|
|
|
max-width: 90px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
2020-01-03 17:17:09 +08:00
|
|
|
<template>
|
2020-03-17 19:30:27 +08:00
|
|
|
<div class="chart-table" :id="'chartTableDiv'+chartIndex" v-show="divFirstShow" @mouseenter="caretShow=true" @mouseleave="caretShow=false">
|
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-03-25 09:21:23 +08:00
|
|
|
<div class="clearfix chartTitle" :class="{'dragTitle':dragTitleShow}" :id="'chartTitle'+chartIndex">
|
2020-04-22 18:45:22 +08:00
|
|
|
<el-popover
|
|
|
|
|
v-if="isError"
|
2020-04-24 17:00:56 +08:00
|
|
|
:close-delay=10
|
2020-04-22 18:45:22 +08:00
|
|
|
placement="top-start"
|
|
|
|
|
trigger="hover"
|
|
|
|
|
popper-class="chart-error-popper">
|
|
|
|
|
<div >{{errorContent}}</div>
|
|
|
|
|
<span slot="reference" style="" class="panel-info-corner panel-info-corner--error">
|
|
|
|
|
<i class="nz-icon nz-icon-warning fa"></i>
|
|
|
|
|
<span class="panel-info-corner-inner"></span>
|
|
|
|
|
</span>
|
|
|
|
|
</el-popover>
|
2020-03-17 19:30:27 +08:00
|
|
|
<el-dropdown trigger="click" v-show="firstShow" class="nz-chart-top" :key="'chartDropdown'+chartIndex" v-clickoutside="clickos">
|
2020-04-21 19:28:01 +08:00
|
|
|
<el-dropdown-menu style="display: none"></el-dropdown-menu>
|
2020-03-17 19:30:27 +08:00
|
|
|
<span class="el-dropdown-link chart-title" @click="dropdownMenuShow=!dropdownMenuShow">
|
2020-03-20 18:47:51 +08:00
|
|
|
<span class="chart-title-text">{{data.title}}</span>
|
|
|
|
|
<span class="chart-title-icon"><i class="el-icon-caret-bottom el-icon--right" :class="{'visible':caretShow,'hidden':!caretShow}"></i></span>
|
2020-03-17 19:30:27 +08:00
|
|
|
</span>
|
2020-03-23 09:12:05 +08:00
|
|
|
<ul slot="dropdown" v-show="dropdownMenuShow" :id="'dropdownUl'+chartIndex" class="el-dropdown-menu nz-chart-dropdown" style="position: absolute; top: 30px; left: calc(50% - 79px); transform-origin: center top; z-index: 1000;" >
|
2020-03-17 19:30:27 +08:00
|
|
|
<li @click="refreshChart" class="el-dropdown-menu__item">
|
|
|
|
|
<i class="global-active-color el-icon-refresh-right" style="font-size: 16px;"></i><span>{{$t('dashboard.refresh')}}</span></li>
|
|
|
|
|
<li @click="editChart" class="el-dropdown-menu__item">
|
|
|
|
|
<i class="nz-icon nz-icon-edit" style="font-size: 14px; margin-right: 11px; margin-left: 1px;"></i>{{$t('dashboard.edit')}}</li>
|
|
|
|
|
<li @click="removeChart" class="el-dropdown-menu__item">
|
|
|
|
|
<i class="el-icon-delete" style="font-size: 16px;"></i>{{$t('dashboard.delete')}}</li>
|
|
|
|
|
<li @click="showAllScreen" class="el-dropdown-menu__item">
|
|
|
|
|
<i class="el-icon-full-screen" style="font-size: 16px;"></i>{{$t('dashboard.screen')}}</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</el-dropdown>
|
2020-02-19 21:33:54 +08:00
|
|
|
|
2020-01-03 17:17:09 +08:00
|
|
|
</div>
|
2020-03-23 21:23:50 +08:00
|
|
|
<div class="mt-10 table-container" v-cloak v-show="firstShow">
|
2020-03-12 16:13:29 +08:00
|
|
|
<el-table class="nz-table" :id="'tableContainer'+chartIndex" ref="tableContainer" :height="290" :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-03-12 14:10:37 +08:00
|
|
|
<el-table-column sortable prop="value" :label="$t('dashboard.panel.chartTableColumn.value')" width="90">
|
2020-03-11 18:48:05 +08:00
|
|
|
<template slot-scope="scope">
|
|
|
|
|
{{ unit.compute(scope.row.value,null,2)}}
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2020-01-17 16:50:17 +08:00
|
|
|
</el-table>
|
2020-03-27 10:53:04 +08:00
|
|
|
<Pagination :pageObj="pageObj" @pageNo='pageNo' :post-page-sizes="pageSizes" @pageSize='pageSize' ref="Pagination" :append-to-body="false"></Pagination>
|
2020-02-19 21:33:54 +08:00
|
|
|
</div>
|
|
|
|
|
<!--全屏-->
|
2020-03-11 18:48:05 +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">
|
2020-04-24 17:00:56 +08:00
|
|
|
<!--
|
2020-02-19 21:33:54 +08:00
|
|
|
<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">
|
2020-04-24 17:00:56 +08:00
|
|
|
</el-date-picker>-->
|
|
|
|
|
<time-picker ref="calendarPanel" class="nz-dashboard-picker" style="margin-top: -12px;" @change="dateChange"></time-picker>
|
2020-02-19 21:33:54 +08:00
|
|
|
<!--<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-12 16:13:29 +08:00
|
|
|
<el-table style="margin-top: 10px;" class="nz-table" height="95%" :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-03-11 18:48:05 +08:00
|
|
|
<el-table-column sortable prop="value" :label="$t('dashboard.panel.chartTableColumn.value')" width="90">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
{{ unit.compute(scope.row.value,null,2)}}
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2020-02-19 21:33:54 +08:00
|
|
|
</el-table>
|
2020-03-27 10:53:04 +08:00
|
|
|
<Pagination :pageObj="screenPageObj" :post-page-sizes="pageSizes" @pageNo='screenPageNo' @pageSize='screenPageSize' ref="Pagination" ></Pagination>
|
2020-03-12 16:13:29 +08:00
|
|
|
<loading :ref="'localLoadingScreen'+chartIndex"></loading>
|
2020-02-21 17:32:59 +08:00
|
|
|
<!--
|
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>
|
2020-03-20 18:47:51 +08:00
|
|
|
<span class="vue-resizable-handle" @mousedown="dragResize"></span>
|
2020-02-19 21:33:54 +08:00
|
|
|
</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-03-11 18:48:05 +08:00
|
|
|
import chartDataFormat from './chartDataFormat'
|
2020-02-21 17:32:59 +08:00
|
|
|
import loading from "../common/loading";
|
2020-04-24 17:00:56 +08:00
|
|
|
import timePicker from '../common/timePicker'
|
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-04-24 17:00:56 +08:00
|
|
|
'time-picker':timePicker
|
2020-02-21 17:32:59 +08:00
|
|
|
},
|
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
|
2020-03-11 18:48:05 +08:00
|
|
|
unit:{},
|
2020-04-22 18:45:22 +08:00
|
|
|
isError:false,
|
|
|
|
|
errorContent:'',
|
2020-03-13 10:52:36 +08:00
|
|
|
pageSizes:[50,100,200],
|
2020-03-12 14:10:37 +08:00
|
|
|
pageObj: {
|
|
|
|
|
pageNo: 1,
|
2020-03-13 18:32:47 +08:00
|
|
|
pageSize: 50,
|
2020-03-12 14:10:37 +08:00
|
|
|
total: 0
|
|
|
|
|
},
|
|
|
|
|
screenPageObj:{
|
|
|
|
|
pageNo: 1,
|
2020-03-13 18:32:47 +08:00
|
|
|
pageSize: 50,
|
2020-03-12 14:10:37 +08:00
|
|
|
total: 0
|
|
|
|
|
},
|
2020-03-12 16:13:29 +08:00
|
|
|
storedTableData:[],
|
|
|
|
|
storedScreanTableData:[],
|
2020-01-17 16:50:17 +08:00
|
|
|
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-03-17 19:30:27 +08:00
|
|
|
caretShow:false,
|
2020-03-25 09:21:23 +08:00
|
|
|
dragTitleShow:false,
|
2020-03-17 19:30:27 +08:00
|
|
|
dropdownMenuShow:false,
|
2020-03-23 21:23:50 +08:00
|
|
|
minHeight:200,
|
|
|
|
|
chartSpaceHeight:5,//top-border: 1,bottom-border: 1,padding-bottome:3
|
|
|
|
|
titleHeight:38,//title-height:28,magrin-bottom:10
|
|
|
|
|
pageHeight:40,
|
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: [],
|
2020-04-24 17:00:56 +08:00
|
|
|
/*pickerOptions: {
|
2020-01-17 16:50:17 +08:00
|
|
|
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-04-24 17:00:56 +08:00
|
|
|
},*/
|
2020-01-17 16:50:17 +08:00
|
|
|
};
|
2020-01-03 17:17:09 +08:00
|
|
|
},
|
2020-03-13 10:52:36 +08:00
|
|
|
created() {
|
|
|
|
|
this.pageObj.pageSize=this.pageSizes[0];
|
|
|
|
|
this.screenPageObj.pageSize=this.pageSizes[0];
|
|
|
|
|
},
|
|
|
|
|
computed: {},
|
2020-01-17 16:50:17 +08:00
|
|
|
watch: {},
|
|
|
|
|
methods: {
|
2020-03-12 14:10:37 +08:00
|
|
|
pageNo(val) {
|
|
|
|
|
this.pageObj.pageNo = val;
|
2020-03-12 16:13:29 +08:00
|
|
|
this.seriesItem=this.filterShowData(this.storedTableData,this.pageObj)
|
2020-03-12 14:10:37 +08:00
|
|
|
},
|
|
|
|
|
pageSize(val) {
|
|
|
|
|
this.pageObj.pageSize = val;
|
2020-03-12 16:13:29 +08:00
|
|
|
this.seriesItem=this.filterShowData(this.storedTableData,this.pageObj)
|
2020-03-12 14:10:37 +08:00
|
|
|
},
|
2020-03-12 16:13:29 +08:00
|
|
|
filterShowData(source,pageObj){
|
|
|
|
|
return source.slice((pageObj.pageNo-1)*pageObj.pageSize,pageObj.pageNo*pageObj.pageSize)
|
|
|
|
|
},
|
2020-03-12 14:10:37 +08:00
|
|
|
screenPageNo(val) {
|
|
|
|
|
this.screenPageObj.pageNo = val;
|
2020-03-12 16:13:29 +08:00
|
|
|
this.seriesItemScreen=this.filterShowData(this.storedScreanTableData,this.screenPageObj)
|
2020-03-12 14:10:37 +08:00
|
|
|
},
|
|
|
|
|
screenPageSize(val) {
|
|
|
|
|
this.screenPageObj.pageSize = val;
|
2020-03-12 16:13:29 +08:00
|
|
|
this.seriesItemScreen=this.filterShowData(this.storedScreanTableData,this.screenPageObj)
|
2020-03-12 14:10:37 +08:00
|
|
|
},
|
2020-03-20 18:47:51 +08:00
|
|
|
dragResize:function(e){
|
2020-03-25 09:21:23 +08:00
|
|
|
var diffWidth =20; //界面的宽度空白的地方的宽度
|
|
|
|
|
var chartBoxPadding = 22;
|
2020-03-20 18:47:51 +08:00
|
|
|
var targetDiv= document.getElementById('chartTableDiv'+this.chartIndex); //e.target.parentNode.parentNode;.children[0]
|
|
|
|
|
var targetDivContainer= document.getElementById('listContainer'); //e.target.parentNode.parentNode;.children[0]
|
|
|
|
|
var maxWidth = targetDivContainer.offsetWidth-diffWidth;
|
|
|
|
|
var minWidth = maxWidth/12;
|
|
|
|
|
var stepWidth = maxWidth/12;
|
|
|
|
|
var stepHeight = 10;
|
|
|
|
|
|
|
|
|
|
//得到点击时该容器的宽高:
|
|
|
|
|
var targetDivHeight=targetDiv.offsetHeight;
|
|
|
|
|
var targetDivWidth=targetDiv.offsetWidth;
|
|
|
|
|
var startY=e.clientY;
|
|
|
|
|
var startX=e.clientX;
|
|
|
|
|
var _this=this;
|
|
|
|
|
|
|
|
|
|
document.onmousemove=function(e){
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
//得到鼠标拖动的宽高距离:取绝对值
|
|
|
|
|
var distY=Math.abs(e.clientY-startY);
|
|
|
|
|
var distX=Math.abs(e.clientX-startX);
|
|
|
|
|
|
|
|
|
|
//往上方拖动:
|
|
|
|
|
if( e.clientY < startY){
|
|
|
|
|
targetDiv.style.height=targetDivHeight-distY+'px';
|
|
|
|
|
//heightTmp = targetDivHeight-distY;
|
|
|
|
|
}
|
|
|
|
|
if( e.clientX < startX){
|
|
|
|
|
targetDiv.style.width=targetDivWidth-distX+'px';
|
|
|
|
|
//widthTmp = targetDivWidth-distX;
|
|
|
|
|
}
|
|
|
|
|
//往下方拖动:
|
|
|
|
|
if (e.clientY > startY) {
|
|
|
|
|
targetDiv.style.height=(targetDivHeight+distY)+'px';
|
|
|
|
|
//heightTmp = targetDivHeight+distY;
|
|
|
|
|
}
|
|
|
|
|
if (e.clientX > startX) {
|
|
|
|
|
targetDiv.style.width=(targetDivWidth+distX)+'px';
|
|
|
|
|
//widthTmp = targetDivWidth+distX;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(parseInt(targetDiv.style.height)<=_this.minHeight){
|
|
|
|
|
targetDiv.style.height=_this.minHeight+'px';
|
|
|
|
|
//heightTmp = _this.minHeight;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(parseInt(targetDiv.style.width)>=maxWidth){
|
|
|
|
|
targetDiv.style.width=maxWidth+'px';
|
|
|
|
|
//widthTmp = maxWidth;
|
|
|
|
|
}
|
|
|
|
|
if(parseInt(targetDiv.style.width)<=minWidth){
|
|
|
|
|
targetDiv.style.width=minWidth+'px';
|
|
|
|
|
//widthTmp = minWidth;
|
|
|
|
|
}
|
|
|
|
|
//调整表格大小
|
|
|
|
|
let containerHeight = parseInt(targetDiv.style.height);
|
|
|
|
|
let containerWidth = parseInt(targetDiv.style.width);
|
|
|
|
|
const chartBox = document.getElementsByClassName('chartBox');
|
2020-03-25 09:21:23 +08:00
|
|
|
chartBox[_this.chartIndex].style.width = (containerWidth+chartBoxPadding)+'px';
|
2020-03-20 18:47:51 +08:00
|
|
|
//chartBox[_this.chartIndex].style.height = `${containerHeight}px`;
|
|
|
|
|
//表格的高度
|
|
|
|
|
const tableBox = document.getElementById('tableContainer'+_this.chartIndex);
|
2020-03-23 21:23:50 +08:00
|
|
|
tableBox.style.height = `${containerHeight-_this.titleHeight-_this.pageHeight}px`;//-75-32+25
|
2020-03-20 18:47:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
document.onmouseup=function(){
|
|
|
|
|
let targetDivHeightNew = parseInt(targetDiv.style.height);
|
|
|
|
|
//let targetDivHeightNew = heightTmp
|
|
|
|
|
let targetDivWidthNew = parseInt(targetDiv.style.width);
|
|
|
|
|
//let targetDivWidthNew = widthTmp;
|
|
|
|
|
|
|
|
|
|
let diffHeight = Math.abs(targetDivHeight-targetDivHeightNew);
|
|
|
|
|
if(targetDivHeight>targetDivHeightNew){
|
|
|
|
|
let finalDiffHeight = Math.floor(diffHeight/stepHeight)*stepHeight;
|
|
|
|
|
//alert('oldWidth='+targetDivHeight+"===diffHeight+"+diffHeight+"==finalDiffHeight="+finalDiffHeight);
|
|
|
|
|
targetDiv.style.height = (targetDivHeight-finalDiffHeight)+'px';
|
|
|
|
|
}
|
|
|
|
|
if(targetDivHeight<targetDivHeightNew){
|
|
|
|
|
let finalDiffHeight = Math.ceil(diffHeight/stepHeight)*stepHeight;
|
|
|
|
|
targetDiv.style.height = (targetDivHeight+finalDiffHeight)+'px';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var span = _this.data.span;
|
|
|
|
|
if(targetDivWidth>targetDivWidthNew){
|
|
|
|
|
span = Math.floor((targetDivWidthNew*12)/maxWidth);
|
|
|
|
|
let finalWidth = Math.floor((targetDivWidthNew*12)/maxWidth)*stepWidth;
|
|
|
|
|
if((finalWidth)<minWidth){
|
|
|
|
|
targetDiv.style.width=minWidth+'px';
|
|
|
|
|
span = 1;
|
|
|
|
|
}else {
|
|
|
|
|
targetDiv.style.width = finalWidth+'px';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(targetDivWidth<targetDivWidthNew){
|
|
|
|
|
span = Math.ceil((targetDivWidthNew*12)/maxWidth);
|
|
|
|
|
let spanUnit = Math.ceil((targetDivWidthNew*12)/maxWidth);
|
|
|
|
|
let finalWidth = spanUnit*stepWidth;
|
|
|
|
|
if(finalWidth>maxWidth || spanUnit===12){
|
|
|
|
|
targetDiv.style.width=maxWidth+'px';
|
|
|
|
|
span = 12;
|
|
|
|
|
}else {
|
|
|
|
|
targetDiv.style.width = finalWidth+'px';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//调整表格大小
|
|
|
|
|
let containerHeight = parseInt(targetDiv.style.height);
|
|
|
|
|
let containerWidth = parseInt(targetDiv.style.width);
|
|
|
|
|
|
|
|
|
|
const chartBox = document.getElementsByClassName('chartBox');
|
2020-03-25 09:21:23 +08:00
|
|
|
chartBox[_this.chartIndex].style.width = (containerWidth+chartBoxPadding)+'px';
|
2020-03-20 18:47:51 +08:00
|
|
|
//chartBox[_this.chartIndex].style.height = `${containerHeight}px`;
|
|
|
|
|
//表格的高度
|
|
|
|
|
const tableBox = document.getElementById('tableContainer'+_this.chartIndex);
|
2020-03-23 21:23:50 +08:00
|
|
|
tableBox.style.height = `${containerHeight-_this.titleHeight-_this.pageHeight}px`;
|
2020-03-20 18:47:51 +08:00
|
|
|
|
|
|
|
|
const modifyParams = {
|
|
|
|
|
id:_this.data.id,
|
|
|
|
|
span:span,
|
2020-03-23 21:23:50 +08:00
|
|
|
height:(containerHeight+_this.chartSpaceHeight),
|
2020-03-20 18:47:51 +08:00
|
|
|
prev:parseInt(_this.data.prev),
|
|
|
|
|
next:parseInt(_this.data.next),
|
|
|
|
|
}
|
|
|
|
|
_this.$put('panel/'+ _this.panelIdInner+'/charts/modify',modifyParams).then(response => {
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
//更新当前图表数据
|
|
|
|
|
_this.data.span= span;
|
2020-03-23 21:23:50 +08:00
|
|
|
_this.data.height= containerHeight+_this.chartSpaceHeight;
|
2020-03-20 18:47:51 +08:00
|
|
|
_this.$emit('on-drag-chart', _this.data);
|
|
|
|
|
}else {
|
|
|
|
|
if(response.msg){
|
|
|
|
|
_this.$message.error(response.msg);
|
|
|
|
|
}else if(response.error){
|
|
|
|
|
_this.$message.error(response.error);
|
|
|
|
|
}else {
|
|
|
|
|
_this.$message.error(response);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
document.onmousemove=null;
|
|
|
|
|
document.onmouseup = null;
|
|
|
|
|
}
|
|
|
|
|
},
|
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;
|
2020-03-23 21:23:50 +08:00
|
|
|
if(height<this.minHeight){
|
|
|
|
|
height = this.minHeight;
|
2020-02-19 21:33:54 +08:00
|
|
|
}
|
2020-03-23 21:23:50 +08:00
|
|
|
chartBox.style.height = `${height-this.chartSpaceHeight}px`;
|
2020-02-19 21:33:54 +08:00
|
|
|
const tableBox = document.getElementById('tableContainer'+this.chartIndex);
|
2020-03-23 21:23:50 +08:00
|
|
|
//tableBox.style.height = `${height-75-32}px`;
|
|
|
|
|
tableBox.style.height = `${height-this.chartSpaceHeight-this.titleHeight-this.pageHeight}px`;// -75-32
|
2020-02-19 21:33:54 +08:00
|
|
|
});
|
|
|
|
|
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-03-17 19:30:27 +08:00
|
|
|
this.dropdownMenuShow=false;
|
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() {
|
2020-03-17 19:30:27 +08:00
|
|
|
this.dropdownMenuShow=false;
|
2020-01-17 16:50:17 +08:00
|
|
|
this.$emit('on-edit-chart-block', this.data.id);
|
|
|
|
|
},
|
|
|
|
|
// 删除该图表
|
|
|
|
|
removeChart() {
|
2020-03-17 19:30:27 +08:00
|
|
|
this.dropdownMenuShow=false;
|
2020-01-17 16:50:17 +08:00
|
|
|
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;
|
2020-04-24 17:00:56 +08:00
|
|
|
this.searchTime = [...time];
|
2020-02-19 21:33:54 +08:00
|
|
|
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);
|
|
|
|
|
},
|
2020-03-17 19:30:27 +08:00
|
|
|
clickos() {
|
|
|
|
|
this.dropdownMenuShow=false;
|
|
|
|
|
},
|
2020-01-17 16:50:17 +08:00
|
|
|
// 全屏查看
|
|
|
|
|
showAllScreen() {
|
2020-03-17 19:30:27 +08:00
|
|
|
this.dropdownMenuShow=false;
|
2020-01-17 16:50:17 +08:00
|
|
|
// 初始化同步时间
|
2020-02-19 21:33:54 +08:00
|
|
|
//this.searchTime = this.oldSearchTime;
|
|
|
|
|
//alert(JSON.stringify(this.oldSearchTime));
|
|
|
|
|
this.searchTime = [];
|
2020-04-24 17:00:56 +08:00
|
|
|
//this.searchTime[0] = this.oldSearchTime[0];//将列表的查询时间复制给全屏的查询时间
|
|
|
|
|
//this.searchTime[1] = this.oldSearchTime[1];
|
|
|
|
|
this.$set(this.searchTime, 0, this.oldSearchTime[0]);
|
|
|
|
|
this.$set(this.searchTime, 1, this.oldSearchTime[1]);
|
|
|
|
|
this.$refs.calendarPanel.setCustomTime(this.searchTime);
|
|
|
|
|
|
2020-02-19 21:33:54 +08:00
|
|
|
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-04-22 18:45:22 +08:00
|
|
|
setData(chartItem, seriesItem, panelId, filter,area,errorMsg) {
|
|
|
|
|
if(errorMsg && errorMsg!==''){
|
|
|
|
|
this.isError = true;
|
|
|
|
|
this.errorContent = errorMsg;
|
|
|
|
|
}else {
|
|
|
|
|
this.isError = false;
|
|
|
|
|
this.errorContent = '';
|
|
|
|
|
}
|
2020-02-19 21:33:54 +08:00
|
|
|
if(area==='showFullScreen'){//全屏按时间查询
|
|
|
|
|
this.data = chartItem;
|
2020-03-11 18:48:05 +08:00
|
|
|
this.unit = chartDataFormat.getUnit(this.data.unit);
|
2020-02-19 21:33:54 +08:00
|
|
|
this.searchTime[0] = filter.start_time;//将列表的查询时间复制给全屏的查询时间
|
|
|
|
|
this.searchTime[1] = filter.end_time;
|
2020-03-12 16:13:29 +08:00
|
|
|
// this.seriesItemScreen = seriesItem;
|
|
|
|
|
this.storedScreanTableData=seriesItem;
|
|
|
|
|
this.storedScreanTableData=Object.assign([],this.storedScreanTableData.reverse());
|
|
|
|
|
this.screenPageObj.total=this.storedScreanTableData.length;
|
|
|
|
|
this.seriesItemScreen=this.filterShowData(this.storedScreanTableData,this.screenPageObj);
|
2020-02-19 21:33:54 +08:00
|
|
|
this.endLoading('screen');
|
|
|
|
|
}else{
|
|
|
|
|
//设置高度 chart-table
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
const chartBox = document.getElementById('chartTableDiv'+this.chartIndex);
|
|
|
|
|
let height = chartItem.height;
|
2020-03-23 21:23:50 +08:00
|
|
|
if(height<this.minHeight){
|
|
|
|
|
height = this.minHeight;
|
2020-02-19 21:33:54 +08:00
|
|
|
}
|
2020-03-23 21:23:50 +08:00
|
|
|
chartBox.style.height = `${height-this.chartSpaceHeight}px`;
|
2020-02-19 21:33:54 +08:00
|
|
|
const tableBox = document.getElementById('tableContainer'+this.chartIndex);
|
2020-03-23 21:23:50 +08:00
|
|
|
tableBox.style.height = `${height-this.chartSpaceHeight-this.titleHeight-this.pageHeight}px`;// -75-32
|
2020-02-19 21:33:54 +08:00
|
|
|
});
|
|
|
|
|
this.divFirstShow = true;
|
|
|
|
|
|
|
|
|
|
this.firstShow = true; // 展示操作按键
|
|
|
|
|
|
|
|
|
|
this.panelIdInner = panelId;
|
|
|
|
|
this.data = chartItem;
|
2020-03-11 18:48:05 +08:00
|
|
|
this.unit = chartDataFormat.getUnit(this.data.unit);
|
2020-03-12 16:13:29 +08:00
|
|
|
// this.seriesItem = seriesItem;
|
|
|
|
|
// this.seriesItemScreen = seriesItem;
|
|
|
|
|
this.storedTableData =seriesItem;
|
|
|
|
|
this.storedScreanTableData=seriesItem;
|
|
|
|
|
this.storedTableData=Object.assign([],this.storedTableData.reverse());
|
|
|
|
|
this.storedScreanTableData=Object.assign([],this.storedScreanTableData.reverse());
|
|
|
|
|
this.pageObj.total=this.storedTableData.length;
|
|
|
|
|
this.screenPageObj.total=this.storedScreanTableData.length;
|
|
|
|
|
this.seriesItem=this.filterShowData(this.storedTableData,this.pageObj);
|
|
|
|
|
this.seriesItemScreen =this.filterShowData(this.storedScreanTableData,this.screenPageObj)
|
2020-02-19 21:33:54 +08:00
|
|
|
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
|
|
|
}
|
|
|
|
|
},
|
2020-03-12 14:10:37 +08:00
|
|
|
dealLegendAlias:function(legend,expression){
|
|
|
|
|
if(/\{\{.+\}\}/.test(expression)){
|
|
|
|
|
let labelValue=expression.replace(/(\{\{.+?\}\})/g,function(i){
|
|
|
|
|
let label=i.substr(i.indexOf('{{')+2,i.indexOf('}}')-i.indexOf('{{')-2)
|
|
|
|
|
let reg=new RegExp(label+'=".+?"')
|
|
|
|
|
let value=null;
|
|
|
|
|
if(reg.test(legend)){
|
|
|
|
|
let find=legend.match(reg)[0];
|
|
|
|
|
value=find.substr(find.indexOf('"')+1,find.lastIndexOf('"')-find.indexOf('"')-1);
|
|
|
|
|
}
|
|
|
|
|
return value?value:label;
|
|
|
|
|
})
|
|
|
|
|
return labelValue
|
|
|
|
|
}else{
|
|
|
|
|
return expression;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
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>
|