30 lines
1.0 KiB
JavaScript
30 lines
1.0 KiB
JavaScript
export const SIGNAL_ROLE_OPTIONS = [
|
|
{ value: "", label: "未设置" },
|
|
{ value: "rem", label: "REM 远程使能" },
|
|
{ value: "run", label: "RUN 运行" },
|
|
{ value: "flt", label: "FLT 故障" },
|
|
{ value: "ii", label: "II 电流" },
|
|
{ value: "start_cmd", label: "启动命令" },
|
|
{ value: "stop_cmd", label: "停止命令" },
|
|
];
|
|
|
|
export const EQUIPMENT_KIND_OPTIONS = [
|
|
{ value: "", label: "未设置" },
|
|
{ value: "coal_feeder", label: "投煤器" },
|
|
{ value: "distributor", label: "布料机" },
|
|
];
|
|
|
|
export function renderRoleOptions(selected = "") {
|
|
return SIGNAL_ROLE_OPTIONS.map((item) => {
|
|
const isSelected = item.value === selected ? "selected" : "";
|
|
return `<option value="${item.value}" ${isSelected}>${item.label}</option>`;
|
|
}).join("");
|
|
}
|
|
|
|
export function renderEquipmentKindOptions(selected = "") {
|
|
return EQUIPMENT_KIND_OPTIONS.map((item) => {
|
|
const isSelected = item.value === selected ? "selected" : "";
|
|
return `<option value="${item.value}" ${isSelected}>${item.label}</option>`;
|
|
}).join("");
|
|
}
|