diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue index df0acd2..5075ff3 100644 --- a/src/views/dashboard/components/PanelGroup.vue +++ b/src/views/dashboard/components/PanelGroup.vue @@ -1,8 +1,10 @@ @@ -23,28 +25,32 @@ context: '--', icon: 'icon-well', color: '#40c9c6', - path: '/wellList' + path: '/wellList', + permission: '/well/list' }, { title: '设备数量', context: '--', icon: 'icon-device', color: '#36a3f7', - path: '/deviceList' + path: '/deviceList', + permission: '/device/list' }, { title: '当前报警数', context: '--', icon: 'icon-alarm', color: '#f4516c', - path: '/alarmNow' + path: '/alarmNow', + permission: '/alarm/now' }, { title: '未完成工单数', context: '--', icon: 'icon-order', color: '#f4516c', - path: '/listJob' + path: '/listJob', + permission: '/job' } ] } @@ -55,18 +61,7 @@ this.getAlarmCount() this.getJobCount() }, - activated() { - this.getWellCount() - this.getDeviceCount() - this.getAlarmCount() - this.getJobCount() - }, methods: { - // 刷新报警和工单数 - refreshData() { - this.getAlarmCount() - this.getJobCount() - }, goPage(path) { this.$router.push(path) }, @@ -97,111 +92,111 @@ diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue index df0acd2..5075ff3 100644 --- a/src/views/dashboard/components/PanelGroup.vue +++ b/src/views/dashboard/components/PanelGroup.vue @@ -1,8 +1,10 @@ @@ -23,28 +25,32 @@ context: '--', icon: 'icon-well', color: '#40c9c6', - path: '/wellList' + path: '/wellList', + permission: '/well/list' }, { title: '设备数量', context: '--', icon: 'icon-device', color: '#36a3f7', - path: '/deviceList' + path: '/deviceList', + permission: '/device/list' }, { title: '当前报警数', context: '--', icon: 'icon-alarm', color: '#f4516c', - path: '/alarmNow' + path: '/alarmNow', + permission: '/alarm/now' }, { title: '未完成工单数', context: '--', icon: 'icon-order', color: '#f4516c', - path: '/listJob' + path: '/listJob', + permission: '/job' } ] } @@ -55,18 +61,7 @@ this.getAlarmCount() this.getJobCount() }, - activated() { - this.getWellCount() - this.getDeviceCount() - this.getAlarmCount() - this.getJobCount() - }, methods: { - // 刷新报警和工单数 - refreshData() { - this.getAlarmCount() - this.getJobCount() - }, goPage(path) { this.$router.push(path) }, @@ -97,111 +92,111 @@ diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index 8f5707e..f4c25b6 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -3,7 +3,7 @@ - + @@ -15,25 +15,25 @@ - + - + - + - + diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue index df0acd2..5075ff3 100644 --- a/src/views/dashboard/components/PanelGroup.vue +++ b/src/views/dashboard/components/PanelGroup.vue @@ -1,8 +1,10 @@ @@ -23,28 +25,32 @@ context: '--', icon: 'icon-well', color: '#40c9c6', - path: '/wellList' + path: '/wellList', + permission: '/well/list' }, { title: '设备数量', context: '--', icon: 'icon-device', color: '#36a3f7', - path: '/deviceList' + path: '/deviceList', + permission: '/device/list' }, { title: '当前报警数', context: '--', icon: 'icon-alarm', color: '#f4516c', - path: '/alarmNow' + path: '/alarmNow', + permission: '/alarm/now' }, { title: '未完成工单数', context: '--', icon: 'icon-order', color: '#f4516c', - path: '/listJob' + path: '/listJob', + permission: '/job' } ] } @@ -55,18 +61,7 @@ this.getAlarmCount() this.getJobCount() }, - activated() { - this.getWellCount() - this.getDeviceCount() - this.getAlarmCount() - this.getJobCount() - }, methods: { - // 刷新报警和工单数 - refreshData() { - this.getAlarmCount() - this.getJobCount() - }, goPage(path) { this.$router.push(path) }, @@ -97,111 +92,111 @@ diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index 8f5707e..f4c25b6 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -3,7 +3,7 @@ - + @@ -15,25 +15,25 @@ - + - + - + - + diff --git a/src/views/dataManage/dataManage.vue b/src/views/dataManage/dataManage.vue index 82631dc..74e765f 100644 --- a/src/views/dataManage/dataManage.vue +++ b/src/views/dataManage/dataManage.vue @@ -47,6 +47,7 @@ import ListFlowmeterData from './deviceData/listFlowmeterData' import ListMeterData from './deviceData/listMeterData' import { parseUrl } from '@/utils/parseutils' +import { hasPermission } from '@/utils/permission' export default { name: 'DataManage', components: { ListMeterData, ListFlowmeterData, ListHyetometerData, ListWellLocaData, ListTempData, ListHarmfulData, ListDigData, ListGasData, ListLiquidData, ListWellCoverData }, @@ -61,12 +62,16 @@ const params = parseUrl(window.location.href) if (params && params.deviceType) { this.changeTab(params.deviceType) + } else { + this.caclActive() } } }, activated() { if (this.$route.query && this.$route.query.deviceType) { this.changeTab(this.$route.query.deviceType) + } else { + this.caclActive() } }, methods: { @@ -116,6 +121,30 @@ } else if (deviceType === '10') { this.activeName = 'meter' } + }, + // 计算那个是当前第一个tab + caclActive() { + if (hasPermission('/welldata/list')) { + this.activeName = 'wellcover' + } else if (hasPermission('/liquiddata/list')) { + this.activeName = 'liquid' + } else if (hasPermission('/gasdata/list')) { + this.activeName = 'gas' + } else if (hasPermission('/digdata/list')) { + this.activeName = 'dig' + } else if (hasPermission('/harmfuldata/list')) { + this.activeName = 'harmful' + } else if (hasPermission('/tempdata/list')) { + this.activeName = 'temp' + } else if (hasPermission('/welllocadata/list')) { + this.activeName = 'wellloca' + } else if (hasPermission('/hyetodata/list')) { + this.activeName = 'hyetometer' + } else if (hasPermission('/flowdata/list')) { + this.activeName = 'flowmeter' + } else if (hasPermission('/meterdata/list')) { + this.activeName = 'meter' + } } } } diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue index df0acd2..5075ff3 100644 --- a/src/views/dashboard/components/PanelGroup.vue +++ b/src/views/dashboard/components/PanelGroup.vue @@ -1,8 +1,10 @@ @@ -23,28 +25,32 @@ context: '--', icon: 'icon-well', color: '#40c9c6', - path: '/wellList' + path: '/wellList', + permission: '/well/list' }, { title: '设备数量', context: '--', icon: 'icon-device', color: '#36a3f7', - path: '/deviceList' + path: '/deviceList', + permission: '/device/list' }, { title: '当前报警数', context: '--', icon: 'icon-alarm', color: '#f4516c', - path: '/alarmNow' + path: '/alarmNow', + permission: '/alarm/now' }, { title: '未完成工单数', context: '--', icon: 'icon-order', color: '#f4516c', - path: '/listJob' + path: '/listJob', + permission: '/job' } ] } @@ -55,18 +61,7 @@ this.getAlarmCount() this.getJobCount() }, - activated() { - this.getWellCount() - this.getDeviceCount() - this.getAlarmCount() - this.getJobCount() - }, methods: { - // 刷新报警和工单数 - refreshData() { - this.getAlarmCount() - this.getJobCount() - }, goPage(path) { this.$router.push(path) }, @@ -97,111 +92,111 @@ diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index 8f5707e..f4c25b6 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -3,7 +3,7 @@ - + @@ -15,25 +15,25 @@ - + - + - + - + diff --git a/src/views/dataManage/dataManage.vue b/src/views/dataManage/dataManage.vue index 82631dc..74e765f 100644 --- a/src/views/dataManage/dataManage.vue +++ b/src/views/dataManage/dataManage.vue @@ -47,6 +47,7 @@ import ListFlowmeterData from './deviceData/listFlowmeterData' import ListMeterData from './deviceData/listMeterData' import { parseUrl } from '@/utils/parseutils' +import { hasPermission } from '@/utils/permission' export default { name: 'DataManage', components: { ListMeterData, ListFlowmeterData, ListHyetometerData, ListWellLocaData, ListTempData, ListHarmfulData, ListDigData, ListGasData, ListLiquidData, ListWellCoverData }, @@ -61,12 +62,16 @@ const params = parseUrl(window.location.href) if (params && params.deviceType) { this.changeTab(params.deviceType) + } else { + this.caclActive() } } }, activated() { if (this.$route.query && this.$route.query.deviceType) { this.changeTab(this.$route.query.deviceType) + } else { + this.caclActive() } }, methods: { @@ -116,6 +121,30 @@ } else if (deviceType === '10') { this.activeName = 'meter' } + }, + // 计算那个是当前第一个tab + caclActive() { + if (hasPermission('/welldata/list')) { + this.activeName = 'wellcover' + } else if (hasPermission('/liquiddata/list')) { + this.activeName = 'liquid' + } else if (hasPermission('/gasdata/list')) { + this.activeName = 'gas' + } else if (hasPermission('/digdata/list')) { + this.activeName = 'dig' + } else if (hasPermission('/harmfuldata/list')) { + this.activeName = 'harmful' + } else if (hasPermission('/tempdata/list')) { + this.activeName = 'temp' + } else if (hasPermission('/welllocadata/list')) { + this.activeName = 'wellloca' + } else if (hasPermission('/hyetodata/list')) { + this.activeName = 'hyetometer' + } else if (hasPermission('/flowdata/list')) { + this.activeName = 'flowmeter' + } else if (hasPermission('/meterdata/list')) { + this.activeName = 'meter' + } } } } diff --git a/src/views/deviceConfig/deviceConfig.vue b/src/views/deviceConfig/deviceConfig.vue index 1bd5274..fc8847a 100644 --- a/src/views/deviceConfig/deviceConfig.vue +++ b/src/views/deviceConfig/deviceConfig.vue @@ -26,6 +26,7 @@ import ListHarmfulConfig from './components/listHarmfulConfig' import ListTempConfig from './components/listTempConfig' import ListDigConfig from './components/listDigConfig' +import { hasPermission } from '@/utils/permission' export default { name: 'DeviceConfig', components: { ListDigConfig, ListTempConfig, ListHarmfulConfig, ListGasConfig, ListLiquidConfig }, @@ -34,6 +35,9 @@ activeName: 'liquid' } }, + created() { + this.caclActive() + }, methods: { handleClick(tab, event) { if (tab.name === 'liquid') { @@ -47,6 +51,20 @@ } else if (tab.name === 'dig') { this.$refs.digConfig.fetchData() } + }, + // 计算那个是当前第一个tab + caclActive() { + if (hasPermission('/busConfig/liquidConfig/list')) { + this.activeName = 'liquid' + } else if (hasPermission('/busConfig/gasConfig/list')) { + this.activeName = 'gas' + } else if (hasPermission('/busConfig/harmfulConfig/list')) { + this.activeName = 'harmful' + } else if (hasPermission('/busConfig/tempConfig/list')) { + this.activeName = 'temp' + } else if (hasPermission('/busConfig/digConfig/list')) { + this.activeName = 'dig' + } } } }