Browse Source

修改分配用户接口,新增菜单树接口,日志管理样式

Zt 2 years ago
parent
commit
6a5428f992

+ 8 - 0
chuanyi-admin/src/api/system/menu.js

@@ -9,6 +9,14 @@ export function getMenuList(query) {
   })
 }
 
+// 查询所有菜单列表(树结构)
+export function getAllMenuList() {
+  return request({
+    url: '/menu/getAllMenu',
+    method: 'get'
+  })
+}
+
 // 新增菜单列表
 export function addtMenuList(query) {
   return request({

+ 9 - 0
chuanyi-admin/src/api/system/user.js

@@ -96,3 +96,12 @@ export function addUserToAuthRole(data) {
     data
   })
 }
+
+// 查询所有后端用户
+export function getAllAdminUser(query) {
+  return request({
+    url: '/user/queryUserType',
+    method: 'get',
+    params: query
+  })
+}

+ 8 - 0
chuanyi-admin/src/styles/index.scss

@@ -231,4 +231,12 @@ aside {
 
 .el-tooltip__popper {
   max-width: 40%
+}
+
+.el-tooltip__popper {
+  display: -webkit-box;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  -webkit-line-clamp:20;
+  -webkit-box-orient: vertical;
 }

+ 1 - 1
chuanyi-admin/src/views/login/index.vue

@@ -61,7 +61,7 @@
             type="text"
             tabindex="3"
             auto-complete="off"
-            @keyup.enter.native="handleLogin"
+            @keydown.enter.native="handleLogin"
           />
         </div>
         <div class="login-code">

+ 8 - 8
chuanyi-admin/src/views/system/menu/index.vue

@@ -151,7 +151,7 @@
 </template>
 
 <script>
-import { getMenuList, addtMenuList, detailtMenuList, delMenuList, editMenuList } from '@/api/system/menu.js'
+import { getMenuList, addtMenuList, detailtMenuList, delMenuList, editMenuList, getAllMenuList } from '@/api/system/menu.js'
 import selectTree from '@/components/SelectTree'
 export default {
   components: {
@@ -240,7 +240,6 @@ export default {
         this.loading = false
         this.total = data.count
         this.defaultExpande(this.menuList)
-        this.getOptionsList()
       })
     },
     /** 默认收起所有行 */
@@ -254,13 +253,10 @@ export default {
     },
     /** 获取上级菜单 */
     getOptionsList() {
-      getMenuList({
-        page: 1,
-        limit: 999
-      }).then(res => {
+      getAllMenuList().then(res => {
         if (res.code === 200) {
           const data = res.data
-          this.options = data.menuList
+          this.options = data
         }
       })
     },
@@ -280,13 +276,17 @@ export default {
       this.dialogVisible = true
       this.title = '添加菜单'
       this.reset()
+      this.getOptionsList()
     },
     /** 修改按钮 */
     handelEdit(id) {
       this.id = id
       this.dialogVisible = true
       detailtMenuList({ id }).then(res => {
-        this.form = res.data
+        if (res.code === 200) {
+          this.form = res.data
+          this.getOptionsList()
+        }
       })
       this.title = '修改菜单'
     },

+ 8 - 8
chuanyi-admin/src/views/system/role/role-select.vue

@@ -39,8 +39,8 @@
         v-show="total > 0"
         :total="total"
         align="right"
-        :page.sync="queryParams.page"
-        :limit.sync="queryParams.limit"
+        :page.sync="queryParams.startNum"
+        :limit.sync="queryParams.limitNum"
         @pagination="getList"
       />
     </el-row>
@@ -52,7 +52,7 @@
 </template>
 
 <script>
-import { getUserList, addUserToAuthRole } from '@/api/system/user'
+import { getAllAdminUser, addUserToAuthRole } from '@/api/system/user'
 export default {
   props: {
     // 角色编号
@@ -76,8 +76,8 @@ export default {
       userType: this.$store.getters.userType,
       // 查询参数
       queryParams: {
-        page: 1,
-        limit: 10,
+        startNum: 1,
+        limitNum: 10,
         roleId: undefined,
         userName: undefined
       }
@@ -109,7 +109,7 @@ export default {
     },
     /** 显示弹框 */
     show() {
-      this.queryParams.page = 1
+      this.queryParams.startNum = 1
       this.queryParams.roleId = this.roleId
       this.visible = true
       this.getList()
@@ -124,7 +124,7 @@ export default {
     },
     /** 查询用户列表 */
     getList() {
-      getUserList(this.queryParams).then(res => {
+      getAllAdminUser(this.queryParams).then(res => {
         if (res.code === 200) {
           const data = res.data
           data.userList.forEach(item => {
@@ -137,7 +137,7 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.page = 1
+      this.queryParams.startNum = 1
       this.getList()
     },
     /** 重置按钮操作 */