Compare commits
No commits in common. "5ff9c588cb1c6b5c88f37ca6b08d8c76655d31b4" and "1725c1857108e2daddd9d4eda065378ea5beb1d8" have entirely different histories.
5ff9c588cb
...
1725c18571
@ -33,11 +33,7 @@
|
|||||||
@selection-change="handleSelectionChange"
|
@selection-change="handleSelectionChange"
|
||||||
>
|
>
|
||||||
<!-- 树形展开 -->
|
<!-- 树形展开 -->
|
||||||
<el-table-column
|
<el-table-column v-if="tree" type="expand">
|
||||||
v-if="tree"
|
|
||||||
type="expand"
|
|
||||||
:header-class-name="headerCellClassName"
|
|
||||||
>
|
|
||||||
<template #default="props">
|
<template #default="props">
|
||||||
<slot name="tree" :row="props.row"></slot>
|
<slot name="tree" :row="props.row"></slot>
|
||||||
</template>
|
</template>
|
||||||
@ -50,15 +46,8 @@
|
|||||||
width="30"
|
width="30"
|
||||||
align="center"
|
align="center"
|
||||||
fixed
|
fixed
|
||||||
:header-class-name="headerCellClassName"
|
|
||||||
/>
|
/>
|
||||||
<el-table-column
|
<el-table-column label="排序" width="50" v-if="showSort" fixed>
|
||||||
label="排序"
|
|
||||||
width="50"
|
|
||||||
v-if="showSort"
|
|
||||||
fixed
|
|
||||||
:header-class-name="headerCellClassName"
|
|
||||||
>
|
|
||||||
<template #default="{ $index }">
|
<template #default="{ $index }">
|
||||||
{{ (currentPage - 1) * pageSize + $index + 1 }}
|
{{ (currentPage - 1) * pageSize + $index + 1 }}
|
||||||
</template>
|
</template>
|
||||||
@ -208,15 +197,9 @@ const props = defineProps({
|
|||||||
type: Function,
|
type: Function,
|
||||||
default: () => "",
|
default: () => "",
|
||||||
},
|
},
|
||||||
// 设置表格行的主键,获取主键集合时用,默认主键为id
|
|
||||||
rowkey: {
|
rowkey: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: "",
|
||||||
},
|
|
||||||
// 动态控制表格的最低高度,无数据时的最小值
|
|
||||||
minHeight: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: '300px',
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -260,9 +243,7 @@ const handleCurrentChange = (val) => {
|
|||||||
|
|
||||||
// 多选框变化
|
// 多选框变化
|
||||||
const handleSelectionChange = (selection) => {
|
const handleSelectionChange = (selection) => {
|
||||||
const selectedIds = selection.map((row) =>
|
const selectedIds = selection.map((row) => props.rowkey == "" ? row.id : row[props.rowkey]);
|
||||||
props.rowkey == "" ? row.id : row[props.rowkey]
|
|
||||||
);
|
|
||||||
emit("selection-change", selection, selectedIds);
|
emit("selection-change", selection, selectedIds);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -307,11 +288,6 @@ onBeforeUnmount(() => {
|
|||||||
height: 100%; /* 关键:继承父容器高度 */
|
height: 100%; /* 关键:继承父容器高度 */
|
||||||
overflow: hidden; /* 防止内容溢出 */
|
overflow: hidden; /* 防止内容溢出 */
|
||||||
|
|
||||||
// 动态控制表格的最低高度,无数据时的最小值
|
|
||||||
:deep(.el-scrollbar__wrap) {
|
|
||||||
min-height: v-bind('props.minHeight');
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 表格弹性布局 */
|
/* 表格弹性布局 */
|
||||||
:deep(.el-table) {
|
:deep(.el-table) {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
@ -374,9 +350,6 @@ onBeforeUnmount(() => {
|
|||||||
color: #999;
|
color: #999;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
/* 自定义单元格样式 */
|
|
||||||
:deep(.custom-cell) {
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.el-pagination) {
|
:deep(.el-pagination) {
|
||||||
/* 整体分页样式 */
|
/* 整体分页样式 */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user