账号支持只看本账号看板;模板重新解析改为保留原映射并多轮补缺。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -81,20 +81,15 @@ const parseDetailState = reactive({
|
||||
mapping: emptyMappingSummary() as MappingParseSummary,
|
||||
});
|
||||
|
||||
/** 未解析清单:优先 mappingGaps,其次 AI 自报项 */
|
||||
/** 未解析清单:只认系统 mappingGaps;齐全(空数组)时不展示 AI 自报标签 */
|
||||
const parseDetailUnparsed = computed(() => {
|
||||
const m = parseDetailState.mapping;
|
||||
const list: string[] = [];
|
||||
for (const g of m.gaps || []) {
|
||||
if (g) list.push(g);
|
||||
if (Array.isArray(m.gaps)) {
|
||||
return (m.gaps || []).filter(Boolean).map(String);
|
||||
}
|
||||
if (!list.length) {
|
||||
for (const c of m.unmappedRequired || []) {
|
||||
list.push(`字段未映射:${FIELD_LABELS[c] || c}`);
|
||||
}
|
||||
for (const lab of m.unmappedLabels || []) {
|
||||
if (lab) list.push(`表标签未落点:${lab}`);
|
||||
}
|
||||
const list: string[] = [];
|
||||
for (const c of m.unmappedRequired || []) {
|
||||
list.push(`字段未映射:${FIELD_LABELS[c] || c}`);
|
||||
}
|
||||
return list;
|
||||
});
|
||||
@@ -377,22 +372,22 @@ function openEdit(row: TemplateRow) {
|
||||
formOpen.value = true;
|
||||
}
|
||||
|
||||
/** 运营可见的未解析项:优先 mappingGaps,其次标签/必填未映射 */
|
||||
/** 运营可见的未解析项:只认系统对照清单 mappingGaps;齐全时角标为 0 */
|
||||
function listMappingGaps(row: TemplateRow): string[] {
|
||||
if (row.mappingGaps?.length) return [...row.mappingGaps];
|
||||
const list: string[] = [];
|
||||
for (const lab of row.unmappedLabels || []) {
|
||||
if (lab) list.push(`表标签未落点:${lab}`);
|
||||
// 主账已带 mappingGaps(含空数组)时,不再用 AI 自报 unmapped* 抬角标
|
||||
if (Array.isArray(row.mappingGaps)) {
|
||||
return row.mappingGaps.filter(Boolean).map(String);
|
||||
}
|
||||
const list: string[] = [];
|
||||
for (const c of row.unmappedRequired || []) {
|
||||
if (c) list.push(`字段未映射:${c}`);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/** 列表角标条数 */
|
||||
/** 列表角标条数:优先主账 unparsedHintCount(与 mappingGaps 同口径) */
|
||||
function unparsedCount(row: TemplateRow): number {
|
||||
if (row.unparsedHintCount && row.unparsedHintCount > 0) return row.unparsedHintCount;
|
||||
if (typeof row.unparsedHintCount === "number") return Math.max(0, row.unparsedHintCount);
|
||||
return listMappingGaps(row).length;
|
||||
}
|
||||
|
||||
@@ -439,6 +434,7 @@ async function toggleStatus(row: TemplateRow) {
|
||||
|
||||
/**
|
||||
* 重新提交 AI 映射解析(已解析也可点;解析中禁用)。
|
||||
* 未换文件:主账带 mergeExisting,回写时保留已有字段只补缺。
|
||||
* 副作用:主账入队;列表进入解析中并轮询。
|
||||
*/
|
||||
async function reparseRow(row: TemplateRow) {
|
||||
@@ -692,7 +688,11 @@ async function downloadPreviewOrOriginal() {
|
||||
type="button"
|
||||
class="link-action"
|
||||
:disabled="row.parseStatus === '解析中'"
|
||||
:title="row.parseStatus === '解析中' ? '解析中,请稍候' : '重新提交 AI 映射解析'"
|
||||
:title="
|
||||
row.parseStatus === '解析中'
|
||||
? '解析中,请稍候'
|
||||
: '重新解析:保留已有映射,只补缺;换文件请用编辑上传'
|
||||
"
|
||||
@click.stop="reparseRow(row)"
|
||||
>
|
||||
重新解析
|
||||
|
||||
Reference in New Issue
Block a user