@daeryun/dr_components 0.9.43 → 0.9.45
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.
|
@@ -163,6 +163,7 @@ const StepTwo = () => {
|
|
|
163
163
|
});
|
|
164
164
|
const [centerCodes, setCenterCodes] = useState([]);
|
|
165
165
|
const [fieldData, setFieldData] = useState({});
|
|
166
|
+
console.log('centerCodes :', centerCodes);
|
|
166
167
|
const center_code = 'CT0001';
|
|
167
168
|
const center_code2 = 'CT0025';
|
|
168
169
|
const categories = [
|
|
@@ -195,8 +196,7 @@ const StepTwo = () => {
|
|
|
195
196
|
// API 호출 함수
|
|
196
197
|
const fetchFieldData = (centerCode) => __awaiter(void 0, void 0, void 0, function* () {
|
|
197
198
|
try {
|
|
198
|
-
|
|
199
|
-
const response = yield fetch(`https://mng.daeryunlaw.com/api/app/seo-template/field/list-by-center?center_code=${centerCode}`);
|
|
199
|
+
const response = yield fetch(`/api/mng/app/seo-template/field/list-by-center?center_code=${centerCode}`);
|
|
200
200
|
if (!response.ok) {
|
|
201
201
|
throw new Error(`API 호출 실패: ${response.status}`);
|
|
202
202
|
}
|
|
@@ -681,6 +681,24 @@ const StepTwo = () => {
|
|
|
681
681
|
</div>
|
|
682
682
|
</div>
|
|
683
683
|
)} */}
|
|
684
|
+
{centerCodes.map((centerCode, index) => {
|
|
685
|
+
var _a, _b;
|
|
686
|
+
const currentFieldData = fieldData[centerCode];
|
|
687
|
+
const categoryName = (_a = categories.find(item => item.code === centerCode)) === null || _a === void 0 ? void 0 : _a.code_name;
|
|
688
|
+
if (!((_b = currentFieldData === null || currentFieldData === void 0 ? void 0 : currentFieldData.data) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
689
|
+
return null;
|
|
690
|
+
}
|
|
691
|
+
return (<div key={centerCode} className="sm:flex sm:flex-row sm:rounded-[16px] sm:border sm:border-solid sm:border-grayScale5 sm:p-[40px] lg:rounded-[20px]">
|
|
692
|
+
<p className="body_large1_mo sm:body_large1_tb lg:body_large1 sm:w-[150px] sm:flex-shrink-0">
|
|
693
|
+
{categoryName}
|
|
694
|
+
</p>
|
|
695
|
+
<div className="my-[12px] w-full bg-grayScale5 max-sm:h-[1px] sm:mx-[44px] sm:my-0 sm:h-auto sm:w-[1px] sm:flex-shrink-0 lg:gap-[80px]"/>
|
|
696
|
+
|
|
697
|
+
<div className={`flex flex-row flex-wrap gap-x-[8px] gap-y-[12px] sm:gap-[20px] lg:gap-x-[24px] ${index === 1 ? 'lg:gap-y-[32px]' : 'lg:gap-y-[24px]'}`}>
|
|
698
|
+
{currentFieldData.data.map(item => (<Box key={item.type_idx} type_idx={item.type_idx} tag_title={item.tag_title} selected={selectedList.includes(item.type_idx)} selectedList={selectedList} setSelectedList={setSelectedList} activeTooltipId={activeTooltipId} setActiveTooltipId={setActiveTooltipId} tooltipTimeoutRef={tooltipTimeoutRef}/>))}
|
|
699
|
+
</div>
|
|
700
|
+
</div>);
|
|
701
|
+
})}
|
|
684
702
|
</div>
|
|
685
703
|
<div className="mb-[56px] mt-[40px] flex flex-col items-center justify-center sm:mt-[60px] lg:mt-[79px]">
|
|
686
704
|
<div className="flex w-full flex-row items-center justify-center gap-[8px]">
|
|
@@ -215,6 +215,8 @@ const StepTwo = () => {
|
|
|
215
215
|
[key: string]: { result: boolean; data: { type_idx: number; tag_title: string }[] };
|
|
216
216
|
}>({});
|
|
217
217
|
|
|
218
|
+
console.log('centerCodes :', centerCodes);
|
|
219
|
+
|
|
218
220
|
const center_code = 'CT0001';
|
|
219
221
|
const center_code2 = 'CT0025';
|
|
220
222
|
const categories = [
|
|
@@ -248,10 +250,7 @@ const StepTwo = () => {
|
|
|
248
250
|
// API 호출 함수
|
|
249
251
|
const fetchFieldData = async (centerCode: string) => {
|
|
250
252
|
try {
|
|
251
|
-
|
|
252
|
-
const response = await fetch(
|
|
253
|
-
`https://mng.daeryunlaw.com/api/app/seo-template/field/list-by-center?center_code=${centerCode}`
|
|
254
|
-
);
|
|
253
|
+
const response = await fetch(`/api/mng/app/seo-template/field/list-by-center?center_code=${centerCode}`);
|
|
255
254
|
|
|
256
255
|
if (!response.ok) {
|
|
257
256
|
throw new Error(`API 호출 실패: ${response.status}`);
|
|
@@ -775,6 +774,44 @@ const StepTwo = () => {
|
|
|
775
774
|
</div>
|
|
776
775
|
</div>
|
|
777
776
|
)} */}
|
|
777
|
+
{centerCodes.map((centerCode, index) => {
|
|
778
|
+
const currentFieldData = fieldData[centerCode];
|
|
779
|
+
const categoryName = categories.find(item => item.code === centerCode)?.code_name;
|
|
780
|
+
|
|
781
|
+
if (!currentFieldData?.data?.length) {
|
|
782
|
+
return null;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
return (
|
|
786
|
+
<div
|
|
787
|
+
key={centerCode}
|
|
788
|
+
className="sm:flex sm:flex-row sm:rounded-[16px] sm:border sm:border-solid sm:border-grayScale5 sm:p-[40px] lg:rounded-[20px]"
|
|
789
|
+
>
|
|
790
|
+
<p className="body_large1_mo sm:body_large1_tb lg:body_large1 sm:w-[150px] sm:flex-shrink-0">
|
|
791
|
+
{categoryName}
|
|
792
|
+
</p>
|
|
793
|
+
<div className="my-[12px] w-full bg-grayScale5 max-sm:h-[1px] sm:mx-[44px] sm:my-0 sm:h-auto sm:w-[1px] sm:flex-shrink-0 lg:gap-[80px]" />
|
|
794
|
+
|
|
795
|
+
<div
|
|
796
|
+
className={`flex flex-row flex-wrap gap-x-[8px] gap-y-[12px] sm:gap-[20px] lg:gap-x-[24px] ${index === 1 ? 'lg:gap-y-[32px]' : 'lg:gap-y-[24px]'}`}
|
|
797
|
+
>
|
|
798
|
+
{currentFieldData.data.map(item => (
|
|
799
|
+
<Box
|
|
800
|
+
key={item.type_idx}
|
|
801
|
+
type_idx={item.type_idx}
|
|
802
|
+
tag_title={item.tag_title}
|
|
803
|
+
selected={selectedList.includes(item.type_idx)}
|
|
804
|
+
selectedList={selectedList}
|
|
805
|
+
setSelectedList={setSelectedList}
|
|
806
|
+
activeTooltipId={activeTooltipId}
|
|
807
|
+
setActiveTooltipId={setActiveTooltipId}
|
|
808
|
+
tooltipTimeoutRef={tooltipTimeoutRef}
|
|
809
|
+
/>
|
|
810
|
+
))}
|
|
811
|
+
</div>
|
|
812
|
+
</div>
|
|
813
|
+
);
|
|
814
|
+
})}
|
|
778
815
|
</div>
|
|
779
816
|
<div className="mb-[56px] mt-[40px] flex flex-col items-center justify-center sm:mt-[60px] lg:mt-[79px]">
|
|
780
817
|
<div className="flex w-full flex-row items-center justify-center gap-[8px]">
|