Визуальные изменение. Доработки и фиксы багов
This commit is contained in:
@@ -511,6 +511,24 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Standard Selection - Multi-select -->
|
||||
<div class="mb-2">
|
||||
<label class="form-label">Стандарт:</label>
|
||||
<div class="d-flex justify-content-between mb-1">
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary"
|
||||
onclick="selectAllOptions('standard_id', true)">Выбрать</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary"
|
||||
onclick="selectAllOptions('standard_id', false)">Снять</button>
|
||||
</div>
|
||||
<select name="standard_id" class="form-select form-select-sm mb-2" multiple size="4">
|
||||
{% for standard in standards %}
|
||||
<option value="{{ standard.id }}" {% if standard.id in selected_standards %}selected{% endif %}>
|
||||
{{ standard.name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Frequency Filter -->
|
||||
<div class="mb-2">
|
||||
<label class="form-label">Частота, МГц:</label>
|
||||
@@ -565,6 +583,24 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Complex Selection - Multi-select -->
|
||||
<div class="mb-2">
|
||||
<label class="form-label">Комплекс:</label>
|
||||
<div class="d-flex justify-content-between mb-1">
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary"
|
||||
onclick="selectAllOptions('complex_id', true)">Выбрать</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary"
|
||||
onclick="selectAllOptions('complex_id', false)">Снять</button>
|
||||
</div>
|
||||
<select name="complex_id" class="form-select form-select-sm mb-2" multiple size="2">
|
||||
{% for complex_value, complex_label in complexes %}
|
||||
<option value="{{ complex_value }}" {% if complex_value in selected_complexes %}selected{% endif %}>
|
||||
{{ complex_label }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Apply Filters and Reset Buttons -->
|
||||
<div class="d-grid gap-2 mt-2">
|
||||
<button type="submit" class="btn btn-primary btn-sm">Применить</button>
|
||||
@@ -1162,25 +1198,30 @@ function updateFilterCounter() {
|
||||
const formData = new FormData(form);
|
||||
let filterCount = 0;
|
||||
|
||||
// Multi-select fields to handle separately
|
||||
const multiSelectFields = ['satellite_id', 'polarization_id', 'modulation_id', 'standard_id', 'mirror_id', 'complex_id', 'info_id', 'ownership_id', 'request_status', 'request_priority'];
|
||||
|
||||
// Count non-empty form fields
|
||||
for (const [key, value] of formData.entries()) {
|
||||
if (value && value.trim() !== '') {
|
||||
// For multi-select fields, skip counting individual selections
|
||||
if (key === 'satellite_id') {
|
||||
if (multiSelectFields.includes(key)) {
|
||||
continue;
|
||||
}
|
||||
filterCount++;
|
||||
}
|
||||
}
|
||||
|
||||
// Count selected options in satellite multi-select field
|
||||
const satelliteSelect = document.querySelector('select[name="satellite_id"]');
|
||||
if (satelliteSelect) {
|
||||
const selectedOptions = Array.from(satelliteSelect.selectedOptions).filter(opt => opt.selected);
|
||||
if (selectedOptions.length > 0) {
|
||||
filterCount++;
|
||||
// Count selected options in multi-select fields
|
||||
multiSelectFields.forEach(fieldName => {
|
||||
const selectElement = document.querySelector(`select[name="${fieldName}"]`);
|
||||
if (selectElement) {
|
||||
const selectedOptions = Array.from(selectElement.selectedOptions).filter(opt => opt.selected);
|
||||
if (selectedOptions.length > 0) {
|
||||
filterCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Check if polygon filter is active
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
@@ -2450,15 +2491,15 @@ function showTransponderModal(transponderId) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Координаты -->
|
||||
<!-- Координаты ГСО -->
|
||||
<div class="row">
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="editRequestCoordsLat" class="form-label">Широта</label>
|
||||
<label for="editRequestCoordsLat" class="form-label">Широта ГСО</label>
|
||||
<input type="number" step="0.000001" class="form-control" id="editRequestCoordsLat" name="coords_lat"
|
||||
placeholder="Например: 55.751244">
|
||||
</div>
|
||||
<div class="col-md-4 mb-3">
|
||||
<label for="editRequestCoordsLon" class="form-label">Долгота</label>
|
||||
<label for="editRequestCoordsLon" class="form-label">Долгота ГСО</label>
|
||||
<input type="number" step="0.000001" class="form-control" id="editRequestCoordsLon" name="coords_lon"
|
||||
placeholder="Например: 37.618423">
|
||||
</div>
|
||||
@@ -2468,6 +2509,30 @@ function showTransponderModal(transponderId) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Координаты источника -->
|
||||
<div class="row">
|
||||
<div class="col-md-3 mb-3">
|
||||
<label for="editRequestCoordsSourceLat" class="form-label">Широта источника</label>
|
||||
<input type="number" step="0.000001" class="form-control" id="editRequestCoordsSourceLat" name="coords_source_lat"
|
||||
placeholder="Например: 55.751244">
|
||||
</div>
|
||||
<div class="col-md-3 mb-3">
|
||||
<label for="editRequestCoordsSourceLon" class="form-label">Долгота источника</label>
|
||||
<input type="number" step="0.000001" class="form-control" id="editRequestCoordsSourceLon" name="coords_source_lon"
|
||||
placeholder="Например: 37.618423">
|
||||
</div>
|
||||
<div class="col-md-3 mb-3">
|
||||
<label for="editRequestCoordsObjectLat" class="form-label">Широта объекта</label>
|
||||
<input type="number" step="0.000001" class="form-control" id="editRequestCoordsObjectLat" name="coords_object_lat"
|
||||
placeholder="Например: 55.751244">
|
||||
</div>
|
||||
<div class="col-md-3 mb-3">
|
||||
<label for="editRequestCoordsObjectLon" class="form-label">Долгота объекта</label>
|
||||
<input type="number" step="0.000001" class="form-control" id="editRequestCoordsObjectLon" name="coords_object_lon"
|
||||
placeholder="Например: 37.618423">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="editRequestPlannedAt" class="form-label">Дата и время планирования</label>
|
||||
@@ -2644,6 +2709,10 @@ function openCreateRequestModalForSource() {
|
||||
document.getElementById('editSourceDataCard').style.display = 'none';
|
||||
document.getElementById('editRequestCoordsLat').value = '';
|
||||
document.getElementById('editRequestCoordsLon').value = '';
|
||||
document.getElementById('editRequestCoordsSourceLat').value = '';
|
||||
document.getElementById('editRequestCoordsSourceLon').value = '';
|
||||
document.getElementById('editRequestCoordsObjectLat').value = '';
|
||||
document.getElementById('editRequestCoordsObjectLon').value = '';
|
||||
document.getElementById('editRequestPointsCount').value = '-';
|
||||
|
||||
// Загружаем данные источника
|
||||
@@ -2700,7 +2769,7 @@ function editSourceRequest(requestId) {
|
||||
document.getElementById('editRequestSymbolRate').value = data.symbol_rate || '-';
|
||||
document.getElementById('editRequestPointsCount').value = data.points_count || '0';
|
||||
|
||||
// Заполняем координаты
|
||||
// Заполняем координаты ГСО
|
||||
if (data.coords_lat !== null) {
|
||||
document.getElementById('editRequestCoordsLat').value = data.coords_lat.toFixed(6);
|
||||
} else {
|
||||
@@ -2712,6 +2781,30 @@ function editSourceRequest(requestId) {
|
||||
document.getElementById('editRequestCoordsLon').value = '';
|
||||
}
|
||||
|
||||
// Заполняем координаты источника
|
||||
if (data.coords_source_lat !== null) {
|
||||
document.getElementById('editRequestCoordsSourceLat').value = data.coords_source_lat.toFixed(6);
|
||||
} else {
|
||||
document.getElementById('editRequestCoordsSourceLat').value = '';
|
||||
}
|
||||
if (data.coords_source_lon !== null) {
|
||||
document.getElementById('editRequestCoordsSourceLon').value = data.coords_source_lon.toFixed(6);
|
||||
} else {
|
||||
document.getElementById('editRequestCoordsSourceLon').value = '';
|
||||
}
|
||||
|
||||
// Заполняем координаты объекта
|
||||
if (data.coords_object_lat !== null) {
|
||||
document.getElementById('editRequestCoordsObjectLat').value = data.coords_object_lat.toFixed(6);
|
||||
} else {
|
||||
document.getElementById('editRequestCoordsObjectLat').value = '';
|
||||
}
|
||||
if (data.coords_object_lon !== null) {
|
||||
document.getElementById('editRequestCoordsObjectLon').value = data.coords_object_lon.toFixed(6);
|
||||
} else {
|
||||
document.getElementById('editRequestCoordsObjectLon').value = '';
|
||||
}
|
||||
|
||||
document.getElementById('editSourceDataCard').style.display = 'block';
|
||||
|
||||
const modal = new bootstrap.Modal(document.getElementById('createRequestModal'));
|
||||
|
||||
Reference in New Issue
Block a user