feat: 设置是否只展开一项子菜单

This commit is contained in:
xiaozzzi 2024-02-06 22:21:38 +08:00
parent 9ae8778ab2
commit ba1545cf91
4 changed files with 13 additions and 3 deletions

View File

@ -28,6 +28,8 @@ export interface ViewStyle {
isGlobalShadow: boolean isGlobalShadow: boolean
// 是否显示试用按钮 // 是否显示试用按钮
isShowTryuseBtn: boolean isShowTryuseBtn: boolean
// 只展开一项子菜单
isMenuUniqueOpened: boolean
} }
/** /**
@ -106,7 +108,8 @@ export const useConfigStore = defineStore('configStore', {
isHomeSubjectCard: true, isHomeSubjectCard: true,
isWebCollectCard: true, isWebCollectCard: true,
isGlobalShadow: false, isGlobalShadow: false,
isShowTryuseBtn: true isShowTryuseBtn: true,
isMenuUniqueOpened: true
}, },
...Local.get(VIEW_STYLE_KEY) ...Local.get(VIEW_STYLE_KEY)
}, },

View File

@ -18,7 +18,7 @@
v-if="!isEmpty(docTreeData)" v-if="!isEmpty(docTreeData)"
ref="DocTreeRef" ref="DocTreeRef"
class="doc-trees" class="doc-trees"
:unique-opened="true" :unique-opened="viewStyle.isMenuUniqueOpened"
:default-active="docTreeActiveArticleId" :default-active="docTreeActiveArticleId"
@open="openMenu"> @open="openMenu">
<!-- ================================================ L1 ================================================ --> <!-- ================================================ L1 ================================================ -->

View File

@ -45,6 +45,13 @@
</bl-row> </bl-row>
<div class="conf-tip">是否在文档列表中以特殊的样式显示专题</div> <div class="conf-tip">是否在文档列表中以特殊的样式显示专题</div>
</el-form-item> </el-form-item>
<el-form-item label="只展开一项子菜单">
<bl-row>
<el-switch v-model="configViewStyleForm.isMenuUniqueOpened" size="default" style="margin-right: 10px" @change="changeViewStyle" />
</bl-row>
<div class="conf-tip">展开子菜单时收起其他子菜单</div>
</el-form-item>
</el-form> </el-form>
<el-form label-position="right" label-width="130px" style="max-width: 800px"> <el-form label-position="right" label-width="130px" style="max-width: 800px">

View File

@ -10,7 +10,7 @@
element-loading-text="正在读取文档..." element-loading-text="正在读取文档..."
:style="{ fontSize: configStore.viewStyle.treeDocsFontSize }"> :style="{ fontSize: configStore.viewStyle.treeDocsFontSize }">
<!-- 文件夹 --> <!-- 文件夹 -->
<el-menu v-if="!isEmpty(docTreeData)" ref="DocTreeRef" class="doc-trees" :unique-opened="true"> <el-menu v-if="!isEmpty(docTreeData)" ref="DocTreeRef" class="doc-trees" :unique-opened="configStore.viewStyle.isMenuUniqueOpened">
<!-- ================================================ L1 ================================================ --> <!-- ================================================ L1 ================================================ -->
<div v-for="L1 in docTreeData" :key="L1.i"> <div v-for="L1 in docTreeData" :key="L1.i">
<div v-if="L1.ty == 11" class="menu-divider" /> <div v-if="L1.ty == 11" class="menu-divider" />