Browse Source

Merge remote-tracking branch 'remotes/origin/intex_online20250410' into intex

intex_onlin20250418
songguoqiang 6 days ago
parent
commit
12ae89deec
  1. 10
      src/components/Table/src/TableV2.vue

10
src/components/Table/src/TableV2.vue

@ -15,7 +15,7 @@
</template> </template>
</el-auto-resizer> </el-auto-resizer>
<div class="mt-15px float-left" style='height:32px;line-height:32px'>已选{{ selections.length }}条数据</div> <div class="mt-15px float-left" style='height:32px;line-height:32px'>已选{{ selections.length }}条数据</div>
<el-pagination v-model:current-page="currentPageRef" v-model:page-size="pageSizeRef" class="float-right mt-15px" layout="total, sizes, prev, pager, next, jumper" :total="total" :page-sizes="[200,500,1000,2000]"/> <el-pagination v-model:current-page="currentPageRef" v-model:page-size="pageSizeRef" class="float-right mt-15px" layout="total, sizes, prev, pager, next, jumper" :total="total" :page-sizes="[200,500,1000]"/>
</div> </div>
</template> </template>
@ -172,18 +172,22 @@ const selections = ref([])
// const selections = computed(()=>mData.value.filter(item=>item.checked)) // const selections = computed(()=>mData.value.filter(item=>item.checked))
// / // /
const toggleAllSelection = (isAll)=>{ const toggleAllSelection = (isAll)=>{
if(isAll){
//
mData.value.forEach((row) => { mData.value.forEach((row) => {
row.checked = isAll row.checked = isAll
}) })
//
selections.value = selections.value.filter(item=>mData.value.findIndex(item1=>item1.id==item.id)==-1)
if(isAll){
selections.value = [...selections.value,...mData.value]
} }
} }
const togglePageSelection = (isAll)=>{ const togglePageSelection = (isAll)=>{
selections.value = selections.value.filter(item=>mData.value.findIndex(item1=>item1.id==item.id)==-1)
mData.value.forEach((row) => { mData.value.forEach((row) => {
row.checked = !row.checked row.checked = !row.checked
}) })
selections.value = [...selections.value,...mData.value.filter(item=>item.checked)]
} }

Loading…
Cancel
Save