@daeryun/dr_components 1.1.99 → 1.2.1
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/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/components/common/integrate/index.d.ts +1 -1
- package/dist/components/common/integrate/index.jsx +6 -5
- package/dist/components/common/integrate/index.tsx +6 -5
- package/dist/components/page/Integrate/Broadcast.d.ts +1 -1
- package/dist/components/page/Integrate/Broadcast.tsx +1 -1
- package/dist/components/page/Integrate/Field.d.ts +1 -1
- package/dist/components/page/Integrate/Field.tsx +1 -1
- package/dist/components/page/Integrate/LawInfo.d.ts +1 -1
- package/dist/components/page/Integrate/LawInfo.tsx +1 -1
- package/dist/components/page/Integrate/Lawyer.d.ts +1 -1
- package/dist/components/page/Integrate/Lawyer.tsx +1 -1
- package/dist/components/page/Integrate/Map.d.ts +2 -2
- package/dist/components/page/Integrate/Map.jsx +198 -110
- package/dist/components/page/Integrate/Map.tsx +198 -197
- package/dist/components/page/Integrate/MenuTab.d.ts +1 -1
- package/dist/components/page/Integrate/MenuTab.jsx +7 -2
- package/dist/components/page/Integrate/MenuTab.tsx +8 -3
- package/dist/components/page/Integrate/Reply.d.ts +1 -1
- package/dist/components/page/Integrate/Reply.jsx +17 -21
- package/dist/components/page/Integrate/Reply.tsx +48 -55
- package/dist/components/page/Integrate/SearchData.d.ts +1 -1
- package/dist/components/page/Integrate/SearchData.jsx +53 -35
- package/dist/components/page/Integrate/SearchData.tsx +57 -38
- package/dist/components/page/Integrate/Success.d.ts +1 -1
- package/dist/components/page/Integrate/Success.tsx +1 -1
- package/dist/components/page/Integrate/Trend.d.ts +21 -0
- package/dist/components/page/Integrate/Trend.jsx +78 -0
- package/dist/components/page/Integrate/Trend.tsx +173 -0
- package/dist/components/page/Integrate/integrateType.d.ts +39 -35
- package/dist/components/page/Integrate/integrateType.js +3 -4
- package/dist/components/page/Integrate/integrateType.ts +44 -40
- package/dist/styles/globals.css +420 -407
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -24,7 +24,7 @@ const Reply = (props: {
|
|
|
24
24
|
info: number;
|
|
25
25
|
broadcast: number;
|
|
26
26
|
reply: number;
|
|
27
|
-
|
|
27
|
+
trend: number;
|
|
28
28
|
};
|
|
29
29
|
}) => {
|
|
30
30
|
const { tab, onMoreViewText, list, pages, isMobileSize, onMoreView, search, listCount } = props;
|
|
@@ -83,66 +83,59 @@ const Reply = (props: {
|
|
|
83
83
|
<div className={'mb-9 mt-8 grid gap-[18px] sm:grid-cols-2'}>
|
|
84
84
|
{(tab === '전체' ? allTabList : list.replyList).map((item, index) => {
|
|
85
85
|
return (
|
|
86
|
-
<
|
|
86
|
+
<Link
|
|
87
|
+
href={
|
|
88
|
+
(item.crime_code != props.crime_code
|
|
89
|
+
? 'https://www.daeryunlaw.com'
|
|
90
|
+
: '') +
|
|
91
|
+
'/reply/' +
|
|
92
|
+
item.id
|
|
93
|
+
}
|
|
94
|
+
target={item.crime_code === props.crime_code ? '' : '_blank'}
|
|
87
95
|
key={'reply' + item.id}
|
|
88
96
|
className={
|
|
89
|
-
'h-[280px] border-[5px] border-solid border-[#EAEAEA] p-7 max-xs:h-[190px] max-xs:p-4 sm:p-8 '
|
|
97
|
+
'flex h-[280px] flex-col border-[5px] border-solid border-[#EAEAEA] p-7 max-xs:h-[190px] max-xs:p-4 sm:p-8 '
|
|
90
98
|
}
|
|
91
99
|
>
|
|
92
|
-
<
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
100
|
+
<p
|
|
101
|
+
className={
|
|
102
|
+
'h-[70px] text-[20px] font-[800] max-xs:h-[60px] max-xs:text-[18px] sm:text-[22px]'
|
|
103
|
+
}
|
|
104
|
+
>
|
|
105
|
+
<span className={'text-[#285FA7]'}>{item.etc4} </span>
|
|
106
|
+
<br className={'block sm:hidden'} />
|
|
107
|
+
{item.etc5}
|
|
108
|
+
</p>
|
|
109
|
+
<p
|
|
110
|
+
className={
|
|
111
|
+
'mb-[20px] mt-[10px] line-clamp-2 h-[50px] text-[18px] text-[#555555] max-sm:mb-[40px] max-sm:mt-[20px] max-sm:text-[16px] max-xs:mb-0 max-xs:mt-[5px] max-xs:h-[40px] max-xs:text-[15px]'
|
|
99
112
|
}
|
|
100
|
-
target={item.crime_code === props.crime_code ? '' : '_blank'}
|
|
101
113
|
>
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
<div
|
|
128
|
-
className={'mt-6 flex items-center text-[#666666] sm:mt-8'}
|
|
129
|
-
>
|
|
130
|
-
<p
|
|
131
|
-
className={
|
|
132
|
-
'w-[20%] text-[17px] max-xl:w-[35%] max-md:w-[50%] max-sm:w-[30%] max-sm:text-[15px]'
|
|
133
|
-
}
|
|
134
|
-
>
|
|
135
|
-
{dayjs(item.timestamp).format('YYYY.MM.DD')}
|
|
136
|
-
</p>
|
|
137
|
-
<div
|
|
138
|
-
className={
|
|
139
|
-
'h-[2px] w-[80%] bg-[#D8D8D8] max-xl:w-[65%] max-md:w-[50%] max-sm:w-[70%]'
|
|
140
|
-
}
|
|
141
|
-
></div>
|
|
142
|
-
</div>
|
|
143
|
-
</div>
|
|
144
|
-
</Link>
|
|
145
|
-
</div>
|
|
114
|
+
{searchColorText(
|
|
115
|
+
item.summary
|
|
116
|
+
.replaceAll(
|
|
117
|
+
/<(\/)?[a-zA-Z0-9]*(\s[a-zA-Z]*=[^>]*)?(\s)*(\/)?>/gi,
|
|
118
|
+
''
|
|
119
|
+
)
|
|
120
|
+
.replaceAll(' ', ' '),
|
|
121
|
+
search
|
|
122
|
+
)}
|
|
123
|
+
</p>
|
|
124
|
+
<div className={'mt-6 flex items-center text-[#666666] sm:mt-8'}>
|
|
125
|
+
<p
|
|
126
|
+
className={
|
|
127
|
+
'w-[20%] text-[17px] max-xl:w-[35%] max-md:w-[50%] max-sm:w-[30%] max-sm:text-[15px]'
|
|
128
|
+
}
|
|
129
|
+
>
|
|
130
|
+
{dayjs(item.timestamp).format('YYYY.MM.DD')}
|
|
131
|
+
</p>
|
|
132
|
+
<div
|
|
133
|
+
className={
|
|
134
|
+
'h-[2px] w-[80%] bg-[#D8D8D8] max-xl:w-[65%] max-md:w-[50%] max-sm:w-[70%]'
|
|
135
|
+
}
|
|
136
|
+
></div>
|
|
137
|
+
</div>
|
|
138
|
+
</Link>
|
|
146
139
|
);
|
|
147
140
|
})}
|
|
148
141
|
</div>
|
|
@@ -17,9 +17,9 @@ import Success from './Success';
|
|
|
17
17
|
import LawInfo from './LawInfo';
|
|
18
18
|
import Broadcast from './Broadcast';
|
|
19
19
|
import Reply from './Reply';
|
|
20
|
-
import Map from './Map';
|
|
21
20
|
import Lawyer from './Lawyer';
|
|
22
21
|
import useBrowser from '../../hook/useBrowser';
|
|
22
|
+
import Trend from './Trend';
|
|
23
23
|
const SearchData = ({ list: propsList, totalCount, listCount, center_code, crime_code }) => {
|
|
24
24
|
const { width } = useBrowser(true);
|
|
25
25
|
const router = useRouter();
|
|
@@ -61,30 +61,28 @@ const SearchData = ({ list: propsList, totalCount, listCount, center_code, crime
|
|
|
61
61
|
}, [width, isMobileSize]);
|
|
62
62
|
return (<span id={'integrate-result'}>
|
|
63
63
|
{tab === '전체' && totalCount < 1 ? (<NoResult />) : (<>
|
|
64
|
-
<
|
|
65
|
-
paramFetch(
|
|
66
|
-
page: pages.
|
|
67
|
-
type: '
|
|
64
|
+
<Field isMobileSize={isMobileSize} listCount={listCount} center_code={center_code} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} onMoreView={() => {
|
|
65
|
+
paramFetch(`/api/integrate/list`, {
|
|
66
|
+
page: pages.fieldList,
|
|
67
|
+
type: 'field',
|
|
68
68
|
search: search,
|
|
69
69
|
center_code: center_code,
|
|
70
70
|
crime_code: crime_code
|
|
71
71
|
}, (obj) => {
|
|
72
|
-
handleMoreView('
|
|
72
|
+
handleMoreView('fieldList', obj.data.list.fieldList);
|
|
73
73
|
});
|
|
74
|
-
}} search={search}
|
|
75
|
-
|
|
76
|
-
<Reply isMobileSize={isMobileSize} crime_code={crime_code} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} onMoreView={() => {
|
|
74
|
+
}} search={search}/>
|
|
75
|
+
<Success isMobileSize={isMobileSize} center_code={center_code} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} onMoreView={() => {
|
|
77
76
|
paramFetch('/api/integrate/list', {
|
|
78
|
-
page: pages.
|
|
79
|
-
type: '
|
|
77
|
+
page: pages.successList,
|
|
78
|
+
type: 'success',
|
|
80
79
|
search: search,
|
|
81
80
|
center_code: center_code,
|
|
82
81
|
crime_code: crime_code
|
|
83
82
|
}, (obj) => {
|
|
84
|
-
handleMoreView('
|
|
83
|
+
handleMoreView('successList', obj.data.list.successList);
|
|
85
84
|
});
|
|
86
|
-
}}
|
|
87
|
-
|
|
85
|
+
}} search={search} listCount={listCount}/>
|
|
88
86
|
<LawInfo isMobileSize={isMobileSize} center_code={center_code} tab={tab} list={list} pages={pages} listCount={listCount} onMoreViewText={handleMoreViewText} onMoreView={() => {
|
|
89
87
|
paramFetch('/api/integrate/list', {
|
|
90
88
|
page: pages.infoList,
|
|
@@ -96,7 +94,6 @@ const SearchData = ({ list: propsList, totalCount, listCount, center_code, crime
|
|
|
96
94
|
handleMoreView('infoList', obj.data.list.infoList);
|
|
97
95
|
});
|
|
98
96
|
}} search={search}/>
|
|
99
|
-
|
|
100
97
|
<Lawyer isMobileSize={isMobileSize} tab={tab} listCount={listCount} list={list} pages={pages} center_code={center_code} onMoreViewText={handleMoreViewText} onMoreView={() => {
|
|
101
98
|
paramFetch(`api/integrate/list`, {
|
|
102
99
|
page: pages.lawyerList,
|
|
@@ -108,42 +105,63 @@ const SearchData = ({ list: propsList, totalCount, listCount, center_code, crime
|
|
|
108
105
|
handleMoreView('lawyerList', obj.data.list.lawyerList);
|
|
109
106
|
});
|
|
110
107
|
}}/>
|
|
111
|
-
|
|
112
|
-
<Broadcast isMobileSize={isMobileSize} listCount={listCount} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} onMoreView={() => {
|
|
108
|
+
<Reply isMobileSize={isMobileSize} crime_code={crime_code} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} onMoreView={() => {
|
|
113
109
|
paramFetch('/api/integrate/list', {
|
|
114
|
-
page: pages.
|
|
115
|
-
type: '
|
|
110
|
+
page: pages.replyList,
|
|
111
|
+
type: 'reply',
|
|
116
112
|
search: search,
|
|
117
113
|
center_code: center_code,
|
|
118
114
|
crime_code: crime_code
|
|
119
115
|
}, (obj) => {
|
|
120
|
-
handleMoreView('
|
|
116
|
+
handleMoreView('replyList', obj.data.list.replyList);
|
|
121
117
|
});
|
|
122
|
-
}} search={search}/>
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
type: 'field',
|
|
118
|
+
}} listCount={listCount} search={search}/>
|
|
119
|
+
<Broadcast isMobileSize={isMobileSize} listCount={listCount} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} onMoreView={() => {
|
|
120
|
+
paramFetch('/api/integrate/list', {
|
|
121
|
+
page: pages.broadcastList,
|
|
122
|
+
type: 'broadcast',
|
|
128
123
|
search: search,
|
|
129
124
|
center_code: center_code,
|
|
130
125
|
crime_code: crime_code
|
|
131
126
|
}, (obj) => {
|
|
132
|
-
handleMoreView('
|
|
127
|
+
handleMoreView('broadcastList', obj.data.list.broadcastList);
|
|
133
128
|
});
|
|
134
129
|
}} search={search}/>
|
|
135
130
|
|
|
136
|
-
<
|
|
131
|
+
<Trend isMobileSize={isMobileSize} listCount={listCount} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} onMoreView={() => {
|
|
137
132
|
paramFetch('/api/integrate/list', {
|
|
138
|
-
page: pages.
|
|
139
|
-
type: '
|
|
140
|
-
search: search
|
|
141
|
-
center_code: center_code,
|
|
142
|
-
crime_code: crime_code
|
|
133
|
+
page: pages.trendList,
|
|
134
|
+
type: 'trend',
|
|
135
|
+
search: search
|
|
143
136
|
}, (obj) => {
|
|
144
|
-
handleMoreView('
|
|
137
|
+
handleMoreView('trendList', obj.data.list.trendList);
|
|
145
138
|
});
|
|
146
|
-
}}/>
|
|
139
|
+
}} search={search}/>
|
|
140
|
+
|
|
141
|
+
{/*<Map*/}
|
|
142
|
+
{/* isMobileSize={isMobileSize}*/}
|
|
143
|
+
{/* listCount={listCount}*/}
|
|
144
|
+
{/* tab={tab}*/}
|
|
145
|
+
{/* list={list}*/}
|
|
146
|
+
{/* pages={pages}*/}
|
|
147
|
+
{/* onMoreViewText={handleMoreViewText}*/}
|
|
148
|
+
{/* search={search}*/}
|
|
149
|
+
{/* onMoreView={() => {*/}
|
|
150
|
+
{/* paramFetch(*/}
|
|
151
|
+
{/* '/api/integrate/list',*/}
|
|
152
|
+
{/* {*/}
|
|
153
|
+
{/* page: pages.mapList,*/}
|
|
154
|
+
{/* type: 'map',*/}
|
|
155
|
+
{/* search: search,*/}
|
|
156
|
+
{/* center_code: center_code,*/}
|
|
157
|
+
{/* crime_code: crime_code*/}
|
|
158
|
+
{/* },*/}
|
|
159
|
+
{/* (obj: any) => {*/}
|
|
160
|
+
{/* handleMoreView('mapList', obj.data.list.mapList);*/}
|
|
161
|
+
{/* }*/}
|
|
162
|
+
{/* );*/}
|
|
163
|
+
{/* }}*/}
|
|
164
|
+
{/*/>*/}
|
|
147
165
|
</>)}
|
|
148
166
|
</span>);
|
|
149
167
|
};
|
|
@@ -12,6 +12,7 @@ import Reply from './Reply';
|
|
|
12
12
|
import Map from './Map';
|
|
13
13
|
import Lawyer from './Lawyer';
|
|
14
14
|
import useBrowser from '../../hook/useBrowser';
|
|
15
|
+
import Trend from './Trend';
|
|
15
16
|
|
|
16
17
|
const SearchData = ({
|
|
17
18
|
list: propsList,
|
|
@@ -31,7 +32,7 @@ const SearchData = ({
|
|
|
31
32
|
info: number;
|
|
32
33
|
broadcast: number;
|
|
33
34
|
reply: number;
|
|
34
|
-
|
|
35
|
+
trend: number;
|
|
35
36
|
};
|
|
36
37
|
}) => {
|
|
37
38
|
const { width } = useBrowser(true);
|
|
@@ -84,8 +85,9 @@ const SearchData = ({
|
|
|
84
85
|
<NoResult />
|
|
85
86
|
) : (
|
|
86
87
|
<>
|
|
87
|
-
<
|
|
88
|
+
<Field
|
|
88
89
|
isMobileSize={isMobileSize}
|
|
90
|
+
listCount={listCount}
|
|
89
91
|
center_code={center_code}
|
|
90
92
|
tab={tab}
|
|
91
93
|
list={list}
|
|
@@ -93,26 +95,25 @@ const SearchData = ({
|
|
|
93
95
|
onMoreViewText={handleMoreViewText}
|
|
94
96
|
onMoreView={() => {
|
|
95
97
|
paramFetch(
|
|
96
|
-
|
|
98
|
+
`/api/integrate/list`,
|
|
97
99
|
{
|
|
98
|
-
page: pages.
|
|
99
|
-
type: '
|
|
100
|
+
page: pages.fieldList,
|
|
101
|
+
type: 'field',
|
|
100
102
|
search: search,
|
|
101
103
|
center_code: center_code,
|
|
102
104
|
crime_code: crime_code
|
|
103
105
|
},
|
|
106
|
+
|
|
104
107
|
(obj: any) => {
|
|
105
|
-
handleMoreView('
|
|
108
|
+
handleMoreView('fieldList', obj.data.list.fieldList);
|
|
106
109
|
}
|
|
107
110
|
);
|
|
108
111
|
}}
|
|
109
112
|
search={search}
|
|
110
|
-
listCount={listCount}
|
|
111
113
|
/>
|
|
112
|
-
|
|
113
|
-
<Reply
|
|
114
|
+
<Success
|
|
114
115
|
isMobileSize={isMobileSize}
|
|
115
|
-
|
|
116
|
+
center_code={center_code}
|
|
116
117
|
tab={tab}
|
|
117
118
|
list={list}
|
|
118
119
|
pages={pages}
|
|
@@ -121,21 +122,20 @@ const SearchData = ({
|
|
|
121
122
|
paramFetch(
|
|
122
123
|
'/api/integrate/list',
|
|
123
124
|
{
|
|
124
|
-
page: pages.
|
|
125
|
-
type: '
|
|
125
|
+
page: pages.successList,
|
|
126
|
+
type: 'success',
|
|
126
127
|
search: search,
|
|
127
128
|
center_code: center_code,
|
|
128
129
|
crime_code: crime_code
|
|
129
130
|
},
|
|
130
131
|
(obj: any) => {
|
|
131
|
-
handleMoreView('
|
|
132
|
+
handleMoreView('successList', obj.data.list.successList);
|
|
132
133
|
}
|
|
133
134
|
);
|
|
134
135
|
}}
|
|
135
|
-
listCount={listCount}
|
|
136
136
|
search={search}
|
|
137
|
+
listCount={listCount}
|
|
137
138
|
/>
|
|
138
|
-
|
|
139
139
|
<LawInfo
|
|
140
140
|
isMobileSize={isMobileSize}
|
|
141
141
|
center_code={center_code}
|
|
@@ -161,7 +161,6 @@ const SearchData = ({
|
|
|
161
161
|
}}
|
|
162
162
|
search={search}
|
|
163
163
|
/>
|
|
164
|
-
|
|
165
164
|
<Lawyer
|
|
166
165
|
isMobileSize={isMobileSize}
|
|
167
166
|
tab={tab}
|
|
@@ -186,10 +185,9 @@ const SearchData = ({
|
|
|
186
185
|
);
|
|
187
186
|
}}
|
|
188
187
|
/>
|
|
189
|
-
|
|
190
|
-
<Broadcast
|
|
188
|
+
<Reply
|
|
191
189
|
isMobileSize={isMobileSize}
|
|
192
|
-
|
|
190
|
+
crime_code={crime_code}
|
|
193
191
|
tab={tab}
|
|
194
192
|
list={list}
|
|
195
193
|
pages={pages}
|
|
@@ -198,71 +196,92 @@ const SearchData = ({
|
|
|
198
196
|
paramFetch(
|
|
199
197
|
'/api/integrate/list',
|
|
200
198
|
{
|
|
201
|
-
page: pages.
|
|
202
|
-
type: '
|
|
199
|
+
page: pages.replyList,
|
|
200
|
+
type: 'reply',
|
|
203
201
|
search: search,
|
|
204
202
|
center_code: center_code,
|
|
205
203
|
crime_code: crime_code
|
|
206
204
|
},
|
|
207
205
|
(obj: any) => {
|
|
208
|
-
handleMoreView('
|
|
206
|
+
handleMoreView('replyList', obj.data.list.replyList);
|
|
209
207
|
}
|
|
210
208
|
);
|
|
211
209
|
}}
|
|
210
|
+
listCount={listCount}
|
|
212
211
|
search={search}
|
|
213
212
|
/>
|
|
214
|
-
|
|
215
|
-
<Field
|
|
213
|
+
<Broadcast
|
|
216
214
|
isMobileSize={isMobileSize}
|
|
217
215
|
listCount={listCount}
|
|
218
|
-
center_code={center_code}
|
|
219
216
|
tab={tab}
|
|
220
217
|
list={list}
|
|
221
218
|
pages={pages}
|
|
222
219
|
onMoreViewText={handleMoreViewText}
|
|
223
220
|
onMoreView={() => {
|
|
224
221
|
paramFetch(
|
|
225
|
-
|
|
222
|
+
'/api/integrate/list',
|
|
226
223
|
{
|
|
227
|
-
page: pages.
|
|
228
|
-
type: '
|
|
224
|
+
page: pages.broadcastList,
|
|
225
|
+
type: 'broadcast',
|
|
229
226
|
search: search,
|
|
230
227
|
center_code: center_code,
|
|
231
228
|
crime_code: crime_code
|
|
232
229
|
},
|
|
233
|
-
|
|
234
230
|
(obj: any) => {
|
|
235
|
-
handleMoreView('
|
|
231
|
+
handleMoreView('broadcastList', obj.data.list.broadcastList);
|
|
236
232
|
}
|
|
237
233
|
);
|
|
238
234
|
}}
|
|
239
235
|
search={search}
|
|
240
236
|
/>
|
|
241
237
|
|
|
242
|
-
<
|
|
238
|
+
<Trend
|
|
243
239
|
isMobileSize={isMobileSize}
|
|
244
240
|
listCount={listCount}
|
|
245
241
|
tab={tab}
|
|
246
242
|
list={list}
|
|
247
243
|
pages={pages}
|
|
248
244
|
onMoreViewText={handleMoreViewText}
|
|
249
|
-
search={search}
|
|
250
245
|
onMoreView={() => {
|
|
251
246
|
paramFetch(
|
|
252
247
|
'/api/integrate/list',
|
|
253
248
|
{
|
|
254
|
-
page: pages.
|
|
255
|
-
type: '
|
|
256
|
-
search: search
|
|
257
|
-
center_code: center_code,
|
|
258
|
-
crime_code: crime_code
|
|
249
|
+
page: pages.trendList,
|
|
250
|
+
type: 'trend',
|
|
251
|
+
search: search
|
|
259
252
|
},
|
|
260
253
|
(obj: any) => {
|
|
261
|
-
handleMoreView('
|
|
254
|
+
handleMoreView('trendList', obj.data.list.trendList);
|
|
262
255
|
}
|
|
263
256
|
);
|
|
264
257
|
}}
|
|
258
|
+
search={search}
|
|
265
259
|
/>
|
|
260
|
+
|
|
261
|
+
{/*<Map*/}
|
|
262
|
+
{/* isMobileSize={isMobileSize}*/}
|
|
263
|
+
{/* listCount={listCount}*/}
|
|
264
|
+
{/* tab={tab}*/}
|
|
265
|
+
{/* list={list}*/}
|
|
266
|
+
{/* pages={pages}*/}
|
|
267
|
+
{/* onMoreViewText={handleMoreViewText}*/}
|
|
268
|
+
{/* search={search}*/}
|
|
269
|
+
{/* onMoreView={() => {*/}
|
|
270
|
+
{/* paramFetch(*/}
|
|
271
|
+
{/* '/api/integrate/list',*/}
|
|
272
|
+
{/* {*/}
|
|
273
|
+
{/* page: pages.mapList,*/}
|
|
274
|
+
{/* type: 'map',*/}
|
|
275
|
+
{/* search: search,*/}
|
|
276
|
+
{/* center_code: center_code,*/}
|
|
277
|
+
{/* crime_code: crime_code*/}
|
|
278
|
+
{/* },*/}
|
|
279
|
+
{/* (obj: any) => {*/}
|
|
280
|
+
{/* handleMoreView('mapList', obj.data.list.mapList);*/}
|
|
281
|
+
{/* }*/}
|
|
282
|
+
{/* );*/}
|
|
283
|
+
{/* }}*/}
|
|
284
|
+
{/*/>*/}
|
|
266
285
|
</>
|
|
267
286
|
)}
|
|
268
287
|
</span>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IListPagesType, IListTypes } from './integrateType';
|
|
3
|
+
declare const Trend: (props: {
|
|
4
|
+
isMobileSize: boolean | null;
|
|
5
|
+
tab: string;
|
|
6
|
+
onMoreViewText: (str: string) => void;
|
|
7
|
+
onMoreView: () => void;
|
|
8
|
+
list: IListTypes;
|
|
9
|
+
pages: IListPagesType;
|
|
10
|
+
search: string;
|
|
11
|
+
listCount: {
|
|
12
|
+
lawyer: number;
|
|
13
|
+
field: number;
|
|
14
|
+
success: number;
|
|
15
|
+
info: number;
|
|
16
|
+
broadcast: number;
|
|
17
|
+
reply: number;
|
|
18
|
+
trend: number;
|
|
19
|
+
};
|
|
20
|
+
}) => React.JSX.Element;
|
|
21
|
+
export default Trend;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import Link from 'next/link';
|
|
3
|
+
import { NoResult } from './NoResult';
|
|
4
|
+
import dayjs from 'dayjs';
|
|
5
|
+
import { Title } from './Title';
|
|
6
|
+
import { ViewMore } from './ViewMore';
|
|
7
|
+
import { searchColorText } from '../../common/integrate';
|
|
8
|
+
const Trend = (props) => {
|
|
9
|
+
const { tab, onMoreViewText, list, pages, onMoreView, search, isMobileSize, listCount } = props;
|
|
10
|
+
const [loading, setLoading] = useState(false);
|
|
11
|
+
const [allTabPage, setAllTabPage] = useState(0);
|
|
12
|
+
const [allTabList, setAllTabList] = useState([]);
|
|
13
|
+
const getAllPage = () => {
|
|
14
|
+
const itemsToAdd = 4;
|
|
15
|
+
// trendList에서 잘라낼 시작 인덱스 계산
|
|
16
|
+
const startIndex = allTabList.length;
|
|
17
|
+
const endIndex = startIndex + itemsToAdd;
|
|
18
|
+
const newItems = list.trendList.slice(startIndex, endIndex);
|
|
19
|
+
const updatedList = [...allTabList, ...newItems];
|
|
20
|
+
setAllTabList(updatedList);
|
|
21
|
+
// 다음 호출 후 예상 총 개수
|
|
22
|
+
const nextTotalCount = updatedList.length + itemsToAdd;
|
|
23
|
+
// 현재 replyList의 길이
|
|
24
|
+
const currentListLength = list.trendList.length;
|
|
25
|
+
// 다음 총 개수가 trendList 길이를 초과하면 api 호출
|
|
26
|
+
// 예: replyList가 24일 때, 22 -> 26이 되면 호출
|
|
27
|
+
if (nextTotalCount > currentListLength) {
|
|
28
|
+
onMoreView();
|
|
29
|
+
}
|
|
30
|
+
// 페이지 상태 증가
|
|
31
|
+
setAllTabPage(allTabPage + 1);
|
|
32
|
+
};
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (allTabList.length <= 4) {
|
|
35
|
+
setAllTabList(list.trendList.slice(0, isMobileSize ? 2 : 4));
|
|
36
|
+
}
|
|
37
|
+
}, [list.trendList, isMobileSize]);
|
|
38
|
+
return (<>
|
|
39
|
+
{tab === '전체' || tab === 'trend' ? (tab === 'trend' && listCount.trend < 1 ? (<NoResult />) : (<>
|
|
40
|
+
{listCount.trend > 0 ? (<div className={'mb-[180px] max-sm:mb-[100px] max-xs:mb-[50px]'}>
|
|
41
|
+
<Title title={'판결분석'} tab={tab} type={'trend'} onClick={str => onMoreViewText(str)} count={listCount.trend}/>
|
|
42
|
+
<div className={'mb-9 mt-8 grid gap-[18px] sm:grid-cols-2'}>
|
|
43
|
+
{(tab === '전체' ? allTabList : list.trendList).map((item, index) => {
|
|
44
|
+
const title = item.title.split('|');
|
|
45
|
+
return (<Link target={'_blank'} href={'https://www.daeryunlaw.com/trend/' + item.idx} key={'trend' + item.idx} className={'flex h-[280px] flex-col border-[5px] border-solid border-[#EAEAEA] p-7 max-xs:h-[190px] max-xs:p-4 sm:p-8 '}>
|
|
46
|
+
<p className={'line-clamp-2 h-[70px] text-[20px] font-[800] text-[#285FA7] max-xs:h-[60px] max-xs:text-[18px] sm:text-[22px]'}>
|
|
47
|
+
{title.length > 1 ? (<>
|
|
48
|
+
{title[0]}
|
|
49
|
+
<span className={'text-[#212223]'}> | {title[1]}</span>
|
|
50
|
+
</>) : (<>{item.title}</>)}
|
|
51
|
+
</p>
|
|
52
|
+
<p className={'mb-[20px] mt-[10px] line-clamp-2 h-[50px] text-[18px] text-[#555555] max-sm:mb-[40px] max-sm:mt-[20px] max-sm:text-[16px] max-xs:mb-0 max-xs:mt-[5px] max-xs:h-[40px] max-xs:text-[15px]'}>
|
|
53
|
+
{searchColorText(item.contents
|
|
54
|
+
.replaceAll(/<(\/)?[a-zA-Z0-9]*(\s[a-zA-Z]*=[^>]*)?(\s)*(\/)?>/gi, '')
|
|
55
|
+
.replaceAll(' ', ' '), search)}
|
|
56
|
+
</p>
|
|
57
|
+
<div className={'mt-6 flex items-center text-[#666666] sm:mt-8'}>
|
|
58
|
+
<p className={'w-[20%] text-[17px] max-xl:w-[35%] max-md:w-[50%] max-sm:w-[30%] max-sm:text-[15px]'}>
|
|
59
|
+
{dayjs(item.created_at).format('YYYY.MM.DD')}
|
|
60
|
+
</p>
|
|
61
|
+
<div className={'h-[2px] w-[80%] bg-[#D8D8D8] max-xl:w-[65%] max-md:w-[50%] max-sm:w-[70%]'}></div>
|
|
62
|
+
</div>
|
|
63
|
+
</Link>);
|
|
64
|
+
})}
|
|
65
|
+
</div>
|
|
66
|
+
{tab != '전체' && (<ViewMore flag={list.trendList.length != listCount.trend} loading={loading} totalPage={Math.ceil(listCount.trend / 12)} nowPage={pages.trendList} func={() => {
|
|
67
|
+
setLoading(true);
|
|
68
|
+
onMoreView();
|
|
69
|
+
setLoading(false);
|
|
70
|
+
}}/>)}
|
|
71
|
+
{tab === '전체' && (<ViewMore flag={allTabList.length != listCount.trend} func={() => {
|
|
72
|
+
getAllPage();
|
|
73
|
+
}}/>)}
|
|
74
|
+
</div>) : (<></>)}
|
|
75
|
+
</>)) : null}
|
|
76
|
+
</>);
|
|
77
|
+
};
|
|
78
|
+
export default Trend;
|