田源
2025-01-07 370b26066c560f15f6a84caca2be149e48e86556
Source/plt-web/plt-web-ui/src/page/index/sidebar/sidebarItem.vue
@@ -6,19 +6,32 @@
                    :class="{'is-active':vaildActive(item)}"
                    :index="item[pathKey]"
                    @click="open(item)">
        <i :class="item[iconKey]"></i>
        <span slot="title"
              :alt="item[pathKey]">{{ generateTitle(item) }}</span>
        <div style="display: flex">
          <icon-show v-if="item[iconKey]" :name="item[iconKey]" :style="{ height: iconSize, width: iconSize }"
                     class="iconShowSpan"></icon-show>
          <div v-else :style="{ height: iconSize, width: iconSize }" class="iconShow iconShowSpan">
            <i :style="{ fontSize: iconSize, width: iconSize,marginTop: '3px'}" class="el-icon-setting"></i>
          </div>
          <span slot="title"
                style="margin-left: 8px"
                :alt="item[pathKey]"
                :class="{'el-menu--display':collapse && first}">{{ generateTitle(item) }}</span>
        </div>
      </el-menu-item>
      <el-submenu v-else-if="!validatenull(item[childrenKey])&&vaildRoles(item)"
                  :key="item[labelKey]"
                  :index="item[pathKey]">
        <template slot="title">
        <div style="display: flex">
          <icon-show :name="item[iconKey]" class="iconShowSpan" :style="{ height: iconSize, width: iconSize }"></icon-show>
          <span slot="title"
                :class="{'el-menu--display':collapse && first}">{{ generateTitle(item) }}</span>
        </div>
          <div style="display: flex">
            <icon-show v-if="item[iconKey]" :name="item[iconKey]" :style="{ height: iconSize, width: iconSize }"
                       class="iconShowSpan"></icon-show>
            <div v-else :style="{ height: iconSize, width: iconSize }" class="iconShow iconShowSpan">
              <i :style="{ fontSize: iconSize, width: iconSize,marginTop: '3px'}" class="el-icon-setting"></i>
            </div>
            <span slot="title"
                  style="margin-left: 8px"
                  :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])"
@@ -27,8 +40,12 @@
                        :index="child[pathKey],cindex"
                        @click="open(child)">
            <div style="display: flex">
              <icon-show :name="child[iconKey]" class="iconShowSpan" :style="{ height: iconSize, width: iconSize }"></icon-show>
              <span slot="title">{{ generateTitle(child) }}</span>
              <icon-show v-if="child[iconKey]" :name="child[iconKey]" :style="{ height: iconSize, width: iconSize }"
                         class="iconShowSpan"></icon-show>
              <div v-else :style="{ height: iconSize, width: iconSize }" class="iconShow iconShowSpan">
                <i :style="{ fontSize: iconSize, width: iconSize,marginTop: '3px'}" class="el-icon-setting"></i>
              </div>
              <span slot="title" style="margin-left: 8px">{{ generateTitle(child) }}</span>
            </div>
          </el-menu-item>
          <sidebar-item v-else
@@ -134,7 +151,8 @@
    open(item) {
      const query = {
        ...item.query,
        id:item.id
        id:item.id,
        name:item.name
      }
      if (this.screen <= 1) this.$store.commit("SET_COLLAPSE");
      if (this.validIsOpen(item)) {
@@ -159,12 +177,18 @@
  outline: 0;
  background-color: #060708;
}
.iconShowSpan{
  display: inline-block;
  color: rgba(255, 255, 255, 0.7);
}
.el-menu-item .iconShowSpan,.el-submenu__title .iconShowSpan{
  margin-top: -2px;
  margin-right: 10px;
  color: #eeeeea;
}
.el-submenu__title:hover .iconShowSpan{
  color: #ffffff;
}
.el-submenu__title:hover .iconShowSpan svg{
  fill: #ffffff;
}
</style>