From 240f22c51ead747a22edca472e7ac2bde8555d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=9A=E7=A5=96=E6=9C=9B?= <573413756@qq.com> Date: Fri, 30 Sep 2022 14:26:39 +0800 Subject: [PATCH] add dashboard page --- xiuosiot-frontend/src/api/dashboard/index.js | 33 ++ .../layout/components/Sidebar/SidebarItem.vue | 2 +- xiuosiot-frontend/src/layout/index.vue | 2 +- xiuosiot-frontend/src/router/index.js | 30 +- .../configuration/transferStation/index.vue | 15 + .../src/views/dashboard/index.vue | 429 ++++++++++++++++++ 6 files changed, 502 insertions(+), 9 deletions(-) create mode 100644 xiuosiot-frontend/src/api/dashboard/index.js create mode 100644 xiuosiot-frontend/src/views/configuration/transferStation/index.vue create mode 100644 xiuosiot-frontend/src/views/dashboard/index.vue diff --git a/xiuosiot-frontend/src/api/dashboard/index.js b/xiuosiot-frontend/src/api/dashboard/index.js new file mode 100644 index 0000000..b66992c --- /dev/null +++ b/xiuosiot-frontend/src/api/dashboard/index.js @@ -0,0 +1,33 @@ +import request from '@/utils/request' + +export function getAlarmLevelCount(data) { + return request({ + url: '/alarmInfo/getAlarmLevelCount', + method: 'get', + params: data || {} + }) +} + +export function getRunStatusCount(data) { + return request({ + url: '/device/getRunStatusCount', + method: 'get', + params: data || {} + }) +} + +export function getTypeCount(data) { + return request({ + url: '/device/getTypeCount', + method: 'get', + params: data || {} + }) +} + +export function getCount(data) { + return request({ + url: '/alarmInfo/getCount', + method: 'get', + params: data || {} + }) +} diff --git a/xiuosiot-frontend/src/layout/components/Sidebar/SidebarItem.vue b/xiuosiot-frontend/src/layout/components/Sidebar/SidebarItem.vue index 4688670..72bc94e 100644 --- a/xiuosiot-frontend/src/layout/components/Sidebar/SidebarItem.vue +++ b/xiuosiot-frontend/src/layout/components/Sidebar/SidebarItem.vue @@ -69,7 +69,7 @@ export default { }) // When there is only one child router, the child router is displayed by default if (showingChildren.length === 1) { - if (children[0].name === 'Overview') { + if (children[0].name === 'Overview' || children[0].name === 'Dashboard') { return true } else { return false diff --git a/xiuosiot-frontend/src/layout/index.vue b/xiuosiot-frontend/src/layout/index.vue index f221cad..f52b6aa 100644 --- a/xiuosiot-frontend/src/layout/index.vue +++ b/xiuosiot-frontend/src/layout/index.vue @@ -48,7 +48,7 @@ export default { } }, showBreadcrumb() { - const whiteList = ['overview', 'terminal/add', 'terminal/plc', 'data/value', 'configuration/development'] + const whiteList = ['overview', 'terminal/add', 'terminal/plc', 'data/value', 'configuration/development', 'dashboard'] return whiteList.every((item) => this.$route.path.indexOf(item) === -1) } }, diff --git a/xiuosiot-frontend/src/router/index.js b/xiuosiot-frontend/src/router/index.js index b2e7c52..c727d8d 100644 --- a/xiuosiot-frontend/src/router/index.js +++ b/xiuosiot-frontend/src/router/index.js @@ -85,7 +85,6 @@ export const constantRoutes = [ component: () => import('@/views/404'), hidden: true }, - { path: '/overview', component: Layout, @@ -97,18 +96,29 @@ export const constantRoutes = [ meta: { title: '概览', icon: 'overview' } }] }, + { + path: '/dashboard', + component: Layout, + meta: {}, + children: [{ + path: '', + name: 'Dashboard', + component: () => import('@/views/dashboard/index'), + meta: { title: '设备看板', icon: 'dashboard' } + }] + }, { path: '/terminal', component: Layout, name: 'Terminal', meta: { title: '设备管理', icon: 'terminal' }, children: [ - { - path: 'product', - name: 'Product', - // component: () => import(''), - meta: { title: '产品分类', disabled: true } - }, + // { + // path: 'product', + // name: 'Product', + // // component: () => import(''), + // meta: { title: '产品分类', disabled: true } + // }, { path: 'add', name: 'Add', @@ -177,6 +187,12 @@ export const constantRoutes = [ name: 'Development', component: () => import('@/views/configuration/development'), meta: { title: '组态开发' } + }, + { + path: 'transferStation', + name: 'TransferStation', + component: () => import('@/views/configuration/transferStation'), + meta: { title: '变电站' } } ] }, diff --git a/xiuosiot-frontend/src/views/configuration/transferStation/index.vue b/xiuosiot-frontend/src/views/configuration/transferStation/index.vue new file mode 100644 index 0000000..251f196 --- /dev/null +++ b/xiuosiot-frontend/src/views/configuration/transferStation/index.vue @@ -0,0 +1,15 @@ +