refactor: 修改顶部菜单更紧凑

This commit is contained in:
Captain.B 2021-06-24 13:33:04 +08:00 committed by 刘瑞斌
parent ed6f8dbede
commit cff1e95686
4 changed files with 23 additions and 6 deletions

View File

@ -15,8 +15,8 @@
<!-- float right --> <!-- float right -->
<ms-user ref="headerUser"/> <ms-user ref="headerUser"/>
<ms-language-switch :color="color"/> <ms-language-switch :color="color"/>
<ms-task-center :color="color"/>
<ms-header-org-ws :color="color"/> <ms-header-org-ws :color="color"/>
<ms-task-center :color="color"/>
</el-col> </el-col>
</el-row> </el-row>

View File

@ -8,12 +8,12 @@
text-color="#fff"> text-color="#fff">
<el-menu-item index="1" v-show="false">Placeholder</el-menu-item> <el-menu-item index="1" v-show="false">Placeholder</el-menu-item>
<el-submenu index="1" popper-class="org-ws-submenu" <el-submenu index="1" popper-class="org-ws-submenu"
:popper-append-to-body="true"
v-permission="['PROJECT_TRACK_CASE:READ','PROJECT_TRACK_PLAN:READ','PROJECT_TRACK_REVIEW:READ', v-permission="['PROJECT_TRACK_CASE:READ','PROJECT_TRACK_PLAN:READ','PROJECT_TRACK_REVIEW:READ',
'PROJECT_API_DEFINITION:READ','PROJECT_API_SCENARIO:READ','PROJECT_API_REPORT:READ', 'PROJECT_API_DEFINITION:READ','PROJECT_API_SCENARIO:READ','PROJECT_API_REPORT:READ',
'PROJECT_PERFORMANCE_TEST:READ','PROJECT_PERFORMANCE_REPORT:READ', 'ORGANIZATION_USER:READ', 'PROJECT_PERFORMANCE_TEST:READ','PROJECT_PERFORMANCE_REPORT:READ', 'ORGANIZATION_USER:READ',
'WORKSPACE_USER:READ']"> 'WORKSPACE_USER:READ']">
<template v-slot:title> <template v-slot:title>
<font-awesome-icon class="icon global" :icon="['fas', 'tag']"/>
<div class="org-ws-name" :title="currentOrganizationName + '-' + currentWorkspaceName"> <div class="org-ws-name" :title="currentOrganizationName + '-' + currentWorkspaceName">
<div>{{ currentWorkspaceName || currentOrganizationName }}</div> <div>{{ currentWorkspaceName || currentOrganizationName }}</div>
</div> </div>
@ -25,7 +25,9 @@
class="search-input" class="search-input"
size="small"/> size="small"/>
<div class="org-ws-menu"> <div class="org-ws-menu">
<el-submenu :index="1+'-'+index" v-for="(item, index) in organizationList" :key="index"> <el-submenu :index="1+'-'+index" v-for="(item, index) in organizationList"
:popper-append-to-body="true"
:key="index">
<template v-slot:title> <template v-slot:title>
<div @click="changeOrg(item)"> <div @click="changeOrg(item)">
{{ item.name }} {{ item.name }}
@ -260,4 +262,8 @@ export default {
text-overflow: ellipsis; text-overflow: ellipsis;
} }
/deep/ .el-submenu__title {
padding-left: 5px;
}
</style> </style>

View File

@ -6,7 +6,6 @@
active-text-color="#fff"> active-text-color="#fff">
<el-submenu index="1"> <el-submenu index="1">
<template slot="title"> <template slot="title">
<font-awesome-icon class="icon global" :icon="['fas', 'globe']"/>
<span>{{ language }}</span> <span>{{ language }}</span>
</template> </template>
<el-menu-item v-for="(value, key) in languageMap" :key="key" @click="changeLanguage(key)"> <el-menu-item v-for="(value, key) in languageMap" :key="key" @click="changeLanguage(key)">
@ -103,4 +102,8 @@ export default {
.global { .global {
color: #fff; color: #fff;
} }
/deep/ .el-submenu__title {
padding-left: 5px;
}
</style> </style>

View File

@ -6,8 +6,11 @@
text-color="#fff" text-color="#fff"
active-text-color="#fff"> active-text-color="#fff">
<el-menu-item onselectstart="return false"> <el-menu-item onselectstart="return false">
<el-tooltip :content="$t('commons.task_center')" effect="light"> <el-tooltip effect="light">
<span @click="showTaskCenter"> <font-awesome-icon class="icon global focusing" :icon="['fas', 'flag']"/></span> <template v-slot:content>
<span>{{ $t('commons.task_center') }}</span>
</template>
<font-awesome-icon @click="showTaskCenter" class="icon global focusing" :icon="['fas', 'tasks']"/>
</el-tooltip> </el-tooltip>
</el-menu-item> </el-menu-item>
</el-menu> </el-menu>
@ -260,4 +263,9 @@ export default {
cursor: pointer; cursor: pointer;
border-color: #783887; border-color: #783887;
} }
/deep/ .el-menu-item {
padding-left: 0;
padding-right: 0;
}
</style> </style>