Видален параметр "Призначення"

This commit is contained in:
2025-10-19 01:21:39 +03:00
parent 3f08f3f6c9
commit c96093c890
9 changed files with 8093 additions and 5633 deletions

View File

@@ -13,7 +13,6 @@ db.serialize(() => {
icon TEXT,
uuid TEXT,
uuid_manager TEXT,
appointment TEXT DEFAULT 'lamb',
mode INTEGER DEFAULT 0,
mode_title TEXT DEFAULT 'Користувач',
FOREIGN KEY (group_id) REFERENCES groups(group_number)

View File

@@ -37,7 +37,6 @@ class AuthService {
icon: sheep.icon,
uuid: sheep.uuid,
uuid_manager: mode && mode == 2 ? sheep.uuid_manager : null,
appointment: sheep.appointment,
mode: mode ? Number(sheep.mode) : 0,
sheepRole: sheep.mode_title,
possibilities: {

View File

@@ -55,7 +55,6 @@ class SheepService {
icon: sheep.icon,
uuid: sheep.uuid,
uuid_manager: mode && mode === 2 ? sheep.uuid_manager : null,
appointment: sheep.appointment,
mode: mode ? Number(sheep.mode) : 0,
mode_title: sheep.mode_title,
possibilities: {}
@@ -126,7 +125,6 @@ class SheepService {
icon: sheep.icon,
uuid: sheep.uuid,
uuid_manager: (mode && mode == 2) ? sheep.uuid_manager : null,
appointment: sheep.appointment,
mode: mode ? Number(sheep.mode) : 0,
mode_title: sheep.mode_title,
possibilities: {}
@@ -150,7 +148,7 @@ class SheepService {
});
}
createSheep(data) {
const stmt1 = db.prepare('INSERT INTO sheeps(name, group_id, appointment, uuid) VALUES (?, ?, ?, ?)');
const stmt1 = db.prepare('INSERT INTO sheeps(name, group_id, uuid) VALUES (?, ?, ?)');
const stmt2 = db.prepare('INSERT INTO possibilities(can_view_territory, sheep_id) VALUES (?, ?)');
return new Promise((res, rej) => {
@@ -160,7 +158,6 @@ class SheepService {
stmt1.run([
data.name,
Number(data.group_id),
data.appointment,
uuid
], function (err) {
if (err) return rej(err);
@@ -185,7 +182,6 @@ class SheepService {
SET
name = ?,
group_id = ?,
appointment = ?,
mode = ?,
mode_title = ?,
uuid_manager = ?
@@ -218,7 +214,6 @@ class SheepService {
stmt1.run([
data.name,
Number(data.group_id),
data.appointment,
Number(data.mode),
data.mode_title,
Number(data.mode) == 0 ? null : (data.uuid_manager ? data.uuid_manager : uuid_manager),

View File

@@ -8,7 +8,6 @@ Table sheeps [note: 'Таблиця вісників'] {
icon text [note: 'Піктограмка вісника']
uuid text [note: 'Код доступа']
uuid_manager text [note: 'Код доступа']
appointment text [default: 'lamb', note: 'Вид призначення']
mode integer [default: 0,note: 'Тип користувача чи адміністратора']
mode_title text [default: 'Користувач', note: 'Назва типу користувача чи адміністратора']
}
@@ -37,7 +36,11 @@ Table groups [note: 'Таблиця теократичних груп'] {
Table subscription [note: 'Таблиця токенів вісників для повідомлень'] {
id integer [primary key]
sheep_id integer [note: 'ID вісника']
token text [note: 'Токен пристрою']
endpoint text [note: 'endpoint пристрою']
keys text [note: 'keys пристрою']
device_name text [note: 'Назва пристрою']
device_model text [note: 'Модель пристрою']
created_at timestamp [note: 'Дата створення']
}
Table badges [note: 'Таблиця кількісті непрочитаних повідомлень'] {
@@ -53,6 +56,7 @@ Table house [note: 'Таблиця багатоповерхових будинк
points text [default: '[]', note: 'Масив точок будинку OSM']
points_number text [default: '[]', note: 'Масив точок будинку OSM']
geo text [default: '[]', note: 'Точка будинку на мапі']
zoom integer [default: 18, note: 'Zoom на мапі']
osm_id text [default: '[]', note: 'Список ID будинків в БД OSM']
settlement text [note: 'Місто роздашування']
description text [note: 'Коментар до будинку']
@@ -65,10 +69,6 @@ Table entrance [note: 'Таблиця підїздів багатоповерх
house_id integer [note: 'ID багатоповерхового будинку']
entrance_number integer [note: 'Номер підїзду']
title text [note: 'Назва підїзду']
points text [default: '[]', note: 'Масив точок підїзду OSM']
points_number text [default: '[]', note: 'Масив точок підїзду OSM']
floors_quantity text [note: 'Кількість поверхів в підїзді']
apartments_quantity text [note: 'Кількість квартир в підїзді']
description text [note: 'Коментар до підїзду']
created_at timestamp [note: 'Дата створення підїзду']
updated_at timestamp [note: 'Дата зміни підїзду']
@@ -111,8 +111,8 @@ Table homestead [note: 'Таблиця житлових районів'] {
title text [note: 'Житловий район']
number text [note: 'Номер житловогу району']
points text [default: '[]', note: 'Масив точок житловогу району OSM']
point_icons text [default: '[]', note: 'Масив точок піктограм житловогу району']
geo text [default: '[]', note: 'Точка житловогу району на мапі']
zoom integer [default: 18, note: 'Zoom на мапі']
osm_id text [default: '[]', note: 'Список ID житловоих районів в БД OSM']
settlement text [note: 'Місто роздашування']
description text [note: 'Коментар до житловогу району']
@@ -122,7 +122,7 @@ Table homestead [note: 'Таблиця житлових районів'] {
Table homestead_history [note: 'Таблиця історії вісників які опрацьовували житлові райони'] {
id integer [primary key]
homestead_id integer [note: 'ID підїзду']
homestead_id integer [note: 'ID житлового район']
name text [note: 'Хто опрацовував (імʼя)']
date_start timestamp [note: 'Початок опрацювання']
date_end timestamp [note: 'Кінець опрацювання']
@@ -131,6 +131,26 @@ Table homestead_history [note: 'Таблиця історії вісників
working integer [default: 0, note: 'Статус опрацювання']
}
Table building [note: 'Таблиця приватних будинків'] {
id integer [primary key]
homestead_id integer [note: 'ID житлового район']
geo text [default: '[]', note: 'Точка будинку на мапі']
title text [note: 'Назва будинку']
status integer [note: 'Статус будинку']
description text [note: 'Коментар до будинку']
sheep_id integer [note: 'ID вісника що зробив зміни']
updated_at timestamp [note: 'Дата зміни історії будинку']
}
Table building_history [note: 'Таблиця історії опрацьовування приватних будинків'] {
id integer [primary key]
sheep_id integer [note: 'ID вісника що зробив зміни']
building_id integer [note: 'ID приватного будинку']
status integer [note: 'Статус будинку']
description text [note: 'Коментар до будинку']
created_at timestamp [note: 'Дата зміни історії будинку']
}
Table meetings_schedule [note: 'Таблиця розкладу зібрань'] {
id integer [primary key]
date timestamp [note: 'Дата зібрання']
@@ -167,16 +187,15 @@ Table stand_schedule [note: 'Таблиця записів служіння зі
Table stand_schedule_history [note: 'Таблиця записів служіння зі стендом'] {
id integer [primary key]
stand_schedule_id integer [note: 'ID стенду']
date timestamp [note: 'Дата служіння зі стендом']
sheep_id integer [note: 'ID вісника']
hour integer [note: 'Година запису']
number_sheep text [note: 'Номер вісника, що одночасно стоїть']
created_at timestamp [note: 'Дата зміни запису']
}
Ref: sheeps.id - possibilities.sheep_id // one-to-one
Ref: sheeps.id < apartments_history.sheep_id // one-to-many
Ref: sheeps.id < apartments.sheep_id // one-to-many
Ref: sheeps.id < building_history.sheep_id // one-to-many
Ref: sheeps.id < building.sheep_id // one-to-many
Ref: sheeps.id < subscription.sheep_id // one-to-many
Ref: sheeps.id < badges.sheep_id // one-to-many
Ref: sheeps.id < homestead_history.sheep_id // one-to-many
@@ -192,11 +211,15 @@ Ref: groups.group_number < homestead_history.group_id // one-to-many
Ref: house.id < entrance.house_id // one-to-many
Ref: homestead.id < homestead_history.homestead_id // one-to-many
Ref: homestead.id < building.homestead_id // one-to-many
Ref: entrance.id < entrance_history.entrance_id // one-to-many
Ref: entrance.id < apartments.entrance_id // one-to-many
Ref: apartments.id < apartments_history.apartments_id // one-to-many
Ref: building.id < building_history.building_id // one-to-many
Ref: stand_list.id < stand_schedule.stand_id // one-to-many
Ref: stand_schedule.id < stand_schedule_history.stand_schedule_id // one-to-many

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 332 KiB

After

Width:  |  Height:  |  Size: 394 KiB

View File

@@ -88,15 +88,6 @@
<option value="7">Група 7</option>
</select>
</div>
<div class="editor-blocks-inputs">
<label for="sheep-editor-appointment">Призначення</label>
<select id="sheep-editor-appointment" name="appointment">
<option value="lamb" selected>Вісник</option>
<option value="pioneer">Піонер</option>
<option value="attender">Служитель збору</option>
<option value="elder">Старійшина збору</option>
</select>
</div>
<div class="editor-blocks-inputs">
<label for="sheep-editor-mode">Права</label>
<select id="sheep-editor-mode" name="mode">
@@ -346,15 +337,6 @@
<option value="7">Група 7</option>
</select>
</div>
<div class="addeds-blocks-inputs">
<label for="sheep-addeds-appointment">Призначення</label>
<select id="sheep-addeds-appointment" name="appointment" required>
<option value="lamb" selected>Вісник</option>
<option value="pioneer">Піонер</option>
<option value="attender">Служитель збору</option>
<option value="elder">Старійшина збору</option>
</select>
</div>
<button id="sheep-addeds-button">Додати</button>
</form>

View File

@@ -50,7 +50,6 @@ const SheepsEvents = {
sheep.name = form.elements["name"].value;
sheep.group_id = Number(formData.get("group_id"));
sheep.appointment = formData.get("appointment");
sheep.mode = formData.get("mode");
sheep.mode_title = ["Користувач", "Модератор", "Адміністратор"][sheep.mode] || "Користувач";
@@ -285,14 +284,6 @@ const Sheeps = {
Router.navigate(`sheeps/${id}`, true, false);
// if (id) {
// let objControl = document.getElementsByName('sheep_' + id);
// window.scroll({
// top: objControl[0].offsetTop,
// behavior: 'smooth'
// });
// }
let block_sheep_list = document.getElementById('block-sheeps-list');
let block_sheep_info = document.getElementById('block-sheep-info');
@@ -323,7 +314,6 @@ const Sheeps = {
let sheep_editor_uuid_copy = document.getElementById('sheep-editor-uuid-copy');
let sheep_editor_name = document.getElementById('sheep-editor-name');
let sheep_editor_group_id = document.getElementById('sheep-editor-group_id');
let sheep_editor_appointment = document.getElementById('sheep-editor-appointment');
let sheep_editor_mode = document.getElementById('sheep-editor-mode');
@@ -354,8 +344,6 @@ const Sheeps = {
sheep_editor_group_id.value = sheep.group_id;
sheep_editor_appointment.value = sheep.appointment;
if (USER.mode == 2 && (sheep.mode != 0)) {
sheep_editor_access_moder.style.display = "";

View File

@@ -1,4 +1,4 @@
const STATIC_CACHE_NAME = 'v2.0.1';
const STATIC_CACHE_NAME = 'v2.0.2';
const FILES_TO_CACHE = [
'/',