|
|
@@ -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>
|