fix hyper-links

This commit is contained in:
MaKarin
2026-03-24 14:43:01 +03:00
parent dd8678cb11
commit f08b862b15
6 changed files with 96 additions and 31 deletions

View File

@@ -1,13 +1,13 @@
import { Show, SimpleShowLayout, TextField } from 'react-admin';
import { Show, SimpleShowLayout, TextField, NumberField } from 'react-admin';
export const EquipmentTypeShow = () => (
<Show>
<SimpleShowLayout>
<TextField source="code" label="code" />
<TextField source="name" label="name" />
<TextField source="manufacturer" label="manufacturer" />
<TextField source="maintenanceIntervalHours" label="maintenanceIntervalHours" />
<TextField source="overhaulIntervalHours" label="overhaulIntervalHours" />
<TextField source="code" label="Код вида оборудования" />
<TextField source="name" label="Наименование вида" />
<TextField source="manufacturer" label="Производитель" />
<NumberField source="maintenanceIntervalHours" label="Периодичность ТО, моточасов" />
<NumberField source="overhaulIntervalHours" label="Периодичность КР, моточасов" />
</SimpleShowLayout>
</Show>
);

View File

@@ -1,20 +1,28 @@
import { Show, SimpleShowLayout, TextField } from 'react-admin';
import { Show, SimpleShowLayout, TextField, NumberField, DateField, SelectField, ReferenceField } from 'react-admin';
const statusChoices = [
{ id: 'Active', name: 'В эксплуатации' },
{ id: 'Repair', name: 'В ремонте' },
{ id: 'Reserve', name: 'В резерве' },
{ id: 'WriteOff', name: 'Списано' },
];
export const EquipmentShow = () => (
<Show>
<SimpleShowLayout>
<TextField source="id" label="id" />
<TextField source="inventoryNumber" label="inventoryNumber" />
<TextField source="serialNumber" label="serialNumber" />
<TextField source="name" label="name" />
<TextField source="equipmentTypeCode" label="equipmentTypeCode" />
<TextField source="status" label="status" />
<TextField source="location" label="location" />
<TextField source="commissionedAt" label="commissionedAt" />
<TextField source="totalEngineHours" label="totalEngineHours" />
<TextField source="engineHoursSinceLastRepair" label="engineHoursSinceLastRepair" />
<TextField source="lastRepairAt" label="lastRepairAt" />
<TextField source="notes" label="notes" />
<TextField source="inventoryNumber" label="Инвентарный номер" />
<TextField source="serialNumber" label="Заводской (серийный) номер" />
<TextField source="name" label="Наименование единицы оборудования" />
<ReferenceField source="equipmentTypeCode" reference="equipment-types" label="Вид оборудования" link="show">
<TextField source="code" />
</ReferenceField>
<SelectField source="status" label="Текущий статус" choices={statusChoices} />
<TextField source="location" label="Место эксплуатации / скважина / куст" />
<DateField source="commissionedAt" label="Дата ввода в эксплуатацию" />
<NumberField source="totalEngineHours" label="Общая наработка, моточасов" />
<NumberField source="engineHoursSinceLastRepair" label="Наработка с последнего ремонта, моточасов" />
<DateField source="lastRepairAt" label="Дата последнего ремонта" />
<TextField source="notes" label="Примечания" />
</SimpleShowLayout>
</Show>
);

View File

@@ -1,20 +1,38 @@
import { Show, SimpleShowLayout, TextField } from 'react-admin';
import { Show, SimpleShowLayout, TextField, NumberField, DateField, SelectField, ReferenceField } from 'react-admin';
const repairKindChoices = [
{ id: 'TO', name: 'Техническое обслуживание' },
{ id: 'TR', name: 'Текущий ремонт' },
{ id: 'TRE', name: 'Текущий расширенный ремонт' },
{ id: 'KR', name: 'Капитальный ремонт' },
{ id: 'AR', name: 'Аварийный ремонт' },
{ id: 'MP', name: 'Метрологическая поверка' },
];
const statusChoices = [
{ id: 'Draft', name: 'Черновик' },
{ id: 'Approved', name: 'Утверждена' },
{ id: 'InWork', name: 'В работе' },
{ id: 'Done', name: 'Выполнена' },
{ id: 'Cancelled', name: 'Отменена' },
];
export const RepairOrderShow = () => (
<Show>
<SimpleShowLayout>
<TextField source="id" label="id" />
<TextField source="number" label="number" />
<TextField source="equipmentId" label="equipmentId" />
<TextField source="repairKind" label="repairKind" />
<TextField source="status" label="status" />
<TextField source="plannedAt" label="plannedAt" />
<TextField source="startedAt" label="startedAt" />
<TextField source="completedAt" label="completedAt" />
<TextField source="contractor" label="contractor" />
<TextField source="engineHoursAtRepair" label="engineHoursAtRepair" />
<TextField source="description" label="description" />
<TextField source="notes" label="notes" />
<TextField source="number" label="Номер заявки" />
<ReferenceField source="equipmentId" reference="equipment" label="Оборудование" link="show">
<TextField source="inventoryNumber" />
</ReferenceField>
<SelectField source="repairKind" label="Вид ремонта" choices={repairKindChoices} />
<SelectField source="status" label="Статус" choices={statusChoices} />
<DateField source="plannedAt" label="Плановая дата начала" />
<DateField source="startedAt" label="Фактическая дата начала" />
<DateField source="completedAt" label="Фактическая дата завершения" />
<TextField source="contractor" label="Подрядная организация (если внешний ремонт)" />
<NumberField source="engineHoursAtRepair" label="Наработка на момент ремонта, моточасов" />
<TextField source="description" label="Описание работ / дефекта" />
<TextField source="notes" label="Примечания" />
</SimpleShowLayout>
</Show>
);