roleslistdiglog.vue
2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<template>
<Dialog
:title="title"
class="tableClass"
:show.sync="visible"
:width="'715px'"
@close="close()"
>
<template slot="content">
<lb-table
ref="multipleTable"
:pagination="false"
:column="tableData.column"
:data="tableData.data"
@selection-change="handleSelectionChange"
>
</lb-table>
</template>
<template slot="footer">
<el-button type="primary" class="save" @click="handleSaveMember()"
>保存</el-button
>
<el-button class="cancel-button" @click="close()">取消</el-button>
</template>
</Dialog>
</template>
<script>
import Dialog from "@/components/Dialog/";
export default {
name: "",
components: { Dialog },
data() {
return {
title: "人员配置",
visible: false,
hasSelectList: [
// {
// name: "管理员",
// loginName: "admin1",
// departmentName: "研发部",
// jobLevel: null,
// },
// {
// name: "测试账号",
// loginName: "admin2",
// departmentName: "研发部",
// jobLevel: null,
// },
], //已经选择的id组成的数组
tableData: {
column: [
{
type: "selection",
},
{
prop: "name",
label: "姓名",
},
{
prop: "loginName",
label: "用户名",
},
{
prop: "departmentName",
label: "部门",
},
{
prop: "jobLevel",
label: "职务",
},
],
data: [],
// 角色id
roleId:""
},
multipleSelection: [],
};
},
computed: {},
created() {},
mounted() {},
methods: {
adds(a,roleId) {
this.roleId=roleId
this.visible = true;
console.log("a",a);
this.tableData.data=a
this.tableData.data.forEach((item, index) => {
if (item.selectStatus === 0) {
this.$nextTick(() => {
this.$refs.multipleTable.toggleRowSelection(
this.tableData.data[index],
true
);
});
}
});
},
close() {
this.visible = false;
},
// 保存
handleSaveMember() {
let arrlist= this.tableData.data.filter((item) => {
return item.selectStatus==0
})
const idList = arrlist.map((item) => {
return item.id
})
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
},
};
</script>
<style scoped lang="scss">
/deep/.el-dialog__header {
text-align: center;
margin-bottom: 10px;
.el-dialog__title {
color: white;
}
}
</style>