Browse Source

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into dev

汪钰 3 years ago
parent
commit
b4d6c48d0a

+ 13 - 0
src/api/system/role/index.js

@@ -119,3 +119,16 @@ export async function updateRoleMenus (data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+
+/**
+ * 点击新增获取角色列表
+ * @param params 
+ */
+export async function getlistRole (id) {
+  const res = await request.get('/sys/role/getByRoleName');
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 3 - 7
src/views/system/user/components/role-select.vue

@@ -18,7 +18,7 @@
 </template>
 
 <script>
-  import { listRoles } from '@/api/system/role';
+  import { getlistRole } from '@/api/system/role';
 
   export default {
     props: {
@@ -37,13 +37,9 @@
     },
     created() {
       /* 获取角色数据 */
-      let params = {
-        pageNum:1,
-        size:99999999999
-      }
-      listRoles(params)
+      getlistRole()
         .then(res => {
-          this.data = res.list;
+          this.data = res;
         })
         .catch((e) => {
           this.$message.error(e.message);

+ 1 - 1
src/views/system/user/components/user-edit.vue

@@ -88,7 +88,7 @@
         // 表单验证规则
         rules: {
           loginName: [{required: true, message: '请输入用户账号',trigger: 'blur'}],
-          roleId: [{required: true, message: '请选择角色',trigger: 'blur'}],
+          roleId: [{required: true, message: '请选择角色',trigger: 'change'}],
           loginPwd: [{required: true, pattern: /^[\S]{5,18}$/,message: '密码必须为5-18位非空白字符',trigger: 'blur'}]
         },
         // 提交状态

+ 8 - 7
src/views/system/user/index.vue

@@ -31,14 +31,14 @@
           >
             删除
           </el-button>
-          <el-button
+<!--          <el-button
             size="small"
             icon="el-icon-upload2"
             class="ele-btn-icon"
             @click="openImport"
           >
             导入
-          </el-button>
+          </el-button> -->
         </template>
         <!-- 用户名列 -->
         <!--        <template v-slot:nickname="{ row }">
@@ -141,15 +141,16 @@
           {
             columnKey: 'index',
             type: 'index',
-            width: 45,
+            width: 55,
             align: 'center',
             showOverflowTooltip: true,
-            fixed: 'left'
+            fixed: 'left',
+            label: '序号',
           },
           {
             prop: 'loginName',
             label: '用户账号',
-            sortable: 'custom',
+            // sortable: 'custom',
             showOverflowTooltip: true,
             minWidth: 110
           },
@@ -163,7 +164,7 @@
           {
             prop: 'createTime',
             label: '创建时间',
-            sortable: 'custom',
+            // sortable: 'custom',
             showOverflowTooltip: true,
             minWidth: 110,
             formatter: (_row, _column, cellValue) => {
@@ -174,7 +175,7 @@
             prop: 'enable',
             label: '状态',
             align: 'center',
-            sortable: 'custom',
+            // sortable: 'custom',
             width: 80,
             resizable: false,
             slot: 'enable',

+ 1 - 0
vue.config.js

@@ -16,6 +16,7 @@ module.exports = {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
         // target: 'http://192.168.3.51:18086', // 跨域请求的地址
+
         target: 'http://192.168.3.35:8080', // kang杨威
         // target: 'http://192.168.3.25:8080', // 黄峥嵘
         // target: 'http://192.168.3.41:8080', // 何江鹏