@daeryun/dr_components 1.1.56 → 1.1.58

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.
Files changed (93) hide show
  1. package/dist/asset/images/myCase//bfileViewer/download.webp +0 -0
  2. package/dist/asset/images/myCase//bfileViewer/rotate_ccw.webp +0 -0
  3. package/dist/asset/images/myCase//bfileViewer/zoom_in.webp +0 -0
  4. package/dist/asset/images/myCase//bfileViewer/zoom_out.webp +0 -0
  5. package/dist/asset/images/myCase/icon/arrow.webp +0 -0
  6. package/dist/asset/images/myCase/icon/chat.webp +0 -0
  7. package/dist/asset/images/myCase/icon/check_ok.webp +0 -0
  8. package/dist/asset/images/myCase/icon/search.webp +0 -0
  9. package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
  10. package/dist/components/Daeryuntalk/index.jsx +58 -0
  11. package/dist/components/Daeryuntalk/index.tsx +66 -0
  12. package/dist/components/page/MyCase/[id]/_component/ContactInfo.jsx +1 -1
  13. package/dist/components/page/MyCase/[id]/_component/ContactInfo.tsx +1 -1
  14. package/dist/components/page/MyCase/[id]/_component/DetailInfo.jsx +1 -1
  15. package/dist/components/page/MyCase/[id]/_component/DetailInfo.tsx +9 -3
  16. package/dist/components/page/MyCase/[id]/_component/MyCaseDetailPageContainer.jsx +35 -14
  17. package/dist/components/page/MyCase/[id]/_component/MyCaseDetailPageContainer.tsx +19 -7
  18. package/dist/components/page/MyCase/[id]/_component/TimeLine.jsx +1 -1
  19. package/dist/components/page/MyCase/[id]/_component/TimeLine.tsx +1 -1
  20. package/dist/components/page/MyCase/[id]/_component/_badge/DocumentBadge.d.ts +4 -0
  21. package/dist/components/page/MyCase/[id]/_component/_badge/DocumentBadge.jsx +13 -0
  22. package/dist/components/page/MyCase/[id]/_component/_badge/DocumentBadge.tsx +18 -0
  23. package/dist/components/page/MyCase/[id]/_component/_caseInquiry/CaseInquiry.jsx +1 -1
  24. package/dist/components/page/MyCase/[id]/_component/_caseInquiry/CaseInquiry.tsx +1 -1
  25. package/dist/components/page/MyCase/[id]/_component/_document/Document.d.ts +2 -1
  26. package/dist/components/page/MyCase/[id]/_component/_document/Document.jsx +63 -21
  27. package/dist/components/page/MyCase/[id]/_component/_document/Document.tsx +97 -17
  28. package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.d.ts +2 -1
  29. package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.jsx +58 -13
  30. package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.tsx +124 -25
  31. package/dist/components/page/MyCase/[id]/_component/_document/FileDropZone.jsx +12 -7
  32. package/dist/components/page/MyCase/[id]/_component/_document/FileDropZone.tsx +12 -7
  33. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineAskSuccessModal.d.ts +5 -0
  34. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineAskSuccessModal.jsx +27 -0
  35. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineAskSuccessModal.tsx +46 -0
  36. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineStopModal.d.ts +6 -0
  37. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineStopModal.jsx +34 -0
  38. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineStopModal.tsx +65 -0
  39. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineSuccessModal.d.ts +5 -0
  40. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineSuccessModal.jsx +27 -0
  41. package/dist/components/page/MyCase/[id]/_component/_modal/CaeeExamineSuccessModal.tsx +47 -0
  42. package/dist/components/page/MyCase/[id]/_component/_modal/CaseExamineDocumentModal.d.ts +7 -0
  43. package/dist/components/page/MyCase/[id]/_component/_modal/CaseExamineDocumentModal.jsx +95 -0
  44. package/dist/components/page/MyCase/[id]/_component/_modal/CaseExamineDocumentModal.tsx +141 -0
  45. package/dist/components/page/MyCase/[id]/_component/_modal/CaseExamineModal.d.ts +10 -0
  46. package/dist/components/page/MyCase/[id]/_component/_modal/CaseExamineModal.jsx +149 -0
  47. package/dist/components/page/MyCase/[id]/_component/_modal/CaseExamineModal.tsx +212 -0
  48. package/dist/components/page/MyCase/[id]/_component/_modal/ContractModal.d.ts +3 -4
  49. package/dist/components/page/MyCase/[id]/_component/_modal/ContractModal.jsx +51 -34
  50. package/dist/components/page/MyCase/[id]/_component/_modal/ContractModal.tsx +88 -59
  51. package/dist/components/page/MyCase/[id]/_component/_modal/FileSuccessModal.jsx +2 -2
  52. package/dist/components/page/MyCase/[id]/_component/_modal/FileSuccessModal.tsx +2 -2
  53. package/dist/components/page/MyCase/[id]/_component/_pdf/PdfInlineViewer.d.ts +6 -0
  54. package/dist/components/page/MyCase/[id]/_component/_pdf/PdfInlineViewer.jsx +154 -0
  55. package/dist/components/page/MyCase/[id]/_component/_pdf/PdfInlineViewer.tsx +177 -0
  56. package/dist/components/page/MyCase/_actions/action.d.ts +34 -0
  57. package/dist/components/page/MyCase/_actions/action.js +59 -0
  58. package/dist/components/page/MyCase/_actions/action.ts +79 -0
  59. package/dist/components/page/MyCase/_component/_button/SubMenuButton.jsx +2 -4
  60. package/dist/components/page/MyCase/_component/_button/SubMenuButton.tsx +2 -5
  61. package/dist/components/page/MyCase/_component/_empty/EmptyTable.d.ts +2 -1
  62. package/dist/components/page/MyCase/_component/_empty/EmptyTable.jsx +14 -6
  63. package/dist/components/page/MyCase/_component/_empty/EmptyTable.tsx +34 -6
  64. package/dist/components/page/MyCase/_component/_fileView/FilePreViewer.d.ts +14 -0
  65. package/dist/components/page/MyCase/_component/_fileView/FilePreViewer.jsx +278 -0
  66. package/dist/components/page/MyCase/_component/_fileView/FilePreViewer.tsx +411 -0
  67. package/dist/components/page/MyCase/_component/_fileView/HwpViewer.d.ts +8 -0
  68. package/dist/components/page/MyCase/_component/_fileView/HwpViewer.jsx +56 -0
  69. package/dist/components/page/MyCase/_component/_fileView/HwpViewer.tsx +111 -0
  70. package/dist/components/page/MyCase/_component/_fileView/TopOverlay.d.ts +3 -0
  71. package/dist/components/page/MyCase/_component/_fileView/TopOverlay.jsx +10 -0
  72. package/dist/components/page/MyCase/_component/_fileView/TopOverlay.tsx +10 -0
  73. package/dist/components/page/MyCase/_component/_table/CaseTabSwiper.jsx +8 -3
  74. package/dist/components/page/MyCase/_component/_table/CaseTabSwiper.tsx +3 -4
  75. package/dist/components/page/MyCase/_fetchers/addMyCaseExamine.d.ts +7 -0
  76. package/dist/components/page/MyCase/_fetchers/addMyCaseExamine.js +34 -0
  77. package/dist/components/page/MyCase/_fetchers/addMyCaseExamine.ts +36 -0
  78. package/dist/components/page/MyCase/_fetchers/getDaeryunFileList.d.ts +5 -0
  79. package/dist/components/page/MyCase/_fetchers/getDaeryunFileList.js +33 -0
  80. package/dist/components/page/MyCase/_fetchers/getDaeryunFileList.ts +25 -0
  81. package/dist/components/page/MyCase/_fetchers/getDocumentExamineHistory.d.ts +5 -0
  82. package/dist/components/page/MyCase/_fetchers/getDocumentExamineHistory.js +33 -0
  83. package/dist/components/page/MyCase/_fetchers/getDocumentExamineHistory.ts +25 -0
  84. package/dist/components/page/MyCase/_fetchers/getHwpToPdfFile.d.ts +4 -0
  85. package/dist/components/page/MyCase/_fetchers/getHwpToPdfFile.js +33 -0
  86. package/dist/components/page/MyCase/_fetchers/getHwpToPdfFile.ts +25 -0
  87. package/dist/components/page/MyCase/_type/type.d.ts +3 -1
  88. package/dist/components/page/MyCase/_type/type.ts +3 -1
  89. package/dist/styles/daeryuntalk.css +14 -0
  90. package/dist/styles/globals.css +501 -94
  91. package/dist/styles/homepage_login.css +3 -3
  92. package/dist/tsconfig.tsbuildinfo +1 -1
  93. package/package.json +6 -2
@@ -0,0 +1,154 @@
1
+ 'use client';
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ import { useEffect, useRef, useState } from 'react';
12
+ import * as pdfjsLib from 'pdfjs-dist';
13
+ // pdf.js worker (pdfjs-dist 3.x)
14
+ pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://unpkg.com/pdfjs-dist@3.11.174/build/pdf.worker.min.js';
15
+ export default function PdfSpread({ url, name }) {
16
+ const hostRef = useRef(null);
17
+ // 문서 객체
18
+ const pdfRef = useRef(null);
19
+ const [numPages, setNumPages] = useState(0);
20
+ // 컨테이너 폭 (ResizeObserver 사용)
21
+ const [width, setWidth] = useState(0);
22
+ const roRef = useRef(null);
23
+ // 페이지별 진행 중인 렌더 태스크 & 캔버스
24
+ const tasksRef = useRef(new Map());
25
+ const canvasesRef = useRef(new Map());
26
+ // 렌더 세션 토큰 (stale run 무시용)
27
+ const sessionRef = useRef(null);
28
+ // 컨테이너 폭 관찰
29
+ useEffect(() => {
30
+ const el = hostRef.current;
31
+ if (!el)
32
+ return;
33
+ const ro = new ResizeObserver(entries => {
34
+ for (const entry of entries) {
35
+ const cw = Math.floor(entry.contentRect.width);
36
+ if (cw && cw !== width)
37
+ setWidth(cw);
38
+ }
39
+ });
40
+ ro.observe(el);
41
+ roRef.current = ro;
42
+ // 초기 폭
43
+ setWidth(el.clientWidth);
44
+ return () => {
45
+ ro.disconnect();
46
+ roRef.current = null;
47
+ };
48
+ }, []);
49
+ // 문서 로드
50
+ useEffect(() => {
51
+ let cancelled = false;
52
+ // 이전 상태 정리
53
+ cancelAll();
54
+ clearHost();
55
+ setNumPages(0);
56
+ pdfRef.current = null;
57
+ (() => __awaiter(this, void 0, void 0, function* () {
58
+ try {
59
+ const pdf = yield pdfjsLib.getDocument({
60
+ url,
61
+ // 서버가 Range를 지원 안 하거나 CORS가 애매할 때 대비 옵션(필요 시 조정)
62
+ disableStream: false,
63
+ disableAutoFetch: false
64
+ }).promise;
65
+ if (cancelled)
66
+ return;
67
+ pdfRef.current = pdf;
68
+ setNumPages(pdf.numPages);
69
+ }
70
+ catch (e) {
71
+ // eslint-disable-next-line no-console
72
+ console.error('[PdfSpread] load error:', e);
73
+ }
74
+ }))();
75
+ return () => {
76
+ cancelled = true;
77
+ cancelAll();
78
+ clearHost();
79
+ };
80
+ }, [url]);
81
+ // 렌더링
82
+ useEffect(() => {
83
+ const pdf = pdfRef.current;
84
+ if (!pdf || !numPages || !width)
85
+ return;
86
+ // 새 세션 시작
87
+ const token = Symbol('render-session');
88
+ sessionRef.current = token;
89
+ // 이전 작업/캔버스 정리
90
+ cancelAll();
91
+ clearHost();
92
+ const host = hostRef.current;
93
+ let aborted = false;
94
+ (() => __awaiter(this, void 0, void 0, function* () {
95
+ for (let i = 1; i <= numPages; i++) {
96
+ if (aborted)
97
+ break;
98
+ if (sessionRef.current !== token)
99
+ break; // stale run 무시
100
+ try {
101
+ const page = yield pdf.getPage(i);
102
+ const unscaled = page.getViewport({ scale: 1 });
103
+ const scale = width / unscaled.width;
104
+ const viewport = page.getViewport({ scale });
105
+ // 새 캔버스 생성(재사용 X가 가장 안전)
106
+ const canvas = document.createElement('canvas');
107
+ canvas.className = 'mb-3 block overflow-hidden rounded bg-white';
108
+ canvas.width = Math.floor(viewport.width);
109
+ canvas.height = Math.floor(viewport.height);
110
+ canvas.style.width = `${viewport.width}px`;
111
+ canvas.style.height = `${viewport.height}px`;
112
+ host.appendChild(canvas);
113
+ canvasesRef.current.set(i, canvas);
114
+ const ctx = canvas.getContext('2d');
115
+ const task = page.render({ canvasContext: ctx, viewport });
116
+ tasksRef.current.set(i, task);
117
+ yield task.promise; // 순차 렌더
118
+ tasksRef.current.delete(i);
119
+ // page.cleanup(); // 필요 시 활성화
120
+ }
121
+ catch (e) {
122
+ // cancel() 시 RenderingCancelledException 발생 → 무시
123
+ if ((e === null || e === void 0 ? void 0 : e.name) !== 'RenderingCancelledException') {
124
+ // eslint-disable-next-line no-console
125
+ console.warn('[PdfSpread] render error page', i, e);
126
+ }
127
+ }
128
+ }
129
+ }))();
130
+ return () => {
131
+ aborted = true;
132
+ // 다음 세션에서 clearHost()가 정리합니다.
133
+ };
134
+ }, [numPages, width]);
135
+ function cancelAll() {
136
+ tasksRef.current.forEach(task => {
137
+ try {
138
+ task.cancel();
139
+ }
140
+ catch (_a) { }
141
+ });
142
+ tasksRef.current.clear();
143
+ }
144
+ function clearHost() {
145
+ const host = hostRef.current;
146
+ if (host)
147
+ host.innerHTML = '';
148
+ canvasesRef.current.clear();
149
+ }
150
+ return (<div className="w-full overflow-hidden rounded-lg border border-gray-200">
151
+ {/* 이 블록의 가로폭에 맞춰 모든 페이지를 “쭉” 렌더 */}
152
+ <div ref={hostRef} className="w-full p-3"/>
153
+ </div>);
154
+ }
@@ -0,0 +1,177 @@
1
+ 'use client';
2
+
3
+ import { useEffect, useRef, useState } from 'react';
4
+ import * as pdfjsLib from 'pdfjs-dist';
5
+
6
+ // pdf.js worker (pdfjs-dist 3.x)
7
+ (pdfjsLib as any).GlobalWorkerOptions.workerSrc = 'https://unpkg.com/pdfjs-dist@3.11.174/build/pdf.worker.min.js';
8
+
9
+ type Props = {
10
+ url: string;
11
+ name?: string;
12
+ };
13
+
14
+ type RenderTask = {
15
+ cancel: () => void;
16
+ promise: Promise<any>;
17
+ };
18
+
19
+ export default function PdfSpread({ url, name }: Props) {
20
+ const hostRef = useRef<HTMLDivElement>(null);
21
+
22
+ // 문서 객체
23
+ const pdfRef = useRef<any>(null);
24
+ const [numPages, setNumPages] = useState(0);
25
+
26
+ // 컨테이너 폭 (ResizeObserver 사용)
27
+ const [width, setWidth] = useState(0);
28
+ const roRef = useRef<ResizeObserver | null>(null);
29
+
30
+ // 페이지별 진행 중인 렌더 태스크 & 캔버스
31
+ const tasksRef = useRef<Map<number, RenderTask>>(new Map());
32
+ const canvasesRef = useRef<Map<number, HTMLCanvasElement>>(new Map());
33
+
34
+ // 렌더 세션 토큰 (stale run 무시용)
35
+ const sessionRef = useRef<symbol | null>(null);
36
+
37
+ // 컨테이너 폭 관찰
38
+ useEffect(() => {
39
+ const el = hostRef.current;
40
+ if (!el) return;
41
+ const ro = new ResizeObserver(entries => {
42
+ for (const entry of entries) {
43
+ const cw = Math.floor(entry.contentRect.width);
44
+ if (cw && cw !== width) setWidth(cw);
45
+ }
46
+ });
47
+ ro.observe(el);
48
+ roRef.current = ro;
49
+ // 초기 폭
50
+ setWidth(el.clientWidth);
51
+ return () => {
52
+ ro.disconnect();
53
+ roRef.current = null;
54
+ };
55
+ }, []);
56
+
57
+ // 문서 로드
58
+ useEffect(() => {
59
+ let cancelled = false;
60
+
61
+ // 이전 상태 정리
62
+ cancelAll();
63
+ clearHost();
64
+
65
+ setNumPages(0);
66
+ pdfRef.current = null;
67
+
68
+ (async () => {
69
+ try {
70
+ const pdf = await pdfjsLib.getDocument({
71
+ url,
72
+ // 서버가 Range를 지원 안 하거나 CORS가 애매할 때 대비 옵션(필요 시 조정)
73
+ disableStream: false,
74
+ disableAutoFetch: false
75
+ }).promise;
76
+
77
+ if (cancelled) return;
78
+ pdfRef.current = pdf;
79
+ setNumPages(pdf.numPages);
80
+ } catch (e) {
81
+ // eslint-disable-next-line no-console
82
+ console.error('[PdfSpread] load error:', e);
83
+ }
84
+ })();
85
+
86
+ return () => {
87
+ cancelled = true;
88
+ cancelAll();
89
+ clearHost();
90
+ };
91
+ }, [url]);
92
+
93
+ // 렌더링
94
+ useEffect(() => {
95
+ const pdf = pdfRef.current;
96
+ if (!pdf || !numPages || !width) return;
97
+
98
+ // 새 세션 시작
99
+ const token = Symbol('render-session');
100
+ sessionRef.current = token;
101
+
102
+ // 이전 작업/캔버스 정리
103
+ cancelAll();
104
+ clearHost();
105
+
106
+ const host = hostRef.current!;
107
+ let aborted = false;
108
+
109
+ (async () => {
110
+ for (let i = 1; i <= numPages; i++) {
111
+ if (aborted) break;
112
+ if (sessionRef.current !== token) break; // stale run 무시
113
+
114
+ try {
115
+ const page = await pdf.getPage(i);
116
+
117
+ const unscaled = page.getViewport({ scale: 1 });
118
+ const scale = width / unscaled.width;
119
+ const viewport = page.getViewport({ scale });
120
+
121
+ // 새 캔버스 생성(재사용 X가 가장 안전)
122
+ const canvas = document.createElement('canvas');
123
+ canvas.className = 'mb-3 block overflow-hidden rounded bg-white';
124
+ canvas.width = Math.floor(viewport.width);
125
+ canvas.height = Math.floor(viewport.height);
126
+ canvas.style.width = `${viewport.width}px`;
127
+ canvas.style.height = `${viewport.height}px`;
128
+ host.appendChild(canvas);
129
+
130
+ canvasesRef.current.set(i, canvas);
131
+
132
+ const ctx = canvas.getContext('2d')!;
133
+ const task = page.render({ canvasContext: ctx, viewport }) as unknown as RenderTask;
134
+
135
+ tasksRef.current.set(i, task);
136
+ await task.promise; // 순차 렌더
137
+
138
+ tasksRef.current.delete(i);
139
+ // page.cleanup(); // 필요 시 활성화
140
+ } catch (e: any) {
141
+ // cancel() 시 RenderingCancelledException 발생 → 무시
142
+ if (e?.name !== 'RenderingCancelledException') {
143
+ // eslint-disable-next-line no-console
144
+ console.warn('[PdfSpread] render error page', i, e);
145
+ }
146
+ }
147
+ }
148
+ })();
149
+
150
+ return () => {
151
+ aborted = true;
152
+ // 다음 세션에서 clearHost()가 정리합니다.
153
+ };
154
+ }, [numPages, width]);
155
+
156
+ function cancelAll() {
157
+ tasksRef.current.forEach(task => {
158
+ try {
159
+ task.cancel();
160
+ } catch {}
161
+ });
162
+ tasksRef.current.clear();
163
+ }
164
+
165
+ function clearHost() {
166
+ const host = hostRef.current;
167
+ if (host) host.innerHTML = '';
168
+ canvasesRef.current.clear();
169
+ }
170
+
171
+ return (
172
+ <div className="w-full overflow-hidden rounded-lg border border-gray-200">
173
+ {/* 이 블록의 가로폭에 맞춰 모든 페이지를 “쭉” 렌더 */}
174
+ <div ref={hostRef} className="w-full p-3" />
175
+ </div>
176
+ );
177
+ }
@@ -30,6 +30,23 @@ export declare const useActionGetMyCaseQuestion: (id: string, page: number, page
30
30
  isLoading: boolean;
31
31
  refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<FetchType<Question[]>, Error>>;
32
32
  };
33
+ export declare const useActionGetDaeryunFileList: (id: string, jwt?: string, enabled?: boolean) => {
34
+ data: FetchType<FileList[]> | undefined;
35
+ isLoading: boolean;
36
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<FetchType<FileList[]>, Error>>;
37
+ };
38
+ export declare const useActionPostCaseExamine: () => {
39
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
40
+ result: boolean;
41
+ data: any;
42
+ }, unknown, {
43
+ caseIdx: string;
44
+ comment: string;
45
+ idx: string;
46
+ isApproved: boolean;
47
+ }, unknown>;
48
+ isLoading: boolean;
49
+ };
33
50
  export declare const useActionPostMyCaseQuestion: (id: string, content: string, jwt?: string) => {
34
51
  mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<FetchType<Question[]>, Error, void, unknown>;
35
52
  isLoading: boolean;
@@ -53,3 +70,20 @@ export type UploadResponse = {
53
70
  export declare const useActionPostMyFileUpload: (id: string) => {
54
71
  mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<UploadResponse, unknown, File[], unknown>;
55
72
  };
73
+ export declare const useActionGetDocumentExamineHistory: ({ caseIdx, idx }: {
74
+ caseIdx: string;
75
+ idx: number;
76
+ }) => {
77
+ data: any;
78
+ isLoading: boolean;
79
+ isFetched: boolean;
80
+ isFetching: boolean;
81
+ error: Error | null;
82
+ };
83
+ export declare const useActionViewHwpToPdf: (key: number) => {
84
+ data: any;
85
+ isLoading: boolean;
86
+ isFetched: boolean;
87
+ isFetching: boolean;
88
+ error: Error | null;
89
+ };
@@ -17,6 +17,10 @@ import addMyCaseQuestion from '../_fetchers/addMyCaseQuestion';
17
17
  import getCaseList from '../_fetchers/getCaseList';
18
18
  import getContact from '../_fetchers/getContact';
19
19
  import addMyFileUpload from '../_fetchers/addMyFileUpload';
20
+ import getDaeryunFileList from '../_fetchers/getDaeryunFileList';
21
+ import addMyCaseExamine from '../_fetchers/addMyCaseExamine';
22
+ import getDocumentExamineHistory from '../_fetchers/getDocumentExamineHistory';
23
+ import getHwpToPdfFile from '../_fetchers/getHwpToPdfFile';
20
24
  const jwt2 = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjIsImlhdCI6MTc0MDAxNDYzOCwiZXhwIjoxNzcxNTcyMjM4fQ.11ra7DkzlOVmBqDjo8SJTQnZDZdRHXjjU3ujK8G3OOY';
21
25
  // 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjMsImVtYWlsIjoiNjAzMDgwNEBnbWFpbC5jb20iLCJwcm92aWRlciI6Imdvb2dsZSIsImlzTmV3IjpmYWxzZSwiaWF0IjoxNzQwNDQ2Nzg1LCJleHAiOjE3NDA0ODI3ODV9.v_d7htci4fjLA5MqBXWxUqyNjsAm2GEcdRBO5se-DB8'; //빈거
22
26
  export const useActionGetCaseList = ({ tapState,
@@ -131,6 +135,41 @@ export const useActionGetMyCaseQuestion = (id, page, pageSize, jwt) => {
131
135
  });
132
136
  return { data, isLoading, refetch };
133
137
  };
138
+ export const useActionGetDaeryunFileList = (id, jwt, enabled) => {
139
+ const { data, isLoading, refetch } = useQuery({
140
+ queryKey: ['case', 'daeryunFileList', id],
141
+ queryFn: () => getDaeryunFileList({
142
+ jwt: jwt ? jwt : jwt2,
143
+ id: id
144
+ }),
145
+ gcTime: 0,
146
+ staleTime: 0,
147
+ enabled: enabled
148
+ // onSuccess: res => {},
149
+ // onError: error => {
150
+ // console.log(error);
151
+ // }
152
+ });
153
+ return { data, isLoading, refetch };
154
+ };
155
+ export const useActionPostCaseExamine = () => {
156
+ const { mutateAsync, status } = useMutation({
157
+ mutationFn: (_a) => __awaiter(void 0, [_a], void 0, function* ({ caseIdx, comment, idx, isApproved }) {
158
+ return yield addMyCaseExamine({
159
+ caseIdx: caseIdx,
160
+ comment: comment,
161
+ idx: idx,
162
+ isApproved: isApproved
163
+ });
164
+ }),
165
+ onSuccess: res => { },
166
+ onError: error => {
167
+ console.log(error);
168
+ }
169
+ });
170
+ const isLoading = status === 'pending';
171
+ return { mutateAsync, isLoading };
172
+ };
134
173
  export const useActionPostMyCaseQuestion = (id, content, jwt) => {
135
174
  const { mutateAsync, status } = useMutation({
136
175
  mutationFn: () => __awaiter(void 0, void 0, void 0, function* () {
@@ -176,3 +215,23 @@ export const useActionPostMyFileUpload = (id) => {
176
215
  });
177
216
  return { mutateAsync };
178
217
  };
218
+ export const useActionGetDocumentExamineHistory = ({ caseIdx, idx }) => {
219
+ const { data, isLoading, isFetched, isFetching, error } = useQuery({
220
+ queryKey: ['case', 'documentExamineHistory', caseIdx, idx],
221
+ queryFn: () => getDocumentExamineHistory({ caseIdx: caseIdx, idx: idx }),
222
+ gcTime: 0,
223
+ staleTime: 0,
224
+ enabled: !!idx && !!caseIdx
225
+ });
226
+ return { data, isLoading, isFetched, isFetching, error };
227
+ };
228
+ export const useActionViewHwpToPdf = (key) => {
229
+ const { data, isLoading, isFetched, isFetching, error } = useQuery({
230
+ queryKey: ['case', 'hwpToPdf', key],
231
+ queryFn: () => getHwpToPdfFile({ key: key.toString() }),
232
+ gcTime: 0,
233
+ staleTime: 0,
234
+ enabled: !!key
235
+ });
236
+ return { data, isLoading, isFetched, isFetching, error };
237
+ };
@@ -10,6 +10,10 @@ import addMyCaseQuestion from '../_fetchers/addMyCaseQuestion';
10
10
  import getCaseList from '../_fetchers/getCaseList';
11
11
  import getContact from '../_fetchers/getContact';
12
12
  import addMyFileUpload from '../_fetchers/addMyFileUpload';
13
+ import getDaeryunFileList from '../_fetchers/getDaeryunFileList';
14
+ import addMyCaseExamine from '../_fetchers/addMyCaseExamine';
15
+ import getDocumentExamineHistory from '../_fetchers/getDocumentExamineHistory';
16
+ import getHwpToPdfFile from '../_fetchers/getHwpToPdfFile';
13
17
 
14
18
  const jwt2 =
15
19
  'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjIsImlhdCI6MTc0MDAxNDYzOCwiZXhwIjoxNzcxNTcyMjM4fQ.11ra7DkzlOVmBqDjo8SJTQnZDZdRHXjjU3ujK8G3OOY';
@@ -148,6 +152,59 @@ export const useActionGetMyCaseQuestion = (id: string, page: number, pageSize: n
148
152
  return { data, isLoading, refetch };
149
153
  };
150
154
 
155
+ export const useActionGetDaeryunFileList = (id: string, jwt?: string, enabled?: boolean) => {
156
+ const { data, isLoading, refetch } = useQuery<FetchType<FileList[]>>({
157
+ queryKey: ['case', 'daeryunFileList', id],
158
+ queryFn: () =>
159
+ getDaeryunFileList({
160
+ jwt: jwt ? jwt : jwt2,
161
+ id: id as string
162
+ }),
163
+ gcTime: 0,
164
+ staleTime: 0,
165
+ enabled: enabled
166
+ // onSuccess: res => {},
167
+ // onError: error => {
168
+ // console.log(error);
169
+ // }
170
+ });
171
+ return { data, isLoading, refetch };
172
+ };
173
+
174
+ export const useActionPostCaseExamine = () => {
175
+ const { mutateAsync, status } = useMutation<
176
+ { result: boolean; data: any },
177
+ unknown,
178
+ { caseIdx: string; comment: string; idx: string; isApproved: boolean }
179
+ >({
180
+ mutationFn: async ({
181
+ caseIdx,
182
+ comment,
183
+ idx,
184
+ isApproved
185
+ }: {
186
+ caseIdx: string;
187
+ comment: string;
188
+ idx: string;
189
+ isApproved: boolean;
190
+ }) =>
191
+ await addMyCaseExamine({
192
+ caseIdx: caseIdx as string,
193
+ comment: comment as string,
194
+ idx: idx as string,
195
+ isApproved: isApproved as boolean
196
+ }),
197
+
198
+ onSuccess: res => {},
199
+ onError: error => {
200
+ console.log(error);
201
+ }
202
+ });
203
+
204
+ const isLoading = status === 'pending';
205
+ return { mutateAsync, isLoading };
206
+ };
207
+
151
208
  export const useActionPostMyCaseQuestion = (id: string, content: string, jwt?: string) => {
152
209
  const { mutateAsync, status } = useMutation<FetchType<Question[]>>({
153
210
  mutationFn: async () =>
@@ -204,3 +261,25 @@ export const useActionPostMyFileUpload = (id: string) => {
204
261
 
205
262
  return { mutateAsync };
206
263
  };
264
+
265
+ export const useActionGetDocumentExamineHistory = ({ caseIdx, idx }: { caseIdx: string; idx: number }) => {
266
+ const { data, isLoading, isFetched, isFetching, error } = useQuery<any>({
267
+ queryKey: ['case', 'documentExamineHistory', caseIdx, idx],
268
+ queryFn: () => getDocumentExamineHistory({ caseIdx: caseIdx as string, idx: idx as number }),
269
+ gcTime: 0,
270
+ staleTime: 0,
271
+ enabled: (!!idx as boolean) && (!!caseIdx as boolean)
272
+ });
273
+ return { data, isLoading, isFetched, isFetching, error };
274
+ };
275
+
276
+ export const useActionViewHwpToPdf = (key: number) => {
277
+ const { data, isLoading, isFetched, isFetching, error } = useQuery<any>({
278
+ queryKey: ['case', 'hwpToPdf', key],
279
+ queryFn: () => getHwpToPdfFile({ key: key.toString() }),
280
+ gcTime: 0,
281
+ staleTime: 0,
282
+ enabled: !!key as boolean
283
+ });
284
+ return { data, isLoading, isFetched, isFetching, error };
285
+ };
@@ -1,9 +1,7 @@
1
1
  import { twMerge } from 'tailwind-merge';
2
2
  const SubMenuButton = ({ onClick, title, isSelected, outerClassName }) => {
3
- return (<button className={twMerge(` sm-top:body_large2_tb lg:body_medium2 flex !h-[34px] !w-fit items-center justify-center rounded-[20px] px-[16px] transition-all duration-300 sm-top:h-[39px] sm-top:px-[16px] lg:h-[41px] lg:px-[20px] ${isSelected ? 'bg-grayScale1' : 'bg-transparent'}`, outerClassName)} onClick={onClick}>
4
- <p className={`label_large2_mo sm-top:label_large2_tb lg:label_large2 !leading-none`} style={{
5
- color: isSelected ? 'white' : 'black'
6
- }}>
3
+ return (<button className={twMerge(` lg:rouned-[25px] relative flex !h-[34px] !w-fit items-center justify-center rounded-[20px] px-[16px] transition-all duration-300 sm-top:!h-[39px] sm-top:px-[16px] lg:!h-[49px] lg:rounded-[25px] lg:px-[28px] ${isSelected ? 'bg-grayScale1' : 'bg-transparent'}`, outerClassName)} onClick={onClick}>
4
+ <p className={`label_large2_mo sm-top:label_large2_tb lg:label_large2 !leading-none ${isSelected ? 'text-white' : 'text-grayScale3'}`}>
7
5
  {title}
8
6
  </p>
9
7
  </button>);
@@ -14,7 +14,7 @@ const SubMenuButton = ({
14
14
  return (
15
15
  <button
16
16
  className={twMerge(
17
- ` sm-top:body_large2_tb lg:body_medium2 flex !h-[34px] !w-fit items-center justify-center rounded-[20px] px-[16px] transition-all duration-300 sm-top:h-[39px] sm-top:px-[16px] lg:h-[41px] lg:px-[20px] ${
17
+ ` lg:rouned-[25px] relative flex !h-[34px] !w-fit items-center justify-center rounded-[20px] px-[16px] transition-all duration-300 sm-top:!h-[39px] sm-top:px-[16px] lg:!h-[49px] lg:rounded-[25px] lg:px-[28px] ${
18
18
  isSelected ? 'bg-grayScale1' : 'bg-transparent'
19
19
  }`,
20
20
  outerClassName
@@ -22,10 +22,7 @@ const SubMenuButton = ({
22
22
  onClick={onClick}
23
23
  >
24
24
  <p
25
- className={`label_large2_mo sm-top:label_large2_tb lg:label_large2 !leading-none`}
26
- style={{
27
- color: isSelected ? 'white' : 'black'
28
- }}
25
+ className={`label_large2_mo sm-top:label_large2_tb lg:label_large2 !leading-none ${isSelected ? 'text-white' : 'text-grayScale3'}`}
29
26
  >
30
27
  {title}
31
28
  </p>
@@ -1,6 +1,7 @@
1
- declare const EmptyTable: ({ tap, subTap, isMinHeight }: {
1
+ declare const EmptyTable: ({ tap, subTap, isMinHeight, titleLabel }: {
2
2
  tap: string;
3
3
  subTap: number;
4
4
  isMinHeight?: boolean;
5
+ titleLabel?: string;
5
6
  }) => import("react").JSX.Element;
6
7
  export default EmptyTable;
@@ -44,12 +44,12 @@ const titleList = {
44
44
  },
45
45
  file: {
46
46
  0: {
47
- title: '현재 제출한 문서가 없어요.',
47
+ title: (ctx) => { var _a; return `${(_a = ctx.label) !== null && _a !== void 0 ? _a : '파일'}가 없어요.`; },
48
48
  subTitle: '',
49
49
  img: caseIcon4,
50
50
  width: 'w-[39.9px] sm-top:w-[49.4px] lg:w-[62.7px] ',
51
51
  height: 'h-[42px] sm-top:h-[52px] lg:h-[66px] ',
52
- marginTop: 'mt-[36px] sm-top:mt-[83px] lg:mt-[67px]'
52
+ marginTop: 'mt-[40px] sm-top:mt-[72px] lg:mt-[76px]'
53
53
  }
54
54
  },
55
55
  caseInquiry: {
@@ -73,7 +73,8 @@ const titleList = {
73
73
  }
74
74
  }
75
75
  };
76
- const EmptyTable = ({ tap, subTap, isMinHeight = true }) => {
76
+ const resolveText = (val, ctx) => (typeof val === 'function' ? val(ctx) : val);
77
+ const EmptyTable = ({ tap, subTap, isMinHeight = true, titleLabel }) => {
77
78
  const selectedTitleList = titleList[tap];
78
79
  const selectedSubTap = selectedTitleList ? selectedTitleList[subTap] : null;
79
80
  const { title, subTitle, img, width, height, marginTop } = selectedSubTap || {
@@ -84,11 +85,18 @@ const EmptyTable = ({ tap, subTap, isMinHeight = true }) => {
84
85
  height: '',
85
86
  marginTop: ''
86
87
  };
87
- return (<div className={`flex gap-[14px] sm-top:gap-[20px] ${isMinHeight ? 'min-h-[100px]' : ''} w-full flex-col items-center lg:gap-[40px] ${marginTop}`}>
88
+ const ctx = {
89
+ tap: tap,
90
+ subTap,
91
+ label: titleLabel
92
+ };
93
+ const titleText = resolveText(title, ctx);
94
+ const subTitleText = resolveText(subTitle, ctx);
95
+ return (<div className={`flex gap-[14px] sm-top:gap-[20px] ${isMinHeight ? 'min-h-[100px]' : ''} mb-[100px] w-full flex-col items-center lg:gap-[40px] ${marginTop}`}>
88
96
  <Image src={img} alt="case_icon" width={60} height={60} className={`${width} ${height}`}/>
89
97
  <div className="flex flex-col items-center justify-center ">
90
- <p className="body_medium1_mo sm-top:body_medium1_tb lg:body_medium1">{title}</p>
91
- {subTitle && <p className="body_medium1_mo sm-top:body_medium1_tb lg:body_medium1">{subTitle}</p>}
98
+ <p className="body_medium1_mo sm-top:body_medium1_tb lg:body_medium1">{titleText}</p>
99
+ {subTitle && <p className="body_medium1_mo sm-top:body_medium1_tb lg:body_medium1">{subTitleText}</p>}
92
100
  </div>
93
101
  </div>);
94
102
  };