vbea 3 years ago
parent
commit
246fbc9ec4

+ 22 - 1
Strides-Admin/src/layout/components/Sidebar/Item.vue

@@ -11,9 +11,13 @@ export default {
       type: String,
       default: ''
     },
+    additional: {
+      type: Boolean,
+      default: false
+    }
   },
   render(h, context) {
-    const { icon, title } = context.props
+    const { icon, title, additional } = context.props
     const vnodes = []
     if (icon) {
       if (icon.includes('el-icon')) {
@@ -21,6 +25,9 @@ export default {
       } else {
         vnodes.push(<svg-icon icon-class={icon}/>)
       }
+      if (additional) {
+        vnodes.push(<i class={'menu-icon-additional'}></i>)
+      }
     }
 
     if (title) {
@@ -37,4 +44,18 @@ export default {
   width: 1em;
   height: 1em;
 }
+.menu-icon-additional {
+  width: 20px;
+  height: 20px;
+  position: absolute;
+}
+.menu-icon-additional::before {
+  width: 10px;
+  height: 10px;
+  right: -5px;
+  content: " ";
+  border-radius: 10px;
+  position: absolute;
+  background-color: #FFCC2C;
+}
 </style>

+ 3 - 1
Strides-Admin/src/layout/components/Sidebar/SidebarItem.vue

@@ -15,6 +15,7 @@
               ? (onlyOneChild.meta.activeIcon || item.meta && item.meta.activeIcon)
               : onlyOneChild.meta.icon || (item.meta && item.meta.icon)" 
             :title="onlyOneChild.meta.title"
+            :additional="onlyOneChild.meta.additional"
           />
         </el-menu-item>
       </app-link>
@@ -32,7 +33,8 @@
                 && resolvePath(item.path)
                   ? item.meta.activeIcon || item.meta.icon
                   : item.meta.icon"
-          :title="item.meta.title" />
+          :title="item.meta.title"
+          :additional="onlyOneChild.meta.additional"/>
       </template>
       <sidebar-item
         v-for="child in item.children"

+ 1 - 1
Strides-Admin/src/layout/components/Sidebar/index.vue

@@ -38,7 +38,7 @@ export default {
   created() {
     this.authRoutesList = getAuthRoutes()
     this.filterRoutes(this.$router.options.routes)
-    this.selectedItemIndex = this.$route.path
+    this.selectedItemIndex = this.activeMenu
   },
   data() {
     return {

+ 2 - 1
Strides-Admin/src/router/index.js

@@ -235,7 +235,8 @@ const constantRoutes = [
           title: 'POS Device Management',
           icon: 'pos-device',
           activeIcon: 'pos-device-active',
-          breadcrumb: false
+          breadcrumb: false,
+          additional: true
         }
       },
       {