feat(workbench): refine operational interface

This commit is contained in:
2026-07-14 16:22:21 +08:00
parent ed60a13f12
commit 2b768c2c06
25 changed files with 512 additions and 153 deletions
@@ -1,5 +1,5 @@
import { describe, expect, it } from "vitest";
import { getFeaturePanelModel, getFeaturePanelProperties, getLocalizedFeatureProperties } from "./feature-properties";
import { formatFeaturePropertyValue, getFeaturePanelModel, getFeaturePanelProperties, getLocalizedFeatureProperties } from "./feature-properties";
describe("feature panel properties", () => {
it.each([
@@ -78,4 +78,9 @@ describe("feature panel properties", () => {
expect(entries.map((entry) => entry.key)).toEqual(["point_name", "device_external_id"]);
});
it("labels uniformly sampled SCADA locations", () => {
expect(formatFeaturePropertyValue("location_source", "uniform_farthest_point_demo"))
.toBe("空间均匀采样模拟位置");
});
});
@@ -212,6 +212,10 @@ export function formatFeaturePropertyValue(key: string, value: unknown) {
return "密度聚类模拟位置";
}
if (normalizedKey === "location_source" && value === "uniform_farthest_point_demo") {
return "空间均匀采样模拟位置";
}
if ((normalizedKey === "diameter" || normalizedKey === "dn") && value !== null && value !== undefined && value !== "") {
const diameterInMeters = typeof value === "number" ? value : Number(value);
return Number.isFinite(diameterInMeters)