feat: improve plugin overlay workflow
This commit is contained in:
@@ -122,6 +122,8 @@ async function writeInputJson(
|
||||
params: Record<string, unknown>,
|
||||
pointCloudPaths: string[],
|
||||
cadPath: string | null,
|
||||
inputPointCloudFileIds: number[],
|
||||
inputCadFileIds: number[],
|
||||
) {
|
||||
const inputJson = {
|
||||
schemaVersion: 1,
|
||||
@@ -133,7 +135,9 @@ async function writeInputJson(
|
||||
outDir: workDir,
|
||||
inputs: {
|
||||
pointCloudPaths,
|
||||
pointCloudFileIds: inputPointCloudFileIds,
|
||||
cadPath,
|
||||
cadFileIds: inputCadFileIds,
|
||||
config: params,
|
||||
},
|
||||
};
|
||||
@@ -331,6 +335,9 @@ export async function runAlgorithmJob(
|
||||
pointCloudFileIds,
|
||||
cadFileIds,
|
||||
);
|
||||
const inputPointCloudFileIds = pointCloudRecords.map((r) => r.id);
|
||||
const inputCadFileIds = Array.isArray(cadFileIds) ? cadFileIds.filter((id) => Number.isInteger(id)) : [];
|
||||
|
||||
const inputJsonPath = await writeInputJson(
|
||||
workDir,
|
||||
taskId,
|
||||
@@ -339,6 +346,8 @@ export async function runAlgorithmJob(
|
||||
params,
|
||||
pointCloudPaths,
|
||||
cadPath,
|
||||
inputPointCloudFileIds,
|
||||
inputCadFileIds,
|
||||
);
|
||||
|
||||
let exitCode: number | null = 0;
|
||||
@@ -363,6 +372,8 @@ export async function runAlgorithmJob(
|
||||
progress: finalStatus === 'completed' ? 1 : undefined,
|
||||
stage: finalStatus === 'completed' ? '完成' : '失败',
|
||||
exitCode,
|
||||
inputPointCloudFileIds,
|
||||
inputCadFileIds,
|
||||
// 把 result.json 内容平展到 resultData 里,方便前端直接使用
|
||||
schemaVersion: result?.schemaVersion ?? manifest.schemaVersion,
|
||||
message: result?.message,
|
||||
|
||||
Reference in New Issue
Block a user