system parameters, groups, fixes and more

This commit is contained in:
Ivan
2023-09-04 12:11:22 +03:00
parent 82b24eb909
commit 8fea734b31
13 changed files with 862 additions and 507 deletions

View File

@ -13,6 +13,7 @@ const content1 = document.getElementById("details");
const content2 = document.getElementById("sim");
const content3 = document.getElementById("ts");
const content4 = document.getElementById("equipment");
const content5 = document.getElementById("parameters");
const btn1 = document.getElementById("continue-details");
const btn2 = document.getElementById("continue-sim");
const btn3 = document.getElementById("continue-ts");
@ -103,6 +104,8 @@ for (let radioButton of radioButtons) {
switchContent(content3);
} else if (radioButton.value === "equipment") {
switchContent(content4);
} else if (radioButton.value === "parameters") {
switchContent(content5);
}
});
}

View File

@ -1,115 +1,4 @@
// const devices = [
// {
// id: "2",
// group: "2-device-2",
// driverID: "233",
// name: "Иван",
// surname: "Спахов",
// numberTS: "008803559E",
// phone: "+7 999 123 45 67",
// mail: "spahov@mail.ru",
// driverCard: "RUD0000000000111",
// },
// {
// id: "6",
// group: "2-device-1",
// driverID: "782",
// name: "Александр",
// surname: "Богаченко",
// numberTS: "0088036B78",
// phone: "+7 989 443 23 46",
// mail: "bogachenko@mail.ru",
// driverCard: "RUD0000000000111",
// },
// {
// id: "7",
// group: "2-device-4",
// driverID: "2943",
// name: "Михаил",
// surname: "Гукасян",
// numberTS: "009800852A",
// phone: "+7 909 133 55 67",
// mail: "agucasyan@mail.ru",
// driverCard: "RUD0000000000111",
// },
// {
// id: "8",
// group: "2-device-4",
// driverID: "87",
// name: "Марат",
// surname: "Шмидт",
// numberTS: "009800858D",
// phone: "+7 915 555 45 89",
// mail: "shmidt@mail.ru",
// driverCard: "RUD0000000000111",
// },
// {
// id: "9",
// group: "1-device-1",
// driverID: "823",
// name: "Никита",
// surname: "Ильяшенко",
// numberTS: "00980084FD",
// phone: "+7 909 123 45 67",
// mail: "iluashenko@mail.ru",
// driverCard: "RUD0000000000111",
// },
// {
// id: "10",
// group: "2-device-4",
// driverID: "15",
// name: "Валерий",
// surname: "Сараев",
// numberTS: "0088036B7F",
// phone: "+7 909 123 45 67",
// mail: "saraev@mail.ru",
// driverCard: "RUD0000000000111",
// },
// {
// id: "11",
// group: "2-device-3",
// driverID: "423",
// name: "Александр",
// surname: "Курочкин",
// numberTS: "00880302CD",
// phone: "+7 999 123 45 67",
// mail: "curochkin@mail.ru",
// driverCard: "RUD0000000000111",
// },
// {
// id: "12",
// group: "1-device-2",
// driverID: "6456",
// name: "Екатерина",
// surname: "Миненко",
// numberTS: "008802A035",
// phone: "+7 999 123 45 67",
// mail: "minenko@mail.ru",
// driverCard: "RUD0000000000111",
// },
// {
// id: "13",
// group: "3-device-1",
// driverID: "887",
// name: "Виталий",
// surname: "Гаспарян",
// numberTS: "008802A96A",
// phone: "+7 999 123 45 67",
// mail: "gosparyan@mail.ru",
// driverCard: "RUD0000000000111",
// },
// {
// id: "15",
// group: "1-device-1",
// driverID: "742",
// name: "Светлана",
// surname: "Амусова",
// numberTS: "00880302C7",
// phone: "+7 999 123 45 67",
// mail: "amusova@mail.ru",
// driverCard: "RUD0000000000111",
// },
// ];
// Получаем высоту таблицы и определяем, сколько строк помещается на странице
let currentPage = 1;

View File

@ -1,105 +1,3 @@
// const devices = [
// {
// id: "1",
// group: "0001",
// name: "Разговор по телефону",
// reportID: "354",
// plate: "AO30877",
// numberTS: "008803559E",
// time: "12.03.23 17:33",
// place: "59.852371, 30.344543",
// },
// {
// id: "2",
// group: "0001",
// name: "Водитель зевает",
// reportID: "353",
// plate: "AO64377",
// numberTS: "0088036B78",
// time: "12.03.23 14:26",
// place: "60.058236, 30.315283",
// },
// {
// id: "3",
// group: "0002",
// name: "Усталость",
// reportID: "352",
// plate: "ГД44377",
// numberTS: "009800852A",
// time: "12.03.23 10:07",
// place: "59.878256, 30.31962",
// },
// {
// id: "4",
// group: "0003",
// name: "Водитель зевает",
// reportID: "351",
// plate: "УА86577",
// numberTS: "009800858D",
// time: "12.03.23 09:56",
// place: "60.045981, 30.4134",
// },
// {
// id: "5",
// group: "0003",
// name: "Разговор по телефону",
// reportID: "350",
// plate: "БВ74665",
// numberTS: "00980084FD",
// time: "11.03.23 20:43",
// place: "59.83257, 30.389893",
// },
// {
// id: "6",
// group: "0004",
// name: "Разговор по телефону",
// reportID: "349",
// plate: "ЦУ445101",
// numberTS: "0088036B7F",
// time: "11.03.23 19:17",
// place: "59.959926, 30.42224",
// },
// {
// id: "7",
// group: "0005",
// name: "Усталость",
// reportID: "348",
// plate: "КТ32376",
// numberTS: "00880302CD",
// time: "11.03.23 15:32",
// place: "60.046346, 30.405688",
// },
// {
// id: "8",
// group: "0006",
// name: "Курение за рулём",
// reportID: "347",
// plate: "ОА33277",
// numberTS: "008802A035",
// time: "11.03.23 15:06",
// place: "59.956626, 30.234408",
// },
// {
// id: "9",
// group: "0007",
// name: "Водитель отвлекся",
// reportID: "346",
// plate: "КЛ987102",
// numberTS: "008802A96A",
// time: "11.03.23 12:44",
// place: "59.956626, 30.234408",
// },
// {
// id: "10",
// group: "0002",
// name: "Водитель отвлекся",
// reportID: "345",
// plate: "АУ22377",
// numberTS: "00880302C7",
// time: "11.03.23 11:40",
// place: "59.956626, 30.234408",
// },
// ];
// Получаем высоту таблицы и определяем, сколько строк помещается на странице
let currentPage = 1;
@ -245,7 +143,7 @@ const applyFilterAndSearch = () => {
const searchString =
`${device.group} ${device.name} ${device.id} ${device.place} ${device.numberTS} ${device.time} ${device.place} ${device.geo} ${device.serial}`.toLowerCase();
const matchGroup =
groupFilters.length === 0 || groupFilters.includes(device.group);
groupFilters.length === 0 || groupFilters.includes(device.group) || groupFilters.includes(device.serial);
const matchSearch = !searchValue || searchString.includes(searchValue);
// Фильтр по временному диапазону

View File

@ -1,172 +1,3 @@
// const devices = [
// {
// id: "1",
// group: "2-device-1",
// name: "Трамваи",
// plate: "AB1234",
// serial: "008803559E",
// sim: "1234567890",
// channels: 12,
// ip: "192.168.0.1",
// port: 17891,
// },
// {
// id: "2",
// group: "2-device-2",
// name: "Электробусы",
// plate: "BC2345",
// serial: "008803559E",
// sim: "2345678901",
// channels: 12,
// ip: "192.168.0.2",
// port: 17891,
// },
// {
// id: "3",
// group: "2-device-1",
// name: "Трамваи",
// plate: "CD3456",
// serial: "009800852A",
// sim: "3456789012",
// channels: 16,
// ip: "192.168.0.3",
// port: 17891,
// },
// {
// id: "4",
// group: "2-device-3",
// name: "Троллейбусы",
// plate: "DE4567",
// serial: "009800858D",
// sim: "4567890123",
// channels: 12,
// ip: "192.168.0.4",
// port: 17891,
// },
// {
// id: "5",
// group: "2-device-2",
// name: "Электробусы",
// plate: "EF5678",
// serial: "00980084FD",
// sim: "5678901234",
// channels: 16,
// ip: "192.168.0.5",
// port: 17891,
// },
// {
// id: "6",
// group: "2-device-1",
// name: "Трамваи",
// plate: "FG6789",
// serial: "0088036B7F",
// sim: "6789012345",
// channels: 16,
// ip: "192.168.0.6",
// port: 17891,
// },
// {
// id: "7",
// group: "2-device-4",
// name: "Старые ТС",
// plate: "GH7890",
// serial: "00880302CD",
// sim: "7890123456",
// channels: 12,
// ip: "192.168.0.7",
// port: 17891,
// },
// {
// id: "8",
// group: "2-device-4",
// name: "Старые ТС",
// plate: "HI8901",
// serial: "008802A035",
// sim: "8901234567",
// channels: 12,
// ip: "192.168.0.8",
// port: 17891,
// },
// {
// id: "9",
// group: "1-device-1",
// name: "Трамваи",
// plate: "IJ9012",
// serial: "008802A96A",
// sim: "9012345678",
// channels: 16,
// ip: "192.168.0.9",
// port: 17891,
// },
// {
// id: "10",
// group: "2-device-4",
// name: "Старые ТС",
// plate: "КТ32376",
// serial: "00880302C7",
// sim: "7012345678",
// channels: 14,
// ip: "192.168.0.10",
// port: 17891,
// },
// {
// id: "11",
// group: "2-device-3",
// name: "Троллейбусы",
// plate: "ОА33277",
// serial: "008802A035",
// sim: "9034234348",
// channels: 12,
// ip: "192.168.0.11",
// port: 17891,
// },
// {
// id: "12",
// group: "1-device-2",
// name: "Маршрутки",
// plate: "КЛ987102",
// serial: "009800852A",
// sim: "9023345678",
// channels: 10,
// ip: "192.168.0.12",
// port: 17891,
// },
// {
// id: "13",
// group: "3-device-1",
// name: "Троллейбусы",
// plate: "КЛ987102",
// serial: "0088036B78",
// sim: "9023345678",
// channels: 8,
// ip: "192.168.0.13",
// port: 17891,
// },
// {
// id: "14",
// group: "3-device-1",
// name: "Маршрутки",
// plate: "КЛ987102",
// serial: "0088036B7F",
// sim: "9023345678",
// channels: 8,
// ip: "192.168.0.14",
// port: 17891,
// },
// {
// id: "15",
// group: "1-device-1",
// name: "Трамваи",
// plate: "КЛ987102",
// serial: "008802A96A",
// sim: "9023345678",
// channels: 16,
// ip: "192.168.0.15",
// port: 17891,
// },
// ];
console.log(devices);
// Получаем высоту таблицы и определяем, сколько строк помещается на странице
let currentPage = 1;
@ -208,7 +39,7 @@ const createTable = () => {
// Добавляем ячейки с данными
const name = document.createElement("td");
name.textContent = device.name;
name.textContent = device.group;
row.appendChild(name);
const plate = document.createElement("td");
plate.textContent = device.plate;
@ -326,7 +157,7 @@ const applyFilterAndSearch = () => {
const searchString =
`${device.group} ${device.name} ${device.plate} ${device.number} ${device.serial} ${device.sim} ${device.channels} ${device.ip} ${device.port}`.toLowerCase();
const matchGroup =
groupFilters.length === 0 || groupFilters.includes(device.group);
groupFilters.length === 0 || groupFilters.includes(device.group) || groupFilters.includes(device.serial);
const matchSearch = !searchValue || searchString.includes(searchValue);
return matchGroup && matchSearch;
});