fix(projects): регионы в 4 выпадашках раздела «Проекты» — сортировка по сути названия
Те же выпадашки региона (новый проект, фильтр списка, массовое add/remove регионов, карточка проекта) переведены на REGIONS_ALPHA — единый порядок с автоподбором, республики по своему имени, а не кучей. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,7 @@ import { ref, reactive, computed, onMounted, onBeforeUnmount, watch } from 'vue'
|
||||
import axios from 'axios';
|
||||
import type { Project, BalancePayload } from '../../stores/projectsStore';
|
||||
import { useProjectsStore } from '../../stores/projectsStore';
|
||||
import { REGIONS, FEDERAL_DISTRICT_NAMES } from '../../constants/regions';
|
||||
import { REGIONS_ALPHA, FEDERAL_DISTRICT_NAMES } from '../../constants/regions';
|
||||
import { formatLeadDate, firstLeadDate } from '../../utils/leadDate';
|
||||
|
||||
const props = defineProps<{ project: Project | null }>();
|
||||
@@ -29,7 +29,7 @@ const form = reactive<FormState>({
|
||||
signal_identifier: '',
|
||||
});
|
||||
|
||||
const selectableRegions = REGIONS.filter((r) => r.code !== 0);
|
||||
const selectableRegions = REGIONS_ALPHA;
|
||||
|
||||
function reseedFromProject(p: Project | null): void {
|
||||
if (!p) return;
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue';
|
||||
import { REGIONS, FEDERAL_DISTRICT_NAMES } from '../../constants/regions';
|
||||
import { REGIONS_ALPHA, FEDERAL_DISTRICT_NAMES } from '../../constants/regions';
|
||||
|
||||
const props = defineProps<{ modelValue: boolean; count: number }>();
|
||||
const emit = defineEmits<{
|
||||
@@ -84,7 +84,8 @@ const emit = defineEmits<{
|
||||
}>();
|
||||
|
||||
// code:0 — sentinel «Вся РФ»; в bulk add/remove субъектов не выбирается.
|
||||
const selectableRegions = REGIONS.filter((r) => r.code !== 0);
|
||||
// REGIONS_ALPHA уже без code 0, сортировка по сути названия.
|
||||
const selectableRegions = REGIONS_ALPHA;
|
||||
|
||||
const open = ref(props.modelValue);
|
||||
const addRegions = ref<number[]>([]);
|
||||
|
||||
@@ -205,7 +205,7 @@ import BulkActionsBar from '../components/projects/BulkActionsBar.vue';
|
||||
import NewProjectDialog from './projects/NewProjectDialog.vue';
|
||||
import EditProjectDialog from './projects/EditProjectDialog.vue';
|
||||
import ProjectLimitOverloadDialog from '../components/projects/ProjectLimitOverloadDialog.vue';
|
||||
import { REGIONS } from '../constants/regions';
|
||||
import { REGIONS_ALPHA } from '../constants/regions';
|
||||
import { formatAppliesFromMessage } from '../composables/appliesFromMessage';
|
||||
|
||||
const store = useProjectsStore();
|
||||
@@ -297,7 +297,7 @@ const statusFilters = [
|
||||
const PER_PAGE_OPTIONS = [20, 50, 100, 200];
|
||||
|
||||
// #7: фильтр регион — все 89 субъектов (без code=0 «вся РФ» — пустой regions[] и так попадает в выдачу).
|
||||
const regionFilterItems = REGIONS.filter((r) => r.code !== 0).map((r) => ({ title: r.name, value: r.code }));
|
||||
const regionFilterItems = REGIONS_ALPHA.map((r) => ({ title: r.name, value: r.code }));
|
||||
|
||||
// #7: фильтр по дню недели — индексы совпадают с битами delivery_days_mask и dayLabels drawer'а.
|
||||
const dayFilterItems = [
|
||||
|
||||
@@ -333,12 +333,12 @@ import { ref, reactive, watch, computed } from 'vue';
|
||||
import { apiClient, ensureCsrfCookie, extractErrorMessage } from '../../api/client';
|
||||
import { getRequisites, updateRequisites, type Requisites } from '../../api/requisites';
|
||||
import { firstLeadDate, formatLeadDate } from '../../utils/leadDate';
|
||||
import { REGIONS, FEDERAL_DISTRICT_NAMES } from '../../constants/regions';
|
||||
import { REGIONS_ALPHA, FEDERAL_DISTRICT_NAMES } from '../../constants/regions';
|
||||
import type { Project } from '../../stores/projectsStore';
|
||||
import DevIndexBadge from '../../components/DevIndexBadge.vue';
|
||||
import ProjectLimitOverloadDialog from '../../components/projects/ProjectLimitOverloadDialog.vue';
|
||||
|
||||
const selectableRegions = REGIONS.filter((r) => r.code !== 0);
|
||||
const selectableRegions = REGIONS_ALPHA;
|
||||
|
||||
// Дата старта лидов для баннера нового проекта (правило слепка 18:00 МСК).
|
||||
const leadStart = computed(() => firstLeadDate());
|
||||
|
||||
Reference in New Issue
Block a user