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 @@ +