[update] 修改bug80276
This commit is contained in:
+44
-6
@@ -17,12 +17,13 @@
|
||||
:can-drag="true"
|
||||
:scroll="{x: '100%'}"
|
||||
ref="table"
|
||||
rowKey="espId"
|
||||
:rowKey="(record, index) => { return (Number(this.ipagination.current) - 1) * Number(this.ipagination.pageSize) + index }"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="false"
|
||||
:pagination="ipagination"
|
||||
:loading="loading"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}">
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
@change="handleTableChange">
|
||||
|
||||
<!-- 企标编号/企标名称 -->
|
||||
<template v-slot:toDetail="{text, record}">
|
||||
@@ -68,6 +69,18 @@ export default {
|
||||
data () {
|
||||
return {
|
||||
loading: false,
|
||||
/* 分页参数 */
|
||||
ipagination: {
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
pageSizeOptions: ['10', '30', '50', '100', '150', '200'],
|
||||
showTotal: (total, range) => {
|
||||
return range[0] + '-' + range[1] + ' ' + this.$t('total') + total + this.$t('strip')
|
||||
},
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
total: 0
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('serialNumber'),
|
||||
@@ -181,6 +194,9 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
handleTableChange (pagination) {
|
||||
this.ipagination = pagination
|
||||
},
|
||||
// 表格选中
|
||||
onSelectChange (selectedRowKeys, selectionRows) {
|
||||
this.selectedRowKeys = selectedRowKeys
|
||||
@@ -203,17 +219,39 @@ export default {
|
||||
},
|
||||
// 编辑
|
||||
handleEdit (record, index) {
|
||||
this.modalType = 'edit' + index
|
||||
const dataIndex = (Number(this.ipagination.current) - 1) * Number(this.ipagination.pageSize) + index
|
||||
this.modalType = 'edit' + ',' + dataIndex
|
||||
this.$refs.changeBaseInfoDrawer.edit(record)
|
||||
this.$refs.changeBaseInfoDrawer.title = this.$t('edit')
|
||||
},
|
||||
// 删除
|
||||
handleDelete (id, index) {
|
||||
this.dataSource.splice(index, 1)
|
||||
this.$confirm({
|
||||
title: this.$t('confirmDeletion'),
|
||||
content: this.$t('areYouSure'),
|
||||
onOk: () => {
|
||||
const dataIndex = (Number(this.ipagination.current) - 1) * Number(this.ipagination.pageSize) + index
|
||||
this.dataSource.splice(dataIndex, 1)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 批量删除
|
||||
batchDel () {
|
||||
this.dataSource = this.dataSource.filter(item => !this.selectedRowKeys.includes(item.espId))
|
||||
if (this.selectedRowKeys.length <= 0) {
|
||||
this.$message.warning(this.$t('selectARecord'))
|
||||
return
|
||||
}
|
||||
this.$confirm({
|
||||
title: this.$t('confirmBatchDeletion'),
|
||||
content: this.$t('deleteAData'),
|
||||
onOk: () => {
|
||||
for (let i = 0; i < this.selectedRowKeys.length; i++) {
|
||||
this.dataSource.splice(this.selectedRowKeys[i], 1, false)
|
||||
}
|
||||
this.dataSource = this.dataSource.filter(item => !!item)
|
||||
this.selectedRowKeys = []
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user