Compare commits
No commits in common. "5498bf4935eed7fe36084af6159564133c86e7e0" and "b23f2d0d1c1414c58c0299b23d1d060bc35df1fc" have entirely different histories.
5498bf4935
...
b23f2d0d1c
@ -101,18 +101,6 @@ const EditCell = memo(({ refCell, onChange, disabled, value, tableId, cellId, ta
|
||||
return () => observer.disconnect();
|
||||
}, [state.currentValue]);
|
||||
|
||||
useEffect(() => {
|
||||
// Небольшая задержка для гарантии, что DOM полностью готов
|
||||
const timeoutId = setTimeout(() => {
|
||||
if (textareaRef.current && !disabled) {
|
||||
textareaRef.current.focus();
|
||||
textareaRef.current.select();
|
||||
}
|
||||
}, 50);
|
||||
|
||||
return () => clearTimeout(timeoutId);
|
||||
}, [disabled]);
|
||||
|
||||
const handleSave = useCallback(() => {
|
||||
const { currentValue } = state;
|
||||
|
||||
|
||||
@ -77,7 +77,6 @@ const RealtimeTable = ({ formType, formId, sheetName, direction, year }) => {
|
||||
error: wsError,
|
||||
updateCell: contextUpdateCell,
|
||||
addRow: contextAddRow,
|
||||
deleteRow: contextDeleteRow,
|
||||
startEditing: contextStartEditing,
|
||||
addProgram: contextAddProgram,
|
||||
addProject: contextAddProject,
|
||||
|
||||
@ -84,8 +84,12 @@ export function updateCells(data, newRows) {
|
||||
) {
|
||||
if (newData && typeof newData === "object") {
|
||||
Object.keys(newData).forEach((key) => {
|
||||
if (row.data && row.data[key] !== undefined) {
|
||||
row.data[key] = deepMerge(row.data[key], newData[key]);
|
||||
if (row.data && row.data[key]) {
|
||||
if (typeof row.data[key] === "object") {
|
||||
row.data[key] = deepMerge(row.data[key], newData[key]);
|
||||
} else {
|
||||
row.data[key] = newData[key];
|
||||
}
|
||||
} else if (row[key]) {
|
||||
row[key] = newData[key];
|
||||
}
|
||||
@ -108,6 +112,7 @@ export function updateCells(data, newRows) {
|
||||
|
||||
findAndUpdate(updatedRows);
|
||||
});
|
||||
|
||||
return updatedRows;
|
||||
}
|
||||
|
||||
|
||||
@ -53,6 +53,5 @@ export const SHEET_NAME = {
|
||||
"AHR_UTILITY": "АХР Коммунальные услуги",
|
||||
"AHR_SECURITY": "АХР Безопасность",
|
||||
"OTCH9F": "Отчет 9ф",
|
||||
"SMETA": "Смета",
|
||||
'STRUCTURE': 'Структура'
|
||||
"SMETA": "Смета"
|
||||
};
|
||||
@ -76,7 +76,7 @@ export default function ProjectsPage() {
|
||||
useEffect(() => {
|
||||
if (!user) return;
|
||||
if (user.role_id == ROLES_NAME_ID.admin) {
|
||||
SspApi.getAll({ is_active: true }).then(data => {
|
||||
SspApi.getAll({is_active: true}).then(data => {
|
||||
if (data.success) {
|
||||
setProjectData(prev => ({
|
||||
...prev, 'ССП/РФ': {
|
||||
@ -248,9 +248,11 @@ export default function ProjectsPage() {
|
||||
getItemId={(project) => project.id}
|
||||
getItemTitle={(project) => project.name || 'Проект'}
|
||||
extraActions={
|
||||
<PrimaryButton onClick={openModal} startIcon={<WhitePlus />} height='2.5rem' >
|
||||
Создать проект
|
||||
</PrimaryButton>
|
||||
user.role_id === ROLES_NAME_ID.admin && (
|
||||
<PrimaryButton onClick={openModal} startIcon={<WhitePlus />} height='2.5rem' >
|
||||
Создать проект
|
||||
</PrimaryButton>
|
||||
)
|
||||
}
|
||||
filterActions={
|
||||
<Box sx={{ display: 'flex', gap: 1.5, flexWrap: 'wrap', alignItems: 'center', height: '2.5rem' }}>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user