From 78fa1f005a9ec2581611e53d7eba8efeacb4df6e Mon Sep 17 00:00:00 2001
From: 田源 <tianyuan@vci-tech.com>
Date: 星期三, 15 一月 2025 18:35:48 +0800
Subject: [PATCH] 调试头像接口

---
 Source/plt-web/plt-web-ui/src/page/index/sidebar/sidebarItem.vue |   56 +++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 47 insertions(+), 9 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/page/index/sidebar/sidebarItem.vue b/Source/plt-web/plt-web-ui/src/page/index/sidebar/sidebarItem.vue
index 3762f5b..d90ab50 100644
--- a/Source/plt-web/plt-web-ui/src/page/index/sidebar/sidebarItem.vue
+++ b/Source/plt-web/plt-web-ui/src/page/index/sidebar/sidebarItem.vue
@@ -6,17 +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">
-          <i :class="item[iconKey]" style="margin-right: 10px"></i>
-          <span slot="title"
-                :class="{'el-menu--display':collapse && first}">{{ 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"
+                  :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 +39,14 @@
                         :class="{'is-active':vaildActive(child)}"
                         :index="child[pathKey],cindex"
                         @click="open(child)">
-            <i :class="child[iconKey]" style="margin-right: 10px"></i>
-            <span slot="title">{{ generateTitle(child) }}</span>
+            <div style="display: flex">
+              <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
                         :key="cindex"
@@ -77,6 +98,9 @@
   },
   computed: {
     ...mapGetters(["roles"]),
+    iconSize() {
+      return this.collapse ? '20px' : '16px';
+    },
     labelKey() {
       return this.props.label || this.config.propsDefault.label;
     },
@@ -127,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)) {
@@ -152,6 +177,19 @@
   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;
+}
+.el-submenu__title:hover .iconShowSpan{
+  color: #ffffff;
+}
+.el-submenu__title:hover .iconShowSpan svg{
+  fill: #ffffff;
+}
 </style>
 
 

--
Gitblit v1.9.3