帮助菜单展示

This commit is contained in:
dong 2022-12-21 13:10:55 +08:00
parent 2973f32f37
commit d4ccd57d76
3 changed files with 32 additions and 2 deletions

View File

@ -91,6 +91,9 @@
</el-submenu>
</template>
</template>
<div v-if="helpShow" class="helpDiv" @click="goToHelp">
<span>帮助</span>
</div>
<el-submenu v-if="!thirdLogin" :key="99" index="/info" :show-timeout="100">
<span slot="title">{{ username }}</span>
<el-menu-item :key="991" index="/info/personalInfo">个人信息</el-menu-item>
@ -141,6 +144,9 @@ export default {
},
isCGY() {
return getSessionStorage('project') === 'cgy';
},
helpShow() {
return this.$store.state.projectConfig.helpShow;
}
},
watch: {
@ -163,6 +169,11 @@ export default {
}
},
methods: {
goToHelp() {
let href = '';
href = this.$store.state.user.baseSite + '/docs/';
window.open(href, '_blank');
},
toggleSideBar() {
this.$store.dispatch('ToggleSideBar');
},
@ -269,4 +280,15 @@ export default {
.targetDiv :hover {
background-color: #434A50;
}
.helpDiv {
height: 60px;
line-height: 60px;
color: #fff;
font-size: 14px;
cursor: pointer;
padding: 0 20px;
&:hover {
background-color: #434A50;
}
}
</style>

View File

@ -113,7 +113,7 @@ router.beforeEach( async (to, from, next) => {
// }
const response = await getFrontProjectConfigByLogin(project);
if (response.data) {
const {browserTitle, loginProLogo, baseApiUrl, baseSite, caseShow, ossUrl, homeTitle, homeProLogoWidth} = response.data.viewSetting;
const {browserTitle, loginProLogo, baseApiUrl, baseSite, caseShow, helpShow, ossUrl, homeTitle, homeProLogoWidth} = response.data.viewSetting;
if (!store.state.user.baseUrl && project) {
const urlData = handlerUrl();
store.dispatch('setBaseUrl', baseApiUrl || urlData.BASE_API);
@ -125,6 +125,7 @@ router.beforeEach( async (to, from, next) => {
const url = loginProLogo ? store.state.user.ossUrl + '/logo/' + loginProLogo : '';
document.querySelector("link[rel*='icon']").href = url;
store.commit('setCaseShow', caseShow);
store.commit('setHelpShow', helpShow);
store.dispatch('setHomeProLogoWidth', homeProLogoWidth);
store.dispatch('setLoginProLogo', url);
store.dispatch('setHomeTitle', homeTitle);

View File

@ -3,7 +3,8 @@ const user = {
homeProLogoWidth:0,
loginProLogo:'',
homeTitle:'',
caseShow:true
caseShow: true,
helpShow: true
},
mutations: {
setHomeProLogoWidth: (state, homeProLogoWidth) => {
@ -17,6 +18,9 @@ const user = {
},
setCaseShow: (state, caseShow) => {
state.caseShow = caseShow;
},
setHelpShow: (state, helpShow) => {
state.helpShow = helpShow;
}
},
actions: {
@ -31,6 +35,9 @@ const user = {
},
setCaseShow({ commit }, caseShow) {
commit('setCaseShow', caseShow);
},
setHelpShow({ commit }, helpShow) {
commit('setHelpShow', helpShow);
}
}
};