chenjun 1 жил өмнө
parent
commit
8fb43612f1

+ 7 - 5
src/getMenu.js

@@ -51,12 +51,14 @@ router.beforeEach(async (to, from, next) => {
           const treeData = await store.dispatch('user/getMenuInfo')
           if (Array.isArray(treeData) && treeData.length) {
             const nd = treeData.filter(item => item.pageconfigurationid)
-            store.dispatch('auth/changeAuthArrs', nd)
+            const ndOrder = _.orderBy(treeData,['displaynumber'])
+            store.dispatch('auth/changeAuthArrs', ndOrder)
             // const typeData = setType(treeData, 'up_auth_id', 'auth_id')
-            const menusArray = parseMenuItem(nd)
+            const menusArray = parseMenuItem(ndOrder)
             const treeMenu = listToTree(menusArray, 'up_auth_id', 'auth_id')
             const dataMenu = _.unionBy(treeMenu, 'auth_id')
             const menus = parseMenu(dataMenu)
+            console.log(menus)
             store.dispatch('permission/setRoutes', menus)
             router.addRoutes(menus)
             next({ ...to, replace: true })
@@ -103,7 +105,7 @@ function parseMenuItem (data) {
         meta: {
           title: item.pagename,
           elSvgIcon: item.pageicon || 'el-icon-s-order',
-          show_index: item.displayorder,
+          show_index: item.displaynumber,
           qid: item.serviceid,
         },
         component: Layout,
@@ -117,8 +119,8 @@ function parseMenuItem (data) {
         name: item.pagename,
         meta: {
           title: item.pagename,
-          elSvgIcon: item.pageicon || 'el-icon-s-order',
-          show_index: item.displayorder,
+          // elSvgIcon: item.pageicon || 'el-icon-s-order',
+          show_index: item.displaynumber,
           qid: item.serviceid,
           auth_id: item.pageconfigurationid,
           up_auth_id: item.superiorid,

+ 1 - 1
src/layout/components/Sidebar/SidebarItem.vue

@@ -10,7 +10,7 @@
 
     <el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body>
       <template v-if="item.meta" slot="title">
-        <item :meta="item.meta" />
+        <item :meta="item.meta" :icon="item.meta.elSvgIcon||(item.meta&&item.meta.elSvgIcon)" />
         <span>{{ item.meta.title }}</span>
       </template>
       <SidebarItem v-for="child in item.children" :key="child.path" :is-nest="true" :item="child" :base-path="resolvePath(child.path)" />

+ 3 - 0
src/views/login/index.vue

@@ -141,6 +141,9 @@ export default {
       this.$store
         .dispatch("user/login", params)
         .then(async (res) => {
+          this.loginForm.password = ""
+          this.loginForm.identify = ""
+          this.changeCode()
           if (res==1) {
             this.dialogOpen()
           } else {