diff --git a/src/main.js b/src/main.js index 9fd2a57..ee2c003 100644 --- a/src/main.js +++ b/src/main.js @@ -37,13 +37,9 @@ // eslint-disable-next-line import animate from 'animate.css' -import { hasPermission, showWellType, showDeviceType, showIpConfig, isOperation, isReceiver } from './utils/permission' +import { hasPermission, isReceiver } from './utils/permission' Vue.prototype.hasPerm = hasPermission -Vue.prototype.showWellType = showWellType -Vue.prototype.showDeviceType = showDeviceType -Vue.prototype.showIpConfig = showIpConfig -Vue.prototype.isOperation = isOperation Vue.prototype.isReceiver = isReceiver // 引入Element-ui Vue.use(ElementUI, { locale }) diff --git a/src/main.js b/src/main.js index 9fd2a57..ee2c003 100644 --- a/src/main.js +++ b/src/main.js @@ -37,13 +37,9 @@ // eslint-disable-next-line import animate from 'animate.css' -import { hasPermission, showWellType, showDeviceType, showIpConfig, isOperation, isReceiver } from './utils/permission' +import { hasPermission, isReceiver } from './utils/permission' Vue.prototype.hasPerm = hasPermission -Vue.prototype.showWellType = showWellType -Vue.prototype.showDeviceType = showDeviceType -Vue.prototype.showIpConfig = showIpConfig -Vue.prototype.isOperation = isOperation Vue.prototype.isReceiver = isReceiver // 引入Element-ui Vue.use(ElementUI, { locale }) diff --git a/src/utils/permission.js b/src/utils/permission.js index 04baa0d..630bb54 100644 --- a/src/utils/permission.js +++ b/src/utils/permission.js @@ -8,40 +8,7 @@ return btn.url === permission }) } -// 根据用户权限判断是否要显示井类型下拉框 -export function showWellType() { - console.log('是否显示井类型下拉') - const wellTypes = store.getters.wellTypes - if (wellTypes.length > 1) return true - else return false -} -// 根据用户权限判断是否要显示设备类型下拉框 -export function showDeviceType() { - const deviceTypes = store.getters.deviceTypes - if (deviceTypes.length > 1) return true - else return false -} -// 根据用户权限判断是否要显示IP配置项,集中器不显示ip -export function showIpConfig() { - const communications = store.getters.communications - return communications.some(communication => { // 遍历通讯方式,只要没有1(集中器)就是返回true - return communication !== '1' - }) -} -export function notContainConcentrator() { - const communications = store.getters.communications - return communications.some(communication => { // 遍历通讯方式,只要有1(集中器)就是返回true - return communication === '1' - }) -} -// 判断用户是否为运维人员或其他管理员 -export function isOperation() { - const roleTips = store.getters.roleTips - return roleTips.some(tip => { // 遍历btns,查找btn.url是否有匹配的permission,有则返回true,否则返回false - return (tip === 'operation' || tip === 'administrator') - }) -} // 判断用户是否为受理员,允许接电话的 export function isReceiver() { const roleTips = store.getters.roleTips