|
|
@ -11,11 +11,13 @@ import MuiDataGrid from 'views/cmm/mui-grid/MuiDataGrid';
|
|
|
|
import { IconFileText } from '@tabler/icons';
|
|
|
|
import { IconFileText } from '@tabler/icons';
|
|
|
|
import { useTheme } from '@mui/material/styles';
|
|
|
|
import { useTheme } from '@mui/material/styles';
|
|
|
|
import Box from '@mui/material/Box';
|
|
|
|
import Box from '@mui/material/Box';
|
|
|
|
|
|
|
|
import { useAlert } from 'react-alert';
|
|
|
|
|
|
|
|
|
|
|
|
// ==============================|| DEFAULT DASHBOARD ||============================== //
|
|
|
|
// ==============================|| DEFAULT DASHBOARD ||============================== //
|
|
|
|
|
|
|
|
|
|
|
|
const Dashboard = () => {
|
|
|
|
const Dashboard = () => {
|
|
|
|
const theme = useTheme();
|
|
|
|
const theme = useTheme();
|
|
|
|
|
|
|
|
const showAlert = useAlert();
|
|
|
|
const [totalCount, setTotalCount] = useState(0);
|
|
|
|
const [totalCount, setTotalCount] = useState(0);
|
|
|
|
const [rowsState, setRowsState] = useState({
|
|
|
|
const [rowsState, setRowsState] = useState({
|
|
|
|
page: 0,
|
|
|
|
page: 0,
|
|
|
@ -129,25 +131,27 @@ const Dashboard = () => {
|
|
|
|
|
|
|
|
|
|
|
|
findDashboard().then((res) => {
|
|
|
|
findDashboard().then((res) => {
|
|
|
|
console.log(res);
|
|
|
|
console.log(res);
|
|
|
|
if (res && res.data) {
|
|
|
|
if (res && res?.success) {
|
|
|
|
const rows = res.data?.pBoardList.content.map((d, idx) => ({ ...d, rowId: idx + 1 }));
|
|
|
|
const rows = res.data?.pBoardList.content.map((d, idx) => ({ ...d, rowId: idx + 1 }));
|
|
|
|
setTotalCount(rows.count);
|
|
|
|
setTotalCount(rows.count);
|
|
|
|
setRowsState((prevState) => ({ ...prevState, rows }));
|
|
|
|
setRowsState((prevState) => ({ ...prevState, rows }));
|
|
|
|
|
|
|
|
|
|
|
|
const parkRows = res.data.parkJudgeList.map((d, idx) => ({ ...d, rowId: idx + 1 }));
|
|
|
|
const parkRows = res.data.parkJudgeList.map((d, idx) => ({ ...d, rowId: idx + 1 }));
|
|
|
|
setMsEdate1(parkRows[0].msEdate);
|
|
|
|
setMsEdate1(parkRows[0]?.msEdate);
|
|
|
|
setTotalCount1(parkRows.count);
|
|
|
|
setTotalCount1(parkRows.count);
|
|
|
|
setRowsState1((prevState) => ({ ...prevState, rows: parkRows }));
|
|
|
|
setRowsState1((prevState) => ({ ...prevState, rows: parkRows }));
|
|
|
|
|
|
|
|
|
|
|
|
const residentRows = res.data.residentJudgeList.map((d, idx) => ({ ...d, rowId: idx + 1 }));
|
|
|
|
const residentRows = res.data.residentJudgeList.map((d, idx) => ({ ...d, rowId: idx + 1 }));
|
|
|
|
setMsEdate2(residentRows[0].msEdate);
|
|
|
|
setMsEdate2(residentRows[0]?.msEdate);
|
|
|
|
setTotalCount2(residentRows.count);
|
|
|
|
setTotalCount2(residentRows.count);
|
|
|
|
setRowsState2((prevState) => ({ ...prevState, rows: residentRows }));
|
|
|
|
setRowsState2((prevState) => ({ ...prevState, rows: residentRows }));
|
|
|
|
|
|
|
|
|
|
|
|
const disabledRows = res.data.disabledJudgeList.map((d, idx) => ({ ...d, rowId: idx + 1 }));
|
|
|
|
const disabledRows = res.data.disabledJudgeList.map((d, idx) => ({ ...d, rowId: idx + 1 }));
|
|
|
|
setMsEdate3(disabledRows[0].msEdate);
|
|
|
|
setMsEdate3(disabledRows[0]?.msEdate);
|
|
|
|
setTotalCount3(disabledRows.count);
|
|
|
|
setTotalCount3(disabledRows.count);
|
|
|
|
setRowsState3((prevState) => ({ ...prevState, rows: disabledRows }));
|
|
|
|
setRowsState3((prevState) => ({ ...prevState, rows: disabledRows }));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
showAlert.show(res.data.methodName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}, []);
|
|
|
|
}, []);
|
|
|
|