|
@@ -14,7 +14,7 @@
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
</el-form>
|
|
</el-form>
|
|
- <div class="tree" v-if="!isNew">
|
|
|
|
|
|
+ <div class="tree">
|
|
<div class="main-title">角色权限</div>
|
|
<div class="main-title">角色权限</div>
|
|
<el-row>
|
|
<el-row>
|
|
<el-col :span="4" v-for="(item, index) in treeData" :key="item[0].authorityId">
|
|
<el-col :span="4" v-for="(item, index) in treeData" :key="item[0].authorityId">
|
|
@@ -93,11 +93,11 @@
|
|
})
|
|
})
|
|
},
|
|
},
|
|
save() {
|
|
save() {
|
|
|
|
+ let checkedTemp = []
|
|
|
|
+ for(let i=0; i<this.treeData.length; i++) {
|
|
|
|
+ checkedTemp.push(...this.$refs[`tree-${i}`][0].getCheckedKeys())
|
|
|
|
+ }
|
|
if(!this.isNew) {
|
|
if(!this.isNew) {
|
|
- let checkedTemp = []
|
|
|
|
- for(let i=0; i<this.treeData.length; i++) {
|
|
|
|
- checkedTemp.push(...this.$refs[`tree-${i}`][0].getCheckedKeys())
|
|
|
|
- }
|
|
|
|
UpdateRoleAuthority(this.$route.params.id, checkedTemp).then(res => {
|
|
UpdateRoleAuthority(this.$route.params.id, checkedTemp).then(res => {
|
|
if(res.code == 200) {
|
|
if(res.code == 200) {
|
|
this.$message({type: 'success', message: '保存成功'})
|
|
this.$message({type: 'success', message: '保存成功'})
|
|
@@ -111,7 +111,7 @@
|
|
}else {
|
|
}else {
|
|
this.$refs.ruleForm.validate((valid) => {
|
|
this.$refs.ruleForm.validate((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- AddRole(this.form.roleName).then(res => {
|
|
|
|
|
|
+ AddRole(this.form.roleName, checkedTemp).then(res => {
|
|
if(res.code == 200) {
|
|
if(res.code == 200) {
|
|
this.$message({type: 'success', message: '角色添加成功'})
|
|
this.$message({type: 'success', message: '角色添加成功'})
|
|
this.$router.push({
|
|
this.$router.push({
|