|
|
@ -4,7 +4,7 @@ |
|
|
|
<el-table class="multipleTableComponents" |
|
|
|
ref="TableBaseComponents_Ref" |
|
|
|
v-loading="tableLoading" |
|
|
|
:data="tableData" |
|
|
|
:data="showTableData()" |
|
|
|
:max-height="maxHeight" |
|
|
|
row-key="id" |
|
|
|
:border="border" |
|
|
@ -13,7 +13,7 @@ |
|
|
|
@row-click="handleTableSelect" |
|
|
|
> |
|
|
|
<!-- 删除按钮多选 --> |
|
|
|
<el-table-column fixed="left" type="selection" width="50" v-if="isShowReduceButtonSelection" /> |
|
|
|
<el-table-column fixed="left" type="selection" width="50" v-if="isShowReduceButtonSelection" :reserve-selection="true" /> |
|
|
|
<!-- 删除按钮 --> |
|
|
|
<el-table-column |
|
|
|
fixed="left" |
|
|
@ -26,10 +26,11 @@ |
|
|
|
<!-- 多选 --> |
|
|
|
<el-table-column |
|
|
|
fixed="left" |
|
|
|
v-if="selectionTable" |
|
|
|
:reserve-selection="true" |
|
|
|
type="selection" |
|
|
|
:width="50" |
|
|
|
v-if="selectionTable" |
|
|
|
|
|
|
|
/> |
|
|
|
<!-- 序号 --> |
|
|
|
<el-table-column |
|
|
@ -314,6 +315,15 @@ |
|
|
|
<ButtonBase :Butttondata="[defaultButtons.mainListDeleteBtn(),]" @button-base-click="handleDeleteTable (row, $index)" /> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<!-- :page-sizes="[ 10,20, 30, 50, 100]" sizes--> |
|
|
|
<el-pagination v-show="tableData.length>5" style="margin-top:10px" |
|
|
|
v-model:current-page="currentPage" |
|
|
|
v-model:page-size="pageSize" |
|
|
|
:small="true" |
|
|
|
:background="false" |
|
|
|
layout="total, prev, pager, next, jumper" |
|
|
|
:total="tableData.length" |
|
|
|
/> |
|
|
|
<div class="button flex" v-if="isShowButton||isShowReduceButtonSelection"> |
|
|
|
<div class="p-12px" v-if="isShowButton" @click="handleAddTable"> |
|
|
|
<Icon icon="ep:circle-plus" color="#409eff" size="26" style="cursor: pointer;" /> |
|
|
@ -453,6 +463,11 @@ const tableSelectionChange = (val) => { |
|
|
|
} |
|
|
|
const handleSelectionDelete = ()=>{ |
|
|
|
emit('tableSelectionDelete', deleteTableData.value) |
|
|
|
nextTick(()=>{ |
|
|
|
deleteTableData.value.forEach(row=>{ |
|
|
|
TableBaseComponents_Ref.value!.toggleRowSelection(row,false) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
// 列表排序 |
|
|
|
const tableSortChange = (column, prop, order) => { |
|
|
@ -497,6 +512,9 @@ const validateForm = () => { |
|
|
|
// 删除数据 |
|
|
|
const handleDeleteTable = (row, index) => { |
|
|
|
emit('handleDeleteTable', row, index) |
|
|
|
nextTick(()=>{ |
|
|
|
TableBaseComponents_Ref.value!.toggleRowSelection(row,false) |
|
|
|
}) |
|
|
|
} |
|
|
|
// 添加数据 |
|
|
|
const handleAddTable = () => { |
|
|
@ -521,6 +539,16 @@ const buttonOperationClick = (row, label, index)=> { |
|
|
|
emit("buttonOperationClick", row, label, index); |
|
|
|
} |
|
|
|
|
|
|
|
const currentPage =ref(1) |
|
|
|
const pageSize = ref(10) |
|
|
|
const showTableData = ()=>{ |
|
|
|
console.log('props.tableData',props.tableData) |
|
|
|
if(props.tableData.length>100){ |
|
|
|
return props.tableData.slice((currentPage.value-1)*pageSize.value,currentPage.value*pageSize.value) |
|
|
|
}else{ |
|
|
|
return props.tableData |
|
|
|
} |
|
|
|
} |
|
|
|
// setup 语法糖 抛出方法 |
|
|
|
defineExpose({ |
|
|
|
TableBaseComponents_Ref, |
|
|
|