【fix ESLint】src/components、src/utils
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { USER_AUTH, SYS_BUTTON_AUTH } from '@/store/mutation-types'
|
||||
|
||||
const hasPermission = {
|
||||
install (Vue, options) {
|
||||
install (Vue) {
|
||||
Vue.directive('has', {
|
||||
inserted: (el, binding, vnode) => {
|
||||
// console.time()
|
||||
@@ -24,7 +24,7 @@ export function filterNodePermission (el, binding, vnode) {
|
||||
if (obj) {
|
||||
const bpmList = obj.permissionList
|
||||
for (const bpm of bpmList) {
|
||||
if (bpm.type != '2') {
|
||||
if (bpm.type + '' !== '2') {
|
||||
permissionList.push(bpm)
|
||||
}
|
||||
}
|
||||
@@ -42,7 +42,7 @@ export function filterNodePermission (el, binding, vnode) {
|
||||
console.log('流程节点页面权限--NODE--')
|
||||
const permissions = []
|
||||
for (const item of permissionList) {
|
||||
if (item.type != '2') {
|
||||
if (item.type + '' !== '2') {
|
||||
permissions.push(item.action)
|
||||
}
|
||||
}
|
||||
@@ -64,30 +64,30 @@ export function filterNodePermission (el, binding, vnode) {
|
||||
/**
|
||||
* 全局权限控制
|
||||
*/
|
||||
export function filterGlobalPermission (el, binding, vnode) {
|
||||
export function filterGlobalPermission (el, binding) {
|
||||
const permissionList = []
|
||||
const allPermissionList = []
|
||||
|
||||
// let authList = Vue.ls.get(USER_AUTH);
|
||||
const authList = JSON.parse(sessionStorage.getItem(USER_AUTH) || '[]')
|
||||
for (const auth of authList) {
|
||||
if (auth.type != '2') {
|
||||
if (auth.type + '' !== '2') {
|
||||
permissionList.push(auth)
|
||||
}
|
||||
}
|
||||
// console.log("页面权限--Global--",sessionStorage.getItem(SYS_BUTTON_AUTH));
|
||||
const allAuthList = JSON.parse(sessionStorage.getItem(SYS_BUTTON_AUTH) || '[]')
|
||||
for (const gauth of allAuthList) {
|
||||
if (gauth.type != '2') {
|
||||
if (gauth.type + '' !== '2') {
|
||||
allPermissionList.push(gauth)
|
||||
}
|
||||
}
|
||||
// 设置全局配置是否有命中
|
||||
let invalidFlag = false// 无效命中
|
||||
if (allPermissionList != null && allPermissionList != '' && allPermissionList != undefined && allPermissionList.length > 0) {
|
||||
if (allPermissionList != null && allPermissionList !== '' && allPermissionList !== undefined && allPermissionList.length > 0) {
|
||||
for (const itemG of allPermissionList) {
|
||||
if (binding.value === itemG.action) {
|
||||
if (itemG.status == '0') {
|
||||
if (itemG.status + '' !== '0') {
|
||||
invalidFlag = true
|
||||
break
|
||||
}
|
||||
@@ -104,13 +104,13 @@ export function filterGlobalPermission (el, binding, vnode) {
|
||||
const permissions = []
|
||||
for (const item of permissionList) {
|
||||
// 权限策略1显示2禁用
|
||||
if (item.type != '2') {
|
||||
if (item.type + '' !== '2') {
|
||||
// update--begin--autor:wangshuai-----date:20200729------for:按钮权限,授权标识的提示信息是多个用逗号分隔逻辑处理 gitee#I1OUGU-------
|
||||
if (item.action) {
|
||||
if (item.action.includes(',')) {
|
||||
const split = item.action.split(',')
|
||||
for (let i = 0; i < split.length; i++) {
|
||||
if (!split[i] || split[i].length == 0) {
|
||||
if (!split[i] || split[i].length === 0) {
|
||||
continue
|
||||
}
|
||||
permissions.push(split[i])
|
||||
|
||||
Reference in New Issue
Block a user