[update] 修改bug80276

This commit is contained in:
lideqin
2024-01-12 11:46:56 +08:00
parent 46be7892ad
commit 92482c305f
11 changed files with 323 additions and 62 deletions
@@ -32,11 +32,12 @@
:can-drag="true"
:scroll="{x: '100%'}"
ref="table"
rowKey="id"
:rowKey="(record, index) => { return (Number(this.ipagination.current) - 1) * Number(this.ipagination.pageSize) + index }"
:columns="columns"
:dataSource="dataSource"
:pagination="false"
:loading="loading">
:pagination="ipagination"
:loading="loading"
@change="handleTableChange">
<!-- 操作栏 -->
<div slot="action" slot-scope="{record, index}" class="action-span-cell">
@@ -68,6 +69,18 @@ export default {
},
data () {
return {
/* 分页参数 */
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('workCenter.enStandardRevision.draftingUnit'),
@@ -145,14 +158,17 @@ export default {
processNameChange (value) {
this.$emit('processNameChange', value)
},
handleTableChange (pagination) {
this.ipagination = pagination
},
handleAdd () {
this.modalType = 'add'
this.$refs.addEditDrafterDrawer.add()
},
// 编辑
handleEdit (record, index) {
console.log(index)
this.modalType = 'edit' + '-' + index
const dataIndex = (Number(this.ipagination.current) - 1) * Number(this.ipagination.pageSize) + index
this.modalType = 'edit' + '-' + dataIndex
this.$refs.addEditDrafterDrawer.edit(record)
},
// 删除
@@ -161,7 +177,8 @@ export default {
title: this.$t('confirmDeletion'),
content: this.$t('areYouSure'),
onOk: () => {
this.dataSource.splice(index, 1)
const dataIndex = (Number(this.ipagination.current) - 1) * Number(this.ipagination.pageSize) + index
this.dataSource.splice(dataIndex, 1)
}
})
},