style: refine acrylic workbench surfaces

This commit is contained in:
2026-07-15 17:07:32 +08:00
parent 8978f2d167
commit 16ecb69d00
41 changed files with 838 additions and 606 deletions
@@ -69,6 +69,34 @@ describe("feature panel properties", () => {
expect(model.attributes.map((entry) => entry.key)).toEqual(["invert_elevation", "max_depth"]);
});
it("shows SCADA identity, device, state, and sync fields", () => {
const model = getFeaturePanelModel("scada", {
id: "4bfa834b-cbbb-5f35-9523-7487ac021ed2",
point_id: "aaedc54a-e5b4-5791-b729-4b7e838a8d00",
point_external_id: "36455",
point_name: "DY22东市南街环城南路西段交叉口",
device_external_id: "26825171",
active: true,
device_type_id: 72,
device_type_name: "2代水质仪",
junction_id: "31011502010001809",
synced_at: "Jul 15, 2026, 7:38:45 AM"
});
expect(model.id).toBe("36455");
expect(model.badge).toEqual({ label: "在线", tone: "active" });
expect(model.attributes.map((entry) => entry.key)).toEqual([
"id",
"point_id",
"point_name",
"device_external_id",
"device_type_id",
"device_type_name",
"junction_id",
"synced_at"
]);
});
it("omits the internal SCADA clustering size from user-facing properties", () => {
const entries = getLocalizedFeatureProperties({
point_name: "THC雷达液位计(MQTT",
@@ -21,6 +21,7 @@ export type FeaturePanelModel = {
};
const PROPERTY_LABELS: Record<string, string> = {
fid: "GeoServer 要素 ID",
id: "编号",
gid: "要素编号",
name: "名称",
@@ -74,6 +75,7 @@ const PROPERTY_LABELS: Record<string, string> = {
};
const PROPERTY_ORDER: Record<string, number> = {
fid: 9,
id: 10,
gid: 11,
name: 12,
@@ -134,12 +136,13 @@ const FEATURE_PANEL_PROPERTY_KEYS: Record<WaterNetworkSourceId, readonly string[
junctions: ["id", "invert_elevation", "max_depth"],
orifices: ["id", "discharge_coeff", "gated", "shape", "geom1", "geom2"],
outfalls: ["id", "invert_elevation", "outfall_type"],
scada: ["point_external_id", "device_type_name", "device_external_id", "junction_id", "synced_at"]
scada: ["id", "point_id", "point_external_id", "point_name", "device_external_id", "active", "device_type_id", "device_type_name", "junction_id", "synced_at"]
};
const FEATURE_PANEL_BADGE_KEYS: Partial<Record<WaterNetworkSourceId, string>> = {
pumps: "status",
orifices: "gated"
orifices: "gated",
scada: "active"
};
export function getLocalizedFeatureProperties(properties: Record<string, unknown>): LocalizedFeatureProperty[] {