fix 79617
This commit is contained in:
@@ -9,11 +9,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<j-table v-bind="$attrs"
|
<j-table v-bind="$attrs"
|
||||||
:scroll="{x: '100%'}"
|
:scroll="{x: '100%'}"
|
||||||
:pagination="false"
|
:pagination="ipagination"
|
||||||
:rowKey="(record,index)=>{return index}"
|
rowKey="tableRowKey"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:dataSource="realDataSource"
|
:dataSource="realDataSource"
|
||||||
:row-selection="needRowSelection ? { selectedRowKeys: selectedRowKeys, onChange: onSelectChange } : null">
|
:row-selection="needRowSelection ? { selectedRowKeys: selectedRowKeys, onChange: onSelectChange } : null"
|
||||||
|
@change="handleTableChange">
|
||||||
|
|
||||||
<template v-slot:file="{text, record, index}">
|
<template v-slot:file="{text, record, index}">
|
||||||
<!--会后资料,如果数据从流程来,就是查看,如果是新增的,就正常显示上传-->
|
<!--会后资料,如果数据从流程来,就是查看,如果是新增的,就正常显示上传-->
|
||||||
@@ -100,13 +101,28 @@ export default {
|
|||||||
],
|
],
|
||||||
selectedRowKeys: [],
|
selectedRowKeys: [],
|
||||||
realDataSource: [],
|
realDataSource: [],
|
||||||
uploadTable: {}
|
uploadTable: {},
|
||||||
|
/* 分页参数 */
|
||||||
|
ipagination: {
|
||||||
|
current: 1,
|
||||||
|
pageSize: 5,
|
||||||
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
dataSource: {
|
dataSource: {
|
||||||
handler (val) {
|
handler (val) {
|
||||||
this.realDataSource = JSON.parse(JSON.stringify(val))
|
this.realDataSource = JSON.parse(JSON.stringify(val)).map((item, index) => {
|
||||||
|
item.tableRowKey = index
|
||||||
|
return item
|
||||||
|
})
|
||||||
},
|
},
|
||||||
immediate: true,
|
immediate: true,
|
||||||
deep: true
|
deep: true
|
||||||
@@ -128,7 +144,8 @@ export default {
|
|||||||
content: this.$t('areYouSure'),
|
content: this.$t('areYouSure'),
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
const data = JSON.parse(JSON.stringify(this.realDataSource))
|
const data = JSON.parse(JSON.stringify(this.realDataSource))
|
||||||
this.selectedRowKeys.forEach(index => {
|
this.selectedRowKeys.forEach(tableRowKey => {
|
||||||
|
const index = data.findIndex(tt => tt && tt.tableRowKey === tableRowKey)
|
||||||
data[index] = null
|
data[index] = null
|
||||||
})
|
})
|
||||||
this.selectedRowKeys = []
|
this.selectedRowKeys = []
|
||||||
@@ -141,6 +158,7 @@ export default {
|
|||||||
this.selectedRowKeys = selectedRowKeys
|
this.selectedRowKeys = selectedRowKeys
|
||||||
},
|
},
|
||||||
formModalOk (lineData) {
|
formModalOk (lineData) {
|
||||||
|
lineData.tableRowKey = this.realDataSource.length
|
||||||
this.realDataSource.push(lineData)
|
this.realDataSource.push(lineData)
|
||||||
this.$emit('ok', this.realDataSource)
|
this.$emit('ok', this.realDataSource)
|
||||||
},
|
},
|
||||||
@@ -164,6 +182,9 @@ export default {
|
|||||||
},
|
},
|
||||||
handleView (record) {
|
handleView (record) {
|
||||||
this.$refs.formModal.view(record)
|
this.$refs.formModal.view(record)
|
||||||
|
},
|
||||||
|
handleTableChange (pagination) {
|
||||||
|
this.ipagination = pagination
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user