execl问题修复
This commit is contained in:
@@ -100,7 +100,7 @@ const persistedExtensionResultVersions = new Map();
|
||||
let taskCreateInProgress = false;
|
||||
const AUTO_HANDOFF_RETRY_MS = 30_000;
|
||||
|
||||
const REQUIRED_EXTENSION_VERSION = '0.5.172';
|
||||
const REQUIRED_EXTENSION_VERSION = '0.5.173';
|
||||
const MANUAL_HANDOFF_LABEL = '确认并提交到 ERP 插件';
|
||||
const RETRY_HANDOFF_LABEL = '继续提交到 ERP 插件';
|
||||
const RECONCILE_LABEL = '只读回查 ERP 现有结果';
|
||||
|
||||
@@ -1736,15 +1736,20 @@ function passengerCell(row, header) {
|
||||
return '';
|
||||
}
|
||||
|
||||
function normalizePassengerTsvText(text) {
|
||||
// Tabs represent columns, including empty final fields; trim only boundary newlines.
|
||||
return String(text || '').replace(/\r\n?/g, '\n').replace(/^\n+|\n+$/g, '');
|
||||
}
|
||||
|
||||
function buildPassengerTsv(value = {}) {
|
||||
if (typeof value.text === 'string' && value.text.trim()) return value.text.trim().replace(/\r\n?/g, '\n');
|
||||
if (typeof value.text === 'string' && value.text.trim()) return normalizePassengerTsvText(value.text);
|
||||
const rows = Array.isArray(value.rows) ? value.rows : [];
|
||||
if (!rows.length) return '';
|
||||
return [PASSENGER_HEADERS.join('\t'), ...rows.map((row) => PASSENGER_HEADERS.map((header) => passengerCell(row, header)).join('\t'))].join('\n');
|
||||
}
|
||||
|
||||
function validatePassengerLeaderContact(value, text, path, errors) {
|
||||
const lines = String(text || '').trim().replace(/\r\n?/g, '\n').split('\n').filter((line) => line.length > 0);
|
||||
const lines = normalizePassengerTsvText(text).split('\n').filter((line) => line.length > 0);
|
||||
const headers = String(lines[0] || '').split('\t').map((header) => header.trim());
|
||||
if (headers.length !== PASSENGER_HEADERS.length
|
||||
|| headers.some((header, index) => header !== PASSENGER_HEADERS[index])) return;
|
||||
@@ -1987,7 +1992,7 @@ function validateAgentPassengerList(value, errors) {
|
||||
errors.push(`${path}.text 必须包含本次提供的 13 列名单 TSV。`);
|
||||
return;
|
||||
}
|
||||
const lines = value.text.trim().replace(/\r\n?/g, '\n').split('\n').filter((line) => line.length > 0);
|
||||
const lines = normalizePassengerTsvText(value.text).split('\n').filter((line) => line.length > 0);
|
||||
const header = String(lines[0] || '').split('\t');
|
||||
if (header.length !== PASSENGER_HEADERS.length
|
||||
|| header.some((name, index) => name.trim() !== PASSENGER_HEADERS[index])) {
|
||||
|
||||
Reference in New Issue
Block a user