feat: add all equipment view with sorting, print functionality, and UI improvements

- Add "Всё оборудование" menu item with equipment sorted by inventory number
- Add row numbering in all equipment view
- Add print functionality for auditory view with "Проверено" column
- Hide unnecessary columns (quantity, type, owner) when printing
- Make cards full-width and responsive (container-fluid)
- Consolidate CSS styles from static/css/index.css to frontend/styles.css
- Fix text wrapping in "Расположение" column
- Add sort_by_inv parameter to /oboruds/ API endpoint

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Danamir
2026-01-22 22:48:27 +01:00
parent e2ff0f9a05
commit 35bd29c223
4 changed files with 280 additions and 36 deletions

View File

@@ -3,6 +3,7 @@ const { createApp } = Vue;
const api = {
auds: "/auditories/",
oboruds: (audId) => `/oboruds/?aud_id=${encodeURIComponent(audId)}`,
allOboruds: "/oboruds/?sort_by_inv=true",
owners: "/owners/",
};
@@ -19,8 +20,10 @@ createApp({
auditories: [],
selectedAudId: '',
oboruds: [],
allOboruds: [],
status: '',
error: '',
printTitle: '',
// auth/user management
token: '',
role: '',
@@ -98,6 +101,34 @@ createApp({
this.status = '';
}
},
async loadAllOboruds() {
this.status = 'Загрузка всего оборудования…';
this.error = '';
try {
this.allOboruds = await fetchJSON(api.allOboruds);
this.status = `Загружено ${this.allOboruds.length} записей`;
} catch (e) {
console.error(e);
this.error = 'Не удалось загрузить оборудование';
this.status = '';
}
},
async showAllEquipment() {
this.view = 'allEquipment';
await this.loadAllOboruds();
},
getAuditoryName(audId) {
if (!audId) return '';
const aud = this.auditories.find(a => a.id === audId);
return aud ? aud.audnazvanie : '';
},
printPage() {
const aud = this.auditories.find(a => a.id === this.selectedAudId);
this.printTitle = 'Аудитория № ' + (aud ? aud.audnazvanie : '');
this.$nextTick(() => {
window.print();
});
},
async saveOwner(item) {
try {
this.status = 'Сохранение владельца…';