fix: 优化后台体验与导出日志交互

This commit is contained in:
Nixevol
2026-07-05 00:04:35 +08:00
parent 935375a904
commit 4122897725
44 changed files with 798 additions and 221 deletions
+5 -3
View File
@@ -19,6 +19,7 @@ import { StorageService } from '../storage/storage.service';
import { JobsService } from '../jobs/jobs.service';
import { BusinessException } from '../common/exceptions/business.exception';
import { buildPage } from '../common/utils/pagination.util';
import { buildOrderBy } from '../common/utils/sort.util';
import { AuthUser } from '../common/decorators/current-user.decorator';
import { OutboundDto } from './dto/outbound.dto';
import { QueryImportRowsDto } from './dto/import-session.dto';
@@ -95,7 +96,7 @@ export class OutboundService {
ws.columns = OUTBOUND_IMPORT_COLUMNS.map((c) => ({ header: c.header, key: c.key, width: c.key === 'outImages' ? 36 : 22 }));
ws.getRow(1).font = { bold: true };
ws.addRow({
shortCode: '请替换为真实短码1',
shortCode: '请替换为真实追溯码1',
batchNo: 'B20260704001',
outTime: '2026-07-04 10:00',
outImages: 'images/out-001.jpg',
@@ -105,7 +106,7 @@ export class OutboundService {
remark: '单图示例',
});
ws.addRow({
shortCode: '请替换为真实短码2',
shortCode: '请替换为真实追溯码2',
batchNo: 'B20260704001',
outTime: '2026-07-04 11:00',
outImages: 'images/out-002.png;images/out-003.jpg',
@@ -201,10 +202,11 @@ export class OutboundService {
await this.getSession(id, user);
const where: Prisma.OutboundImportRowWhereInput = { sessionId: id };
if (query.status) where.status = query.status as any;
const orderBy = buildOrderBy(query.sortField, query.sortOrder, ['outTime', 'createdAt'] as const, { rowNo: 'asc' });
const [list, total] = await this.prisma.$transaction([
this.prisma.outboundImportRow.findMany({
where,
orderBy: { rowNo: 'asc' },
orderBy,
skip: query.skip,
take: query.take,
}),