自动化配置增加青年编委模块

This commit is contained in:
2026-04-29 17:13:40 +08:00
parent 9234318139
commit 8b9e35287c
9 changed files with 1023 additions and 17 deletions

View File

@@ -20,8 +20,15 @@
<template v-for="subItem in item.subs">
<el-submenu v-if="subItem.subs" :index="subItem.index" :key="subItem.index + '-submenu'">
<template slot="title">
{{ subItem.title }}
<!-- <el-badge is-dot :hidden="false">{{ subItem.title }}</el-badge> -->
<el-badge
v-if="subItem.index === '45'"
is-dot
:hidden="applyBadgeYouth <= 0"
class="sidebar-submenu-apply-badge"
>
<span>{{ subItem.title }}</span>
</el-badge>
<template v-else>{{ subItem.title }}</template>
</template>
<template v-for="(threeItem, i) in subItem.subs">
@@ -35,8 +42,16 @@
{{ fourItem.title }}
</el-menu-item>
</el-submenu>
<el-menu-item v-else :index="threeItem.index" :key="threeItem.index + '-item'"
>{{ threeItem.title }}
<el-menu-item v-else :index="threeItem.index" :key="threeItem.index + '-item'">
<el-badge
v-if="threeItem.index === 'youthApplyList'"
is-dot
:hidden="applyBadgeYouth <= 0"
class="sidebar-menu-youth-apply-badge"
>
<span class="sidebar-menu-youth-apply-badge__text">{{ threeItem.title }}</span>
</el-badge>
<template v-else>{{ threeItem.title }}</template>
</el-menu-item>
</template>
</el-submenu>
@@ -220,6 +235,8 @@ export default {
user_cap: localStorage.getItem('U_role'),
menuList: [],
/** 青年编委申请红点Young Scientist 父级 + Apply 子项,数据来自 getYboardApplys */
applyBadgeYouth: 0,
items: [],
// 作者
author_items: [
@@ -677,6 +694,9 @@ export default {
}
},
mounted() {
if (String(this.userrole) === '1') {
this.fetchApplyBadgeSummary();
}
// if(this.user_cap.includes(',board')||this.user_cap.includes('board_editor')||this.user_cap.includes('chief')||this.user_cap.includes('chief_editor')||this.user_cap.includes('deputy_editor')){
// Promise.all([
// this.$api
@@ -845,10 +865,33 @@ export default {
localStorage.setItem('collapse', this.collapse);
bus.$emit('collapse-content', msg);
});
bus.$on('apply-badge-refresh', () => {
this.fetchApplyBadgeSummary();
});
},
beforeDestroy() {
bus.$off('apply-badge-refresh');
},
methods: {
// 获取数据
getDate() {}
getDate() {},
fetchApplyBadgeSummary() {
if (String(this.userrole) !== '1') return;
const editorId = localStorage.getItem('U_id');
if (!editorId) return;
this.$api
.post('api/User/getYboardApplys', { editor_id: editorId })
.then((res) => {
if (res && res.code === 0 && res.data && Array.isArray(res.data.applys)) {
this.applyBadgeYouth = res.data.applys.length > 0 ? 1 : 0;
} else {
this.applyBadgeYouth = 0;
}
})
.catch(() => {
this.applyBadgeYouth = 0;
});
}
}
};
</script>
@@ -922,4 +965,38 @@ export default {
.linkBar:hover {
background: #00527a;
}
/* Young Scientist 父级标题红点 */
.sidebar-submenu-apply-badge {
display: inline-block;
vertical-align: middle;
}
.sidebar-submenu-apply-badge ::v-deep .el-badge__content.is-dot {
top: 28%;
margin-top: 6px;
right: -4px;
border: 0;
display: none !important;
}
/* Apply 子菜单行上的红点,与菜单行高对齐 */
.sidebar-menu-youth-apply-badge {
display: inline-block;
vertical-align: middle;
line-height: 50px;
}
.sidebar-menu-youth-apply-badge ::v-deep .el-badge__content.is-dot {
top: 28%;
margin-top: 6px;
right: -4px;
border: 0;
display: none !important;
}
.sidebar-menu-youth-apply-badge__text {
color: inherit;
vertical-align: middle;
}
</style>

View File

@@ -2,14 +2,14 @@
//记得切换
//正式
// const mediaUrl = '/public/';
// const baseUrl = '/';
const mediaUrl = '/public/';
const baseUrl = '/';
//正式环境
const mediaUrl = 'https://submission.tmrjournals.com/public/';
// const mediaUrl = 'http://zmzm.tougao.dev.com/public/';
const baseUrl = '/api'
// const mediaUrl = 'https://submission.tmrjournals.com/public/';
// // const mediaUrl = 'http://zmzm.tougao.dev.com/public/';
// const baseUrl = '/api'
//测试环境