|
|
@ -61,6 +61,7 @@ export default defineComponent({ |
|
|
|
default: () => [] |
|
|
|
}, |
|
|
|
searchTableSelectionsList:[],//回显列表 |
|
|
|
selectionColor: propTypes.bool.def(false), |
|
|
|
}, |
|
|
|
emits: ['update:pageSize', 'update:currentPage', 'register', 'update:sort','getSelectionRows'], |
|
|
|
setup(props, { attrs, slots, emit, expose }) { |
|
|
@ -369,6 +370,13 @@ export default defineComponent({ |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
const selectionBg = ({row}) => { |
|
|
|
if (unref(getProps).selectionColor&&elTableRef.value?.getSelectionRows().includes(row)) { |
|
|
|
return 'selectionRow' |
|
|
|
} |
|
|
|
return 'tableRow' |
|
|
|
} |
|
|
|
|
|
|
|
return () => ( |
|
|
|
<div v-loading={unref(getProps).loading}> |
|
|
|
<ElTable default-expand-all={true} |
|
|
@ -376,7 +384,7 @@ export default defineComponent({ |
|
|
|
ref={elTableRef} |
|
|
|
data={unref(getProps).data} |
|
|
|
header-cell-class-name="tableHeader" |
|
|
|
row-class-name="tableRow" |
|
|
|
row-class-name={selectionBg} |
|
|
|
cell-class-name="tableRow" |
|
|
|
onSelect={selectRow} |
|
|
|
onSelect-all={selectAll} |
|
|
@ -418,6 +426,10 @@ export default defineComponent({ |
|
|
|
--el-bg-color:#f5f5f5; |
|
|
|
} |
|
|
|
|
|
|
|
.el-table .selectionRow{ |
|
|
|
--el-table-tr-bg-color: var(--el-color-primary-light-9); |
|
|
|
} |
|
|
|
|
|
|
|
</style> |
|
|
|
<style lang="scss" scoped> |
|
|
|
:deep(.el-button.is-text) { |
|
|
|