|
|
|
@ -309,7 +309,7 @@ |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<Sign ref="signRef" @callback="doChangRoleUser" /> |
|
|
|
<Sign ref="signRef" @callback="doSign" /> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
@ -416,7 +416,10 @@ export default { |
|
|
|
|
|
|
|
oldIdList:[] |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
operate:'', |
|
|
|
currRow:{} |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
@ -482,8 +485,22 @@ export default { |
|
|
|
}, |
|
|
|
// 角色状态修改 |
|
|
|
handleStatusChange(row) { |
|
|
|
changeRoleStatus(row.roleId, row.status === "0"?'1':'0').then(response => { |
|
|
|
this.operate = "disable" |
|
|
|
this.currRow = row |
|
|
|
this.$refs.signRef.show( |
|
|
|
row.status === "0"?this.$t('page.system.role.disable'):this.$t('page.system.role.enable'), |
|
|
|
row.status === "0"?this.$t('page.system.role.disable'):this.$t('page.system.role.enable'), |
|
|
|
) |
|
|
|
}, |
|
|
|
// 角色状态修改 |
|
|
|
doHandleStatusChange(sign) { |
|
|
|
this.$modal.loading() |
|
|
|
let row = this.currRow |
|
|
|
changeRoleStatus({role:{roleId:row.roleId, status:row.status === "0"?'1':'0'},sign:sign}).then(response => { |
|
|
|
this.$refs.signRef.cancel() |
|
|
|
this.getList() |
|
|
|
}).finally(()=>{ |
|
|
|
this.$modal.closeLoading() |
|
|
|
}) |
|
|
|
|
|
|
|
// let text = row.status === "0" ? "启用" : "停用" |
|
|
|
@ -655,24 +672,42 @@ export default { |
|
|
|
this.$modal.loading() |
|
|
|
if (this.form.roleId != undefined) { |
|
|
|
this.form.menuIds = this.getMenuAllCheckedKeys() |
|
|
|
updateRole(this.form).then(response => { |
|
|
|
this.open = false |
|
|
|
this.getList() |
|
|
|
}).finally(()=>{ |
|
|
|
this.$modal.closeLoading() |
|
|
|
}) |
|
|
|
this.operate = "update" |
|
|
|
this.$refs.signRef.show( |
|
|
|
this.$t('page.system.role.modifyRole'), |
|
|
|
this.$t('page.system.role.modifyRole'), |
|
|
|
) |
|
|
|
} else { |
|
|
|
this.form.menuIds = this.getMenuAllCheckedKeys() |
|
|
|
addRole(this.form).then(response => { |
|
|
|
this.open = false |
|
|
|
this.getList() |
|
|
|
}).finally(()=>{ |
|
|
|
this.$modal.closeLoading() |
|
|
|
}) |
|
|
|
this.operate = "add" |
|
|
|
this.$refs.signRef.show( |
|
|
|
this.$t('page.system.role.addRole'), |
|
|
|
this.$t('page.system.role.addRole'), |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
doAdd(sign){ |
|
|
|
this.$modal.loading() |
|
|
|
addRole({role:this.form,sign:sign}).then(response => { |
|
|
|
this.$refs.signRef.cancel() |
|
|
|
this.open = false |
|
|
|
this.getList() |
|
|
|
}).finally(()=>{ |
|
|
|
this.$modal.closeLoading() |
|
|
|
}) |
|
|
|
}, |
|
|
|
doUpdate(sign){ |
|
|
|
this.$modal.loading() |
|
|
|
updateRole({role:this.form,sign:sign}).then(response => { |
|
|
|
this.$refs.signRef.cancel() |
|
|
|
this.open = false |
|
|
|
this.getList() |
|
|
|
}).finally(()=>{ |
|
|
|
this.$modal.closeLoading() |
|
|
|
}) |
|
|
|
}, |
|
|
|
/** 提交按钮(数据权限) */ |
|
|
|
submitDataScope: function() { |
|
|
|
if (this.form.roleId != undefined) { |
|
|
|
@ -736,6 +771,7 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
if(update){ |
|
|
|
this.operate = 'allocated' |
|
|
|
this.$refs.signRef.show( |
|
|
|
this.$t('page.system.role.fpjs'), |
|
|
|
this.$t('page.system.role.fpjs'), |
|
|
|
@ -752,7 +788,21 @@ export default { |
|
|
|
}).finally(()=>{ |
|
|
|
this.$modal.closeLoading() |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
doSign(val){ |
|
|
|
if(this.operate==='update'){ |
|
|
|
this.doUpdate(val) |
|
|
|
} |
|
|
|
if(this.operate==='add'){ |
|
|
|
this.doAdd(val) |
|
|
|
} |
|
|
|
if(this.operate==='disable'){ |
|
|
|
this.doHandleStatusChange(val) |
|
|
|
} |
|
|
|
if(this.operate==='allocated'){ |
|
|
|
this.doChangRoleUser(val) |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|