田源
2024-12-30 a4d039cee6e2943eb025717a8fe69b4c992797a5
Source/plt-web/plt-web-ui/src/page/index/sidebar/sidebarItem.vue
@@ -14,9 +14,14 @@
                  :key="item[labelKey]"
                  :index="item[pathKey]">
        <template slot="title">
          <i :class="item[iconKey]"></i>
        <div style="display: flex">
          <icon-show v-if="item[iconKey]" :name="item[iconKey]" class="iconShowSpan" :style="{ height: iconSize, width: iconSize }"></icon-show>
         <div  v-else>
           <i class="el-icon-setting" :font-size="iconSize"></i>
         </div>
          <span slot="title"
                :class="{'el-menu--display':collapse && first}">{{ generateTitle(item) }}</span>
        </div>
        </template>
        <template v-for="(child,cindex) in item[childrenKey]">
          <el-menu-item v-if="validatenull(child[childrenKey])"
@@ -24,8 +29,10 @@
                        :class="{'is-active':vaildActive(child)}"
                        :index="child[pathKey],cindex"
                        @click="open(child)">
            <i :class="child[iconKey]"></i>
            <span slot="title">{{ generateTitle(child) }}</span>
            <div style="display: flex">
              <icon-show :name="child[iconKey]" class="iconShowSpan" :style="{ height: iconSize, width: iconSize }"></icon-show>
              <span slot="title">{{ generateTitle(child) }}</span>
            </div>
          </el-menu-item>
          <sidebar-item v-else
                        :key="cindex"
@@ -77,6 +84,9 @@
  },
  computed: {
    ...mapGetters(["roles"]),
    iconSize() {
      return this.collapse ? '20px' : '16px';
    },
    labelKey() {
      return this.props.label || this.config.propsDefault.label;
    },
@@ -152,6 +162,13 @@
  outline: 0;
  background-color: #060708;
}
.iconShowSpan{
  display: inline-block;
  margin-top: -2px;
  margin-right: 10px;
  color: #eeeeea;
}
</style>