Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-customization-system
/
micro-portal
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit eb8188f2
authored
Jun 04, 2021
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改样式
1 parent
8039de4d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
32 deletions
src/utils/common/common.js
src/utils/common/common.js
View file @
eb8188f
import
store
from
'@/store/index'
;
import
store
from
'@/store/index'
export
const
Common
=
{
setAuthBtn
(
resData
)
{
let
data
=
resData
||
store
.
getters
.
curMenuAuth
.
data
;
const
authBtnEl
=
document
.
getElementsByTagName
(
'button'
);
const
authStringArr
=
[
'新增'
,
'编辑'
,
'删除'
,
'导出'
,
'导入'
,
'修改'
];
if
(
authBtnEl
&&
authBtnEl
.
length
>
0
)
{
if
(
data
&&
data
.
length
>
0
)
{
authBtnEl
.
forEach
(
elItem
=>
{
let
flag
=
true
;
let
authFlag
=
false
;
const
elText
=
elItem
.
innerText
;
authStringArr
.
forEach
(
authItem
=>
{
if
(
elText
.
includes
(
authItem
)){
authFlag
=
true
;
return
;
}
})
if
(
authFlag
)
{
data
.
forEach
(
labelItem
=>
{
if
(
flag
)
{
elItem
.
style
.
display
=
'none'
;
if
(
elText
.
includes
(
labelItem
.
label
))
{
elItem
.
style
.
display
=
'block'
;
flag
=
false
;
}
}
})
}
});
setAuthBtn
(
resData
)
{
let
data
=
resData
||
store
.
getters
.
curMenuAuth
.
data
const
authBtnEl
=
document
.
getElementsByTagName
(
'button'
)
const
authStringArr
=
[
'新增'
,
'编辑'
,
'删除'
,
'导出'
,
'导入'
,
'修改'
]
if
(
authBtnEl
&&
authBtnEl
.
length
>
0
)
{
if
(
data
&&
data
.
length
>
0
)
{
authBtnEl
.
forEach
(
elItem
=>
{
let
flag
=
true
let
authFlag
=
false
const
elText
=
elItem
.
innerText
authStringArr
.
forEach
(
authItem
=>
{
if
(
elText
.
includes
(
authItem
))
{
authFlag
=
true
return
}
}
})
if
(
authFlag
)
{
data
.
forEach
(
labelItem
=>
{
if
(
flag
)
{
elItem
.
style
.
display
=
'none'
if
(
elText
.
includes
(
labelItem
.
label
))
{
elItem
.
style
.
display
=
'inline-block'
flag
=
false
}
}
})
}
})
}
}
}
\ No newline at end of file
},
getAuthData
()
{
return
store
.
getters
.
curMenuAuth
.
data
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment