|
|
|
|
@ -1,16 +1,22 @@
@@ -1,16 +1,22 @@
|
|
|
|
|
<template> |
|
|
|
|
<div class="edfs-table-components"> |
|
|
|
|
<el-table :data="data" :fit="fit" :stripe="stripe" :border="border" v-loading="loading" :show-header="showHeader" |
|
|
|
|
:max-height="maxHeight" :highlight-current-row="highlightCurrentRow" :row-class-name="rowClassName" |
|
|
|
|
@current-change="onCurrentChange" ref="ELTableRef" @row-click="onRowClick" @row-dblclick="onRowDblclick" |
|
|
|
|
@selection-change="handleSelectionChange" @expand-change="expandChange" class="edfs-table" |
|
|
|
|
<el-table :data="data" :fit="fit" :stripe="stripe" :border="border" v-loading="loading" |
|
|
|
|
:show-header="showHeader" |
|
|
|
|
:max-height="maxHeight" :highlight-current-row="highlightCurrentRow" |
|
|
|
|
:row-class-name="rowClassName" |
|
|
|
|
@current-change="onCurrentChange" ref="ELTableRef" @row-click="onRowClick" |
|
|
|
|
@row-dblclick="onRowDblclick" |
|
|
|
|
@selection-change="handleSelectionChange" @expand-change="expandChange" |
|
|
|
|
class="edfs-table" |
|
|
|
|
:span-method="spanMethod"> |
|
|
|
|
<slot></slot> |
|
|
|
|
</el-table> |
|
|
|
|
<template v-if="usePaging"> |
|
|
|
|
<div class="pagination-block"> |
|
|
|
|
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :width-type="1" |
|
|
|
|
layout="prev, pager, next, jumper" :total="pageTotal" background @current-change="onPageCurrentChange" /> |
|
|
|
|
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" |
|
|
|
|
:width-type="1" |
|
|
|
|
layout="prev, pager, next,total, jumper" :total="pageTotal" background |
|
|
|
|
@current-change="onPageCurrentChange"/> |
|
|
|
|
|
|
|
|
|
<!-- @size-change="onPageSizeChange" --> |
|
|
|
|
</div> |
|
|
|
|
@ -45,9 +51,11 @@ const emit = defineEmits<{
@@ -45,9 +51,11 @@ const emit = defineEmits<{
|
|
|
|
|
function onCurrentChange(currentRow: any, oldCurrentRow: any) { |
|
|
|
|
emit('current-change', currentRow, oldCurrentRow) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function onRowClick(row: any, column: any, event: Event) { |
|
|
|
|
emit('row-click', row, column, event) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function onRowDblclick(row: any, column: any, event: Event) { |
|
|
|
|
emit('row-dblclick', row, column, event) |
|
|
|
|
} |
|
|
|
|
@ -55,6 +63,7 @@ function onRowDblclick(row: any, column: any, event: Event) {
@@ -55,6 +63,7 @@ function onRowDblclick(row: any, column: any, event: Event) {
|
|
|
|
|
function handleSelectionChange(selection: any[]) { |
|
|
|
|
emit('selection-change', selection) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function expandChange(row: any, expandedRows: any[]) { |
|
|
|
|
emit('expand-change', row, expandedRows) |
|
|
|
|
} |
|
|
|
|
@ -92,6 +101,7 @@ function getSize() {
@@ -92,6 +101,7 @@ function getSize() {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const ELTableRef = ref<InstanceType<typeof ElTable>>() |
|
|
|
|
|
|
|
|
|
function clearSelection() { |
|
|
|
|
ELTableRef.value?.clearSelection() |
|
|
|
|
} |
|
|
|
|
|