Browse Source

feat:[模板管理][表格多行删除]

ouqian
HanLong 1 month ago
parent
commit
3c3bceb4f9
2 changed files with 14 additions and 7 deletions
  1. +9
    -1
      src/components/Template/CustomTable.vue
  2. +5
    -6
      src/views/business/comps/template/comps/pcr/PCR008.vue

+ 9
- 1
src/components/Template/CustomTable.vue View File

@ -73,7 +73,7 @@
</div>
</template>
<!--
<!--
<template v-else-if="col.bodyType === 'select'">
<div class="flex flex1">
<HandleFormItem :fieldKey="prefixKey + '_' + col.prop + '_' + rowIndex"
@ -811,6 +811,14 @@ export default {
this.localDataSource.splice(rowIndex, 1);
this.$emit('row-delete', rowIndex);
},
deleteRows(rowsIndex) {
rowsIndex.sort((a, b) => b - a);
rowsIndex.forEach(index => {
this.localDataSource.splice(index, 1);
this.$emit('row-delete', index);
});
},
// formData
updateDataSource(dataSource = []) {
this.oldLocalDataSource = JSON.parse(JSON.stringify(this.localDataSource));

+ 5
- 6
src/views/business/comps/template/comps/pcr/PCR008.vue View File

@ -231,17 +231,16 @@ export default {
methods: {
onClickDelete() {
this.$modal.confirm(this.$t('form.confirmDelete')).then(() => {
//this.$refs.stepTableRef.deleteRow()
this.deleteRow.forEach(item => {
this.$refs.stepTableRef.deleteRow(item)
})
this.$refs.stepTableRef.deleteRows(this.deleteRows)
this.$refs.stepTableRef.justUpdateFilledFormData();
}).catch(() => { });
},
handleSelectionChange(row) {
this.deleteRow = []
this.deleteRows = []
row.forEach(item => {
this.deleteRow.push(item.rowIndex)
this.deleteRows.push(item.rowIndex)
})
},
//

Loading…
Cancel
Save