feat: 심의결과 excel download 기능 추가

mpower
minuk926 2 years ago
parent 5831c191a5
commit 0333e8087b

@ -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() {

@ -1,4 +1,3 @@
import React from 'react';
import ReactDOM from 'react-dom';
// third party

@ -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);
/**

@ -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';

@ -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';

@ -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 = {

@ -1,10 +1,6 @@
// third-party
import { createSlice } from '@reduxjs/toolkit';
// project imports
import axios from 'utils/axios';
import { dispatch } from '../index';
// ----------------------------------------------------------------------
const initialState = {

@ -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();

@ -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
<Grid item xs={3.7}>
<FormControl fullWidth>
<InputLabel required></InputLabel>
<Select
sx={{ marginTop: 1 }}
defaultValue={msuTeam}
value={msuTeam}
onChange={(e) => setMsuTeam(e.target.value)}
size="small"
>
<Select sx={{ marginTop: 1 }} defaultValue={msuTeam} value={msuTeam} onChange={onChangeTeam} size="small">
{combo.teams.map((team, idx) => (
<MenuItem key={idx} value={team.code}>
{team.value}
@ -224,7 +225,7 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse
조회
</Button>
<Button
disabled={judgeDatas.length === 0}
disabled={judgeDataCnt === 0}
variant="contained"
color="primary"
size="small"
@ -234,7 +235,7 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse
일괄처리
</Button>
<Button
disabled={judgeDatas.length === 0}
disabled={judgeResult.totJudgeUsers.length === 0}
variant="contained"
size="small"
startIcon={<IconFileExport />}

@ -18,8 +18,6 @@ import ProcessParkingJudge from './ProcessParkingJudge';
import useAuth from 'hooks/useAuth';
import Button from '@mui/material/Button';
import { useAlert } from 'react-alert';
import PropTypes from 'prop-types';
import JudgeByUserReview from './JudgeByUserReview';
const ParkingJudgeByUserReview = () => {
const { user } = useAuth();

@ -2,7 +2,7 @@ import { useEffect, useRef, useState } from 'react';
import PropTypes from 'prop-types';
import { Button, Divider, FormControl, Grid, ImageList, InputLabel, MenuItem, Select, TextField } from '@mui/material';
import { findJudgeImages, findParkingImages, saveJudgeResult, saveParkingJudgeResult } from 'apis/judge';
import { findParkingImages, saveParkingJudgeResult } from 'apis/judge';
import { SkipNext, SkipPrevious, Save } from '@mui/icons-material';
import ImgItem from '../../cmm/ImgItem';
import NumberFormat from 'react-number-format';

@ -1,7 +1,7 @@
import { useEffect, useState, useCallback } from 'react';
// material-ui
import { Card, CardContent, Grid, Link, Typography } from '@mui/material';
import { Card, CardContent, Grid, Typography } from '@mui/material';
import PlaylistAddCheckIcon from '@mui/icons-material/PlaylistAddCheck';
// project imports

Loading…
Cancel
Save