|
@@ -5,6 +5,7 @@
|
|
|
:needPage="false"
|
|
:needPage="false"
|
|
|
:columns="columns"
|
|
:columns="columns"
|
|
|
:datasource="datasource"
|
|
:datasource="datasource"
|
|
|
|
|
+ :selection.sync="selection"
|
|
|
cache-key="systemRoleTable21"
|
|
cache-key="systemRoleTable21"
|
|
|
>
|
|
>
|
|
|
<!-- 表头工具栏 -->
|
|
<!-- 表头工具栏 -->
|
|
@@ -18,6 +19,16 @@
|
|
|
>
|
|
>
|
|
|
新增
|
|
新增
|
|
|
</el-button>
|
|
</el-button>
|
|
|
|
|
+
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ @click="handAllDel"
|
|
|
|
|
+ icon="el-icon-delete"
|
|
|
|
|
+ type="danger"
|
|
|
|
|
+ >
|
|
|
|
|
+ 删除
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+
|
|
|
</template>
|
|
</template>
|
|
|
<!-- 操作列 -->
|
|
<!-- 操作列 -->
|
|
|
<template v-slot:action="{ row }">
|
|
<template v-slot:action="{ row }">
|
|
@@ -59,12 +70,20 @@
|
|
|
data () {
|
|
data () {
|
|
|
return {
|
|
return {
|
|
|
columns: [
|
|
columns: [
|
|
|
|
|
+ {
|
|
|
|
|
+ columnKey: 'selection',
|
|
|
|
|
+ type: 'selection',
|
|
|
|
|
+ width: 45,
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ fixed: 'left'
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
{
|
|
{
|
|
|
width: 45,
|
|
width: 45,
|
|
|
type: 'index',
|
|
type: 'index',
|
|
|
columnKey: 'index',
|
|
columnKey: 'index',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
- fixed:'left'
|
|
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'name',
|
|
prop: 'name',
|
|
@@ -91,7 +110,8 @@
|
|
|
],
|
|
],
|
|
|
datasource: [],
|
|
datasource: [],
|
|
|
|
|
|
|
|
- deleteUserIds: []
|
|
|
|
|
|
|
+ deleteUserIds: [],
|
|
|
|
|
+ selection: []
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -104,6 +124,24 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
|
|
+ handAllDel() {
|
|
|
|
|
+ console.log(this.selection);
|
|
|
|
|
+ console.log(this.datasource)
|
|
|
|
|
+
|
|
|
|
|
+ this.selection.forEach((e) => {
|
|
|
|
|
+ this.datasource.forEach((f,i) => {
|
|
|
|
|
+ if(e.id == f.id){
|
|
|
|
|
+ this.datasource.splice(i, 1);
|
|
|
|
|
+ this.deleteUserIds.push((f.id));
|
|
|
|
|
+ this.$emit('deleteIds', this.deleteUserIds);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
handlAdd () {
|
|
handlAdd () {
|
|
|
this.$refs.staffSelection.open(
|
|
this.$refs.staffSelection.open(
|
|
|
JSON.parse(JSON.stringify(this.datasource))
|
|
JSON.parse(JSON.stringify(this.datasource))
|