|
@@ -28,11 +28,16 @@
|
|
|
<a-icon type="upload"/>
|
|
|
新增导入
|
|
|
</a-button>
|
|
|
+ <a-button style="margin-left:8px;" type="primary" v-if="selectedRowKeys.length > 0" @click="batchDelete">
|
|
|
+ <a-icon type="delete"/>
|
|
|
+ 删除
|
|
|
+ </a-button>
|
|
|
<!-- <a-button style="margin-left: 8px" type="primary" icon="download" @click="doExport">导出</a-button>-->
|
|
|
</div>
|
|
|
<a-table
|
|
|
:data-source="data"
|
|
|
:columns="columns"
|
|
|
+ :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
|
|
tableLayout="auto"
|
|
|
rowKey="id">
|
|
|
<span slot="action" slot-scope="record">
|
|
@@ -113,6 +118,7 @@ export default {
|
|
|
modalTitle: null,
|
|
|
visible: false,
|
|
|
typeMap: {},
|
|
|
+ selectedRowKeys: [], // Check here to configure the default column
|
|
|
checkUserTypeMap: {},
|
|
|
actionTypeMap: {},
|
|
|
// 表头
|
|
@@ -171,6 +177,9 @@ export default {
|
|
|
this.checkUserTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_USER_TYPE)
|
|
|
},
|
|
|
methods: {
|
|
|
+ onSelectChange (selectedRowKeys) {
|
|
|
+ this.selectedRowKeys = selectedRowKeys
|
|
|
+ },
|
|
|
base (record) {
|
|
|
this.visible = true
|
|
|
this.model = record
|
|
@@ -215,16 +224,18 @@ export default {
|
|
|
handleCancel () {
|
|
|
this.visible = false
|
|
|
this.confirmLoading = false
|
|
|
+ this.selectedRowKeys = []
|
|
|
this.$emit('ok')
|
|
|
},
|
|
|
batchDelete (id) {
|
|
|
let ids = []
|
|
|
if (this.BaseTool.String.isBlank(id)) {
|
|
|
+ const length = this.selectedRowKeys.length
|
|
|
if (length === 0) {
|
|
|
- this.$message.info('请选择要删除的记录')
|
|
|
+ this.$message.info('请选择记录')
|
|
|
return
|
|
|
}
|
|
|
- ids = this.selectedRows.map(item => item.id)
|
|
|
+ ids = this.selectedRowKeys
|
|
|
} else {
|
|
|
ids = [id]
|
|
|
}
|