perf: 任务进度只对有权限者可见
This commit is contained in:
parent
90508e97ee
commit
766ea645c6
@ -9,7 +9,7 @@
|
|||||||
width="600"
|
width="600"
|
||||||
trigger="hover">
|
trigger="hover">
|
||||||
<TaskProgress :task-count.sync="taskCount"/>
|
<TaskProgress :task-count.sync="taskCount"/>
|
||||||
<div slot="reference" class="right-content-button" v-show="showTaskProgress > 0 || taskCount > 0">
|
<div slot="reference" class="right-content-button" v-show="hasTaskProgressRole && (showTaskProgress > 0 || taskCount > 0)">
|
||||||
<svg-icon icon-class="gengxinjindu" :class="progressExecuting ? 'rotate' : ''"></svg-icon>
|
<svg-icon icon-class="gengxinjindu" :class="progressExecuting ? 'rotate' : ''"></svg-icon>
|
||||||
{{ $t('app.taskProgress') }}
|
{{ $t('app.taskProgress') }}
|
||||||
</div>
|
</div>
|
||||||
@ -112,6 +112,9 @@ export default {
|
|||||||
routes.rightTopRoutes = rightTopRoutes
|
routes.rightTopRoutes = rightTopRoutes
|
||||||
return routes
|
return routes
|
||||||
},
|
},
|
||||||
|
hasTaskProgressRole() {
|
||||||
|
return localStorage.getItem('taskProgressRole') === '1'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.isShow = this.$pc;
|
this.isShow = this.$pc;
|
||||||
|
|||||||
@ -88,7 +88,16 @@ const actions = {
|
|||||||
async setMenuList({ commit, state }) {
|
async setMenuList({ commit, state }) {
|
||||||
return new Promise( (resolve,reject) => {
|
return new Promise( (resolve,reject) => {
|
||||||
menuApi.menuTree({userId: state.userId}).then((res) => {
|
menuApi.menuTree({userId: state.userId}).then((res) => {
|
||||||
|
|
||||||
|
const index = res.data.findIndex((item) => item.path === '/setting/taskProgress')
|
||||||
|
if (index > -1) {
|
||||||
|
localStorage.setItem('taskProgressRole', "1")
|
||||||
|
} else {
|
||||||
|
localStorage.removeItem('taskProgressRole')
|
||||||
|
}
|
||||||
|
|
||||||
state.menuList = getMenuTree(res.data);
|
state.menuList = getMenuTree(res.data);
|
||||||
|
console.log('state.menuList', state.menuList)
|
||||||
commit('SET_MENU_LIST', state.menuList);
|
commit('SET_MENU_LIST', state.menuList);
|
||||||
resetRouter(state.menuList)
|
resetRouter(state.menuList)
|
||||||
router.options.routes = router.options.routes.concat(state.menuList);
|
router.options.routes = router.options.routes.concat(state.menuList);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user