From 0333e8087b03582c3e11356342f4ba5670694972 Mon Sep 17 00:00:00 2001 From: minuk926 Date: Mon, 25 Jul 2022 15:11:04 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=8B=AC=EC=9D=98=EA=B2=B0=EA=B3=BC=20?= =?UTF-8?q?excel=20download=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/judge.js | 2 - src/index.js | 1 - .../MainLayout/Header/ProfileSection/index.js | 2 +- src/layout/MainLayout/Header/index.js | 2 +- .../Sidebar/MenuList/NavGroup/index.js | 2 +- src/routes/MainRoutes.js | 3 -- src/store/slices/user.js | 4 -- src/views/biz/admin/judge/JudgeDataReview.jsx | 1 - .../biz/admin/judge/ModalJudgeResult.jsx | 37 ++++++++++--------- .../biz/judge/ParkingJudgeByUserReview.jsx | 2 - src/views/biz/judge/ProcessParkingJudge.jsx | 2 +- src/views/dashboard/index.js | 2 +- 12 files changed, 24 insertions(+), 36 deletions(-) diff --git a/src/apis/judge.js b/src/apis/judge.js index 0cb3550..64a44aa 100644 --- a/src/apis/judge.js +++ b/src/apis/judge.js @@ -20,14 +20,12 @@ import { SAVE_ADMIN_JUDGE_STDS, GET_DASHBOARD, SAVE_PARKING_JUDGE_RESULT, - GET_PARKING_IMAGE2, GET_PARKING_FRECAD_IMAGE, GET_PARKING_CONTAD_IMAGE, GET_PARKING_PICAD_IMAGE, GET_PARKING_JUDGE_FILE_DOWNLOAD } from 'commons/ApiUrl'; import { setRowId } from './common'; -import FileSaver from 'file-saver'; import _ from 'lodash'; export async function findDashboard() { diff --git a/src/index.js b/src/index.js index 32a646e..bc3f91b 100755 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,3 @@ -import React from 'react'; import ReactDOM from 'react-dom'; // third party diff --git a/src/layout/MainLayout/Header/ProfileSection/index.js b/src/layout/MainLayout/Header/ProfileSection/index.js index 9e25061..830952b 100755 --- a/src/layout/MainLayout/Header/ProfileSection/index.js +++ b/src/layout/MainLayout/Header/ProfileSection/index.js @@ -35,7 +35,7 @@ const ProfileSection = () => { const theme = useTheme(); const { borderRadius } = useConfig(); - const [selectedIndex, setSelectedIndex] = useState(-1); + const [selectedIndex] = useState(-1); const { logout, user } = useAuth(); const [open, setOpen] = useState(false); /** diff --git a/src/layout/MainLayout/Header/index.js b/src/layout/MainLayout/Header/index.js index 7874302..adf8a74 100755 --- a/src/layout/MainLayout/Header/index.js +++ b/src/layout/MainLayout/Header/index.js @@ -1,6 +1,6 @@ // material-ui import { useTheme } from '@mui/material/styles'; -import { Avatar, Box, Link } from '@mui/material'; +import { Avatar, Box } from '@mui/material'; // project imports import LogoSection from '../LogoSection'; diff --git a/src/layout/MainLayout/Sidebar/MenuList/NavGroup/index.js b/src/layout/MainLayout/Sidebar/MenuList/NavGroup/index.js index 55c51c9..3189ce9 100755 --- a/src/layout/MainLayout/Sidebar/MenuList/NavGroup/index.js +++ b/src/layout/MainLayout/Sidebar/MenuList/NavGroup/index.js @@ -2,7 +2,7 @@ import PropTypes from 'prop-types'; // material-ui import { useTheme } from '@mui/material/styles'; -import { Divider, List, Typography } from '@mui/material'; +import { List, Typography } from '@mui/material'; // project imports import NavItem from '../NavItem'; diff --git a/src/routes/MainRoutes.js b/src/routes/MainRoutes.js index ede11c5..5d81c25 100755 --- a/src/routes/MainRoutes.js +++ b/src/routes/MainRoutes.js @@ -25,9 +25,6 @@ const UserByJudgeReview = Loadable(lazy(() => import('views/biz/judge/JudgeByUse // user const UserManager = Loadable(lazy(() => import('views/biz/user/UserManager'))); -// component -const ModalForm = Loadable(lazy(() => import('views/form/Modal'))); - // ==============================|| MAIN ROUTING ||============================== // const MainRoutes = { diff --git a/src/store/slices/user.js b/src/store/slices/user.js index 99c9840..37154fb 100755 --- a/src/store/slices/user.js +++ b/src/store/slices/user.js @@ -1,10 +1,6 @@ // third-party import { createSlice } from '@reduxjs/toolkit'; -// project imports -import axios from 'utils/axios'; -import { dispatch } from '../index'; - // ---------------------------------------------------------------------- const initialState = { diff --git a/src/views/biz/admin/judge/JudgeDataReview.jsx b/src/views/biz/admin/judge/JudgeDataReview.jsx index be8ca7a..20218bf 100644 --- a/src/views/biz/admin/judge/JudgeDataReview.jsx +++ b/src/views/biz/admin/judge/JudgeDataReview.jsx @@ -16,7 +16,6 @@ import JudgeDataDetailForm from './JudgeDataDetailForm'; import { useAlert } from 'react-alert'; import { getComboCodeList } from 'apis/common'; import JudgeDataModifyForm from './JudgeDataModifyForm'; -import { useQuery } from 'react-query'; const JudgeDataReview = ({ scDatagb, menuName }) => { const showAlert = useAlert(); diff --git a/src/views/biz/admin/judge/ModalJudgeResult.jsx b/src/views/biz/admin/judge/ModalJudgeResult.jsx index e9ac790..fe5198c 100644 --- a/src/views/biz/admin/judge/ModalJudgeResult.jsx +++ b/src/views/biz/admin/judge/ModalJudgeResult.jsx @@ -59,6 +59,19 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse }); const [judgeDatas, setJudgeDatas] = useState(judgeData ?? []); const [msuTeam, setMsuTeam] = useState(judgeTeam ?? '001'); + const [judgeDataCnt, setJudgeDataCnt] = useState(judgeUserData.filter((d) => d.msResult === '0').length); + + const onChangeTeam = (e) => { + setJudgeResult({ + ...judgeResult, + totJudgeUsers: [], + totJudgeUserData: [], + judgeCars: [], + judgeUserData: [] + }); + setJudgeDataCnt(0); + setMsuTeam(e.target.value); + }; const onSearch = async () => { if (msuTeam) { @@ -79,7 +92,6 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse } } setJudgeDatas(arrJudgeData); - // judgeDatas.current = arrJudgeData; setJudgeResult({ ...judgeResult, @@ -88,14 +100,9 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse judgeCars: res.data?.judgeCars, judgeUserData: res.data?.judgeUserData }); + setJudgeDataCnt(res.data?.judgeUserData.filter((d) => d.msResult === '0').length); + console.log(res.data?.judgeUserData.filter((d) => d.msResult === '0').length); } else { - setJudgeResult({ - ...judgeResult, - totJudgeUsers: [], - totJudgeUserData: [], - judgeCars: [], - judgeUserData: [] - }); alert.show('조회된 데이타가 없습니다.'); } } @@ -156,7 +163,7 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse summaryRight: false }; - excelDatas.forEach((row, idx) => { + excelDatas.forEach((row) => { const dataRow = worksheet.addRow(); colNames.forEach((col, i) => { @@ -204,13 +211,7 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse - {combo.teams.map((team, idx) => ( {team.value} @@ -224,7 +225,7 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse 조회