refactor(权限设置): 增加全选操作

This commit is contained in:
shiziyuan9527 2021-06-01 18:13:41 +08:00 committed by 刘瑞斌
parent 3b3cf79efc
commit 45962b5e1e
1 changed files with 12 additions and 0 deletions

View File

@ -35,6 +35,15 @@
<group-permission :permissions="scope.row.permissions" :selected.sync="tableData"/> <group-permission :permissions="scope.row.permissions" :selected.sync="tableData"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
width="50px"
label="全选">
<template v-slot:default="scope">
<div style="text-align: center;">
<el-checkbox @change="handleSelectAll($event, scope.row.permissions)"/>
</div>
</template>
</el-table-column>
</el-table> </el-table>
</div> </div>
<el-button type="primary" @click="onSubmit" size="small" style="margin-top: 10px;margin-left: 5px;">确定</el-button> <el-button type="primary" @click="onSubmit" size="small" style="margin-top: 10px;margin-left: 5px;">确定</el-button>
@ -142,6 +151,9 @@ export default {
} }
} }
}, },
handleSelectAll(check, permissions) {
permissions.map(p => p.checked = check);
}
} }
} }
</script> </script>