@olenbetong/synergi-react 5.4.0 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/styles/styles.css +1 -1
- package/dist/styles/styles.css.map +1 -1
- package/es/charts/CallOffDeliveries/TicketScanDialog.d.ts +7 -0
- package/es/charts/CallOffDeliveries/TicketScanDialog.js +47 -0
- package/es/charts/CallOffDeliveries/chartOptions.d.ts +8 -0
- package/es/charts/CallOffDeliveries/chartOptions.js +138 -0
- package/es/charts/CallOffDeliveries/data.d.ts +35 -0
- package/es/charts/CallOffDeliveries/data.js +30 -0
- package/es/charts/CallOffDeliveries/index.css +1 -0
- package/es/charts/CallOffDeliveries/index.d.ts +24 -0
- package/es/charts/CallOffDeliveries/index.js +115 -0
- package/es/charts/CallOffDeliveries/model.d.ts +37 -0
- package/es/charts/CallOffDeliveries/model.js +59 -0
- package/es/charts/ProductionPlan/PlanValueDialog.d.ts +14 -0
- package/es/charts/ProductionPlan/PlanValueDialog.js +47 -0
- package/es/charts/ProductionPlan/chartOptions.d.ts +20 -0
- package/es/charts/ProductionPlan/chartOptions.js +353 -0
- package/es/charts/ProductionPlan/data.d.ts +105 -0
- package/es/charts/ProductionPlan/data.js +61 -0
- package/es/charts/ProductionPlan/index.css +1 -0
- package/es/charts/ProductionPlan/index.d.ts +31 -0
- package/es/charts/ProductionPlan/index.js +203 -0
- package/es/charts/ProductionPlan/model.d.ts +29 -0
- package/es/charts/ProductionPlan/model.js +65 -0
- package/es/charts/Pumping/chartOptions.d.ts +12 -0
- package/es/charts/Pumping/chartOptions.js +197 -0
- package/es/charts/Pumping/data.d.ts +65 -0
- package/es/charts/Pumping/data.js +20 -0
- package/es/charts/Pumping/index.css +1 -0
- package/es/charts/Pumping/index.d.ts +27 -0
- package/es/charts/Pumping/index.js +124 -0
- package/es/charts/Pumping/model.d.ts +34 -0
- package/es/charts/Pumping/model.js +88 -0
- package/es/charts/UnboundPreview/chartOptions.d.ts +3 -0
- package/es/charts/UnboundPreview/chartOptions.js +126 -0
- package/es/charts/UnboundPreview/index.css +1 -0
- package/es/charts/UnboundPreview/index.d.ts +20 -0
- package/es/charts/UnboundPreview/index.js +55 -0
- package/es/charts/UnboundPreview/model.d.ts +49 -0
- package/es/charts/UnboundPreview/model.js +67 -0
- package/es/charts/VehicleDeliveries/chartOptions.d.ts +13 -0
- package/es/charts/VehicleDeliveries/chartOptions.js +270 -0
- package/es/charts/VehicleDeliveries/data.d.ts +71 -0
- package/es/charts/VehicleDeliveries/data.js +20 -0
- package/es/charts/VehicleDeliveries/deliveryXRange.d.ts +4 -0
- package/es/charts/VehicleDeliveries/deliveryXRange.js +62 -0
- package/es/charts/VehicleDeliveries/index.css +1 -0
- package/es/charts/VehicleDeliveries/index.d.ts +24 -0
- package/es/charts/VehicleDeliveries/index.js +129 -0
- package/es/charts/VehicleDeliveries/model.d.ts +24 -0
- package/es/charts/VehicleDeliveries/model.js +106 -0
- package/es/charts/format.d.ts +12 -0
- package/es/charts/format.js +34 -0
- package/es/charts/index.d.ts +5 -0
- package/es/charts/index.js +5 -0
- package/es/charts/storage.d.ts +5 -0
- package/es/charts/storage.js +35 -0
- package/es/components/ColorCard/index.css +8 -8
- package/es/index.css +1 -1
- package/es/vehicles/VehicleInfoDialog/OutOfServiceForm.d.ts +4 -0
- package/es/vehicles/VehicleInfoDialog/OutOfServiceForm.js +51 -0
- package/es/vehicles/VehicleInfoDialog/data/dsDeliveryTickets.d.ts +99 -0
- package/es/vehicles/VehicleInfoDialog/data/dsDeliveryTickets.js +499 -0
- package/es/vehicles/VehicleInfoDialog/data/dsDriverStatus.d.ts +13 -0
- package/es/vehicles/VehicleInfoDialog/data/dsDriverStatus.js +69 -0
- package/es/vehicles/VehicleInfoDialog/data/dsVehicleInfo.d.ts +33 -0
- package/es/vehicles/VehicleInfoDialog/data/dsVehicleInfo.js +164 -0
- package/es/vehicles/VehicleInfoDialog/data/dsVehicleInfoLog.d.ts +15 -0
- package/es/vehicles/VehicleInfoDialog/data/dsVehicleInfoLog.js +80 -0
- package/es/vehicles/VehicleInfoDialog/formatting.d.ts +13 -0
- package/es/vehicles/VehicleInfoDialog/formatting.js +48 -0
- package/es/vehicles/VehicleInfoDialog/index.css +1 -0
- package/es/vehicles/VehicleInfoDialog/index.d.ts +11 -0
- package/es/vehicles/VehicleInfoDialog/index.js +46 -0
- package/es/vehicles/VehicleInfoDialog/tabs.d.ts +6 -0
- package/es/vehicles/VehicleInfoDialog/tabs.js +85 -0
- package/es/vehicles/index.d.ts +1 -0
- package/es/vehicles/index.js +1 -0
- package/package.json +17 -8
- package/src/charts/CallOffDeliveries/TicketScanDialog.tsx +79 -0
- package/src/charts/CallOffDeliveries/chartOptions.ts +160 -0
- package/src/charts/CallOffDeliveries/data.ts +67 -0
- package/src/charts/CallOffDeliveries/index.scss +51 -0
- package/src/charts/CallOffDeliveries/index.tsx +217 -0
- package/src/charts/CallOffDeliveries/model.test.ts +90 -0
- package/src/charts/CallOffDeliveries/model.ts +87 -0
- package/src/charts/ProductionPlan/PlanValueDialog.tsx +107 -0
- package/src/charts/ProductionPlan/chartOptions.ts +406 -0
- package/src/charts/ProductionPlan/data.ts +170 -0
- package/src/charts/ProductionPlan/index.scss +148 -0
- package/src/charts/ProductionPlan/index.tsx +432 -0
- package/src/charts/ProductionPlan/model.test.ts +132 -0
- package/src/charts/ProductionPlan/model.ts +102 -0
- package/src/charts/Pumping/chartOptions.ts +224 -0
- package/src/charts/Pumping/data.ts +91 -0
- package/src/charts/Pumping/index.scss +42 -0
- package/src/charts/Pumping/index.tsx +222 -0
- package/src/charts/Pumping/model.test.ts +122 -0
- package/src/charts/Pumping/model.ts +104 -0
- package/src/charts/UnboundPreview/chartOptions.ts +137 -0
- package/src/charts/UnboundPreview/index.scss +17 -0
- package/src/charts/UnboundPreview/index.tsx +100 -0
- package/src/charts/UnboundPreview/model.test.ts +129 -0
- package/src/charts/UnboundPreview/model.ts +110 -0
- package/src/charts/VehicleDeliveries/chartOptions.ts +311 -0
- package/src/charts/VehicleDeliveries/data.ts +98 -0
- package/src/charts/VehicleDeliveries/deliveryXRange.ts +80 -0
- package/src/charts/VehicleDeliveries/index.scss +43 -0
- package/src/charts/VehicleDeliveries/index.tsx +262 -0
- package/src/charts/VehicleDeliveries/model.test.ts +117 -0
- package/src/charts/VehicleDeliveries/model.ts +139 -0
- package/src/charts/format.ts +38 -0
- package/src/charts/index.ts +20 -0
- package/src/charts/storage.ts +36 -0
- package/src/components/ColorCard/index.css +8 -8
- package/src/vehicles/VehicleInfoDialog/OutOfServiceForm.tsx +127 -0
- package/src/vehicles/VehicleInfoDialog/data/dsDeliveryTickets.ts +600 -0
- package/src/vehicles/VehicleInfoDialog/data/dsDriverStatus.ts +84 -0
- package/src/vehicles/VehicleInfoDialog/data/dsVehicleInfo.ts +198 -0
- package/src/vehicles/VehicleInfoDialog/data/dsVehicleInfoLog.ts +97 -0
- package/src/vehicles/VehicleInfoDialog/formatting.test.ts +57 -0
- package/src/vehicles/VehicleInfoDialog/formatting.ts +58 -0
- package/src/vehicles/VehicleInfoDialog/index.scss +131 -0
- package/src/vehicles/VehicleInfoDialog/index.tsx +106 -0
- package/src/vehicles/VehicleInfoDialog/tabs.tsx +188 -0
- package/src/vehicles/index.ts +1 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Dialog, Heading, Textfield } from "@digdir/designsystemet-react";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { getLocalizedString } from "../../i18n.js";
|
|
5
|
+
import { parsePlanValue } from "./model.js";
|
|
6
|
+
function getLabel(parameter) {
|
|
7
|
+
switch (parameter) {
|
|
8
|
+
case "arrival":
|
|
9
|
+
return getLocalizedString("Arrival at the building site (HH:mm)");
|
|
10
|
+
case "interval":
|
|
11
|
+
return getLocalizedString("Interval to the next load (minutes)");
|
|
12
|
+
case "drivetime":
|
|
13
|
+
return getLocalizedString("Driving time to the building site (minutes)");
|
|
14
|
+
case "unloadtime":
|
|
15
|
+
return getLocalizedString("Unloading time (minutes)");
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/** Asks for a new value for one of the planning columns. Mounted only while it is open. */
|
|
19
|
+
export function PlanValueDialog({ parameter, initialValue, onCancel, onSubmit }) {
|
|
20
|
+
let [text, setText] = useState(initialValue);
|
|
21
|
+
let [touched, setTouched] = useState(false);
|
|
22
|
+
let value = parsePlanValue(parameter, text);
|
|
23
|
+
let error = touched && value === null
|
|
24
|
+
? parameter === "arrival"
|
|
25
|
+
? getLocalizedString("Enter a time of day, such as 07:30")
|
|
26
|
+
: getLocalizedString("Enter a whole number of minutes")
|
|
27
|
+
: undefined;
|
|
28
|
+
function handleSubmit(event) {
|
|
29
|
+
event.preventDefault();
|
|
30
|
+
setTouched(true);
|
|
31
|
+
if (value === null)
|
|
32
|
+
return;
|
|
33
|
+
if (text.trim() === initialValue) {
|
|
34
|
+
onCancel();
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
onSubmit(value);
|
|
38
|
+
}
|
|
39
|
+
return (_jsx(Dialog, { open: true, closedby: "any", onClose: onCancel, className: "ObProductionPlan-dialog", children: _jsxs("form", { onSubmit: handleSubmit, children: [_jsx(Dialog.Block, { children: _jsx(Heading, { level: 2, "data-size": "xs", children: getLocalizedString("Enter new value") }) }), _jsx(Dialog.Block, { children: _jsx(Textfield
|
|
40
|
+
// oxlint-disable-next-line jsx-a11y/no-autofocus -- the field is the only control in the dialog
|
|
41
|
+
, {
|
|
42
|
+
// oxlint-disable-next-line jsx-a11y/no-autofocus -- the field is the only control in the dialog
|
|
43
|
+
autoFocus: true, label: getLabel(parameter), value: text, error: error, inputMode: parameter === "arrival" ? "text" : "numeric", onChange: (event) => setText(event.currentTarget.value) }) }), _jsxs(Dialog.Block, { className: "ObProductionPlan-dialog-actions", children: [_jsx(Button, { type: "submit", children: getLocalizedString("Save") }), _jsx(Button, { type: "button", variant: "secondary", onClick: onCancel, children: getLocalizedString("Cancel") })] })] }) }));
|
|
44
|
+
}
|
|
45
|
+
export function ConfirmResetDialog({ onCancel, onConfirm }) {
|
|
46
|
+
return (_jsxs(Dialog, { open: true, closedby: "any", onClose: onCancel, className: "ObProductionPlan-dialog", children: [_jsx(Dialog.Block, { children: _jsx(Heading, { level: 2, "data-size": "xs", children: getLocalizedString("Reset the plan?") }) }), _jsx(Dialog.Block, { children: getLocalizedString("All call-offs will be planned again, and the manual changes made to them will be reset.") }), _jsxs(Dialog.Block, { className: "ObProductionPlan-dialog-actions", children: [_jsx(Button, { "data-color": "danger", onClick: onConfirm, children: getLocalizedString("Reset the plan") }), _jsx(Button, { variant: "secondary", onClick: onCancel, children: getLocalizedString("Cancel") })] })] }));
|
|
47
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import Highcharts from "highcharts";
|
|
2
|
+
import type { PlannedDeliveryRecord } from "./data.js";
|
|
3
|
+
import { type DeliveryMethod, type PlantPlan } from "./model.js";
|
|
4
|
+
/** Room left of the plot for the columns of the delivery chart, the same on all three charts so their time axes line up. */
|
|
5
|
+
export declare const LABEL_WIDTH = 440;
|
|
6
|
+
export declare const METHOD_COLORS: Record<DeliveryMethod, string>;
|
|
7
|
+
export type MovePlannedDelivery = (delivery: PlannedDeliveryRecord, prodTime: Date) => void;
|
|
8
|
+
export type ChartSettings = {
|
|
9
|
+
date: Date;
|
|
10
|
+
minOffset: number;
|
|
11
|
+
maxOffset: number;
|
|
12
|
+
readOnly: boolean;
|
|
13
|
+
onMove: MovePlannedDelivery;
|
|
14
|
+
};
|
|
15
|
+
export declare function formatNumber(value: number | null | undefined, decimals: number): string;
|
|
16
|
+
export declare function getVolumeChartOptions(plan: PlantPlan, settings: ChartSettings): Highcharts.Options;
|
|
17
|
+
export declare function getVehiclesChartOptions(plan: PlantPlan, settings: ChartSettings): Highcharts.Options;
|
|
18
|
+
/** The columns left of a load: call-off (on its first load), quantity, and the values the user can change. */
|
|
19
|
+
export declare function getDeliveryLabel(plan: PlantPlan, index: number, readOnly: boolean): string;
|
|
20
|
+
export declare function getDeliveriesChartOptions(plan: PlantPlan, settings: ChartSettings): Highcharts.Options;
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
import Highcharts from "highcharts";
|
|
2
|
+
import { getLocalizedString, localize } from "../../i18n.js";
|
|
3
|
+
import { getAxisMax, getChartHeight, getDeliveryMethod, isFirstLoad, } from "./model.js";
|
|
4
|
+
import { formatTime, escapeHtml } from "../format.js";
|
|
5
|
+
const HOUR = 3600000;
|
|
6
|
+
/** Room left of the plot for the columns of the delivery chart, the same on all three charts so their time axes line up. */
|
|
7
|
+
export const LABEL_WIDTH = 440;
|
|
8
|
+
const MARGIN_LEFT = LABEL_WIDTH + 20;
|
|
9
|
+
// Highcharts' old palette, which the colours of the delivery methods were picked from.
|
|
10
|
+
export const METHOD_COLORS = {
|
|
11
|
+
pump: "#7cb5ec",
|
|
12
|
+
telescopic: "#f7a35c",
|
|
13
|
+
conveyor: "#e4d354",
|
|
14
|
+
none: "#91e8e1",
|
|
15
|
+
};
|
|
16
|
+
const VOLUME_COLOR = "#2b908f";
|
|
17
|
+
const VEHICLES_COLOR = "#f45b5b";
|
|
18
|
+
// Highcharts strips SVG from HTML labels, so the icons are drawn by the stylesheet.
|
|
19
|
+
const REFRESH_ICON = '<span class="ObProductionPlan-icon ObProductionPlan-icon-refresh"></span>';
|
|
20
|
+
const WARNING_ICON = '<span class="ObProductionPlan-icon ObProductionPlan-icon-warning"></span>';
|
|
21
|
+
function culture() {
|
|
22
|
+
return globalThis.af?.userSession?.culture;
|
|
23
|
+
}
|
|
24
|
+
export function formatNumber(value, decimals) {
|
|
25
|
+
if (value == null)
|
|
26
|
+
return "";
|
|
27
|
+
return new Intl.NumberFormat(culture(), {
|
|
28
|
+
minimumFractionDigits: decimals,
|
|
29
|
+
maximumFractionDigits: decimals,
|
|
30
|
+
}).format(value);
|
|
31
|
+
}
|
|
32
|
+
function barColor(color) {
|
|
33
|
+
return Highcharts.color(color).setOpacity(0.8).get("rgba");
|
|
34
|
+
}
|
|
35
|
+
function getTimeAxis(settings) {
|
|
36
|
+
let midnight = settings.date.getTime();
|
|
37
|
+
let min = midnight + settings.minOffset * HOUR;
|
|
38
|
+
let max = midnight + settings.maxOffset * HOUR;
|
|
39
|
+
let band = (from, to) => ({ color: "var(--ds-color-neutral-background-tinted)", from, to });
|
|
40
|
+
let shiftLine = (hour) => ({
|
|
41
|
+
color: "var(--ds-color-neutral-border-default)",
|
|
42
|
+
width: 2,
|
|
43
|
+
dashStyle: "Dash",
|
|
44
|
+
value: midnight + hour * HOUR,
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
type: "datetime",
|
|
48
|
+
min,
|
|
49
|
+
max,
|
|
50
|
+
dateTimeLabelFormats: { hour: "%H", day: "%d.%m" },
|
|
51
|
+
tickInterval: HOUR,
|
|
52
|
+
minorTickInterval: 0.5 * HOUR,
|
|
53
|
+
plotBands: [band(min - 24 * HOUR, midnight + 6 * HOUR), band(midnight + 18 * HOUR, max + 24 * HOUR)],
|
|
54
|
+
plotLines: [
|
|
55
|
+
shiftLine(9),
|
|
56
|
+
shiftLine(12),
|
|
57
|
+
shiftLine(15),
|
|
58
|
+
{
|
|
59
|
+
color: "#ffcc00",
|
|
60
|
+
width: 2,
|
|
61
|
+
dashStyle: "Dot",
|
|
62
|
+
// The bars are wall clock times carried as UTC, so "now" has to be as well.
|
|
63
|
+
value: Date.now() - new Date().getTimezoneOffset() * 60000,
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function getTitle(text) {
|
|
69
|
+
return { text, align: "left", style: { fontSize: "14px", color: "var(--ds-color-neutral-text-default)" } };
|
|
70
|
+
}
|
|
71
|
+
function getColumnOptions(settings, title) {
|
|
72
|
+
return {
|
|
73
|
+
chart: {
|
|
74
|
+
type: "column",
|
|
75
|
+
backgroundColor: "transparent",
|
|
76
|
+
height: 150,
|
|
77
|
+
marginLeft: MARGIN_LEFT,
|
|
78
|
+
zooming: { type: "x" },
|
|
79
|
+
},
|
|
80
|
+
accessibility: { enabled: false },
|
|
81
|
+
credits: { enabled: false },
|
|
82
|
+
title: getTitle(title),
|
|
83
|
+
legend: { enabled: false },
|
|
84
|
+
xAxis: getTimeAxis(settings),
|
|
85
|
+
plotOptions: {
|
|
86
|
+
series: { animation: false, states: { inactive: { opacity: 1 } } },
|
|
87
|
+
column: { groupPadding: 0, pointPadding: 0, borderWidth: 0 },
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
export function getVolumeChartOptions(plan, settings) {
|
|
92
|
+
let base = getColumnOptions(settings, getLocalizedString("Calculated production load:"));
|
|
93
|
+
let data = plan.volume.map((row) => ({
|
|
94
|
+
x: row.CutOff.getTime(),
|
|
95
|
+
y: row.Qty,
|
|
96
|
+
cutOffStart: row.CutOffStart,
|
|
97
|
+
cutOffEnd: row.CutOffEnd,
|
|
98
|
+
}));
|
|
99
|
+
return {
|
|
100
|
+
...base,
|
|
101
|
+
yAxis: {
|
|
102
|
+
title: { text: "" },
|
|
103
|
+
min: 0,
|
|
104
|
+
max: getAxisMax(data.map((point) => point.y), 25),
|
|
105
|
+
tickInterval: 25,
|
|
106
|
+
gridLineColor: "var(--ds-color-neutral-border-subtle)",
|
|
107
|
+
labels: { format: "{value} m³" },
|
|
108
|
+
},
|
|
109
|
+
tooltip: {
|
|
110
|
+
useHTML: true,
|
|
111
|
+
formatter() {
|
|
112
|
+
let point = this.point;
|
|
113
|
+
return `<div style="font-size:10px">
|
|
114
|
+
<div>${getLocalizedString("Production at")} ${formatTime(point.cutOffStart)}-${formatTime(point.cutOffEnd)}</div>
|
|
115
|
+
<div style="font-size:12px;font-weight:bold">${formatNumber(point.y, 1)} m³ ${getLocalizedString("per 15 min.")}</div>
|
|
116
|
+
<div>~${formatNumber(point.y * 4, 0)} m³ ${getLocalizedString("per hour")}</div>
|
|
117
|
+
</div>`;
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
series: [{ type: "column", name: "Volume", color: barColor(VOLUME_COLOR), data }],
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
export function getVehiclesChartOptions(plan, settings) {
|
|
124
|
+
let base = getColumnOptions(settings, getLocalizedString("Number of vehicles:"));
|
|
125
|
+
let data = plan.vehicleCounts.map((row) => ({ x: row.CutOff.getTime(), y: row.VehicleCount }));
|
|
126
|
+
return {
|
|
127
|
+
...base,
|
|
128
|
+
yAxis: {
|
|
129
|
+
title: { text: "" },
|
|
130
|
+
min: 0,
|
|
131
|
+
max: getAxisMax(data.map((point) => point.y), 10),
|
|
132
|
+
tickInterval: 5,
|
|
133
|
+
gridLineColor: "var(--ds-color-neutral-border-subtle)",
|
|
134
|
+
},
|
|
135
|
+
tooltip: {
|
|
136
|
+
useHTML: true,
|
|
137
|
+
formatter() {
|
|
138
|
+
return `<div style="font-size:10px">
|
|
139
|
+
<div>${localize `At ${formatTime(this.point.x)}`}</div>
|
|
140
|
+
<div style="font-size:12px;font-weight:bold">${this.point.y} ${getLocalizedString("vehicles")}</div>
|
|
141
|
+
</div>`;
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
series: [{ type: "column", name: "Vehicles", color: barColor(VEHICLES_COLOR), data }],
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
function methodText(row) {
|
|
148
|
+
switch (getDeliveryMethod(row)) {
|
|
149
|
+
case "pump":
|
|
150
|
+
return `${getLocalizedString("Pump")} (${escapeHtml(row.Pump)})`;
|
|
151
|
+
case "telescopic":
|
|
152
|
+
return getLocalizedString("Telescopic chute");
|
|
153
|
+
case "conveyor":
|
|
154
|
+
return getLocalizedString("Conveyor belt vehicle");
|
|
155
|
+
default:
|
|
156
|
+
return getLocalizedString("Not specified");
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function deliveryTooltip(row) {
|
|
160
|
+
return `<div style="font-size:10px">
|
|
161
|
+
<div>${formatNumber(row.LoadQty, 1)} m³</div>
|
|
162
|
+
<div>${getLocalizedString("Mixing starts at")} ${formatTime(row.ProdDateTime)}</div>
|
|
163
|
+
<div>${getLocalizedString("Produced at")} ${formatTime(row.ProdFinishDateTime)}</div>
|
|
164
|
+
<div>${getLocalizedString("Arrival at")} ${formatTime(row.Arrival)}</div>
|
|
165
|
+
<div>${getLocalizedString("Returns at")} ${formatTime(row.ReturnTime)}</div>
|
|
166
|
+
<div style="color:var(--ds-color-info-text-subtle)">${getLocalizedString("Unloading")}: ${methodText(row)}</div>
|
|
167
|
+
</div>`;
|
|
168
|
+
}
|
|
169
|
+
function valueCell(className, parameter, row, text, readOnly) {
|
|
170
|
+
let content = readOnly
|
|
171
|
+
? escapeHtml(text)
|
|
172
|
+
: `<a href="#plan-${parameter}-${escapeHtml(row.PrimKey)}">${escapeHtml(text) || " "}</a>`;
|
|
173
|
+
return `<span class="${className}">${content}</span>`;
|
|
174
|
+
}
|
|
175
|
+
/** The columns left of a load: call-off (on its first load), quantity, and the values the user can change. */
|
|
176
|
+
export function getDeliveryLabel(plan, index, readOnly) {
|
|
177
|
+
let row = plan.deliveries[index];
|
|
178
|
+
if (!row)
|
|
179
|
+
return "";
|
|
180
|
+
let first = isFirstLoad(plan.deliveries, index);
|
|
181
|
+
let visibility = first ? "visible" : "hidden";
|
|
182
|
+
let warning = plan.warnings.get(row.CallOffID);
|
|
183
|
+
let name = `${row.CustomerName ?? ""}/${row.BuildSite ?? ""}`;
|
|
184
|
+
let reset = readOnly
|
|
185
|
+
? ""
|
|
186
|
+
: `<a class="ObProductionPlan-reset" href="#plan-reset-${row.CallOffID}" title="${escapeHtml(getLocalizedString("Update planned loads (manual changes are discarded)"))}">${REFRESH_ICON}</a> `;
|
|
187
|
+
let warningIcon = warning
|
|
188
|
+
? `<span class="ObProductionPlan-warning" title="${escapeHtml(warning)}">${WARNING_ICON}</span> `
|
|
189
|
+
: "";
|
|
190
|
+
return [
|
|
191
|
+
`<div class="ObProductionPlan-row">`,
|
|
192
|
+
`<span class="ObProductionPlan-title" style="visibility:${visibility}">${reset}${warningIcon}<span title="${escapeHtml(`${row.CustomerName ?? ""}\n${row.BuildSite ?? ""}`)}">${escapeHtml(name)}</span></span>`,
|
|
193
|
+
`<span class="ObProductionPlan-qty" style="visibility:${visibility}">${formatNumber(row.Qty, 1)} m³</span>`,
|
|
194
|
+
valueCell("ObProductionPlan-arrival", "arrival", row, formatTime(row.Arrival), readOnly),
|
|
195
|
+
valueCell("ObProductionPlan-minutes", "interval", row, String(row.DeliveryInterval ?? ""), readOnly),
|
|
196
|
+
valueCell("ObProductionPlan-minutes", "drivetime", row, String(row.DriveToSiteTime ?? ""), readOnly),
|
|
197
|
+
valueCell("ObProductionPlan-minutes", "unloadtime", row, String(row.UnloadTime ?? ""), readOnly),
|
|
198
|
+
`</div>`,
|
|
199
|
+
].join("");
|
|
200
|
+
}
|
|
201
|
+
function columnHeaders() {
|
|
202
|
+
return [
|
|
203
|
+
`<div class="ObProductionPlan-row ObProductionPlan-headers">`,
|
|
204
|
+
`<span class="ObProductionPlan-title">${getLocalizedString("Customer/building site")}</span>`,
|
|
205
|
+
`<span class="ObProductionPlan-qty">${getLocalizedString("Quantity")}</span>`,
|
|
206
|
+
`<span class="ObProductionPlan-arrival">${getLocalizedString("At site")}</span>`,
|
|
207
|
+
`<span class="ObProductionPlan-minutes">${getLocalizedString("Interval")}</span>`,
|
|
208
|
+
`<span class="ObProductionPlan-minutes">${getLocalizedString("Driving")}</span>`,
|
|
209
|
+
`<span class="ObProductionPlan-minutes">${getLocalizedString("Unloading")}</span>`,
|
|
210
|
+
`</div>`,
|
|
211
|
+
].join("");
|
|
212
|
+
}
|
|
213
|
+
export function getDeliveriesChartOptions(plan, settings) {
|
|
214
|
+
let { readOnly, onMove } = settings;
|
|
215
|
+
let categories = plan.deliveries.map((row) => row.PrimKey);
|
|
216
|
+
let rowsByKey = new Map(plan.deliveries.map((row) => [row.PrimKey, row]));
|
|
217
|
+
let timeAxis = getTimeAxis(settings);
|
|
218
|
+
let data = plan.deliveries.map((row, index) => ({
|
|
219
|
+
y: index,
|
|
220
|
+
x: row.ProdDateTime.getTime(),
|
|
221
|
+
x2: row.ReturnTime.getTime(),
|
|
222
|
+
primKey: row.PrimKey,
|
|
223
|
+
vehicleNo: row.VehicleNo,
|
|
224
|
+
color: barColor(METHOD_COLORS[getDeliveryMethod(row)]),
|
|
225
|
+
}));
|
|
226
|
+
return {
|
|
227
|
+
chart: {
|
|
228
|
+
type: "xrange",
|
|
229
|
+
backgroundColor: "transparent",
|
|
230
|
+
zooming: { type: "x" },
|
|
231
|
+
height: getChartHeight(categories.length),
|
|
232
|
+
marginTop: 70,
|
|
233
|
+
marginBottom: 40,
|
|
234
|
+
marginLeft: MARGIN_LEFT,
|
|
235
|
+
},
|
|
236
|
+
accessibility: { enabled: false },
|
|
237
|
+
credits: { enabled: false },
|
|
238
|
+
title: getTitle(getLocalizedString("Planned deliveries:")),
|
|
239
|
+
// Moved left to line up with the axis labels below it.
|
|
240
|
+
subtitle: { useHTML: true, align: "left", x: -5, text: columnHeaders() },
|
|
241
|
+
legend: { enabled: false },
|
|
242
|
+
xAxis: [
|
|
243
|
+
timeAxis,
|
|
244
|
+
{ type: "datetime", linkedTo: 0, opposite: true, dateTimeLabelFormats: { hour: "%H", day: "%d.%m" } },
|
|
245
|
+
],
|
|
246
|
+
yAxis: {
|
|
247
|
+
categories,
|
|
248
|
+
reversed: true,
|
|
249
|
+
min: 0,
|
|
250
|
+
max: categories.length - 1,
|
|
251
|
+
title: { text: "" },
|
|
252
|
+
tickInterval: 1,
|
|
253
|
+
gridLineColor: "var(--ds-color-neutral-border-subtle)",
|
|
254
|
+
labels: {
|
|
255
|
+
useHTML: true,
|
|
256
|
+
step: 1,
|
|
257
|
+
style: { width: LABEL_WIDTH, whiteSpace: "nowrap", textOverflow: "clip" },
|
|
258
|
+
formatter() {
|
|
259
|
+
return getDeliveryLabel(plan, this.pos, readOnly);
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
tooltip: {
|
|
264
|
+
useHTML: true,
|
|
265
|
+
formatter() {
|
|
266
|
+
let row = rowsByKey.get(this.point.primKey);
|
|
267
|
+
return row ? deliveryTooltip(row) : false;
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
plotOptions: {
|
|
271
|
+
xrange: {
|
|
272
|
+
animation: false,
|
|
273
|
+
grouping: false,
|
|
274
|
+
groupPadding: 0.05,
|
|
275
|
+
pointPadding: 0,
|
|
276
|
+
borderRadius: 0,
|
|
277
|
+
colorByPoint: false,
|
|
278
|
+
dataLabels: {
|
|
279
|
+
enabled: true,
|
|
280
|
+
// The label runs past the end of a short bar, so it carries its own outline to read on
|
|
281
|
+
// the bar and on the background alike.
|
|
282
|
+
color: "var(--ds-color-neutral-text-default)",
|
|
283
|
+
align: "left",
|
|
284
|
+
y: 2,
|
|
285
|
+
style: {
|
|
286
|
+
fontWeight: "normal",
|
|
287
|
+
fontSize: "10px",
|
|
288
|
+
textOutline: "2px var(--ds-color-neutral-background-default)",
|
|
289
|
+
},
|
|
290
|
+
formatter() {
|
|
291
|
+
return `${getLocalizedString("Vehicle")} ${this.point.vehicleNo ?? ""}`;
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
dragDrop: {
|
|
295
|
+
draggableX: !readOnly,
|
|
296
|
+
draggableY: false,
|
|
297
|
+
draggableX1: false,
|
|
298
|
+
draggableX2: false,
|
|
299
|
+
dragPrecisionX: 5 * 60 * 1000,
|
|
300
|
+
liveRedraw: true,
|
|
301
|
+
},
|
|
302
|
+
point: {
|
|
303
|
+
events: {
|
|
304
|
+
dragStart() {
|
|
305
|
+
let row = rowsByKey.get(this.primKey);
|
|
306
|
+
if (!row)
|
|
307
|
+
return false;
|
|
308
|
+
let offset = (value) => (value ? value.getTime() - this.x : null);
|
|
309
|
+
this.dragOffsets = {
|
|
310
|
+
ProdFinishDateTime: offset(row.ProdFinishDateTime),
|
|
311
|
+
Arrival: offset(row.Arrival),
|
|
312
|
+
UnloadStart: offset(row.UnloadStart),
|
|
313
|
+
UnloadComplete: offset(row.UnloadComplete),
|
|
314
|
+
ReturnTime: offset(row.ReturnTime),
|
|
315
|
+
};
|
|
316
|
+
},
|
|
317
|
+
drag(event) {
|
|
318
|
+
if (!this.dragOffsets || !event.newPoint)
|
|
319
|
+
return false;
|
|
320
|
+
// The tooltip follows the bar while it is dragged.
|
|
321
|
+
let row = rowsByKey.get(this.primKey);
|
|
322
|
+
let newX = event.newPoint.x;
|
|
323
|
+
row.ProdDateTime.setTime(newX);
|
|
324
|
+
for (let key of [
|
|
325
|
+
"ProdFinishDateTime",
|
|
326
|
+
"Arrival",
|
|
327
|
+
"UnloadStart",
|
|
328
|
+
"UnloadComplete",
|
|
329
|
+
"ReturnTime",
|
|
330
|
+
]) {
|
|
331
|
+
let offset = this.dragOffsets[key];
|
|
332
|
+
if (offset !== null)
|
|
333
|
+
row[key]?.setTime(newX + offset);
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
drop(event) {
|
|
337
|
+
if (!this.dragOffsets || !event.newPoint) {
|
|
338
|
+
event.preventDefault?.();
|
|
339
|
+
return false;
|
|
340
|
+
}
|
|
341
|
+
let row = rowsByKey.get(this.primKey);
|
|
342
|
+
onMove(row, new Date(event.newPoint.x));
|
|
343
|
+
},
|
|
344
|
+
},
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
series: { states: { inactive: { opacity: 1 } } },
|
|
348
|
+
},
|
|
349
|
+
series: [
|
|
350
|
+
{ type: "xrange", name: "Deliveries", data, cursor: readOnly ? undefined : "move" },
|
|
351
|
+
],
|
|
352
|
+
};
|
|
353
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { ProcedureAPI } from "@olenbetong/appframe-data";
|
|
2
|
+
export type PlantRecord = {
|
|
3
|
+
PlantID: number;
|
|
4
|
+
Description: string;
|
|
5
|
+
};
|
|
6
|
+
/** Planned production volume in a quarter of an hour. `CutOff` is the middle of the quarter. */
|
|
7
|
+
export type ProdVolumeRecord = {
|
|
8
|
+
PlantID: number;
|
|
9
|
+
CutOff: Date;
|
|
10
|
+
CutOffStart: Date;
|
|
11
|
+
CutOffEnd: Date;
|
|
12
|
+
Qty: number;
|
|
13
|
+
};
|
|
14
|
+
/** Vehicles out on a planned load at `CutOff`, every five minutes. */
|
|
15
|
+
export type VehicleCountRecord = {
|
|
16
|
+
PlantID: number;
|
|
17
|
+
CutOff: Date;
|
|
18
|
+
CutOffStart: Date;
|
|
19
|
+
CutOffEnd: Date;
|
|
20
|
+
VehicleCount: number;
|
|
21
|
+
};
|
|
22
|
+
export type PlannedDeliveryRecord = {
|
|
23
|
+
PlantID: number;
|
|
24
|
+
CallOffID: number;
|
|
25
|
+
DeliveryStartDateTime: Date;
|
|
26
|
+
CustomerName: string | null;
|
|
27
|
+
BuildSite: string | null;
|
|
28
|
+
Qty: number;
|
|
29
|
+
Pump: number | null;
|
|
30
|
+
Pumping: boolean | null;
|
|
31
|
+
Telescopic: boolean | null;
|
|
32
|
+
ConveyorBelt: boolean | null;
|
|
33
|
+
VehicleID: number | null;
|
|
34
|
+
VehicleNo: number | null;
|
|
35
|
+
Driver: string | null;
|
|
36
|
+
LoadQty: number;
|
|
37
|
+
DeliveryTicketID: number | null;
|
|
38
|
+
DriveToSiteTime: number | null;
|
|
39
|
+
/** Minutes until the next load of the call-off, null on the last one. */
|
|
40
|
+
DeliveryInterval: number | null;
|
|
41
|
+
UnloadTime: number | null;
|
|
42
|
+
ProdDateTime: Date;
|
|
43
|
+
ProdFinishDateTime: Date | null;
|
|
44
|
+
Arrival: Date | null;
|
|
45
|
+
UnloadStart: Date | null;
|
|
46
|
+
UnloadComplete: Date | null;
|
|
47
|
+
ReturnTime: Date;
|
|
48
|
+
PrimKey: string;
|
|
49
|
+
LoadNo: number;
|
|
50
|
+
};
|
|
51
|
+
export type CallOffWarningRecord = {
|
|
52
|
+
PlantID: number;
|
|
53
|
+
CallOffID: number;
|
|
54
|
+
WarningType: string;
|
|
55
|
+
WarningText: string;
|
|
56
|
+
};
|
|
57
|
+
export type PlantsParams = {
|
|
58
|
+
PlantIDs: [number][];
|
|
59
|
+
Date: Date;
|
|
60
|
+
};
|
|
61
|
+
export type ProdVolumeResult = {
|
|
62
|
+
Table: ProdVolumeRecord[];
|
|
63
|
+
Table1: PlantRecord[];
|
|
64
|
+
};
|
|
65
|
+
export type ProdPlanResult = {
|
|
66
|
+
Table: VehicleCountRecord[];
|
|
67
|
+
Table1: PlannedDeliveryRecord[];
|
|
68
|
+
Table2: Array<{
|
|
69
|
+
Unplanned: number;
|
|
70
|
+
}>;
|
|
71
|
+
Table3: PlantRecord[];
|
|
72
|
+
Table4: CallOffWarningRecord[];
|
|
73
|
+
};
|
|
74
|
+
export type CreateAutoPlanParams = {
|
|
75
|
+
PlantID: number;
|
|
76
|
+
Date: Date;
|
|
77
|
+
DeleteExisting?: boolean;
|
|
78
|
+
} | {
|
|
79
|
+
CallOffID: number;
|
|
80
|
+
DeleteExisting?: boolean;
|
|
81
|
+
};
|
|
82
|
+
export type CreateAutoVehiclesParams = {
|
|
83
|
+
PlantID: number;
|
|
84
|
+
Date: Date;
|
|
85
|
+
ResetExisting?: boolean;
|
|
86
|
+
};
|
|
87
|
+
export type UpdatePlannedDeliveryParams = {
|
|
88
|
+
PrimKey: string;
|
|
89
|
+
DriveTime?: number | null;
|
|
90
|
+
Interval?: number | null;
|
|
91
|
+
UnloadTime?: number | null;
|
|
92
|
+
/** Wall clock time at the site, HH:mm. */
|
|
93
|
+
Arrival?: string | null;
|
|
94
|
+
};
|
|
95
|
+
export type MovePlannedDeliveryParams = {
|
|
96
|
+
PrimKey: string;
|
|
97
|
+
ProdDateTime: Date;
|
|
98
|
+
};
|
|
99
|
+
export declare const procProdVolume: ProcedureAPI<PlantsParams, ProdVolumeResult>;
|
|
100
|
+
export declare const procProdPlan: ProcedureAPI<PlantsParams, ProdPlanResult>;
|
|
101
|
+
export declare const procCreateAutoPlan: ProcedureAPI<CreateAutoPlanParams, unknown>;
|
|
102
|
+
export declare const procCreateAutoVehicles: ProcedureAPI<CreateAutoVehiclesParams, unknown>;
|
|
103
|
+
export declare const procUpdatePlannedDeliveryParam: ProcedureAPI<UpdatePlannedDeliveryParams, unknown>;
|
|
104
|
+
/** Moves a planned load in time, keeping its vehicle (the chart only drags along the time axis). */
|
|
105
|
+
export declare const procMovePlannedDelivery: ProcedureAPI<MovePlannedDeliveryParams, unknown>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ProcedureAPI } from "@olenbetong/appframe-data";
|
|
2
|
+
const TIMEOUT = 30000;
|
|
3
|
+
export const procProdVolume = new ProcedureAPI({
|
|
4
|
+
procedureId: "astp_Plant_CallOffs_Planning_ProdVolumeByQuarter",
|
|
5
|
+
parameters: [
|
|
6
|
+
{ name: "PlantIDs", type: "string", hasDefault: false, required: true },
|
|
7
|
+
{ name: "Date", type: "date", hasDefault: false, required: true },
|
|
8
|
+
{ name: "AddHoursStart", type: "number", hasDefault: true, required: false },
|
|
9
|
+
{ name: "AddHoursEnd", type: "number", hasDefault: true, required: false },
|
|
10
|
+
],
|
|
11
|
+
timeout: TIMEOUT,
|
|
12
|
+
});
|
|
13
|
+
export const procProdPlan = new ProcedureAPI({
|
|
14
|
+
procedureId: "astp_Plant_CallOffs_Planning_ProdPlan",
|
|
15
|
+
parameters: [
|
|
16
|
+
{ name: "PlantIDs", type: "string", hasDefault: false, required: true },
|
|
17
|
+
{ name: "Date", type: "date", hasDefault: false, required: true },
|
|
18
|
+
],
|
|
19
|
+
timeout: TIMEOUT,
|
|
20
|
+
});
|
|
21
|
+
export const procCreateAutoPlan = new ProcedureAPI({
|
|
22
|
+
procedureId: "astp_Plant_CallOffs_Planning_CreateAutoPlan",
|
|
23
|
+
parameters: [
|
|
24
|
+
{ name: "PlantID", type: "number", hasDefault: true, required: false },
|
|
25
|
+
{ name: "Date", type: "date", hasDefault: true, required: false },
|
|
26
|
+
{ name: "CallOffID", type: "number", hasDefault: true, required: false },
|
|
27
|
+
{ name: "DeleteExisting", type: "boolean", hasDefault: true, required: false },
|
|
28
|
+
],
|
|
29
|
+
timeout: TIMEOUT,
|
|
30
|
+
});
|
|
31
|
+
export const procCreateAutoVehicles = new ProcedureAPI({
|
|
32
|
+
procedureId: "astp_Plant_CallOffs_Planning_CreateAutoVehicles",
|
|
33
|
+
parameters: [
|
|
34
|
+
{ name: "PlantID", type: "number", hasDefault: false, required: true },
|
|
35
|
+
{ name: "Date", type: "date", hasDefault: false, required: true },
|
|
36
|
+
{ name: "CallOffID", type: "number", hasDefault: true, required: false },
|
|
37
|
+
{ name: "ResetExisting", type: "boolean", hasDefault: true, required: false },
|
|
38
|
+
],
|
|
39
|
+
timeout: TIMEOUT,
|
|
40
|
+
});
|
|
41
|
+
export const procUpdatePlannedDeliveryParam = new ProcedureAPI({
|
|
42
|
+
procedureId: "astp_Plant_CallOffs_Planning_UpdatePlannedDeliveryParam",
|
|
43
|
+
parameters: [
|
|
44
|
+
{ name: "PrimKey", type: "string", hasDefault: false, required: true },
|
|
45
|
+
{ name: "DriveTime", type: "number", hasDefault: true, required: false },
|
|
46
|
+
{ name: "Interval", type: "number", hasDefault: true, required: false },
|
|
47
|
+
{ name: "UnloadTime", type: "number", hasDefault: true, required: false },
|
|
48
|
+
{ name: "Arrival", type: "string", hasDefault: true, required: false },
|
|
49
|
+
],
|
|
50
|
+
timeout: TIMEOUT,
|
|
51
|
+
});
|
|
52
|
+
/** Moves a planned load in time, keeping its vehicle (the chart only drags along the time axis). */
|
|
53
|
+
export const procMovePlannedDelivery = new ProcedureAPI({
|
|
54
|
+
procedureId: "astp_Plant_CallOffs_MovePlannedDelivery",
|
|
55
|
+
parameters: [
|
|
56
|
+
{ name: "PrimKey", type: "string", hasDefault: false, required: true },
|
|
57
|
+
{ name: "ProdDateTime", type: "date", hasDefault: false, required: true },
|
|
58
|
+
{ name: "VehicleID", type: "number", hasDefault: true, required: false },
|
|
59
|
+
],
|
|
60
|
+
timeout: TIMEOUT,
|
|
61
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ObProductionPlan{padding-block:.5rem}.ObProductionPlan-options{display:flex;gap:.5rem 1rem;justify-content:flex-end;position:sticky;top:0;z-index:1;padding:5px;padding-inline-start:2.5rem;background-color:var(--ds-color-neutral-background-default)}.ObProductionPlan-status{position:absolute;inset-block:0;inset-inline-start:5px;display:flex;align-items:center;pointer-events:none}.ObProductionPlan-legend{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem 1rem;margin:0}.ObProductionPlan-legend-item{display:inline-flex;align-items:center;gap:.375rem}.ObProductionPlan-legend-icon{display:inline-block;width:20px;height:.875em;border-radius:5px;opacity:.8}.ObProductionPlan-unplanned{text-align:center}.ObProductionPlan-header{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:.5rem;padding-inline-start:.6rem;padding-block-start:.5rem;color:var(--ds-color-neutral-text-subtle)}.ObProductionPlan-plantname{text-align:center}.ObProductionPlan-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.5rem}.ObProductionPlan-chart .highcharts-container{color-scheme:inherit}.ObProductionPlan-row{display:flex;align-items:baseline;width:440px;color:var(--ds-color-neutral-text-default);white-space:nowrap}.ObProductionPlan-row>span{flex:none;text-align:end}.ObProductionPlan-row a{color:var(--ds-color-info-text-subtle)}.ObProductionPlan-row .ObProductionPlan-title{width:185px;overflow:hidden;text-overflow:ellipsis;text-align:start}.ObProductionPlan-row .ObProductionPlan-qty,.ObProductionPlan-row .ObProductionPlan-arrival{width:60px}.ObProductionPlan-row .ObProductionPlan-minutes{width:45px}.ObProductionPlan-icon{display:inline-block;width:1em;height:1em;vertical-align:-0.125em;background-color:currentColor;mask:center/contain no-repeat}.ObProductionPlan-icon-refresh{mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M20 12a8 8 0 1 1-2.34-5.66'/%3E%3Cpath d='M20 4v4.5h-4.5'/%3E%3C/svg%3E")}.ObProductionPlan-icon-warning{mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5 1 21.5h22L12 2.5Zm-1 7h2v6h-2v-6Zm0 8h2v2h-2v-2Z'/%3E%3C/svg%3E")}.ObProductionPlan-headers{border-block-end:1px solid var(--ds-color-neutral-border-default);font-size:.75em;color:var(--ds-color-neutral-text-subtle)}.ObProductionPlan-warning{color:var(--ds-color-warning-base-default)}.ObProductionPlan-dialog-actions{display:flex;gap:.5rem}.ObProductionPlan hr{border:0;border-block-start:1px solid var(--ds-color-neutral-border-subtle)}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import "highcharts/modules/xrange";
|
|
2
|
+
import "highcharts/modules/draggable-points";
|
|
3
|
+
import type { Ref } from "react";
|
|
4
|
+
import "./index.css";
|
|
5
|
+
export type ProductionPlanHandle = {
|
|
6
|
+
/** Fetches the data again, keeping the zoom. */
|
|
7
|
+
reload: () => void;
|
|
8
|
+
/** Sets the hours shown around the day. An undefined offset forgets the stored one. */
|
|
9
|
+
setOffsets: (min?: number, max?: number) => void;
|
|
10
|
+
};
|
|
11
|
+
export type ProductionPlanProps = {
|
|
12
|
+
plants: number[];
|
|
13
|
+
/** Midnight UTC of the day to show. */
|
|
14
|
+
date: Date;
|
|
15
|
+
/** Shows the plan without the buttons, links and dragging that change it. */
|
|
16
|
+
readOnly?: boolean;
|
|
17
|
+
/** Prefix of the settings in localStorage. */
|
|
18
|
+
storageKey: string;
|
|
19
|
+
/** Called after the charts have drawn, when the height of the page may have changed. */
|
|
20
|
+
onRendered?: () => void;
|
|
21
|
+
/** Called after the planned loads have been spread on the vehicles again, which other charts show too. */
|
|
22
|
+
onVehiclesReassigned?: () => void;
|
|
23
|
+
ref?: Ref<ProductionPlanHandle>;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* The production plan of a day: the planned production volume, the number of vehicles out and the
|
|
27
|
+
* planned loads of every call-off, one set of charts per plant. Unless `readOnly` is set, loads can be
|
|
28
|
+
* dragged to another time, and the arrival, interval, driving and unloading times changed from the
|
|
29
|
+
* columns left of the loads.
|
|
30
|
+
*/
|
|
31
|
+
export declare function ProductionPlan({ plants, date, readOnly, storageKey, onRendered, onVehiclesReassigned, ref, }: ProductionPlanProps): import("react").JSX.Element;
|