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