| | |
| | | </template> |
| | | </avue-crud> |
| | | |
| | | <!-- 分配角色穿梭框 --> |
| | | <!-- 分配成员穿梭框 --> |
| | | <transfer ref="transfer" :left-role-data="leftRoleData" :right-role-data="rightRoleData" |
| | | :transferTitle="transferTitle" title="角色添加成员" |
| | | @transferSend="roleSendHandler"> |
| | |
| | | refreshBtn: false, |
| | | addBtn: false, |
| | | menu: false, |
| | | header:false, |
| | | column: [ |
| | | { |
| | | label: '部门', |
| | |
| | | this.$refs.roleCrud, |
| | | this.lastIndex, |
| | | (newIndex) => { this.lastIndex = newIndex; }, |
| | | () => { this.selectList = []; } |
| | | () => { this.selectList = [row]; } |
| | | ); |
| | | }, |
| | | |
| | |
| | | rowSaveHandler(row, done, loading) { |
| | | delete row.roleClassifyText; |
| | | addRole(row).then(res => { |
| | | console.log(res) |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTableList(); |
| | |
| | | } |
| | | }).catch(err => { |
| | | loading(); |
| | | console.log(err); |
| | | }); |
| | | }, |
| | | |
| | |
| | | listUserUnInRoleOid({pkRole: this.selectList[0].oid}), |
| | | listUserByRoleOid({pkRole: this.selectList[0].oid}) |
| | | ]).then(([unInRoleRes, byRoleRes]) => { |
| | | this.leftRoleData=[]; |
| | | this.rightRoleData=[]; |
| | | if (unInRoleRes.data.code === 200 && byRoleRes.data.code === 200) { |
| | | const leftData = [...unInRoleRes.data.data, ...byRoleRes.data.data]; |
| | | // 组装好穿梭框可用数据 |
| | |
| | | this.rightRoleData = byRoleRes.data.data.map(item => item.oid); |
| | | this.$refs.transfer.visible = true; |
| | | } |
| | | }).catch(err => { |
| | | console.error(err); |
| | | }); |
| | | |
| | | }, |
| | |
| | | saveRight(params).then(res => { |
| | | this.$message.success(res.data.obj); |
| | | this.getTableList(); |
| | | }).catch(err => { |
| | | this.$message.error(err) |
| | | }) |
| | | }, |
| | | |
| | |
| | | return; |
| | | } |
| | | listUserByRoleOid({pkRole: this.selectList[0].oid}).then(res => { |
| | | console.log(res) |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data; |
| | | this.countData = data.map(item => { |
| | |
| | | }); |
| | | this.statisticsVisible = true; |
| | | } |
| | | }).catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | |