Skip to content

Commit

Permalink
Merge pull request #12 from moevm/koroleva/serverCommunication
Browse files Browse the repository at this point in the history
Fix type input
  • Loading branch information
polinaKoroleva05 authored Nov 8, 2024
2 parents d8be62a + 9fdc927 commit 283ff45
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 27 deletions.
7 changes: 7 additions & 0 deletions client/src/components/Addition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ export default function Addition<Type>(props: { handleSend: any, obj: any }) {
}
{
props.obj[key].type == "d" && <Form.Control
type="datetime-local"
placeholder={props.obj[key].name} name={key}
/>
}
{
props.obj[key].type == "n" && <Form.Control
type="number"
placeholder={props.obj[key].name} name={key}
/>
}
Expand Down
6 changes: 3 additions & 3 deletions client/src/serviceFiles/constants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export let cellsInit = [
{ cellId: 5, cellNum: 1, tierNum: 1, isFree: true, needService: true, endOfRent: "2025-02-02", size: 0.1, warehouseId: 1 },
{ cellId: 9, cellNum: 2, tierNum: 10, isFree: true, needService: false, endOfRent: "2025-01-02", size: 0.3, warehouseId: 2 },
{ cellId: 4, cellNum: 3, tierNum: 2, isFree: true, needService: true, endOfRent: "2026-02-01", size: 0.6, warehouseId: 3 }]
{ cellId: 5, cellNum: 1, tierNum: 1, isFree: true, needService: true, endOfRent: "2025-02-02", size: 0.1, warehouseId: 1, tarifPerDay: 12.00 },
{ cellId: 9, cellNum: 2, tierNum: 10, isFree: true, needService: false, endOfRent: "2025-01-02", size: 0.3, warehouseId: 2, tarifPerDay: 12.00 },
{ cellId: 4, cellNum: 3, tierNum: 2, isFree: true, needService: true, endOfRent: "2026-02-01", size: 0.6, warehouseId: 3, tarifPerDay: 20.00}]

export let eventsInit = [{
eventId: 1,
Expand Down
58 changes: 34 additions & 24 deletions client/src/serviceFiles/types.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
export type Cell = { cellId: number, cellNum: number, tierNum: number, isFree: boolean, needService: boolean, size: number, endOfRent: string, warehouseId: number }
export type Cell = {
cellId: number,
cellNum: number,
tierNum: number,
isFree: boolean,
needService: boolean,
size: number,
endOfRent: string,
warehouseId: number,
tarifPerDay: number
}

export let cellFields = {
cellId: { name: "id", type: "s" },
cellNum: { name: "Номер", type: "s" },
tierNum: { name: "Ряд", type: "s" },
isFree: { name: "Свободна", type: "b" },
needService: { name: "Нужно ТО", type: "b" },
size: { name: "Размер", type: "s" },
endOfRent: { name: "КонецАренды", type: "d" },
warehouseId: { name: "id склада", type: "s" },
tarifPerDay: { name: "Тариф", type: "s" }
cellId: { name: "id", type: "n" },
cellNum: { name: "Номер", type: "n" },
tierNum: { name: "Ряд", type: "n" },
isFree: { name: "Свободна", type: "b" },
needService: { name: "Нужно ТО", type: "b" },
size: { name: "Размер", type: "n" },
endOfRent: { name: "КонецАренды", type: "d" },
warehouseId: { name: "id склада", type: "n" },
tarifPerDay: { name: "Тариф", type: "n" }
};
export type User = {
id: number,
Expand All @@ -24,15 +34,15 @@ export type User = {
}

export let userFields = {
id: { name: "id", type: "s" },
id: { name: "id", type: "n" },
NameSurnamePatronymic: { name: "ФИО", type: "s" },
role: { name: "Роль", type: "s" },
login: { name: "Почта", type: "s" },
birthday: { name: "Дата рождения", type: "s" },
regDate: { name: "Дата регистрации", type: "s" },
editDate: { name: "Дата обновления", type: "s" },
rentedCells: { name: "Арендованные ячейки", type: "s" },
indebtedness: { name: "Долг", type: "s" }
birthday: { name: "Дата рождения", type: "d" },
regDate: { name: "Дата регистрации", type: "d" },
editDate: { name: "Дата обновления", type: "d" },
rentedCells: { name: "Арендованные ячейки", type: "n" },
indebtedness: { name: "Долг", type: "n" }
}

export type Event = {
Expand All @@ -45,11 +55,11 @@ export type Event = {
}

export let eventFields = {
eventId: { name: "id", type: "s" },
cellId: { name: "id Ячейки", type: "s" },
userId: { name: "id Пользователя", type: "s" },
eventId: { name: "id", type: "n" },
cellId: { name: "id Ячейки", type: "n" },
userId: { name: "id Пользователя", type: "n" },
action: { name: "Действие", type: "s" },
dateAndTime: { name: "Дата и время события", type: "s" },
dateAndTime: { name: "Дата и время события", type: "d" },
description: { name: "Описание", type: "s" }
}

Expand All @@ -62,9 +72,9 @@ export type Warehouse = {
}

export let warehouseFields = {
id: { name: "id", type: "s" },
id: { name: "id", type: "n" },
adress: { name: "Адресс", type: "s" },
capacity: { name: "Вместимость", type: "s" },
chiefId: { name: "id Ответственного", type: "s" },
cells: { name: "Ячейки", type: "s" },
capacity: { name: "Вместимость", type: "n" },
chiefId: { name: "id Ответственного", type: "n" },
cells: { name: "Ячейки", type: "n" },
}

0 comments on commit 283ff45

Please sign in to comment.