| | |
| | | @row-del="rowDeleteHandler" |
| | | > |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button icon="el-icon-delete" plain size="small" type="danger" @click="allDelHandler">删除</el-button> |
| | | <el-button icon="el-icon-school" plain size="small" type="primary" @click="assignMembersHandler">分配成员 |
| | | <el-button v-if="permissionList.delBtn" icon="el-icon-delete" plain size="small" type="danger" |
| | | @click="allDelHandler">删除 |
| | | </el-button> |
| | | <el-button icon="el-icon-user" plain size="small" type="primary" @click="statisticsHandler">统计</el-button> |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadRole">导入角色</el-button> |
| | | <el-button icon="el-icon-download" plain size="small" type="primary">导出</el-button> |
| | | <el-button v-if="permissionList.assignMembersBtn" icon="el-icon-school" plain size="small" type="primary" |
| | | @click="assignMembersHandler">分配成员 |
| | | </el-button> |
| | | <el-button v-if="permissionList.statisticsBtn" icon="el-icon-user" plain size="small" type="primary" |
| | | @click="statisticsHandler">统计 |
| | | </el-button> |
| | | <el-button v-if="permissionList.importRoleBtn" icon="el-icon-upload2" plain size="small" type="primary" |
| | | @click="upLoadRole">导入角色 |
| | | </el-button> |
| | | <el-button v-if="permissionList.exportBtn" icon="el-icon-download" plain size="small" type="primary">导出 |
| | | </el-button> |
| | | </template> |
| | | |
| | | <template slot="roleClassifyText" slot-scope="{row}"> |
| | |
| | | import basicOption from "@/util/basic-option"; |
| | | import {column} from "@/views/system/role/option"; |
| | | import func from "@/util/func"; |
| | | import {mapGetters} from "vuex"; |
| | | |
| | | export default { |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | tableData: [], |
| | | option: { |
| | | ...basicOption, |
| | | dialogTop: 0, |
| | | dialogWidth: '30%', |
| | | column: column, |
| | | calcHeight: -60, |
| | | }, |
| | | page: { |
| | | currentPage: 1, |
| | | pageSize: 10, |
| | |
| | | refreshBtn: false, |
| | | addBtn: false, |
| | | menu: false, |
| | | header: false, |
| | | column: [ |
| | | { |
| | | label: '部门', |
| | |
| | | upFileType: ['xls', 'xlsx'], |
| | | fileUrl: 'api/roleQueryController/importRole', |
| | | tipList: ["角色导入只有 名称 和 描述 两列,且名称为必输项不能为空"] |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission[this.$route.query.id].ADD, false), |
| | | delBtn: this.vaildData(this.permission[this.$route.query.id].DELETE, false), |
| | | editBtn: this.vaildData(this.permission[this.$route.query.id].EDIT, false), |
| | | exportBtn: this.vaildData(this.permission[this.$route.query.id].EXPORT, false), |
| | | assignMembersBtn: this.vaildData(this.permission[this.$route.query.id].assignMembers, false), |
| | | importRoleBtn: this.vaildData(this.permission[this.$route.query.id].importRole, false), |
| | | statisticsBtn: this.vaildData(this.permission[this.$route.query.id].statistics, false), |
| | | }; |
| | | }, |
| | | option() { |
| | | return { |
| | | ...basicOption, |
| | | addBtn: this.permissionList.addBtn, |
| | | delBtn: this.permissionList.delBtn, |
| | | editBtn: this.permissionList.editBtn, |
| | | dialogTop: 0, |
| | | dialogWidth: '30%', |
| | | column: column, |
| | | calcHeight: -60, |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | row, |
| | | this.$refs.roleCrud, |
| | | this.lastIndex, |
| | | (newIndex) => { this.lastIndex = newIndex; }, |
| | | () => { this.selectList = []; } |
| | | (newIndex) => { |
| | | this.lastIndex = newIndex; |
| | | }, |
| | | () => { |
| | | 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]; |
| | | // 组装好穿梭框可用数据 |
| | |
| | | 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) |
| | | }) |
| | | }, |
| | | |