Przeglądaj źródła

:bug: Fixing a bug.

#189 用户编辑界面加载异常
#192 pigx-ui显示组织机构树和请求提示问题
冷冷 6 lat temu
rodzic
commit
7ef66fbd54

+ 0 - 8
src/api/admin/dept.js

@@ -17,14 +17,6 @@
 
 import request from '@/router/axios'
 
-export function fetchDeptTree (query) {
-  return request({
-    url: '/admin/dept/user-tree',
-    method: 'get',
-    params: query
-  })
-}
-
 export function fetchTree (query) {
   return request({
     url: '/admin/dept/tree',

+ 11 - 11
src/const/crud/admin/user.js

@@ -14,7 +14,7 @@
  * this software without specific prior written permission.
  * Author: lengleng (wangiegie@gmail.com)
  */
-import { getDetails } from '@/api/admin/user'
+import {getDetails} from '@/api/admin/user'
 
 var validateUsername = (rule, value, callback) => {
   getDetails(value).then(response => {
@@ -57,13 +57,13 @@ export const tableOption = {
       required: true,
       message: '请输入用户名'
     },
-    {
-      min: 3,
-      max: 20,
-      message: '长度在 3 到 20 个字符',
-      trigger: 'blur'
-    },
-    { validator: validateUsername, trigger: 'blur' }
+      {
+        min: 3,
+        max: 20,
+        message: '长度在 3 到 20 个字符',
+        trigger: 'blur'
+      },
+      {validator: validateUsername, trigger: 'blur'}
     ]
   }, {
     label: '密码',
@@ -93,12 +93,12 @@ export const tableOption = {
   }, {
     label: '手机号',
     prop: 'phone',
-    type: 'phone',
+    type: 'tel',
     value: '',
     span: 24,
     rules: [{
-      min: 6,
-      max: 20,
+      min: 11,
+      max: 11,
       message: '长度在 11 个字符',
       trigger: 'blur'
     }]

+ 2 - 2
src/views/admin/user/index.vue

@@ -115,7 +115,7 @@
 <script>
   import {addObj, delObj, fetchList, getObj, putObj} from "@/api/admin/user";
   import {deptRoleList} from "@/api/admin/role";
-  import {fetchDeptTree,fetchTree} from "@/api/admin/dept";
+  import {fetchTree} from "@/api/admin/dept";
   import {tableOption} from '@/const/crud/admin/user';
   import {mapGetters} from "vuex";
   import {constants} from 'fs';
@@ -175,7 +175,7 @@
     },
     methods: {
       init() {
-        fetchDeptTree().then(response => {
+        fetchTree().then(response => {
           this.treeData = response.data.data;
         });
       },