fix: keep absent brief SMS content empty

This commit is contained in:
hectorzhao
2026-09-03 09:37:24 +08:00
parent fe5b25a7e4
commit 068b8047dd
4 changed files with 13 additions and 9 deletions
@@ -95,8 +95,10 @@ export class ReportChannelExportService {
const values = fields.map(
(field) => resolveExportValue(item.snapshot, field.code, field.name) ?? field.defaultValue ?? '',
);
const smsContentIndex = fields.findIndex((field) => field.name.trim() === '短信内容');
const smsContentValue = smsContentIndex >= 0 ? values[smsContentIndex] : '';
const smsContentField = fields.find((field) => field.name.trim() === '短信内容');
const smsContentValue = smsContentField
? resolveExportValue(item.snapshot, smsContentField.code, smsContentField.name) ?? ''
: '';
const smsContent = isFileRef(smsContentValue) ? '' : String(smsContentValue ?? '');
const missing = fields.filter((field, index) => field.required && !hasValue(values[index]));
const missingReason =