表格优化

This commit is contained in:
仲么了
2023-12-27 15:06:57 +08:00
parent d42936398e
commit b456881e6e
17 changed files with 115 additions and 74 deletions

View File

@@ -1,21 +1,23 @@
<template>
<el-table
<vxe-table
ref="tableRef"
class="ba-data-table w100"
header-cell-class-name="table-header-cell"
:data="tableStore.table.data"
:row-key="tableStore.pk"
:border="true"
v-loading="tableStore.table.loading"
stripe
@selection-change="onSelectionChange"
v-bind="$attrs"
:column-config="{resizable: true}"
:tree-config="{}"
>
<!-- Column 组件内部是 el-table-column -->
<Column
:attr="item"
:key="key + '-column'"
v-for="(item, key) in tableStore.table.column"
:tree-node='item.treeNode'
>
<!-- tableStore 预设的列 render 方案 -->
<template v-if="item.render" #default="scope">
@@ -23,20 +25,20 @@
:field="item"
:row="scope.row"
:column="scope.column"
:index="scope.$index"
:index="scope.rowIndex"
:key="
key +
'-' +
scope.$index +
scope.rowIndex +
'-' +
item.render +
'-' +
(item.prop ? '-' + item.prop + '-' + scope.row[item.prop] : '')
(item.field ? '-' + item.field + '-' + scope.row[item.field] : '')
"
/>
</template>
</Column>
</el-table>
</vxe-table>
<div v-if="props.pagination" class="table-pagination">
<el-pagination
:currentPage="tableStore.table.params!.pageNum"