c41df77c09
Moves estimate work import into the app as ?page=import&projectId=. Behaviour is kept 1:1 with the legacy web part: project lookup with UniqueId0 check, project objects query, works paging by 200 with the progress text, 250 ms debounced search over the same fields, 100 rows per page, select-all over all filtered not-imported works, duplicate protection via cree9_comment, the same Dataverse POST body, import into the selected object and import with object creation (find or create root and child in «Объекты», cached per pair), toasts and all texts. The object picker still shows only the first 100 matches (legacy bug). HTTP-response errors are detected by their status field instead of instanceof HttpError, which does not survive the ES5 build target. Deviations are listed in docs/MIGRATION-CHECKLIST.md section 6. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
69 lines
3.3 KiB
TypeScript
69 lines
3.3 KiB
TypeScript
// Тексты раздела «Импорт работ» — дословно из stroy-bot-import-works.
|
|
|
|
export const IMPORT_TEXTS = {
|
|
header: {
|
|
label: 'ИМПОРТ РАБОТ',
|
|
loading: 'Загрузка...',
|
|
projectFallback: 'Проект'
|
|
},
|
|
loading: {
|
|
project: 'Загрузка проекта...',
|
|
objects: 'Загрузка объектов...',
|
|
works: 'Загрузка работ...',
|
|
worksProgress: (loaded: number, total: number): string => `Загрузка работ... ${loaded} из ${total}`
|
|
},
|
|
errors: {
|
|
noProjectId: 'Не указан projectId в URL',
|
|
projectNotOk: 'Не удалось загрузить данные проекта',
|
|
projectFailed: 'Ошибка загрузки данных проекта',
|
|
objectsNotOk: 'Не удалось загрузить список объектов',
|
|
objectsFailed: 'Ошибка загрузки объектов',
|
|
worksNotOk: 'Не удалось загрузить список работ',
|
|
worksFailed: 'Ошибка загрузки работ',
|
|
createObject: (title: string): string => `Не удалось создать объект: ${title}`
|
|
},
|
|
notBound: 'Проект не привязан к справочнику проектов. Обратитесь к администратору.',
|
|
objectPicker: {
|
|
label: 'Объект',
|
|
placeholder: 'Выберите объект...',
|
|
clear: 'Сбросить объект',
|
|
dialogTitle: 'Выбор объекта',
|
|
search: 'Поиск...',
|
|
nothingFound: 'Ничего не найдено'
|
|
},
|
|
works: {
|
|
empty: 'Работы не найдены',
|
|
nothingFound: 'Ничего не найдено по запросу',
|
|
searchPlaceholder: 'Поиск по работам (название, код СНБ, объект, ед. изм., объём)...',
|
|
countAll: (total: number, page: number, pages: number): string =>
|
|
`Работы (${total}), страница ${page} из ${pages}`,
|
|
countFound: (found: number, total: number, page: number, pages: number): string =>
|
|
`Найдено: ${found} из ${total} — страница ${page} из ${pages}`,
|
|
selectAll: 'Выделить всё на странице',
|
|
deselectAll: 'Снять все на странице',
|
|
columns: { number: '#', name: 'Наименование', code: 'Код СНБ', unit: 'Ед. изм.', volume: 'Объём' },
|
|
imported: '✓ импортировано',
|
|
alreadyImported: 'Уже импортировано',
|
|
prevPage: '<',
|
|
nextPage: '>',
|
|
ellipsis: '...'
|
|
},
|
|
importBar: {
|
|
selected: (count: number): string => `Выбрано: ${count}`,
|
|
importWithObjects: 'Импорт с созданием объекта',
|
|
import: 'Импортировать',
|
|
importing: 'Импорт...'
|
|
},
|
|
structureHint: {
|
|
label: 'Объекты из сметы:',
|
|
arrow: '→',
|
|
more: (rest: number): string => `+ ещё ${rest}`
|
|
},
|
|
toasts: {
|
|
selectObject: 'Выберите объект чтобы импортировать работу в объект',
|
|
success: (count: number): string => `✓ Успешно импортировано: ${count}`,
|
|
partial: (success: number, errors: number): string => `Импортировано: ${success}, ошибок: ${errors}`
|
|
},
|
|
noValue: '—'
|
|
} as const;
|