fix: 优化顶部操作栏展示条件

This commit is contained in:
Xu Zhimeng 2023-09-27 15:55:48 +08:00
parent e7533a7fe2
commit 47e6b19c8c

View File

@ -13,7 +13,7 @@
<a-button type="primary">{{ operation.title }}</a-button>
<div slot="overlay">
<template v-for="(child, index) in operation.children">
<component :is="child.type" :key="index" v-bind="child.attrs" v-on="child.on">
<component v-if="child.show !== false" :is="child.type" :key="index" v-bind="child.attrs" v-on="child.on">
<template v-for="item in child.children">
<component v-if="item.show !== false" :is="item.type" :key="item.title" @click="item.handler">
{{ item.title }}
@ -691,6 +691,7 @@ export default {
children: [
{
type: 'MultiLevelMenu',
show: this.isBetaGamma || this.isGamma,
attrs: {
children: [
{
@ -842,7 +843,6 @@ export default {
},
{
title: 'NUCLIDELIBRARY',
show: !this.isBetaGamma,
children: [
{
type: 'a-menu',
@ -850,11 +850,13 @@ export default {
{
type: 'a-menu-item',
title: 'Nuclide Library',
show: this.isGamma,
handler: () => (this.nuclideLibraryModalVisible = true),
},
{
type: 'a-menu-item',
title: 'Config User Library',
show: this.isGamma,
handler: () => (this.configUserLibModalVisible = true),
},
],
@ -1042,6 +1044,7 @@ export default {
{
type: 'a-menu-item',
title: 'Automatic Analysis Log',
show: this.isBetaGamma || this.isGamma,
handler: () => {
this.autoAnalysisMogModalType = this.isGamma ? 1 : this.isBetaGamma ? 2 : 1
this.autoAnalysisMogModalVisible = true