Explorar el Código

对接部分接口

尹帮元 hace 2 años
padre
commit
d501e3a6bd

+ 6 - 2
.env.development

@@ -5,8 +5,12 @@ VUE_APP_TITLE = 移动安全保卫管理平台(开发)
 ENV = 'development'
 
 # 开发环境
-VUE_APP_BASE_API = 'http://127.0.0.1:8080/'
-
+#测试地址
+#VUE_APP_BASE_API = 'http://10.87.10.55:8081/'
+#罗俊
+#VUE_APP_BASE_API = 'http://10.87.10.49:8080/'
+#罗伟
+VUE_APP_BASE_API = 'http://10.87.10.47:8080/'
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true
 

+ 0 - 1
package.json

@@ -5,7 +5,6 @@
   "author": "若依",
   "private": true,
   "license": "MIT",
-  "private": true,
   "scripts": {
     "dev": "vue-cli-service serve",
     "build:prod": "vue-cli-service build",

+ 2 - 2
src/api/system/role.js

@@ -111,9 +111,9 @@ export function authUserSelectAll(data) {
 }
 
 // 根据角色ID查询部门树结构
-export function deptTreeSelect(roleId) {
+export function deptTreeSelect(id) {
   return request({
-    url: '/system/role/deptTree/' + roleId,
+    url: '/system/role/deptTree/' + id,
     method: 'get'
   })
 }

+ 3 - 6
src/api/system/user.js

@@ -45,15 +45,12 @@ export function delUser(userId) {
 }
 
 // 用户密码重置
-export function resetUserPwd(userId, password) {
-  const data = {
-    userId,
-    password
-  }
+export function resetUserPwd(data) {
+
   return request({
     url: '/system/user/resetPwd',
     method: 'put',
-    data: data
+    data
   })
 }
 

+ 1 - 2
src/views/login.vue

@@ -48,8 +48,7 @@
         <el-button
           :loading="loading"
           size="medium"
-          type="primary"
-          style="width:100%;"
+          style="width:100%;background-color: #00afff;color:#fff;"
           @click.native.prevent="handleLogin">
           <span v-if="!loading">登 录</span>
           <span v-else>登 录 中...</span>

+ 51 - 44
src/views/system/role/index.vue

@@ -84,16 +84,16 @@
           v-hasPermi="['system:role:remove']"
         >删除</el-button>
       </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          @click="handleExport"
-          v-hasPermi="['system:role:export']"
-        >导出</el-button>
-      </el-col>
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="warning"-->
+<!--          plain-->
+<!--          icon="el-icon-download"-->
+<!--          size="mini"-->
+<!--          @click="handleExport"-->
+<!--          v-hasPermi="['system:role:export']"-->
+<!--        >导出</el-button>-->
+<!--      </el-col>-->
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -109,7 +109,7 @@
             v-model="scope.row.status"
             active-value="0"
             inactive-value="1"
-          
+
             @change="handleStatusChange(scope.row)"
           ></el-switch>
         </template>
@@ -186,7 +186,7 @@
         <el-form-item label="菜单权限">
           <el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')">展开/折叠</el-checkbox>
           <el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')">全选/全不选</el-checkbox>
-          <el-checkbox v-model="form.menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')">父子联动</el-checkbox>
+          <el-checkbox v-model="form.menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')">自动选中下级</el-checkbox>
           <el-tree
             class="tree-border"
             :data="menuOptions"
@@ -195,7 +195,6 @@
             node-key="id"
             :check-strictly="!form.menuCheckStrictly"
             empty-text="加载中,请稍候"
-            :props="defaultProps"
           ></el-tree>
         </el-form-item>
         <el-form-item label="备注">
@@ -231,17 +230,19 @@
           <el-checkbox v-model="deptExpand" @change="handleCheckedTreeExpand($event, 'dept')">展开/折叠</el-checkbox>
           <el-checkbox v-model="deptNodeAll" @change="handleCheckedTreeNodeAll($event, 'dept')">全选/全不选</el-checkbox>
           <el-checkbox v-model="form.deptCheckStrictly" @change="handleCheckedTreeConnect($event, 'dept')">父子联动</el-checkbox>
-          <el-tree
-            class="tree-border"
-            :data="deptOptions"
-            show-checkbox
-            default-expand-all
-            ref="dept"
-            node-key="id"
-            :check-strictly="!form.deptCheckStrictly"
-            empty-text="加载中,请稍候"
-            :props="defaultProps"
-          ></el-tree>
+          <div class="tree-container" style="max-height: 300px;">
+            <el-tree
+              class="tree-border"
+              :data="deptOptions"
+              show-checkbox
+              default-expand-all
+              ref="dept"
+              node-key="id"
+              :check-strictly="!form.deptCheckStrictly"
+              empty-text="加载中,请稍候"
+              :props="defaultProps"
+            ></el-tree>
+          </div>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -326,7 +327,7 @@ export default {
       form: {},
       defaultProps: {
         children: "children",
-        label: "label"
+        label: "name"
       },
       // 表单校验
       rules: {
@@ -339,7 +340,7 @@ export default {
         roleSort: [
           { required: true, message: "角色顺序不能为空", trigger: "blur" }
         ]
-      }
+      },
     };
   },
   created() {
@@ -388,22 +389,24 @@ export default {
       });
     },
     /** 根据角色ID查询部门树结构 */
-    getDeptTree(roleId) {
-      return deptTreeSelect(roleId).then(response => {
-        this.deptOptions = response.depts;
-        return response;
-      });
-    },
+    // getDeptTree(userId) {
+    //   let roleList;
+    //   deptTreeSelect(userId).then(response => {
+    //     this.deptOptions = response.depts;
+    //     roleList = response.depts;
+    //   });
+    //   return roleList;
+    // },
     // 角色状态修改
     handleStatusChange(row) {
       let text = row.status === "0" ? "启用" : "停用";
       this.$modal.confirm('确认要"' + text + '""' + row.roleName + '"角色吗?').then(function() {
         return changeRoleStatus(row.id,row.status);
       }).then(() => {
-       
+
         this.$modal.msgSuccess(text + "成功");
       }).catch(function() {
-        
+
         row.status = row.status === "0" ? "1" : "0";
       });
     },
@@ -537,17 +540,21 @@ export default {
     /** 分配数据权限操作 */
     handleDataScope(row) {
       this.reset();
-    
-      const deptTreeSelect = this.getDeptTree(row.id);
-      getRole(row.id).then(response => {
-        this.form = response.data;
-        this.openDataScope = true;
-        this.$nextTick(() => {
-          deptTreeSelect.then(res => {
-            this.$refs.dept.setCheckedKeys(res.checkedKeys);
+      console.log(row,'row')
+      deptTreeSelect(row.id).then(response => {
+        this.deptOptions = response.depts;
+        const deptTreeSelect = response.depts;
+        console.log(deptTreeSelect,'deptTreeSelect')
+        getRole(row.id).then(response => {
+          this.form = response.data;
+          this.openDataScope = true;
+          this.$nextTick(() => {
+            deptTreeSelect.then(res => {
+              this.$refs.dept.setCheckedKeys(res.checkedKeys);
+            });
           });
+          this.title = "分配数据权限";
         });
-        this.title = "分配数据权限";
       });
     },
     /** 分配用户操作 */
@@ -614,4 +621,4 @@ export default {
     }
   }
 };
-</script>
+</script>

+ 9 - 2
src/views/system/user/index.vue

@@ -487,6 +487,8 @@ export default {
       console.log(this.queryParams,111);
       console.log(this.addDateRange(this.queryParams, this.dateRange),2222);
       listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
+          //兼容框架userId字段
+          response.rows.forEach(v=>{v.userId = v.id});
           this.userList = response.rows;
           this.total = response.total;
           this.loading = false;
@@ -611,14 +613,19 @@ export default {
     },
     /** 重置密码按钮操作 */
     handleResetPwd(row) {
-      this.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
+      console.log(row,'row')
+      this.$prompt('请输入"' + row.name + '"的新密码', "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         closeOnClickModal: false,
         inputPattern: /^.{5,20}$/,
         inputErrorMessage: "用户密码长度必须介于 5 和 20 之间"
       }).then(({ value }) => {
-          resetUserPwd(row.userId, value).then(response => {
+          let data = {
+            id:row.userId,
+            password:value
+          }
+          resetUserPwd(data).then(response => {
             this.$modal.msgSuccess("修改成功,新密码是:" + value);
           });
         }).catch(() => {});