@daeryun/dr_components 0.4.49 → 0.4.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/asset/images/myCase/icon/check box_3.webp +0 -0
- package/dist/asset/images/myCase/icon/file.webp +0 -0
- package/dist/asset/images/myCase/icon/jpeg.webp +0 -0
- package/dist/asset/images/myCase/icon/upload.webp +0 -0
- package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/components/common/integrate/index.d.ts +1 -1
- package/dist/components/page/Integrate/Broadcast.jsx +2 -5
- package/dist/components/page/Integrate/Broadcast.tsx +0 -6
- package/dist/components/page/Integrate/Field.jsx +2 -6
- package/dist/components/page/Integrate/Field.tsx +0 -7
- package/dist/components/page/Integrate/LawInfo.jsx +2 -5
- package/dist/components/page/Integrate/LawInfo.tsx +0 -7
- package/dist/components/page/Integrate/Lawyer.jsx +5 -8
- package/dist/components/page/Integrate/Lawyer.tsx +1 -11
- package/dist/components/page/Integrate/Map.jsx +2 -5
- package/dist/components/page/Integrate/Map.tsx +0 -7
- package/dist/components/page/Integrate/Reply.jsx +2 -6
- package/dist/components/page/Integrate/Reply.tsx +0 -8
- package/dist/components/page/Integrate/Success.jsx +2 -6
- package/dist/components/page/Integrate/Success.tsx +0 -8
- package/dist/components/page/MyCase/[id]/_component/MyCaseDetailPageContainer.jsx +1 -1
- package/dist/components/page/MyCase/[id]/_component/MyCaseDetailPageContainer.tsx +2 -0
- package/dist/components/page/MyCase/[id]/_component/_document/Document.d.ts +3 -1
- package/dist/components/page/MyCase/[id]/_component/_document/Document.jsx +3 -1
- package/dist/components/page/MyCase/[id]/_component/_document/Document.tsx +13 -1
- package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.jsx +36 -5
- package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.tsx +39 -6
- package/dist/components/page/MyCase/[id]/_component/_document/FileDropZone.d.ts +5 -0
- package/dist/components/page/MyCase/[id]/_component/_document/FileDropZone.jsx +32 -0
- package/dist/components/page/MyCase/[id]/_component/_document/FileDropZone.tsx +65 -0
- package/dist/components/page/MyCase/[id]/_component/_document/FileUpload.d.ts +10 -0
- package/dist/components/page/MyCase/[id]/_component/_document/FileUpload.js +43 -0
- package/dist/components/page/MyCase/[id]/_component/_document/FileUpload.ts +38 -0
- package/dist/components/page/MyCase/[id]/_component/_modal/FileSuccessModal.d.ts +5 -0
- package/dist/components/page/MyCase/[id]/_component/_modal/FileSuccessModal.jsx +22 -0
- package/dist/components/page/MyCase/[id]/_component/_modal/FileSuccessModal.tsx +50 -0
- package/dist/components/page/MyCase/[id]/_component/_modal/FileUploadModal.d.ts +7 -0
- package/dist/components/page/MyCase/[id]/_component/_modal/FileUploadModal.jsx +71 -0
- package/dist/components/page/MyCase/[id]/_component/_modal/FileUploadModal.tsx +117 -0
- package/dist/components/page/MyCase/_actions/action.d.ts +5 -3
- package/dist/components/page/MyCase/_actions/action.js +23 -2
- package/dist/components/page/MyCase/_actions/action.ts +25 -6
- package/dist/components/page/MyCase/_component/CaseContainer.jsx +1 -3
- package/dist/components/page/MyCase/_component/CaseContainer.tsx +4 -9
- package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenu.jsx +2 -2
- package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenu.tsx +12 -2
- package/dist/components/page/MyCase/_fetchers/addMyFileUpload.d.ts +5 -0
- package/dist/components/page/MyCase/_fetchers/addMyFileUpload.js +34 -0
- package/dist/components/page/MyCase/_fetchers/addMyFileUpload.ts +27 -0
- package/dist/styles/globals.css +276 -177
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import Image from 'next/image';
|
|
2
|
+
import ModalContainer from './ModalCotainer';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
const CaseInquiryConfirmModal = ({
|
|
6
|
+
isOpen,
|
|
7
|
+
onClose,
|
|
8
|
+
|
|
9
|
+
}: {
|
|
10
|
+
isOpen: boolean;
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
|
|
13
|
+
}) => {
|
|
14
|
+
// console.log(isLoading);
|
|
15
|
+
return (
|
|
16
|
+
<ModalContainer
|
|
17
|
+
isOpen={isOpen}
|
|
18
|
+
onClose={() => {
|
|
19
|
+
onClose();
|
|
20
|
+
}}
|
|
21
|
+
>
|
|
22
|
+
<div
|
|
23
|
+
className="absolute flex w-[calc(100%-40px)] flex-col items-center justify-center overflow-y-auto rounded-[12px] border border-solid border-grayScale4 bg-grayScale8 p-[30px] sm-top:w-[calc(100%-252px)] sm-top:max-w-[648px] sm-top:rounded-[24px] sm-top:px-[54px] sm-top:py-[44px] lg:w-full lg:max-w-[804px] lg:p-[52px] "
|
|
24
|
+
onClick={e => e.stopPropagation()}
|
|
25
|
+
>
|
|
26
|
+
<Image
|
|
27
|
+
src="/images/mycase/icon/modal_icon.webp"
|
|
28
|
+
alt="check"
|
|
29
|
+
width={40}
|
|
30
|
+
height={48.9}
|
|
31
|
+
className="h-[48.9px] w-[40px] sm-top:h-[68.44px] sm-top:w-[56px] lg:h-[88px] lg:w-[72px]"
|
|
32
|
+
/>
|
|
33
|
+
<p className="body_large1_mo sm-top:body_large1_tb sm-top: lg:body_large1 mt-[20.11px] sm-top:mt-[48px] lg:mt-[60px]">
|
|
34
|
+
파일 제출이 완료되었습니다.
|
|
35
|
+
</p>
|
|
36
|
+
|
|
37
|
+
<button
|
|
38
|
+
className={`mt-[20px] h-[48px] w-full rounded-[4px] bg-grayScale1 sm-top:mt-[53px] sm-top:h-[60px] sm-top:rounded-[8px] lg:mt-[73px] lg:h-[72px] lg:rounded-[16px] `}
|
|
39
|
+
onClick={() => {
|
|
40
|
+
onClose();
|
|
41
|
+
}}
|
|
42
|
+
>
|
|
43
|
+
<p className="text-white body_large2_mo sm-top:body_large2_tb lg:body_large2">확인</p>
|
|
44
|
+
</button>
|
|
45
|
+
</div>
|
|
46
|
+
</ModalContainer>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default CaseInquiryConfirmModal;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import Image from 'next/image';
|
|
2
|
+
import ModalContainer from './ModalCotainer';
|
|
3
|
+
import file from '../../../../../../asset/images/mycase/icon/file.webp';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
const FileUploadModal = ({ isOpen, onClose, getRootProps, getInputProps }) => {
|
|
6
|
+
const [value, setValue] = useState('');
|
|
7
|
+
const [isCheck, setIsCheck] = useState(false);
|
|
8
|
+
const [isOpenConfirm, setIsOpenConfirm] = useState(false);
|
|
9
|
+
const customClickHandler = (event) => {
|
|
10
|
+
// 체크박스가 선택되었을 경우 localStorage 저장
|
|
11
|
+
if (isCheck) {
|
|
12
|
+
localStorage.setItem('isFileUploadModalCheck', 'true');
|
|
13
|
+
}
|
|
14
|
+
// 🔥 getRootProps()에서 제공하는 onClick 실행
|
|
15
|
+
const { onClick } = getRootProps();
|
|
16
|
+
if (onClick) {
|
|
17
|
+
onClick(event);
|
|
18
|
+
}
|
|
19
|
+
// onClose();
|
|
20
|
+
};
|
|
21
|
+
return (<>
|
|
22
|
+
<ModalContainer isOpen={isOpen} onClose={() => {
|
|
23
|
+
setValue('');
|
|
24
|
+
setIsCheck(false);
|
|
25
|
+
onClose();
|
|
26
|
+
}}>
|
|
27
|
+
<div className={'absolute flex h-full max-h-[317px] w-[calc(100%-40px)] flex-col items-center justify-center overflow-y-auto rounded-[16px] border border-solid border-grayScale4 bg-grayScale8 p-[30px] ' +
|
|
28
|
+
' sm-top:max-h-[372px] sm-top:w-[644px] sm-top:rounded-[24px] sm-top:px-[52px] sm-top:py-[44px] ' +
|
|
29
|
+
' lg:h-full lg:max-h-[465px] lg:w-full lg:max-w-[804px] lg:p-[52px]'} onClick={e => e.stopPropagation()}>
|
|
30
|
+
<div className="flex w-full items-center justify-center">
|
|
31
|
+
<Image src={file} alt="upload" width={120} height={120} className="h-[40px] w-[48px] sm-top:h-[50px] sm-top:w-[60px] lg:h-[66.67px] lg:w-[80px]"/>
|
|
32
|
+
</div>
|
|
33
|
+
<p className="body_large1_mo sm-top:body_large1_tb lg:body_large1 mt-[16px] sm-top:mt-[20px] lg:mt-[36.33px]">
|
|
34
|
+
파일 제출 안내
|
|
35
|
+
</p>
|
|
36
|
+
<div className="body_medium2_mo mt-[12px] text-center sm-top:hidden">
|
|
37
|
+
<p>제출하신 파일은 관리자에게 전달되며,</p>
|
|
38
|
+
<p>제출 후 수정 및 삭제가 불가능합니다.</p>
|
|
39
|
+
<p>필요한 경우 담당자에게 요청해 주세요.</p>
|
|
40
|
+
</div>
|
|
41
|
+
<div className="sm-top:body_medium2_tb flex flex-col items-center justify-center max-sm-top:hidden sm-top:mt-[8px] lg:hidden">
|
|
42
|
+
<p>제출하신 파일은 관리자에게 전달되며, 제출 후 수정 및 삭제가</p>
|
|
43
|
+
<p>불가능합니다. 필요한 경우 담당자에게 요청해 주세요.</p>
|
|
44
|
+
</div>
|
|
45
|
+
<div className="lg:body_medium2 max-lg:hidden lg:mt-[12px] lg:text-center">
|
|
46
|
+
<p>제출하신 파일은 관리자에게 전달되며, 제출 후 수정 및 삭제가 불가능합니다.</p>
|
|
47
|
+
<p>필요한 경우 담당자에게 요청해 주세요.</p>
|
|
48
|
+
</div>
|
|
49
|
+
<div className="mt-[20px] flex w-full items-center justify-center gap-[8px] sm-top:mt-[24px] lg:mt-[28px] lg:gap-[12px]">
|
|
50
|
+
<input type="checkbox" id="agreementCheckbox" checked={isCheck} onChange={() => setIsCheck(!isCheck)} className="h-[12px] w-[12px] sm-top:h-[16px] sm-top:w-[16px] lg:h-[20px] lg:w-[20px]"/>
|
|
51
|
+
<label htmlFor="agreementCheckbox" className="body_small2_mo sm-top:body_small2_tb lg:body_small2 cursor-pointer leading-[20px] text-grayScale3 sm-top:leading-[26px] lg:leading-[28px]">
|
|
52
|
+
다시 보지 않기
|
|
53
|
+
</label>
|
|
54
|
+
</div>
|
|
55
|
+
<div className="mt-[12px] flex w-full flex-row gap-[4px] sm-top:mt-[16px] sm-top:gap-[12px] lg:mt-[20px] lg:gap-[12px]">
|
|
56
|
+
<button className="h-[48px] w-full rounded-[4px] bg-grayScale7 text-black sm-top:h-[60px] sm-top:rounded-[8px] lg:h-[72px] lg:rounded-[16px]" onClick={() => {
|
|
57
|
+
setIsCheck(false);
|
|
58
|
+
onClose();
|
|
59
|
+
}}>
|
|
60
|
+
<p className="body_large2_mo sm-top:body_large2_tb lg:body_large2">닫기</p>
|
|
61
|
+
</button>
|
|
62
|
+
<div {...getRootProps()} className="flex h-[48px] w-full cursor-pointer items-center justify-center rounded-[4px] bg-grayScale1 text-white sm-top:h-[60px] sm-top:rounded-[8px] lg:h-[72px] lg:rounded-[16px]" onClick={customClickHandler}>
|
|
63
|
+
<input {...getInputProps()}/>
|
|
64
|
+
<p className="body_large2_mo sm-top:body_large2_tb lg:body_large2">확인</p>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</ModalContainer>
|
|
69
|
+
</>);
|
|
70
|
+
};
|
|
71
|
+
export default FileUploadModal;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import Image from 'next/image';
|
|
2
|
+
import ModalContainer from './ModalCotainer';
|
|
3
|
+
import file from '../../../../../../asset/images/mycase/icon/file.webp';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
|
|
6
|
+
const FileUploadModal = ({
|
|
7
|
+
isOpen,
|
|
8
|
+
onClose,
|
|
9
|
+
getRootProps,
|
|
10
|
+
getInputProps
|
|
11
|
+
}: {
|
|
12
|
+
isOpen: boolean;
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
getRootProps: any;
|
|
15
|
+
getInputProps: any;
|
|
16
|
+
}) => {
|
|
17
|
+
const [value, setValue] = useState('');
|
|
18
|
+
const [isCheck, setIsCheck] = useState(false);
|
|
19
|
+
const [isOpenConfirm, setIsOpenConfirm] = useState(false);
|
|
20
|
+
|
|
21
|
+
const customClickHandler = (event: React.MouseEvent<HTMLDivElement>) => {
|
|
22
|
+
// 체크박스가 선택되었을 경우 localStorage 저장
|
|
23
|
+
if (isCheck) {
|
|
24
|
+
localStorage.setItem('isFileUploadModalCheck', 'true');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// 🔥 getRootProps()에서 제공하는 onClick 실행
|
|
28
|
+
const { onClick } = getRootProps();
|
|
29
|
+
if (onClick) {
|
|
30
|
+
onClick(event);
|
|
31
|
+
}
|
|
32
|
+
// onClose();
|
|
33
|
+
};
|
|
34
|
+
return (
|
|
35
|
+
<>
|
|
36
|
+
<ModalContainer
|
|
37
|
+
isOpen={isOpen}
|
|
38
|
+
onClose={() => {
|
|
39
|
+
setValue('');
|
|
40
|
+
setIsCheck(false);
|
|
41
|
+
onClose();
|
|
42
|
+
}}
|
|
43
|
+
>
|
|
44
|
+
<div
|
|
45
|
+
className={
|
|
46
|
+
'absolute flex h-full max-h-[317px] w-[calc(100%-40px)] flex-col items-center justify-center overflow-y-auto rounded-[16px] border border-solid border-grayScale4 bg-grayScale8 p-[30px] ' +
|
|
47
|
+
' sm-top:max-h-[372px] sm-top:w-[644px] sm-top:rounded-[24px] sm-top:px-[52px] sm-top:py-[44px] ' +
|
|
48
|
+
' lg:h-full lg:max-h-[465px] lg:w-full lg:max-w-[804px] lg:p-[52px]'
|
|
49
|
+
}
|
|
50
|
+
onClick={e => e.stopPropagation()}
|
|
51
|
+
>
|
|
52
|
+
<div className="flex w-full items-center justify-center">
|
|
53
|
+
<Image
|
|
54
|
+
src={file}
|
|
55
|
+
alt="upload"
|
|
56
|
+
width={120}
|
|
57
|
+
height={120}
|
|
58
|
+
className="h-[40px] w-[48px] sm-top:h-[50px] sm-top:w-[60px] lg:h-[66.67px] lg:w-[80px]"
|
|
59
|
+
/>
|
|
60
|
+
</div>
|
|
61
|
+
<p className="body_large1_mo sm-top:body_large1_tb lg:body_large1 mt-[16px] sm-top:mt-[20px] lg:mt-[36.33px]">
|
|
62
|
+
파일 제출 안내
|
|
63
|
+
</p>
|
|
64
|
+
<div className="body_medium2_mo mt-[12px] text-center sm-top:hidden">
|
|
65
|
+
<p>제출하신 파일은 관리자에게 전달되며,</p>
|
|
66
|
+
<p>제출 후 수정 및 삭제가 불가능합니다.</p>
|
|
67
|
+
<p>필요한 경우 담당자에게 요청해 주세요.</p>
|
|
68
|
+
</div>
|
|
69
|
+
<div className="sm-top:body_medium2_tb flex flex-col items-center justify-center max-sm-top:hidden sm-top:mt-[8px] lg:hidden">
|
|
70
|
+
<p>제출하신 파일은 관리자에게 전달되며, 제출 후 수정 및 삭제가</p>
|
|
71
|
+
<p>불가능합니다. 필요한 경우 담당자에게 요청해 주세요.</p>
|
|
72
|
+
</div>
|
|
73
|
+
<div className="lg:body_medium2 max-lg:hidden lg:mt-[12px] lg:text-center">
|
|
74
|
+
<p>제출하신 파일은 관리자에게 전달되며, 제출 후 수정 및 삭제가 불가능합니다.</p>
|
|
75
|
+
<p>필요한 경우 담당자에게 요청해 주세요.</p>
|
|
76
|
+
</div>
|
|
77
|
+
<div className="mt-[20px] flex w-full items-center justify-center gap-[8px] sm-top:mt-[24px] lg:mt-[28px] lg:gap-[12px]">
|
|
78
|
+
<input
|
|
79
|
+
type="checkbox"
|
|
80
|
+
id="agreementCheckbox"
|
|
81
|
+
checked={isCheck}
|
|
82
|
+
onChange={() => setIsCheck(!isCheck)}
|
|
83
|
+
className="h-[12px] w-[12px] sm-top:h-[16px] sm-top:w-[16px] lg:h-[20px] lg:w-[20px]"
|
|
84
|
+
/>
|
|
85
|
+
<label
|
|
86
|
+
htmlFor="agreementCheckbox"
|
|
87
|
+
className="body_small2_mo sm-top:body_small2_tb lg:body_small2 cursor-pointer leading-[20px] text-grayScale3 sm-top:leading-[26px] lg:leading-[28px]"
|
|
88
|
+
>
|
|
89
|
+
다시 보지 않기
|
|
90
|
+
</label>
|
|
91
|
+
</div>
|
|
92
|
+
<div className="mt-[12px] flex w-full flex-row gap-[4px] sm-top:mt-[16px] sm-top:gap-[12px] lg:mt-[20px] lg:gap-[12px]">
|
|
93
|
+
<button
|
|
94
|
+
className="h-[48px] w-full rounded-[4px] bg-grayScale7 text-black sm-top:h-[60px] sm-top:rounded-[8px] lg:h-[72px] lg:rounded-[16px]"
|
|
95
|
+
onClick={() => {
|
|
96
|
+
setIsCheck(false);
|
|
97
|
+
onClose();
|
|
98
|
+
}}
|
|
99
|
+
>
|
|
100
|
+
<p className="body_large2_mo sm-top:body_large2_tb lg:body_large2">닫기</p>
|
|
101
|
+
</button>
|
|
102
|
+
<div
|
|
103
|
+
{...getRootProps()}
|
|
104
|
+
className="flex h-[48px] w-full cursor-pointer items-center justify-center rounded-[4px] bg-grayScale1 text-white sm-top:h-[60px] sm-top:rounded-[8px] lg:h-[72px] lg:rounded-[16px]"
|
|
105
|
+
onClick={customClickHandler}
|
|
106
|
+
>
|
|
107
|
+
<input {...getInputProps()} />
|
|
108
|
+
<p className="body_large2_mo sm-top:body_large2_tb lg:body_large2">확인</p>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
</ModalContainer>
|
|
113
|
+
</>
|
|
114
|
+
);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export default FileUploadModal;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { FetchType, DetailList, TimeLineType, FileList, Question, PaymentList } from '../_type/type';
|
|
2
|
-
export declare const useActionGetCaseList: ({ tapState,
|
|
2
|
+
export declare const useActionGetCaseList: ({ tapState, pageNumber, pageSize }: {
|
|
3
3
|
tapState: string;
|
|
4
|
-
state: "ongoing" | "closed";
|
|
5
4
|
pageNumber: number;
|
|
6
5
|
pageSize: number;
|
|
7
|
-
jwt?: string;
|
|
8
6
|
}) => {
|
|
9
7
|
data: any;
|
|
10
8
|
isLoading: boolean;
|
|
@@ -38,3 +36,7 @@ export declare const useActionGetContact: (id: string) => {
|
|
|
38
36
|
data: FetchType<PaymentList> | undefined;
|
|
39
37
|
isLoading: boolean;
|
|
40
38
|
};
|
|
39
|
+
export declare const useActionPostMyFileUpload: (id: string) => {
|
|
40
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<FetchType<Question[]>, unknown, File, unknown>;
|
|
41
|
+
isLoading: boolean;
|
|
42
|
+
};
|
|
@@ -16,11 +16,16 @@ import getMyCaseQuestion from '../_fetchers/getMyCaseQuestion';
|
|
|
16
16
|
import addMyCaseQuestion from '../_fetchers/addMyCaseQuestion';
|
|
17
17
|
import getCaseList from '../_fetchers/getCaseList';
|
|
18
18
|
import getContact from '../_fetchers/getContact';
|
|
19
|
+
import addMyFileUpload from '../_fetchers/addMyFileUpload';
|
|
19
20
|
const jwt2 = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjIsImlhdCI6MTc0MDAxNDYzOCwiZXhwIjoxNzcxNTcyMjM4fQ.11ra7DkzlOVmBqDjo8SJTQnZDZdRHXjjU3ujK8G3OOY';
|
|
20
21
|
// 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjMsImVtYWlsIjoiNjAzMDgwNEBnbWFpbC5jb20iLCJwcm92aWRlciI6Imdvb2dsZSIsImlzTmV3IjpmYWxzZSwiaWF0IjoxNzQwNDQ2Nzg1LCJleHAiOjE3NDA0ODI3ODV9.v_d7htci4fjLA5MqBXWxUqyNjsAm2GEcdRBO5se-DB8'; //빈거
|
|
21
|
-
export const useActionGetCaseList = ({ tapState,
|
|
22
|
+
export const useActionGetCaseList = ({ tapState,
|
|
23
|
+
// state,
|
|
24
|
+
pageNumber, pageSize
|
|
25
|
+
// jwt
|
|
26
|
+
}) => {
|
|
22
27
|
const { data, isLoading } = useQuery({
|
|
23
|
-
queryKey: ['case', tapState, pageNumber, pageSize
|
|
28
|
+
queryKey: ['case', tapState, pageNumber, pageSize],
|
|
24
29
|
queryFn: () => getCaseList({
|
|
25
30
|
jwt: jwt2,
|
|
26
31
|
size: pageSize,
|
|
@@ -159,3 +164,19 @@ export const useActionGetContact = (id) => {
|
|
|
159
164
|
});
|
|
160
165
|
return { data, isLoading };
|
|
161
166
|
};
|
|
167
|
+
export const useActionPostMyFileUpload = (id) => {
|
|
168
|
+
const { mutateAsync, status } = useMutation({
|
|
169
|
+
mutationFn: (file) => __awaiter(void 0, void 0, void 0, function* () {
|
|
170
|
+
return yield addMyFileUpload({
|
|
171
|
+
id: id,
|
|
172
|
+
file: file
|
|
173
|
+
});
|
|
174
|
+
}),
|
|
175
|
+
onSuccess: res => { },
|
|
176
|
+
onError: error => {
|
|
177
|
+
console.log(error);
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
const isLoading = status === 'pending';
|
|
181
|
+
return { mutateAsync, isLoading };
|
|
182
|
+
};
|
|
@@ -9,6 +9,7 @@ import getMyCaseQuestion from '../_fetchers/getMyCaseQuestion';
|
|
|
9
9
|
import addMyCaseQuestion from '../_fetchers/addMyCaseQuestion';
|
|
10
10
|
import getCaseList from '../_fetchers/getCaseList';
|
|
11
11
|
import getContact from '../_fetchers/getContact';
|
|
12
|
+
import addMyFileUpload from '../_fetchers/addMyFileUpload';
|
|
12
13
|
|
|
13
14
|
const jwt2 =
|
|
14
15
|
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjIsImlhdCI6MTc0MDAxNDYzOCwiZXhwIjoxNzcxNTcyMjM4fQ.11ra7DkzlOVmBqDjo8SJTQnZDZdRHXjjU3ujK8G3OOY';
|
|
@@ -16,19 +17,19 @@ const jwt2 =
|
|
|
16
17
|
|
|
17
18
|
export const useActionGetCaseList = ({
|
|
18
19
|
tapState,
|
|
19
|
-
state,
|
|
20
|
+
// state,
|
|
20
21
|
pageNumber,
|
|
21
|
-
pageSize
|
|
22
|
-
jwt
|
|
22
|
+
pageSize
|
|
23
|
+
// jwt
|
|
23
24
|
}: {
|
|
24
25
|
tapState: string;
|
|
25
|
-
state: 'ongoing' | 'closed';
|
|
26
|
+
// state: 'ongoing' | 'closed';
|
|
26
27
|
pageNumber: number;
|
|
27
28
|
pageSize: number;
|
|
28
|
-
jwt?: string;
|
|
29
|
+
// jwt?: string;
|
|
29
30
|
}) => {
|
|
30
31
|
const { data, isLoading } = useQuery({
|
|
31
|
-
queryKey: ['case', tapState, pageNumber, pageSize
|
|
32
|
+
queryKey: ['case', tapState, pageNumber, pageSize],
|
|
32
33
|
queryFn: () =>
|
|
33
34
|
getCaseList({
|
|
34
35
|
jwt: jwt2,
|
|
@@ -183,3 +184,21 @@ export const useActionGetContact = (id: string) => {
|
|
|
183
184
|
});
|
|
184
185
|
return { data, isLoading };
|
|
185
186
|
};
|
|
187
|
+
|
|
188
|
+
export const useActionPostMyFileUpload = (id: string) => {
|
|
189
|
+
const { mutateAsync, status } = useMutation<FetchType<Question[]>, unknown, File>({
|
|
190
|
+
mutationFn: async (file: File) =>
|
|
191
|
+
await addMyFileUpload({
|
|
192
|
+
id: id as string,
|
|
193
|
+
file: file
|
|
194
|
+
}),
|
|
195
|
+
|
|
196
|
+
onSuccess: res => {},
|
|
197
|
+
onError: error => {
|
|
198
|
+
console.log(error);
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
const isLoading = status === 'pending';
|
|
203
|
+
return { mutateAsync, isLoading };
|
|
204
|
+
};
|
|
@@ -36,10 +36,8 @@ const CaseContainer = ({ jwt }) => {
|
|
|
36
36
|
// };
|
|
37
37
|
const { data, isLoading } = useActionGetCaseList({
|
|
38
38
|
tapState,
|
|
39
|
-
state: tapState === 'ongoing' ? 'ongoing' : 'closed',
|
|
40
39
|
pageNumber,
|
|
41
|
-
pageSize
|
|
42
|
-
jwt
|
|
40
|
+
pageSize
|
|
43
41
|
});
|
|
44
42
|
// useEffect(() => {
|
|
45
43
|
// const handleResize = () => {
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useState, Suspense } from 'react';
|
|
2
2
|
import CaseLayout from './_layout/CaseLayout';
|
|
3
|
-
|
|
4
|
-
import { useQuery } from 'react-query';
|
|
5
|
-
import getCaseList from '../_fetchers/getCaseList';
|
|
6
|
-
import CaseTable from './_table/CaseTable';
|
|
7
|
-
import { Case } from '../_type/type';
|
|
3
|
+
|
|
8
4
|
import EmptyTable from './_empty/EmptyTable';
|
|
9
5
|
import { useRouter, useSearchParams } from 'next/navigation';
|
|
10
6
|
import Loading from './_loading/Loading';
|
|
@@ -63,10 +59,9 @@ const CaseContainer = ({ jwt }: { jwt?: string }) => {
|
|
|
63
59
|
|
|
64
60
|
const { data, isLoading } = useActionGetCaseList({
|
|
65
61
|
tapState,
|
|
66
|
-
|
|
62
|
+
|
|
67
63
|
pageNumber,
|
|
68
|
-
pageSize
|
|
69
|
-
jwt
|
|
64
|
+
pageSize
|
|
70
65
|
});
|
|
71
66
|
// useEffect(() => {
|
|
72
67
|
// const handleResize = () => {
|
|
@@ -32,12 +32,12 @@ const CategoryMenu = (props) => {
|
|
|
32
32
|
<Image src={imagePath} alt={'집'} width={15} height={15} className={'mb-[1px] h-auto sm:w-[17px] lg:w-[18px]'}/>
|
|
33
33
|
</Link>
|
|
34
34
|
<Image src={arrowImage} alt={'화살표_1'} width={8} height={13} className={'h-[13px] w-[8px]'}/>
|
|
35
|
-
{menu.title === menu.subTitle ? (<Link href={`/${menu.address}
|
|
35
|
+
{menu.title === menu.subTitle ? (<Link href={menu.address ? `/${menu.address}`.replace(/^\/+/, '') : '/'} onClick={() => menu.address && reloadUrl(menu.address.startsWith('/') ? menu.address : `/${menu.address}`)}>
|
|
36
36
|
<div className={textColor}>{menu === null || menu === void 0 ? void 0 : menu.title}</div>
|
|
37
37
|
</Link>) : (<>
|
|
38
38
|
<div className={textColor}>{menu === null || menu === void 0 ? void 0 : menu.title}</div>
|
|
39
39
|
<Image src={arrowImage} alt={'화살표_2'} width={8} height={13} className={'h-[13px] w-[8px]'}/>
|
|
40
|
-
<Link href={`/${menu.address}
|
|
40
|
+
<Link href={menu.address ? `/${menu.address}`.replace(/^\/+/, '') : '/'} onClick={() => menu.address && reloadUrl(menu.address.startsWith('/') ? menu.address : `/${menu.address}`)}>
|
|
41
41
|
<div className={textColor}>{menu === null || menu === void 0 ? void 0 : menu.subTitle}</div>
|
|
42
42
|
</Link>
|
|
43
43
|
</>)}
|
|
@@ -56,14 +56,24 @@ const CategoryMenu = (props: CategoryMenuType) => {
|
|
|
56
56
|
</Link>
|
|
57
57
|
<Image src={arrowImage} alt={'화살표_1'} width={8} height={13} className={'h-[13px] w-[8px]'} />
|
|
58
58
|
{menu.title === menu.subTitle ? (
|
|
59
|
-
<Link
|
|
59
|
+
<Link
|
|
60
|
+
href={menu.address ? `/${menu.address}`.replace(/^\/+/, '') : '/'}
|
|
61
|
+
onClick={() =>
|
|
62
|
+
menu.address && reloadUrl(menu.address.startsWith('/') ? menu.address : `/${menu.address}`)
|
|
63
|
+
}
|
|
64
|
+
>
|
|
60
65
|
<div className={textColor}>{menu?.title}</div>
|
|
61
66
|
</Link>
|
|
62
67
|
) : (
|
|
63
68
|
<>
|
|
64
69
|
<div className={textColor}>{menu?.title}</div>
|
|
65
70
|
<Image src={arrowImage} alt={'화살표_2'} width={8} height={13} className={'h-[13px] w-[8px]'} />
|
|
66
|
-
<Link
|
|
71
|
+
<Link
|
|
72
|
+
href={menu.address ? `/${menu.address}`.replace(/^\/+/, '') : '/'}
|
|
73
|
+
onClick={() =>
|
|
74
|
+
menu.address && reloadUrl(menu.address.startsWith('/') ? menu.address : `/${menu.address}`)
|
|
75
|
+
}
|
|
76
|
+
>
|
|
67
77
|
<div className={textColor}>{menu?.subTitle}</div>
|
|
68
78
|
</Link>
|
|
69
79
|
</>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import Fetch from '../../Login/_fetch/fetch';
|
|
11
|
+
const addMyFileUpload = (_a) => __awaiter(void 0, [_a], void 0, function* ({ id, file }) {
|
|
12
|
+
try {
|
|
13
|
+
const formData = new FormData();
|
|
14
|
+
formData.append('idx', id);
|
|
15
|
+
formData.append('file', file);
|
|
16
|
+
const response = yield Fetch(`https://aegis.daeryunlaw.com/api/app/case/${id}/docs/my`, {
|
|
17
|
+
method: 'POST',
|
|
18
|
+
headers: {
|
|
19
|
+
// Authorization: `${jwt}`
|
|
20
|
+
},
|
|
21
|
+
body: formData
|
|
22
|
+
});
|
|
23
|
+
if (!response.ok) {
|
|
24
|
+
throw new Error('Network response was not ok');
|
|
25
|
+
}
|
|
26
|
+
const data = yield response.json();
|
|
27
|
+
return data;
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
console.error('Failed to fetch case:', error);
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
export default addMyFileUpload;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import Fetch from '../../Login/_fetch/fetch';
|
|
2
|
+
|
|
3
|
+
const addMyFileUpload = async ({ id, file }: { id: string; file: File }) => {
|
|
4
|
+
try {
|
|
5
|
+
const formData = new FormData();
|
|
6
|
+
formData.append('idx', id);
|
|
7
|
+
formData.append('file', file);
|
|
8
|
+
|
|
9
|
+
const response = await Fetch(`https://aegis.daeryunlaw.com/api/app/case/${id}/docs/my`, {
|
|
10
|
+
method: 'POST',
|
|
11
|
+
headers: {
|
|
12
|
+
// Authorization: `${jwt}`
|
|
13
|
+
},
|
|
14
|
+
body: formData
|
|
15
|
+
});
|
|
16
|
+
if (!response.ok) {
|
|
17
|
+
throw new Error('Network response was not ok');
|
|
18
|
+
}
|
|
19
|
+
const data = await response.json();
|
|
20
|
+
return data;
|
|
21
|
+
} catch (error) {
|
|
22
|
+
console.error('Failed to fetch case:', error);
|
|
23
|
+
throw error;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default addMyFileUpload;
|