From 951c3db93cb946fda05490dc57afddd7147dd0eb Mon Sep 17 00:00:00 2001 From: DongZeLiang <2746733890@qq.com> Date: Fri, 19 Apr 2024 15:24:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=9F=E8=BD=BD=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../node-list/dashboard/BarChart.vue | 103 ++++++++++ .../node-list/dashboard/LineChart.vue | 122 +++++++++++ .../node-list/dashboard/PanelGroup.vue | 189 ++++++++++++++++++ .../node-list/dashboard/PieChart.vue | 80 ++++++++ .../node-list/dashboard/RaddarChart.vue | 117 +++++++++++ .../node-list/dashboard/mixins/resize.js | 56 ++++++ src/views/statistics/node-list/index.vue | 101 +++++++++- 7 files changed, 765 insertions(+), 3 deletions(-) create mode 100644 src/views/statistics/node-list/dashboard/BarChart.vue create mode 100644 src/views/statistics/node-list/dashboard/LineChart.vue create mode 100644 src/views/statistics/node-list/dashboard/PanelGroup.vue create mode 100644 src/views/statistics/node-list/dashboard/PieChart.vue create mode 100644 src/views/statistics/node-list/dashboard/RaddarChart.vue create mode 100644 src/views/statistics/node-list/dashboard/mixins/resize.js diff --git a/src/views/statistics/node-list/dashboard/BarChart.vue b/src/views/statistics/node-list/dashboard/BarChart.vue new file mode 100644 index 0000000..e175369 --- /dev/null +++ b/src/views/statistics/node-list/dashboard/BarChart.vue @@ -0,0 +1,103 @@ + + + + + diff --git a/src/views/statistics/node-list/dashboard/LineChart.vue b/src/views/statistics/node-list/dashboard/LineChart.vue new file mode 100644 index 0000000..c14c5db --- /dev/null +++ b/src/views/statistics/node-list/dashboard/LineChart.vue @@ -0,0 +1,122 @@ + + + + + + + diff --git a/src/views/statistics/node-list/dashboard/PanelGroup.vue b/src/views/statistics/node-list/dashboard/PanelGroup.vue new file mode 100644 index 0000000..d72cfb2 --- /dev/null +++ b/src/views/statistics/node-list/dashboard/PanelGroup.vue @@ -0,0 +1,189 @@ + + + + + + + + + + 网关收集节点数量 + + + + + + + + + + + + + 数据解析节点数量 + + + + + + + + + + + + + 整体负载 + + + + + + + + + + + + + 车辆在线数 + + + + + + + + + + + diff --git a/src/views/statistics/node-list/dashboard/PieChart.vue b/src/views/statistics/node-list/dashboard/PieChart.vue new file mode 100644 index 0000000..3ba4411 --- /dev/null +++ b/src/views/statistics/node-list/dashboard/PieChart.vue @@ -0,0 +1,80 @@ + + + + + diff --git a/src/views/statistics/node-list/dashboard/RaddarChart.vue b/src/views/statistics/node-list/dashboard/RaddarChart.vue new file mode 100644 index 0000000..2a5e27d --- /dev/null +++ b/src/views/statistics/node-list/dashboard/RaddarChart.vue @@ -0,0 +1,117 @@ + + + + + diff --git a/src/views/statistics/node-list/dashboard/mixins/resize.js b/src/views/statistics/node-list/dashboard/mixins/resize.js new file mode 100644 index 0000000..d0410ec --- /dev/null +++ b/src/views/statistics/node-list/dashboard/mixins/resize.js @@ -0,0 +1,56 @@ +import {debounce} from '@/utils' + +export default { + data() { + return { + $_sidebarElm: null, + $_resizeHandler: null + } + }, + mounted() { + this.initListener() + }, + activated() { + if (!this.$_resizeHandler) { + // avoid duplication init + this.initListener() + } + + // when keep-alive chart activated, auto resize + this.resize() + }, + beforeDestroy() { + this.destroyListener() + }, + deactivated() { + this.destroyListener() + }, + methods: { + // use $_ for mixins properties + // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential + $_sidebarResizeHandler(e) { + if (e.propertyName === 'width') { + this.$_resizeHandler() + } + }, + initListener() { + this.$_resizeHandler = debounce(() => { + this.resize() + }, 100) + window.addEventListener('resize', this.$_resizeHandler) + + this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0] + this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler) + }, + destroyListener() { + window.removeEventListener('resize', this.$_resizeHandler) + this.$_resizeHandler = null + + this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler) + }, + resize() { + const {chart} = this + chart && chart.resize() + } + } +} diff --git a/src/views/statistics/node-list/index.vue b/src/views/statistics/node-list/index.vue index cd0cb0a..c111cea 100644 --- a/src/views/statistics/node-list/index.vue +++ b/src/views/statistics/node-list/index.vue @@ -8,21 +8,116 @@ 节点列表 + + + + + + + 节点名称:{{nodeInfo.nodeId}} + 查看详情 + + + + + CPU + + + + 内存 + + + + 负载 + + + + + + + + + 收集节点:{{nodeInfo.nodeId}} 在线数:{{nodeInfo.vehicleInfoList.length}} + 关闭详情 + + + + 2024-4-19 15:13:45 + 23分26秒 + + + + +