luowei 2 سال پیش
والد
کامیت
994a9b7708
2فایلهای تغییر یافته به همراه15 افزوده شده و 5 حذف شده
  1. 1 1
      .env.development
  2. 14 4
      src/views/system/role/index.vue

+ 1 - 1
.env.development

@@ -5,7 +5,7 @@ VUE_APP_TITLE = 移动安全保卫管理平台(开发)
 ENV = 'development'
 
 # 开发环境
-VUE_APP_BASE_API = 'http://10.87.10.55:8081/'
+VUE_APP_BASE_API = 'http://127.0.0.1:8080/'
 
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 14 - 4
src/views/system/role/index.vue

@@ -109,6 +109,7 @@
             v-model="scope.row.status"
             active-value="0"
             inactive-value="1"
+          
             @change="handleStatusChange(scope.row)"
           ></el-switch>
         </template>
@@ -397,7 +398,7 @@ export default {
     handleStatusChange(row) {
       let text = row.status === "0" ? "启用" : "停用";
       this.$modal.confirm('确认要"' + text + '""' + row.roleName + '"角色吗?').then(function() {
-        return changeRoleStatus(row.id, row.status);
+        return changeRoleStatus(row.id,row.status);
       }).then(() => {
        
         this.$modal.msgSuccess(text + "成功");
@@ -536,8 +537,9 @@ export default {
     /** 分配数据权限操作 */
     handleDataScope(row) {
       this.reset();
-      const deptTreeSelect = this.getDeptTree(row.roleId);
-      getRole(row.roleId).then(response => {
+    
+      const deptTreeSelect = this.getDeptTree(row.id);
+      getRole(row.id).then(response => {
         this.form = response.data;
         this.openDataScope = true;
         this.$nextTick(() => {
@@ -584,11 +586,19 @@ export default {
           this.openDataScope = false;
           this.getList();
         });
+      }else{
+         this.form.deptIds = this.getDeptAllCheckedKeys();
+        dataScope(this.form).then(response => {
+          this.$modal.msgSuccess("修改成功");
+          this.openDataScope = false;
+          this.getList();
+        });
+
       }
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const roleIds = row.roleId || this.ids;
+      const roleIds = row.id || this.ids;
       this.$modal.confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?').then(function() {
         return delRole(roleIds);
       }).then(() => {