From f76757311f9db1a7390fb83dad9e871f2044a30f Mon Sep 17 00:00:00 2001 From: = <=> Date: Fri, 3 Apr 2026 14:16:13 +1000 Subject: [PATCH] lab fix --- labs/lab4/src/App.jsx | 2 ++ labs/lab4/src/components/Filter.jsx | 9 ++++++++- labs/lab4/src/components/Table.jsx | 9 +++++++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/labs/lab4/src/App.jsx b/labs/lab4/src/App.jsx index cf97cd8..4095811 100644 --- a/labs/lab4/src/App.jsx +++ b/labs/lab4/src/App.jsx @@ -2,6 +2,7 @@ import { useState } from 'react' import Table from './components/Table.jsx'; import buildings from './data.js'; import './CSS/App.css' +import Task from './Task.jsx' function App() { const [count, setCount] = useState(0) @@ -9,6 +10,7 @@ function App() {

Самые высокие здания и сооружения

+ ) } diff --git a/labs/lab4/src/components/Filter.jsx b/labs/lab4/src/components/Filter.jsx index 3b03790..671431b 100644 --- a/labs/lab4/src/components/Filter.jsx +++ b/labs/lab4/src/components/Filter.jsx @@ -34,8 +34,15 @@ const Filter = (props) => { //передаем родительскому компоненту новое состояние - отфильтрованный массив props.filtering(arr); } + const doReset=(event)=>{ + event.target.querySelectorAll("input[type=\"number\"],input[type=\"text\"]").forEach(element => { + element.value=null; + }); + handleSubmit(event); + + } return ( -
+

diff --git a/labs/lab4/src/components/Table.jsx b/labs/lab4/src/components/Table.jsx index 747b5e9..364af6a 100644 --- a/labs/lab4/src/components/Table.jsx +++ b/labs/lab4/src/components/Table.jsx @@ -20,7 +20,12 @@ const Table = (props) => { }; //количество страниц разбиения таблицы - const n = Math.ceil(dataTable.length / props.amountRows); + let n = Math.ceil(dataTable.length / props.amountRows); + let rowCount = props.amountRows; + if(props.disablePagination){ + n=1; + rowCount=dataTable.length; + } // массив с номерами страниц const arr = Array.from({ length: n }, (v, i) => i + 1); @@ -37,7 +42,7 @@ const Table = (props) => {

- +
{n>1 &&