유저 제재 권한화면 모듈화
This commit is contained in:
@@ -9,7 +9,7 @@ import { Title, BtnWrapper, TextInput, SelectInput, DatePickerWrapper, ButtonClo
|
|||||||
import Modal from '../../components/common/modal/Modal';
|
import Modal from '../../components/common/modal/Modal';
|
||||||
import DatePickerComponent from '../../components/common/Date/DatePickerComponent';
|
import DatePickerComponent from '../../components/common/Date/DatePickerComponent';
|
||||||
|
|
||||||
import { blockPeriod, blockSanctions, blockType, HourList, MinuteList } from '../../assets/data';
|
import { authType, blockPeriod, blockSanctions, blockType, HourList, MinuteList } from '../../assets/data';
|
||||||
import DatePicker, { registerLocale } from 'react-datepicker';
|
import DatePicker, { registerLocale } from 'react-datepicker';
|
||||||
import { ko } from 'date-fns/esm/locale';
|
import { ko } from 'date-fns/esm/locale';
|
||||||
import 'react-datepicker/dist/react-datepicker.css';
|
import 'react-datepicker/dist/react-datepicker.css';
|
||||||
@@ -21,6 +21,7 @@ import { BlackListRegist, BlackListMultipleUpload } from '../../apis';
|
|||||||
|
|
||||||
import { authList } from '../../store/authList';
|
import { authList } from '../../store/authList';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
|
import AuthModal from '../../components/common/modal/AuthModal';
|
||||||
|
|
||||||
registerLocale('ko', ko);
|
registerLocale('ko', ko);
|
||||||
|
|
||||||
@@ -50,7 +51,7 @@ const UserBlockRegist = () => {
|
|||||||
const [guidList, setGuidList] = useState([]);
|
const [guidList, setGuidList] = useState([]);
|
||||||
const [typeError, setTypeError] = useState(true);
|
const [typeError, setTypeError] = useState(true);
|
||||||
const [resultData, setResultData] = useState({
|
const [resultData, setResultData] = useState({
|
||||||
list: { guid: '' },
|
list: [{ guid: '' }],
|
||||||
type: '',
|
type: '',
|
||||||
sanctions: '',
|
sanctions: '',
|
||||||
period: '',
|
period: '',
|
||||||
@@ -66,7 +67,7 @@ const UserBlockRegist = () => {
|
|||||||
|
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
setResultData({
|
setResultData({
|
||||||
list: { guid: '' },
|
list: [{ guid: '' }],
|
||||||
type: '',
|
type: '',
|
||||||
sanctions: '',
|
sanctions: '',
|
||||||
period: '',
|
period: '',
|
||||||
@@ -124,7 +125,7 @@ const UserBlockRegist = () => {
|
|||||||
|
|
||||||
const result = new Date(sendDate.getFullYear(), sendDate.getMonth(), sendDate.getDate(), e.target.id === 'hour' ? e.target.value : sendHour, e.target.id === 'min' ? e.target.value : sendMin);
|
const result = new Date(sendDate.getFullYear(), sendDate.getMonth(), sendDate.getDate(), e.target.id === 'hour' ? e.target.value : sendHour, e.target.id === 'min' ? e.target.value : sendMin);
|
||||||
|
|
||||||
const blockDay = resultData.period.slice(1) > 0 ? Number(resultData.period.slice(1)) + 1 : 0;
|
const blockDay = resultData.period.slice(1) > 0 ? Number(resultData.period.slice(1)) : 0;
|
||||||
const permanentDay = 2999 - sendDate.getFullYear();
|
const permanentDay = 2999 - sendDate.getFullYear();
|
||||||
|
|
||||||
if (e.target.id === 'hour') setSendHour(e.target.value);
|
if (e.target.id === 'hour') setSendHour(e.target.value);
|
||||||
@@ -264,20 +265,8 @@ const UserBlockRegist = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{userInfo.auth_list && !userInfo.auth_list.some(auth => auth.id === 25) ? (
|
{userInfo.auth_list && !userInfo.auth_list.some(auth => auth.id === authType.blackListUpdate) ? (
|
||||||
<Modal min="440px" $padding="40px" $bgcolor="transparent" $view={'view'}>
|
<AuthModal/>
|
||||||
<BtnWrapper $justify="flex-end">
|
|
||||||
<ButtonClose onClick={() => navigate(-1)} />
|
|
||||||
</BtnWrapper>
|
|
||||||
<ModalText $align="center">
|
|
||||||
해당 메뉴에 대한 등록 권한이 없습니다.
|
|
||||||
<br />
|
|
||||||
권한 등급을 변경 후 다시 이용해주세요.
|
|
||||||
</ModalText>
|
|
||||||
<BtnWrapper $gap="10px">
|
|
||||||
<Button text="확인" theme="primary" type="submit" size="large" width="100%" handleClick={() => navigate(-1)} />
|
|
||||||
</BtnWrapper>
|
|
||||||
</Modal>
|
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<Title>이용자 제재 등록</Title>
|
<Title>이용자 제재 등록</Title>
|
||||||
@@ -291,7 +280,7 @@ const UserBlockRegist = () => {
|
|||||||
placeholder="GUID 입력"
|
placeholder="GUID 입력"
|
||||||
width="400px"
|
width="400px"
|
||||||
disabled={selectSingle}
|
disabled={selectSingle}
|
||||||
value={resultData.list.guid}
|
value={resultData.list[0]?.guid || ''}
|
||||||
onChange={e => {
|
onChange={e => {
|
||||||
let list = [];
|
let list = [];
|
||||||
list.push({ guid: e.target.value });
|
list.push({ guid: e.target.value });
|
||||||
|
|||||||
Reference in New Issue
Block a user