feat(outbound): 批量模式下支持点击整行切换选中状态
This commit is contained in:
@ -52,12 +52,15 @@
|
||||
/>
|
||||
|
||||
<el-table
|
||||
ref="tableRef"
|
||||
v-else
|
||||
:data="sortedSelectedItems"
|
||||
border
|
||||
style="width: 100%"
|
||||
row-key="uniqueKey"
|
||||
@selection-change="handleSelectionChange"
|
||||
@row-click="handleBulkRowClick"
|
||||
:row-class-name="getRowClassName"
|
||||
>
|
||||
<el-table-column v-if="isBulkMode" type="selection" width="55" align="center" />
|
||||
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||
@ -390,6 +393,7 @@ let stockSearchTimer: ReturnType<typeof setTimeout> | null = null
|
||||
|
||||
// 表格引用
|
||||
const manualTableRef = ref<InstanceType<typeof ElTable>>()
|
||||
const tableRef = ref<InstanceType<typeof ElTable>>()
|
||||
|
||||
// BOM 相关
|
||||
const bomOptions = ref<any[]>([])
|
||||
@ -725,6 +729,16 @@ const handleSelectionChange = (val: any[]) => {
|
||||
}
|
||||
}
|
||||
|
||||
const handleBulkRowClick = (row: any) => {
|
||||
if (isBulkMode.value && tableRef.value) {
|
||||
tableRef.value.toggleRowSelection(row, undefined)
|
||||
}
|
||||
}
|
||||
|
||||
const getRowClassName = () => {
|
||||
return isBulkMode.value ? 'bulk-clickable-row' : ''
|
||||
}
|
||||
|
||||
const cancelBulkMode = () => {
|
||||
isBulkMode.value = false
|
||||
selectedRows.value = []
|
||||
@ -858,4 +872,8 @@ const confirmExport = () => {
|
||||
.sig-label { font-size: 14px; margin-bottom: 40px; text-align: left; width: 100%; }
|
||||
.sig-line { border-bottom: 1px solid #000; width: 100%; height: 1px; display: block; }
|
||||
}
|
||||
|
||||
:deep(.bulk-clickable-row) {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user