2022-07-19 10:16:44 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="network-overview-apps">
|
|
|
|
|
|
<div class="line-select-metric">
|
|
|
|
|
|
<span>{{$t('network.metric')}}:</span>
|
|
|
|
|
|
<div class="line-select__operation">
|
|
|
|
|
|
<el-select
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
v-model="metricFilter"
|
2022-07-21 15:06:24 +08:00
|
|
|
|
class="option__select select-top"
|
2022-07-19 10:16:44 +08:00
|
|
|
|
placeholder=""
|
2022-07-21 15:06:24 +08:00
|
|
|
|
popper-class="option-popper select-top"
|
|
|
|
|
|
:popper-append-to-body="false"
|
2022-07-19 10:16:44 +08:00
|
|
|
|
>
|
|
|
|
|
|
<el-option v-for="item in metricOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="app-cards">
|
2022-07-19 17:53:22 +08:00
|
|
|
|
<div class="app-card" v-for="(app, index) in appData" :key="index">
|
|
|
|
|
|
<div class="app-card-title">
|
|
|
|
|
|
<div class="app-card-title-name">
|
|
|
|
|
|
<span><i class="cn-icon cn-icon-social-network"></i></span>
|
|
|
|
|
|
<span>{{app.name}}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<el-row class="block-col-2">
|
|
|
|
|
|
<el-col>
|
|
|
|
|
|
<el-dropdown
|
|
|
|
|
|
trigger="click"
|
|
|
|
|
|
placement="bottom-end"
|
|
|
|
|
|
popper-class="app-dropdown"
|
|
|
|
|
|
>
|
|
|
|
|
|
<span><i class="cn-icon cn-icon-more-dark"></i></span>
|
|
|
|
|
|
<template #dropdown>
|
|
|
|
|
|
<el-dropdown-menu>
|
|
|
|
|
|
<el-dropdown-item><span><i class="cn-icon cn-icon-delete"></i>{{$t('overall.delete')}}</span></el-dropdown-item>
|
|
|
|
|
|
</el-dropdown-menu>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-dropdown>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="app-card__bodys">
|
|
|
|
|
|
<div class="app-card__body">
|
|
|
|
|
|
<div class="app-card__body-content">
|
|
|
|
|
|
<div class="app-card__body-content-value">
|
|
|
|
|
|
<div class="app-card__body-content-number">{{unitConvert(app.number, unitTypes.number).join(' ')}}</div>
|
|
|
|
|
|
<div class="app-card__body-content-percent" :class="app.trend === 'up' ? 'red' : 'green'">
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<span v-if="app.trend === 'up'">+</span><span v-else-if="app.trend === 'down'">-</span>{{unitConvert(app.value, unitTypes.percent).join('')}}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="app-card__body-previous">
|
|
|
|
|
|
<div>previous 24 hours</div>
|
|
|
|
|
|
<div>{{unitConvert(app.number1, unitTypes.number).join(' ')}}</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="chart__drawing" :id="`chart${app.name}`"></div>
|
|
|
|
|
|
</div>
|
2022-07-19 10:16:44 +08:00
|
|
|
|
</div>
|
2022-07-21 15:06:19 +08:00
|
|
|
|
<div class="app-card app-card--create">
|
|
|
|
|
|
<i class="cn-icon cn-icon-add1" @click="addApp"></i>
|
|
|
|
|
|
<span @click="addApp">{{$t('overall.add')}}</span>
|
|
|
|
|
|
</div>
|
2022-07-19 10:16:44 +08:00
|
|
|
|
</div>
|
2022-07-21 15:06:19 +08:00
|
|
|
|
<el-drawer
|
|
|
|
|
|
v-model="showAddApp"
|
|
|
|
|
|
direction="btt"
|
|
|
|
|
|
custom-class="add-app-drawer"
|
|
|
|
|
|
:with-header="false"
|
|
|
|
|
|
:show-close="false"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="add-app">
|
|
|
|
|
|
<div class="add-app__header">
|
|
|
|
|
|
<div class="header__title">{{$t('overall.add')}}</div>
|
|
|
|
|
|
<div class="header__operations">
|
2022-07-21 18:23:33 +08:00
|
|
|
|
<div class="header__operation header__operation--cancel" @click="cancelApp">{{$t('overall.cancel')}}</div>
|
2022-07-21 15:06:19 +08:00
|
|
|
|
<div class="header__operation header__operation--save">{{$t('overall.save')}}</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="add-app__body">
|
2022-07-21 18:23:33 +08:00
|
|
|
|
<el-tabs v-model="appTypeTab" @tab-click="appTypeTabChange">
|
2022-07-21 15:06:19 +08:00
|
|
|
|
<el-tab-pane :label="$t('networkOverview.appType.provider')" :name="0">
|
|
|
|
|
|
<div class="body__apps">
|
2022-07-22 15:13:32 +08:00
|
|
|
|
<div class="body__app" :class="{'provide-show': app.provideShow}" v-for="app in providerOptions" :key="app.name" @click="appCheckedChange(app, 0)">
|
2022-07-21 19:24:55 +08:00
|
|
|
|
<div class="body__app-content">
|
|
|
|
|
|
<div class="body__app-left">
|
2022-07-21 18:23:33 +08:00
|
|
|
|
<span><i class="cn-icon cn-icon-mining-pool"></i></span>
|
2022-07-22 15:13:32 +08:00
|
|
|
|
<span class="body__app-left-title">{{app.name}}</span>
|
2022-07-21 18:23:33 +08:00
|
|
|
|
</div>
|
2022-07-21 19:24:55 +08:00
|
|
|
|
<div class="body__app-content-right" v-if="app.provideShow"><span><i class="cn-icon cn-icon-a-allclear"></i></span></div>
|
2022-07-21 18:23:33 +08:00
|
|
|
|
</div>
|
2022-07-22 15:13:32 +08:00
|
|
|
|
<div class="body__app-value">{{app.desc}}</div>
|
2022-07-21 18:23:33 +08:00
|
|
|
|
</div>
|
2022-07-21 15:06:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
<el-tab-pane :label="$t('networkOverview.appType.app')" :name="1">
|
|
|
|
|
|
<div class="body__apps">
|
2022-07-22 15:13:32 +08:00
|
|
|
|
<div class="body__app" :class="{'app-show': app.appShow}" v-for="app in appOptions" :key="app.name" @click="appCheckedChange(app, 1)">
|
2022-07-21 19:24:55 +08:00
|
|
|
|
<div class="body__app-content">
|
|
|
|
|
|
<div class="body__app-left">
|
2022-07-21 18:23:33 +08:00
|
|
|
|
<span><i class="cn-icon cn-icon-mining-pool"></i></span>
|
2022-07-22 15:13:32 +08:00
|
|
|
|
<span class="body__app-left-title">{{app.name}}</span>
|
2022-07-21 18:23:33 +08:00
|
|
|
|
</div>
|
2022-07-21 19:24:55 +08:00
|
|
|
|
<div class="body__app-content-right" v-if="app.appShow"><span><i class="cn-icon cn-icon-a-allclear"></i></span></div>
|
2022-07-21 18:23:33 +08:00
|
|
|
|
</div>
|
2022-07-22 15:13:32 +08:00
|
|
|
|
<div class="body__app-value">{{app.desc}}</div>
|
2022-07-21 18:23:33 +08:00
|
|
|
|
</div>
|
2022-07-21 15:06:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
</el-tabs>
|
|
|
|
|
|
<div class="body__searcher">
|
2022-07-21 18:23:33 +08:00
|
|
|
|
<el-input v-model="searcherApp" @input="searcherAppChange" size="mini" :placeholder="$t('networkOverview.searcher')" prefix-icon="el-icon-search"></el-input>
|
2022-07-21 15:06:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-drawer>
|
2022-07-19 10:16:44 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2022-07-19 17:53:22 +08:00
|
|
|
|
import unitConvert from '@/utils/unit-convert'
|
|
|
|
|
|
import { unitTypes } from '@/utils/constants'
|
|
|
|
|
|
import * as echarts from 'echarts'
|
|
|
|
|
|
import { appListChartOption } from '@/views/charts2/charts/options/echartOption'
|
|
|
|
|
|
import { shallowRef } from 'vue'
|
2022-07-19 10:16:44 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
name: 'NetworkOverviewApps',
|
|
|
|
|
|
props: {
|
|
|
|
|
|
chart: Object
|
|
|
|
|
|
},
|
2022-07-19 17:53:22 +08:00
|
|
|
|
setup () {
|
|
|
|
|
|
return {
|
2022-07-21 18:23:33 +08:00
|
|
|
|
myChart: shallowRef([])
|
2022-07-19 17:53:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2022-07-19 10:16:44 +08:00
|
|
|
|
data () {
|
|
|
|
|
|
return {
|
|
|
|
|
|
metricFilter: '',
|
2022-07-19 17:53:22 +08:00
|
|
|
|
metricOptions: [],
|
|
|
|
|
|
chartOption: [],
|
2022-07-21 15:06:19 +08:00
|
|
|
|
appData: [],
|
|
|
|
|
|
// 假数据
|
|
|
|
|
|
appTempData: [
|
2022-07-19 17:53:22 +08:00
|
|
|
|
{ value: 1.3912, number: 684600000000, previous: 24, number1: 3675, trend: 'down', icon: 'cn-icon-mining-pool' },
|
|
|
|
|
|
{ value: 1.8934, number: 382100000000, previous: 24, number1: 3675, trend: 'up', icon: 'cn-icon-fraudulent-ip' },
|
|
|
|
|
|
{ value: 1.2054, number: 184600000000, previous: 24, number1: 3675, trend: 'up', icon: 'cn-icon-debug' },
|
|
|
|
|
|
{ value: 1.2506, number: 584800000000, previous: 24, number1: 3675, trend: 'down', icon: 'cn-icon-language' },
|
|
|
|
|
|
{ value: 1.6415, number: 734100000000, previous: 24, number1: 3675, trend: 'down', icon: 'cn-icon-authoritative-domain' }
|
|
|
|
|
|
],
|
|
|
|
|
|
unitTypes,
|
|
|
|
|
|
timer: null,
|
2022-07-21 15:06:19 +08:00
|
|
|
|
showAddApp: false,
|
|
|
|
|
|
// add弹框中的可选项
|
|
|
|
|
|
providerOptions: [],
|
|
|
|
|
|
appOptions: [],
|
2022-07-21 18:23:33 +08:00
|
|
|
|
appTypeTab: 0,
|
|
|
|
|
|
appShowName: false,
|
|
|
|
|
|
searcherApp: '',
|
2022-07-22 15:13:32 +08:00
|
|
|
|
appShowTypeTab: 0,
|
|
|
|
|
|
initialAppOptionsData: [],
|
2022-07-26 10:24:38 +08:00
|
|
|
|
initialProviderOptionsData: [],
|
|
|
|
|
|
myChartArray: []
|
2022-07-19 17:53:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
2022-07-21 15:06:19 +08:00
|
|
|
|
unitConvert,
|
|
|
|
|
|
init () {
|
|
|
|
|
|
this.appData.forEach((app, i) => {
|
|
|
|
|
|
// 根据app.name和app.type查除接口,获取数据
|
|
|
|
|
|
this.appData[i] = { ...app, ...this.appTempData[i] }
|
|
|
|
|
|
this.appData[i].lineData = [
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658128320',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658129184',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658130048',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658130912',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658131776',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658132640',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658133504',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658134368',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658135232',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658136096',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658136960',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658137824',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658138688',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658139552',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658140416',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658141280',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658142144',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658143008',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658143872',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658144736',
|
|
|
|
|
|
'1'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658145600',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658146464',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658147328',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658148192',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658149056',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658149920',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658150784',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658151648',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658152512',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658153376',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658154240',
|
|
|
|
|
|
'1'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658155104',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658155968',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658156832',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658157696',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658158560',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658159424',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658160288',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658161152',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658162016',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658162880',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658163744',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658164608',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658165472',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658166336',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658167200',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658168064',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658168928',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658169792',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658170656',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658171520',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658172384',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658173248',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658174112',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658174976',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658175840',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658176704',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658177568',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658178432',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658179296',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658180160',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658181024',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658181888',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658182752',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658183616',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658184480',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658185344',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658186208',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658187072',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658187936',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658188800',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658189664',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658190528',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658191392',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658192256',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658193120',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658193984',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658194848',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658195712',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658196576',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658197440',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658198304',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658199168',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658200032',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658200896',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658201760',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658202624',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658203488',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658204352',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658205216',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658206080',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658206944',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658207808',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658208672',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658209536',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658210400',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658211264',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658212128',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658212992',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658213856',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
],
|
|
|
|
|
|
[
|
|
|
|
|
|
'1658214720',
|
|
|
|
|
|
'0'
|
|
|
|
|
|
]
|
|
|
|
|
|
].map(v => [Number(v[0]) * 1000, Number(v[1]), 'time'])
|
2022-07-26 10:24:38 +08:00
|
|
|
|
this.initChart(this.appData[i])
|
2022-07-21 15:06:19 +08:00
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
initChart (obj) {
|
2022-07-19 17:53:22 +08:00
|
|
|
|
const dom = document.getElementById(`chart${obj.name}`)
|
2022-07-26 10:24:38 +08:00
|
|
|
|
this.myChart = echarts.init(dom)
|
2022-07-19 17:53:22 +08:00
|
|
|
|
this.chartOption = appListChartOption
|
|
|
|
|
|
const seriesTemplate = this.chartOption.series[0]
|
2022-07-26 10:24:38 +08:00
|
|
|
|
if (obj && obj.lineData) {
|
|
|
|
|
|
this.chartOption.series[0] = {
|
|
|
|
|
|
...seriesTemplate,
|
|
|
|
|
|
data: obj.lineData,
|
|
|
|
|
|
lineStyle: {
|
|
|
|
|
|
color: obj.trend === 'up' ? '#7FA054' : '#35ADDA'
|
|
|
|
|
|
},
|
|
|
|
|
|
areaStyle: {
|
|
|
|
|
|
opacity: 0.1,
|
|
|
|
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
|
|
|
|
{
|
|
|
|
|
|
offset: 0,
|
|
|
|
|
|
color: obj.trend === 'up' ? '#7FA054' : '#35ADDA'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
offset: 1,
|
|
|
|
|
|
color: obj.trend === 'up' ? '#7FA054' : '#35ADDA'
|
|
|
|
|
|
}
|
|
|
|
|
|
])
|
|
|
|
|
|
}
|
2022-07-19 17:53:22 +08:00
|
|
|
|
}
|
2022-07-26 10:24:38 +08:00
|
|
|
|
this.myChartArray.push(this.myChart)
|
|
|
|
|
|
this.myChart.setOption(this.chartOption)
|
|
|
|
|
|
}
|
2022-07-19 17:53:22 +08:00
|
|
|
|
},
|
2022-07-21 15:06:19 +08:00
|
|
|
|
addApp () {
|
|
|
|
|
|
this.showAddApp = true
|
2022-07-22 18:10:42 +08:00
|
|
|
|
this.searcherApp = ''
|
2022-07-21 15:06:19 +08:00
|
|
|
|
const letter = 'abcdefghijklmnopqrstuvwxyz'
|
2022-07-22 18:10:42 +08:00
|
|
|
|
const appOptions = []
|
|
|
|
|
|
const providerOptions = []
|
2022-07-21 15:06:19 +08:00
|
|
|
|
for (let i = 0; i < 100; i++) {
|
2022-07-22 18:10:42 +08:00
|
|
|
|
appOptions.push({
|
2022-07-21 15:06:19 +08:00
|
|
|
|
name: letter[i % 26] + i,
|
2022-07-21 18:23:33 +08:00
|
|
|
|
desc: 'this is a really nice app',
|
|
|
|
|
|
appShow: false
|
2022-07-21 15:06:19 +08:00
|
|
|
|
})
|
2022-07-22 18:10:42 +08:00
|
|
|
|
providerOptions.push({
|
2022-07-21 15:06:19 +08:00
|
|
|
|
name: letter[i % 26] + i,
|
2022-07-21 18:23:33 +08:00
|
|
|
|
desc: 'this is a really nice provider',
|
|
|
|
|
|
provideShow: false
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2022-07-22 18:10:42 +08:00
|
|
|
|
this.appOptions = appOptions
|
|
|
|
|
|
this.providerOptions = providerOptions
|
2022-07-22 15:13:32 +08:00
|
|
|
|
this.initialAppOptionsData = this.appOptions
|
|
|
|
|
|
this.initialProviderOptionsData = this.providerOptions
|
2022-07-21 18:23:33 +08:00
|
|
|
|
},
|
|
|
|
|
|
cancelApp () {
|
|
|
|
|
|
this.showAddApp = false
|
|
|
|
|
|
},
|
2022-07-22 18:10:42 +08:00
|
|
|
|
appTypeTabChange (val) {
|
|
|
|
|
|
this.appShowTypeTab = val.index
|
2022-07-21 18:52:15 +08:00
|
|
|
|
this.searcherApp = ''
|
2022-07-22 18:10:42 +08:00
|
|
|
|
this.searcherAppChange(this.searcherApp)
|
2022-07-21 18:23:33 +08:00
|
|
|
|
},
|
|
|
|
|
|
searcherAppChange (val) {
|
|
|
|
|
|
if (val) {
|
2022-07-22 18:10:42 +08:00
|
|
|
|
if (this.appShowTypeTab == 0) {
|
|
|
|
|
|
this.providerOptions = this.initialProviderOptionsData.filter(t => t.name.indexOf(val) > -1)
|
|
|
|
|
|
} else if (this.appShowTypeTab == 1) {
|
|
|
|
|
|
this.appOptions = this.initialAppOptionsData.filter(t => t.name.indexOf(val) > -1)
|
|
|
|
|
|
}
|
2022-07-21 18:52:15 +08:00
|
|
|
|
} else {
|
2022-07-22 18:10:42 +08:00
|
|
|
|
if (this.appShowTypeTab == 0) {
|
|
|
|
|
|
this.providerOptions = this.initialProviderOptionsData
|
|
|
|
|
|
} else if (this.appShowTypeTab == 1) {
|
|
|
|
|
|
this.appOptions = this.initialAppOptionsData
|
|
|
|
|
|
}
|
2022-07-21 18:23:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
appCheckedChange (app, num) {
|
|
|
|
|
|
if (num === 0) {
|
|
|
|
|
|
this.providerOptions.forEach(t => {
|
|
|
|
|
|
if (t.name === app.name && t.desc === app.desc) {
|
|
|
|
|
|
t.provideShow = !t.provideShow
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
} else if (num === 1) {
|
|
|
|
|
|
this.appOptions.forEach(t => {
|
|
|
|
|
|
if (t.name === app.name && t.desc === app.desc) {
|
|
|
|
|
|
t.appShow = !t.appShow
|
|
|
|
|
|
}
|
2022-07-21 15:06:19 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2022-07-19 17:53:22 +08:00
|
|
|
|
resize () {
|
2022-07-26 10:24:38 +08:00
|
|
|
|
this.myChartArray.forEach(t => {
|
2022-07-21 18:23:33 +08:00
|
|
|
|
t.resize()
|
|
|
|
|
|
})
|
2022-07-19 17:53:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
mounted () {
|
|
|
|
|
|
if (this.chart.params.app) {
|
2022-07-21 15:06:19 +08:00
|
|
|
|
this.appData = this.chart.params.app
|
2022-07-19 10:16:44 +08:00
|
|
|
|
}
|
2022-07-19 17:53:22 +08:00
|
|
|
|
this.timer = setTimeout(() => {
|
2022-07-21 15:06:19 +08:00
|
|
|
|
this.init()
|
2022-07-19 17:53:22 +08:00
|
|
|
|
}, 100)
|
|
|
|
|
|
window.addEventListener('resize', this.resize)
|
2022-07-19 10:16:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|