Bläddra i källkod

feat: 图标修改

hum 1 år sedan
förälder
incheckning
c498c92ba2

+ 1 - 0
ruoyi-ui/src/assets/icons/svg/icon-data.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><defs><clipPath id="master_svg0_109_66276/22_3755"><rect x="0" y="0" width="24" height="24" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_109_66276/22_3755)"><g><path d="M11.27586,20.9L19.9,20.9L19.9,20L19.9,10.735299999999999L19.9,4.1L4.1,4.1L4.1,20.9L11.27586,20.9ZM18.1,19.1L11.27586,19.1L5.9,19.1L5.9,5.9L18.1,5.9L18.1,10.735289999999999L18.1,19.1Z" fill-rule="evenodd" fill="currentColor" fill-opacity="1"/></g><g><path d="M8.099996,10.900004L9,10.9L15,10.9L15.9,10.900004L15.9,9.099996L15,9.1L9,9.1L8.099996,9.099996L8.099996,10.900004Z" fill-rule="evenodd" fill="currentColor" fill-opacity="1"/></g><g><path d="M8.099996,15.900004L9,15.9L13,15.9L13.9,15.900004L13.9,14.099996L13,14.1L9,14.1L8.099996,14.099996L8.099996,15.900004Z" fill-rule="evenodd" fill="currentColor" fill-opacity="1"/></g></g></svg>

+ 1 - 0
ruoyi-ui/src/assets/icons/svg/icon-dot.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><defs><clipPath id="master_svg0_109_66304/22_3755"><rect x="0" y="0" width="24" height="24" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_109_66304/22_3755)"><g><rect x="10" y="10" width="4" height="4" rx="0" fill="currentColor" fill-opacity="1"/></g></g></svg>

+ 1 - 0
ruoyi-ui/src/assets/icons/svg/icon-home.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><defs><clipPath id="master_svg0_109_66268/22_3755"><rect x="0" y="0" width="24" height="24" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_109_66268/22_3755)"><g><path d="M1.500079,11.665876875Q1.7688869999999999,12.376866875,2.528997,12.376866875L4.2764500000000005,12.376866875L4.2764500000000005,21.054296875L19.7235,21.054296875L19.7235,12.376866875L21.471,12.376866875Q22.2311,12.376866875,22.4999,11.665876875Q22.7687,10.954886875,22.1987,10.452006875L12,1.454096875L1.801258,10.452006875Q1.231271,10.954886875,1.500079,11.665876875ZM4.38049,10.576866875L6.07645,10.576866875L6.07645,19.254296875L17.9235,19.254296875L17.9235,10.576866875L19.6195,10.576866875L12,3.8544968749999997L4.38049,10.576866875Z" fill-rule="evenodd" fill="currentColor" fill-opacity="1"/></g><g><rect x="10" y="13.154296875" width="4" height="7" rx="0" fill-opacity="0" stroke-opacity="1" stroke="currentColor" fill="none" stroke-width="1.7999999523162842"/></g></g></svg>

+ 1 - 0
ruoyi-ui/src/assets/icons/svg/icon-site.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><defs><clipPath id="master_svg0_109_66289/22_3755"><rect x="0" y="0" width="24" height="24" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_109_66289/22_3755)"><g><rect x="8" y="3.23046875" width="8" height="5" rx="0" fill-opacity="0" stroke-opacity="1" stroke="currentColor" fill="none" stroke-width="1.7999999523162842" stroke-linecap="SQUARE"/></g><g><rect x="4" y="16.23046875" width="5" height="5" rx="0" fill-opacity="0" stroke-opacity="1" stroke="currentColor" fill="none" stroke-width="1.7999999523162842" stroke-linecap="SQUARE"/></g><g><rect x="15" y="16.23046875" width="5" height="5" rx="0" fill-opacity="0" stroke-opacity="1" stroke="currentColor" fill="none" stroke-width="1.7999999523162842" stroke-linecap="SQUARE"/></g><g><path d="M11.099996,8.1302694375L11.1,9.0302734375L11.1,12.0302734375L11.099996,12.9302734375L12.900004,12.9302734375L12.9,12.0302734375L12.9,9.0302734375L12.900004,8.1302694375L11.099996,8.1302694375Z" fill-rule="evenodd" fill="currentColor" fill-opacity="1"/></g><g><path d="M17.1,13.13046875L17.1,15.23046875L17.1,16.13046875L18.9,16.13046875L18.9,15.23046875L18.9,11.33046875L5.1,11.33046875L5.1,15.23046875L5.099996,16.13046875L6.900004,16.13046875L6.9,15.23046875L6.9,13.13046875L17.1,13.13046875Z" fill-rule="evenodd" fill="currentColor" fill-opacity="1"/></g></g></svg>

+ 1 - 0
ruoyi-ui/src/assets/icons/svg/icon-system.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="24" height="24" viewBox="0 0 24 24"><defs><clipPath id="master_svg0_109_66284/22_3755"><rect x="0" y="0" width="24" height="24" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_109_66284/22_3755)"><g><path d="M11.235924375,15.669034375L20.284434375,15.669034375L20.284434375,14.769034375L20.284434375,8.497594375L20.284434375,3.715234375L3.715234375,3.715234375L3.715234375,15.669034375L11.235924375,15.669034375ZM18.484434375,13.869074375L11.235924375,13.869084375L5.515234375,13.869084375L5.515234375,5.515234375L18.484434375,5.515234375L18.484434375,8.497584375L18.484434375,13.869074375Z" fill-rule="evenodd" fill="currentColor" fill-opacity="1"/></g><g><path d="M7.4076131875,19.3619180625L8.3076171875,19.3619140625L15.6922271875,19.3619140625L16.5922371875,19.3619180625L16.5922371875,17.5619100625L15.6922271875,17.5619140625L8.3076171875,17.5619140625L7.4076131875,17.5619100625L7.4076131875,19.3619180625Z" fill-rule="evenodd" fill="currentColor" fill-opacity="1"/></g></g></svg>

+ 9 - 1
ruoyi-ui/src/assets/styles/sidebar.scss

@@ -61,7 +61,9 @@
     }
 
     .svg-icon {
-      margin-right: 16px;
+      margin-right: 6px;
+      width: 20px;
+      height: 20px;
     }
 
     .el-menu {
@@ -71,6 +73,12 @@
       background: #1D2738;
     }
 
+    .el-submenu__title,
+    .el-menu-item {
+      display: flex;
+      align-items: center;
+    }
+
     .el-menu-item, .el-submenu__title {
       overflow: hidden !important;
       text-overflow: ellipsis !important;

+ 1 - 1
ruoyi-ui/src/router/index.js

@@ -70,7 +70,7 @@ export const constantRoutes = [
         path: 'index',
         component: () => import('@/views/index'),
         name: 'Index',
-        meta: { title: '首页', icon: 'dashboard', affix: true }
+        meta: { title: '首页', icon: 'icon-home', affix: true }
       }
     ]
   },

+ 137 - 137
ruoyi-ui/src/store/modules/permission.js

@@ -1,137 +1,137 @@
-import auth from '@/plugins/auth'
-import router, { constantRoutes, dynamicRoutes } from '@/router'
-import { getRouters } from '@/api/menu'
-import Layout from '@/layout/index'
-import ParentView from '@/components/ParentView'
-import InnerLink from '@/layout/components/InnerLink'
-
-const permission = {
-  state: {
-    routes: [],
-    addRoutes: [],
-    defaultRoutes: [],
-    topbarRouters: [],
-    sidebarRouters: []
-  },
-  mutations: {
-    SET_ROUTES: (state, routes) => {
-      state.addRoutes = routes
-      state.routes = constantRoutes.concat(routes)
-    },
-    SET_DEFAULT_ROUTES: (state, routes) => {
-      state.defaultRoutes = constantRoutes.concat(routes)
-    },
-    SET_TOPBAR_ROUTES: (state, routes) => {
-      state.topbarRouters = routes
-    },
-    SET_SIDEBAR_ROUTERS: (state, routes) => {
-      state.sidebarRouters = routes
-    },
-  },
-  actions: {
-    // 生成路由
-    GenerateRoutes({ commit }) {
-      return new Promise(resolve => {
-        // 向后端请求路由数据
-        getRouters().then(res => {
-          const sdata = JSON.parse(JSON.stringify(res.data))
-          const rdata = JSON.parse(JSON.stringify(res.data))
-          const sidebarRoutes = filterAsyncRouter(sdata)
-          const rewriteRoutes = filterAsyncRouter(rdata, false, true)
-          const asyncRoutes = filterDynamicRoutes(dynamicRoutes);
-          rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true })
-          router.addRoutes(asyncRoutes);
-          commit('SET_ROUTES', rewriteRoutes)
-          commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes))
-          commit('SET_DEFAULT_ROUTES', sidebarRoutes)
-          commit('SET_TOPBAR_ROUTES', sidebarRoutes)
-          resolve(rewriteRoutes)
-        })
-      })
-    }
-  }
-}
-
-// 遍历后台传来的路由字符串,转换为组件对象
-function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
-  return asyncRouterMap.filter(route => {
-    if (type && route.children) {
-      route.children = filterChildren(route.children)
-    }
-    if (route.component) {
-      // Layout ParentView 组件特殊处理
-      if (route.component === 'Layout') {
-        route.component = Layout
-      } else if (route.component === 'ParentView') {
-        route.component = ParentView
-      } else if (route.component === 'InnerLink') {
-        route.component = InnerLink
-      } else {
-        route.component = loadView(route.component)
-      }
-    }
-    if (route.children != null && route.children && route.children.length) {
-      route.children = filterAsyncRouter(route.children, route, type)
-    } else {
-      delete route['children']
-      delete route['redirect']
-    }
-    return true
-  })
-}
-
-function filterChildren(childrenMap, lastRouter = false) {
-  var children = []
-  childrenMap.forEach((el, index) => {
-    if (el.children && el.children.length) {
-      if (el.component === 'ParentView' && !lastRouter) {
-        el.children.forEach(c => {
-          c.path = el.path + '/' + c.path
-          if (c.children && c.children.length) {
-            children = children.concat(filterChildren(c.children, c))
-            return
-          }
-          children.push(c)
-        })
-        return
-      }
-    }
-    if (lastRouter) {
-      el.path = lastRouter.path + '/' + el.path
-      if (el.children && el.children.length) {
-        children = children.concat(filterChildren(el.children, el))
-        return
-      }
-    }
-    children = children.concat(el)
-  })
-  return children
-}
-
-// 动态路由遍历,验证是否具备权限
-export function filterDynamicRoutes(routes) {
-  const res = []
-  routes.forEach(route => {
-    if (route.permissions) {
-      if (auth.hasPermiOr(route.permissions)) {
-        res.push(route)
-      }
-    } else if (route.roles) {
-      if (auth.hasRoleOr(route.roles)) {
-        res.push(route)
-      }
-    }
-  })
-  return res
-}
-
-export const loadView = (view) => {
-  if (process.env.NODE_ENV === 'development') {
-    return (resolve) => require([`@/views/${view}`], resolve)
-  } else {
-    // 使用 import 实现生产环境的路由懒加载
-    return () => import(`@/views/${view}`)
-  }
-}
-
-export default permission
+import auth from '@/plugins/auth'
+import router, { constantRoutes, dynamicRoutes } from '@/router'
+import { getRouters } from '@/api/menu'
+import Layout from '@/layout/index'
+import ParentView from '@/components/ParentView'
+import InnerLink from '@/layout/components/InnerLink'
+
+const permission = {
+  state: {
+    routes: [],
+    addRoutes: [],
+    defaultRoutes: [],
+    topbarRouters: [],
+    sidebarRouters: []
+  },
+  mutations: {
+    SET_ROUTES: (state, routes) => {
+      state.addRoutes = routes
+      state.routes = constantRoutes.concat(routes)
+    },
+    SET_DEFAULT_ROUTES: (state, routes) => {
+      state.defaultRoutes = constantRoutes.concat(routes)
+    },
+    SET_TOPBAR_ROUTES: (state, routes) => {
+      state.topbarRouters = routes
+    },
+    SET_SIDEBAR_ROUTERS: (state, routes) => {
+      state.sidebarRouters = routes
+    },
+  },
+  actions: {
+    // 生成路由
+    GenerateRoutes({ commit }) {
+      return new Promise(resolve => {
+        // 向后端请求路由数据
+        getRouters().then(res => {
+          const sdata = JSON.parse(JSON.stringify(res.data))
+          const rdata = JSON.parse(JSON.stringify(res.data))
+          const sidebarRoutes = filterAsyncRouter(sdata)
+          const rewriteRoutes = filterAsyncRouter(rdata, false, true)
+          const asyncRoutes = filterDynamicRoutes(dynamicRoutes);
+          rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true })
+          router.addRoutes(asyncRoutes);
+          commit('SET_ROUTES', rewriteRoutes)
+          commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes))
+          commit('SET_DEFAULT_ROUTES', sidebarRoutes)
+          commit('SET_TOPBAR_ROUTES', sidebarRoutes)
+          resolve(rewriteRoutes)
+        })
+      })
+    }
+  }
+}
+
+// 遍历后台传来的路由字符串,转换为组件对象
+function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
+  return asyncRouterMap.filter(route => {
+    if (type && route.children) {
+      route.children = filterChildren(route.children)
+    }
+    if (route.component) {
+      // Layout ParentView 组件特殊处理
+      if (route.component === 'Layout') {
+        route.component = Layout
+      } else if (route.component === 'ParentView') {
+        route.component = ParentView
+      } else if (route.component === 'InnerLink') {
+        route.component = InnerLink
+      } else {
+        route.component = loadView(route.component)
+      }
+    }
+    if (route.children != null && route.children && route.children.length) {
+      route.children = filterAsyncRouter(route.children, route, type)
+    } else {
+      delete route['children']
+      delete route['redirect']
+    }
+    return true
+  })
+}
+
+function filterChildren(childrenMap, lastRouter = false) {
+  var children = []
+  childrenMap.forEach((el, index) => {
+    if (el.children && el.children.length) {
+      if (el.component === 'ParentView' && !lastRouter) {
+        el.children.forEach(c => {
+          c.path = el.path + '/' + c.path
+          if (c.children && c.children.length) {
+            children = children.concat(filterChildren(c.children, c))
+            return
+          }
+          children.push(c)
+        })
+        return
+      }
+    }
+    if (lastRouter) {
+      el.path = lastRouter.path + '/' + el.path
+      if (el.children && el.children.length) {
+        children = children.concat(filterChildren(el.children, el))
+        return
+      }
+    }
+    children = children.concat(el)
+  })
+  return children
+}
+
+// 动态路由遍历,验证是否具备权限
+export function filterDynamicRoutes(routes) {
+  const res = []
+  routes.forEach(route => {
+    if (route.permissions) {
+      if (auth.hasPermiOr(route.permissions)) {
+        res.push(route)
+      }
+    } else if (route.roles) {
+      if (auth.hasRoleOr(route.roles)) {
+        res.push(route)
+      }
+    }
+  })
+  return res
+}
+
+export const loadView = (view) => {
+  if (process.env.NODE_ENV === 'development') {
+    return (resolve) => require([`@/views/${view}`], resolve)
+  } else {
+    // 使用 import 实现生产环境的路由懒加载
+    return () => import(`@/views/${view}`)
+  }
+}
+
+export default permission