Визуальные изменение. Доработки и фиксы багов

This commit is contained in:
2025-12-12 15:08:10 +03:00
parent f5875e5b87
commit 9bf701f05a
26 changed files with 1923 additions and 419 deletions

View File

@@ -121,6 +121,8 @@ class KubsatView(LoginRequiredMixin, FormView):
'kubsat_success': req.kubsat_success,
'coords_source_lat': float(req.coords_source.y) if req.coords_source else None,
'coords_source_lon': float(req.coords_source.x) if req.coords_source else None,
'coords_object_lat': float(req.coords_object.y) if req.coords_object else None,
'coords_object_lon': float(req.coords_object.x) if req.coords_object else None,
'comment': req.comment or '',
})
context['requests_json'] = json.dumps(requests_json_data, ensure_ascii=False)
@@ -140,7 +142,8 @@ class KubsatView(LoginRequiredMixin, FormView):
date_to = form.cleaned_data.get('date_to')
has_date_filter = bool(date_from or date_to)
objitem_count = form.cleaned_data.get('objitem_count')
objitem_count_min = form.cleaned_data.get('objitem_count_min')
objitem_count_max = form.cleaned_data.get('objitem_count_max')
sources_with_date_info = []
for source in sources:
# Get latest request info for this source
@@ -200,11 +203,10 @@ class KubsatView(LoginRequiredMixin, FormView):
# Применяем фильтр по количеству точек (если задан)
include_source = True
if objitem_count:
if objitem_count == '1':
include_source = (filtered_count == 1)
elif objitem_count == '2+':
include_source = (filtered_count >= 2)
if objitem_count_min is not None and filtered_count < objitem_count_min:
include_source = False
if objitem_count_max is not None and filtered_count > objitem_count_max:
include_source = False
# Сортируем точки по дате ГЛ перед расчётом усреднённых координат
source_data['objitems_data'].sort(
@@ -302,12 +304,14 @@ class KubsatView(LoginRequiredMixin, FormView):
if filters.get('object_ownership'):
queryset = queryset.filter(ownership__in=filters['object_ownership'])
# Фильтр по количеству ObjItem
objitem_count = filters.get('objitem_count')
if objitem_count == '1':
queryset = queryset.filter(objitem_count=1)
elif objitem_count == '2+':
queryset = queryset.filter(objitem_count__gte=2)
# Фильтр по количеству ObjItem (диапазон)
objitem_count_min = filters.get('objitem_count_min')
objitem_count_max = filters.get('objitem_count_max')
if objitem_count_min is not None:
queryset = queryset.filter(objitem_count__gte=objitem_count_min)
if objitem_count_max is not None:
queryset = queryset.filter(objitem_count__lte=objitem_count_max)
# Фильтр по наличию планов (заявок со статусом 'planned')
has_plans = filters.get('has_plans')