@gientech/modual 1.5.0 → 1.5.2
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/assets/GientechStreamReader-KtCNi1G3.js +447 -0
- package/dist/assets/style3.css +1 -1
- package/dist/chat.js +911 -2202
- package/dist/index.js +1 -1
- package/dist/package.json +1 -1
- package/dist/streamFilesReader.js +1 -1
- package/dist/worker/pdf.worker1.min.js +23 -0
- package/package.json +1 -1
- package/public/worker/pdf.worker1.min.js +23 -0
- package/src/main.tsx.backup +5 -5
- package/src/modules/chat/ReferenceBar.tsx +520 -11
- package/src/modules/chat/index.tsx +21 -29
- package/src/{utils/gientechCommon/components → modules/chat}/referenceCom/DrawerTitle.tsx +1 -1
- package/src/{utils/gientechCommon/components → modules/chat}/referenceCom/TagCom.tsx +1 -1
- package/src/{utils/gientechCommon/components → modules/chat}/utils/index.ts +6 -6
- package/src/utils/gientechCommon/components/Messages/GientechNewChatWelcome.tsx +231 -18
- package/src/utils/testconfigs/index.ts +1 -1
- package/stats.html +1 -1
- package/dist/assets/GientechStreamReader-BE_oxQLt.js +0 -446
- package/src/utils/gientechCommon/components/ReferenceListDrawer.tsx +0 -542
- package/src/utils/gientechCommon/components/hooks/useAichatEvent.ts +0 -10
- /package/src/{utils/gientechCommon/components → modules/chat}/referenceCom/DeleteModal.tsx +0 -0
- /package/src/{utils/gientechCommon/components → modules/chat}/referenceCom/DrawerContent.tsx +0 -0
- /package/src/{utils/gientechCommon/components → modules/chat}/referenceCom/DrawerDatabase.tsx +0 -0
- /package/src/{utils/gientechCommon/components → modules/chat}/referenceCom/DrawerGraphPreview.tsx +0 -0
- /package/src/{utils/gientechCommon/components → modules/chat}/referenceCom/DrawerPreview.tsx +0 -0
- /package/src/{utils/gientechCommon/components → modules/chat}/referenceCom/RenameModal.tsx +0 -0
- /package/src/{utils/gientechCommon/components → modules/chat}/style.css +0 -0
|
@@ -1,542 +0,0 @@
|
|
|
1
|
-
import { ConfigProvider, Drawer } from 'antd';
|
|
2
|
-
import { DrawerType } from '../../../lib_enter';
|
|
3
|
-
import SingleQa from '../../../assets/img/singleQa.png';
|
|
4
|
-
import DownLoad from '../../../assets/img/downLoad.png';
|
|
5
|
-
import GraphIcon from '../../../assets/img/graphIcon.png';
|
|
6
|
-
import WebSearch from '../../../assets/img/webSearch.png';
|
|
7
|
-
import Database from '../../../assets/img/database.png';
|
|
8
|
-
import { useEffect, useMemo, useState } from 'react';
|
|
9
|
-
import './style.css';
|
|
10
|
-
import useAichatEvent from './hooks/useAichatEvent';
|
|
11
|
-
import DrawerGraphPreview from './referenceCom/DrawerGraphPreview';
|
|
12
|
-
import { DrawerContent } from './referenceCom/DrawerContent';
|
|
13
|
-
import DrawerPreview from './referenceCom/DrawerPreview';
|
|
14
|
-
import DrawerDatabase from './referenceCom/DrawerDatabase';
|
|
15
|
-
import DrawerTitle from './referenceCom/DrawerTitle';
|
|
16
|
-
import TagCom from './referenceCom/TagCom';
|
|
17
|
-
import {
|
|
18
|
-
downloadByStream,
|
|
19
|
-
getFileIcon,
|
|
20
|
-
getFileName,
|
|
21
|
-
getMarkExcludeType,
|
|
22
|
-
TempBaseUrl,
|
|
23
|
-
} from './utils';
|
|
24
|
-
|
|
25
|
-
enum ListName {
|
|
26
|
-
KNOWLEDGE = 'knowledgeList',
|
|
27
|
-
SEARCH = 'searchList',
|
|
28
|
-
DATABASE = 'databaseList',
|
|
29
|
-
GRAPH = 'graphList',
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export const bgColor: any = {
|
|
33
|
-
[ListName.KNOWLEDGE]: '#EAF4FD',
|
|
34
|
-
[ListName.SEARCH]: '#E8F7F0',
|
|
35
|
-
[ListName.DATABASE]: '#FFF4E5',
|
|
36
|
-
[ListName.GRAPH]: '#E7F8FB',
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export const textColor: any = {
|
|
40
|
-
[ListName.KNOWLEDGE]: '#2072F0',
|
|
41
|
-
[ListName.SEARCH]: '#39B83F',
|
|
42
|
-
[ListName.DATABASE]: '#F48C14',
|
|
43
|
-
[ListName.GRAPH]: '#10BBD9',
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const BTNS = [
|
|
47
|
-
{
|
|
48
|
-
key: ListName.KNOWLEDGE,
|
|
49
|
-
name: '知识库文档',
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
key: ListName.SEARCH,
|
|
53
|
-
name: '联网搜索',
|
|
54
|
-
hideBtns: true,
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
key: ListName.DATABASE,
|
|
58
|
-
name: '数据库',
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
key: ListName.GRAPH,
|
|
62
|
-
name: '知识图谱',
|
|
63
|
-
hideBtns: true,
|
|
64
|
-
},
|
|
65
|
-
];
|
|
66
|
-
|
|
67
|
-
export const ReferenceListDrawer = ({
|
|
68
|
-
open,
|
|
69
|
-
setOpen,
|
|
70
|
-
type,
|
|
71
|
-
data,
|
|
72
|
-
token,
|
|
73
|
-
eventsEmit,
|
|
74
|
-
}: {
|
|
75
|
-
open: boolean;
|
|
76
|
-
setOpen: (arg: boolean) => void;
|
|
77
|
-
type: string;
|
|
78
|
-
data: any;
|
|
79
|
-
token: string;
|
|
80
|
-
eventsEmit?: (eventName: string, data: any) => void;
|
|
81
|
-
}) => {
|
|
82
|
-
const [btns, setBtns] = useState(BTNS);
|
|
83
|
-
const { setDrawerType, setCurFileInfo, setDrawerOpen, drawerOpen, drawerType, curFileInfo } =
|
|
84
|
-
useAichatEvent();
|
|
85
|
-
const [activeBtn, setActiveBtn] = useState<any>(ListName.KNOWLEDGE);
|
|
86
|
-
const [lists, seLists] = useState<any>({
|
|
87
|
-
[ListName.KNOWLEDGE]: [],
|
|
88
|
-
[ListName.SEARCH]: [],
|
|
89
|
-
[ListName.DATABASE]: [],
|
|
90
|
-
[ListName.GRAPH]: [],
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
const getEmptyBoxs = useMemo(() => {
|
|
94
|
-
const n = 4 - btns.length;
|
|
95
|
-
const arr = Array(n)
|
|
96
|
-
.fill(null)
|
|
97
|
-
.map((v, i) => {
|
|
98
|
-
return {
|
|
99
|
-
name: '',
|
|
100
|
-
key: 100 + i,
|
|
101
|
-
};
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
const r = [...btns, ...arr];
|
|
105
|
-
console.log('rrrrrr', r);
|
|
106
|
-
|
|
107
|
-
return r;
|
|
108
|
-
}, [btns]);
|
|
109
|
-
|
|
110
|
-
const filterScore = (score: any) => {
|
|
111
|
-
if (isNaN(score)) {
|
|
112
|
-
return '';
|
|
113
|
-
} else {
|
|
114
|
-
return (+score).toFixed(2);
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
const getIcon = (btn: string, filtType?: string) => {
|
|
119
|
-
switch (btn) {
|
|
120
|
-
case ListName.KNOWLEDGE:
|
|
121
|
-
return getFileIcon(filtType as any);
|
|
122
|
-
case ListName.SEARCH:
|
|
123
|
-
return WebSearch;
|
|
124
|
-
case ListName.DATABASE:
|
|
125
|
-
return Database;
|
|
126
|
-
case ListName.GRAPH:
|
|
127
|
-
return GraphIcon;
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
const dealData = (type: string, data: any[]) => {
|
|
132
|
-
if (type === ListName.GRAPH) {
|
|
133
|
-
return data.map(item => {
|
|
134
|
-
return {
|
|
135
|
-
...item,
|
|
136
|
-
name: item.graphName,
|
|
137
|
-
};
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
if (type === ListName.KNOWLEDGE) {
|
|
142
|
-
return data.map(item => {
|
|
143
|
-
return {
|
|
144
|
-
...item,
|
|
145
|
-
name: item.file_name,
|
|
146
|
-
score: item.rrf_score,
|
|
147
|
-
};
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
if (type === ListName.SEARCH) {
|
|
152
|
-
return data.map(item => {
|
|
153
|
-
return {
|
|
154
|
-
...item,
|
|
155
|
-
name: item.file_name,
|
|
156
|
-
};
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
return data;
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
const clickTag = (file: any, tag: any, btn: any) => {
|
|
164
|
-
switch (btn.key) {
|
|
165
|
-
case ListName.KNOWLEDGE:
|
|
166
|
-
console.log('click knowledge tag', file, tag);
|
|
167
|
-
const curFile = file;
|
|
168
|
-
const { pdfPages, parsedFilePath, order_num, metadata } = curFile;
|
|
169
|
-
const id = tag.id || order_num || 'Unknown ID';
|
|
170
|
-
// 解析 source 字段
|
|
171
|
-
const sourceParts = metadata.source.split('/');
|
|
172
|
-
const fileName = sourceParts[sourceParts.length - 1] || '';
|
|
173
|
-
const fileParts = fileName.split('.');
|
|
174
|
-
const label = fileParts.slice(0, -1).join('.') || 'Unknown Label';
|
|
175
|
-
const file_type = fileParts[fileParts.length - 1] || 'Unknown Type';
|
|
176
|
-
|
|
177
|
-
setCurFileInfo({
|
|
178
|
-
id,
|
|
179
|
-
title: label,
|
|
180
|
-
file_name: fileName,
|
|
181
|
-
file_type: file_type,
|
|
182
|
-
file_source: getMarkExcludeType(file_type)
|
|
183
|
-
? `${TempBaseUrl}${metadata.source}`
|
|
184
|
-
: parsedFilePath,
|
|
185
|
-
metadata: metadata,
|
|
186
|
-
pdfPages: pdfPages,
|
|
187
|
-
});
|
|
188
|
-
setDrawerType('mark');
|
|
189
|
-
setDrawerOpen(true);
|
|
190
|
-
break;
|
|
191
|
-
case ListName.SEARCH:
|
|
192
|
-
console.log('click search tag', file, tag);
|
|
193
|
-
break;
|
|
194
|
-
case ListName.DATABASE:
|
|
195
|
-
console.log('click database tag', file, tag);
|
|
196
|
-
break;
|
|
197
|
-
case ListName.GRAPH:
|
|
198
|
-
console.log('click graph tag', file, tag);
|
|
199
|
-
setDrawerType('graphPreview');
|
|
200
|
-
setCurFileInfo({
|
|
201
|
-
...file,
|
|
202
|
-
traceNode: (data?.traceNode || []).find((item: any) => {
|
|
203
|
-
return item.id === tag.id;
|
|
204
|
-
}),
|
|
205
|
-
});
|
|
206
|
-
setDrawerOpen(true);
|
|
207
|
-
break;
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
useEffect(() => {
|
|
212
|
-
if (type !== DrawerType.REFERENCELIST) return;
|
|
213
|
-
console.log('data in reference drawer', data);
|
|
214
|
-
if (!data) return;
|
|
215
|
-
const { graphRefs, knowledgeRefs, webRefs } = data;
|
|
216
|
-
if (graphRefs?.length) {
|
|
217
|
-
lists[ListName.GRAPH] = dealData(ListName.GRAPH, graphRefs);
|
|
218
|
-
}
|
|
219
|
-
if (knowledgeRefs?.length) {
|
|
220
|
-
lists[ListName.KNOWLEDGE] = dealData(ListName.KNOWLEDGE, knowledgeRefs);
|
|
221
|
-
}
|
|
222
|
-
if (webRefs?.length) {
|
|
223
|
-
lists[ListName.SEARCH] = dealData(ListName.SEARCH, webRefs);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
const curBtns = BTNS.filter((item: any) => {
|
|
227
|
-
return lists[item.key]?.length;
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
setBtns(curBtns);
|
|
231
|
-
|
|
232
|
-
if (curBtns?.length) {
|
|
233
|
-
setActiveBtn(curBtns[0].key);
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
seLists({ ...lists });
|
|
237
|
-
}, [data]);
|
|
238
|
-
|
|
239
|
-
return (
|
|
240
|
-
<>
|
|
241
|
-
<ConfigProvider
|
|
242
|
-
drawer={{
|
|
243
|
-
styles: {
|
|
244
|
-
body: { padding: 0 },
|
|
245
|
-
header: { display: 'none' },
|
|
246
|
-
},
|
|
247
|
-
}}
|
|
248
|
-
>
|
|
249
|
-
<Drawer
|
|
250
|
-
autoFocus={false}
|
|
251
|
-
onClose={() => setOpen(false)}
|
|
252
|
-
open={open && type === DrawerType.REFERENCELIST}
|
|
253
|
-
width={400}
|
|
254
|
-
className="overflow-x-hidden"
|
|
255
|
-
getContainer={false}
|
|
256
|
-
afterOpenChange={open => {
|
|
257
|
-
if (!open) {
|
|
258
|
-
}
|
|
259
|
-
}}
|
|
260
|
-
>
|
|
261
|
-
<div className="listWrap w-full h-full">
|
|
262
|
-
<DrawerTitle title="知识溯源" setOpen={setOpen} />
|
|
263
|
-
<div style={{ height: 'calc(100% - 60px)' }}>
|
|
264
|
-
<div
|
|
265
|
-
className="tabs"
|
|
266
|
-
style={{ display: 'flex', justifyContent: 'space-between', padding: '12px 20px' }}
|
|
267
|
-
>
|
|
268
|
-
{getEmptyBoxs.map(item => (
|
|
269
|
-
<div
|
|
270
|
-
key={item.key}
|
|
271
|
-
className="tab-item"
|
|
272
|
-
style={{
|
|
273
|
-
display: 'inline-block',
|
|
274
|
-
padding: '5.5px 12px',
|
|
275
|
-
backgroundColor: !item.name
|
|
276
|
-
? 'transparent'
|
|
277
|
-
: activeBtn === item.key
|
|
278
|
-
? '#4E6EF2'
|
|
279
|
-
: '#F5F6F9',
|
|
280
|
-
cursor: 'pointer',
|
|
281
|
-
borderRadius: '4px',
|
|
282
|
-
color: activeBtn === item.key ? '#FFFFFF' : '#4E5969',
|
|
283
|
-
fontSize: '14px',
|
|
284
|
-
minWidth: '80px',
|
|
285
|
-
}}
|
|
286
|
-
onClick={() => {
|
|
287
|
-
if (item.name) {
|
|
288
|
-
setActiveBtn(item.key);
|
|
289
|
-
}
|
|
290
|
-
}}
|
|
291
|
-
>
|
|
292
|
-
{item.name}
|
|
293
|
-
</div>
|
|
294
|
-
))}
|
|
295
|
-
</div>
|
|
296
|
-
<div
|
|
297
|
-
className="listBox"
|
|
298
|
-
style={{
|
|
299
|
-
height: 'calc(100% - 66px)',
|
|
300
|
-
overflowY: 'auto',
|
|
301
|
-
display: 'flex',
|
|
302
|
-
flexDirection: 'column',
|
|
303
|
-
alignItems: 'center',
|
|
304
|
-
}}
|
|
305
|
-
>
|
|
306
|
-
{btns.map((item: any) => {
|
|
307
|
-
let list: any[] = lists[item.key] || [];
|
|
308
|
-
if (activeBtn !== item.key) return null;
|
|
309
|
-
return (
|
|
310
|
-
<div key={item.key}>
|
|
311
|
-
{list.map(
|
|
312
|
-
(i: {
|
|
313
|
-
name: string;
|
|
314
|
-
id: string;
|
|
315
|
-
score: number | string;
|
|
316
|
-
tags?: any[];
|
|
317
|
-
hideBtns?: boolean;
|
|
318
|
-
file_type?: string;
|
|
319
|
-
link?: string;
|
|
320
|
-
metadata: any;
|
|
321
|
-
file_name: any;
|
|
322
|
-
parsedFilePath: any;
|
|
323
|
-
}) => {
|
|
324
|
-
return (
|
|
325
|
-
<div
|
|
326
|
-
key={i.id}
|
|
327
|
-
style={{
|
|
328
|
-
width: '360px',
|
|
329
|
-
padding: '4px 8px',
|
|
330
|
-
borderRadius: '4px',
|
|
331
|
-
margin: '6px 0',
|
|
332
|
-
cursor: 'pointer',
|
|
333
|
-
}}
|
|
334
|
-
className="listItemBox"
|
|
335
|
-
onClick={() => {
|
|
336
|
-
if (item.key === ListName.SEARCH) {
|
|
337
|
-
window.open(i.link, '_blank');
|
|
338
|
-
}
|
|
339
|
-
}}
|
|
340
|
-
>
|
|
341
|
-
<div
|
|
342
|
-
style={{
|
|
343
|
-
display: 'flex',
|
|
344
|
-
justifyContent: 'space-between',
|
|
345
|
-
alignItems: 'center',
|
|
346
|
-
}}
|
|
347
|
-
>
|
|
348
|
-
<div
|
|
349
|
-
style={{
|
|
350
|
-
width: item.hideBtns ? '339px' : '288px',
|
|
351
|
-
fontSize: '14px',
|
|
352
|
-
color: '#1D2129',
|
|
353
|
-
fontWeight: '700',
|
|
354
|
-
display: 'flex',
|
|
355
|
-
alignItems: 'center',
|
|
356
|
-
}}
|
|
357
|
-
>
|
|
358
|
-
<img
|
|
359
|
-
src={getIcon(item.key, i.file_type)}
|
|
360
|
-
style={{ width: '16px', height: '16px', marginRight: '2px' }}
|
|
361
|
-
/>
|
|
362
|
-
<div
|
|
363
|
-
style={{
|
|
364
|
-
whiteSpace: 'nowrap',
|
|
365
|
-
overflow: 'hidden',
|
|
366
|
-
textOverflow: 'ellipsis',
|
|
367
|
-
width: item.hideBtns ? '322px' : '258px',
|
|
368
|
-
}}
|
|
369
|
-
>
|
|
370
|
-
{i.name}
|
|
371
|
-
</div>
|
|
372
|
-
</div>
|
|
373
|
-
<div
|
|
374
|
-
style={{
|
|
375
|
-
width: '52px',
|
|
376
|
-
justifyContent: 'space-between',
|
|
377
|
-
alignItems: 'center',
|
|
378
|
-
marginRight: '8px',
|
|
379
|
-
display: item.hideBtns ? 'none' : 'flex',
|
|
380
|
-
}}
|
|
381
|
-
>
|
|
382
|
-
<img
|
|
383
|
-
src={SingleQa}
|
|
384
|
-
style={{ width: '16px', height: '16px', cursor: 'pointer' }}
|
|
385
|
-
onClick={() => {
|
|
386
|
-
eventsEmit?.('referenceFile_filechat', {
|
|
387
|
-
data: {
|
|
388
|
-
...i,
|
|
389
|
-
file_type: i.file_type,
|
|
390
|
-
file_name: i.file_name,
|
|
391
|
-
metadata: i.metadata,
|
|
392
|
-
parsedFilePath: i.parsedFilePath,
|
|
393
|
-
},
|
|
394
|
-
});
|
|
395
|
-
}}
|
|
396
|
-
/>
|
|
397
|
-
<div
|
|
398
|
-
style={{ borderRight: '1px solid #E5E6EB', height: '14px' }}
|
|
399
|
-
></div>
|
|
400
|
-
<img
|
|
401
|
-
src={DownLoad}
|
|
402
|
-
style={{ width: '16px', height: '16px', cursor: 'pointer' }}
|
|
403
|
-
onClick={() => {
|
|
404
|
-
console.log('sdgasgdsag', i);
|
|
405
|
-
if (!i?.metadata) return;
|
|
406
|
-
downloadByStream({
|
|
407
|
-
filePath: `${TempBaseUrl}${i.metadata.source}`,
|
|
408
|
-
fileName: getFileName(i),
|
|
409
|
-
token,
|
|
410
|
-
});
|
|
411
|
-
}}
|
|
412
|
-
/>
|
|
413
|
-
</div>
|
|
414
|
-
</div>
|
|
415
|
-
{(typeof i.score === 'string' ||
|
|
416
|
-
typeof i.score === 'number' ||
|
|
417
|
-
(i?.tags?.length && i.tags.length > 0 && i.tags.length <= 10)) && (
|
|
418
|
-
<div
|
|
419
|
-
style={{
|
|
420
|
-
display: 'flex',
|
|
421
|
-
justifyContent: 'space-between',
|
|
422
|
-
height: '18px',
|
|
423
|
-
marginTop: '4px',
|
|
424
|
-
}}
|
|
425
|
-
>
|
|
426
|
-
{(typeof i.score === 'string' || typeof i.score === 'number') && (
|
|
427
|
-
<div
|
|
428
|
-
style={{
|
|
429
|
-
backgroundColor: '#F2F2FB',
|
|
430
|
-
borderRadius: '4px',
|
|
431
|
-
padding: '2px 3px',
|
|
432
|
-
display: 'flex',
|
|
433
|
-
justifyContent: 'center',
|
|
434
|
-
alignItems: 'center',
|
|
435
|
-
fontSize: '12px',
|
|
436
|
-
}}
|
|
437
|
-
>
|
|
438
|
-
<span style={{ color: '#4E5969', marginRight: '6px' }}>
|
|
439
|
-
分数:
|
|
440
|
-
</span>
|
|
441
|
-
<span style={{ color: '#1D2129' }}>
|
|
442
|
-
{filterScore(i.score)}
|
|
443
|
-
</span>
|
|
444
|
-
</div>
|
|
445
|
-
)}
|
|
446
|
-
<div
|
|
447
|
-
style={{ flex: 1, display: 'flex', justifyContent: 'flex-end' }}
|
|
448
|
-
>
|
|
449
|
-
{(i?.tags?.length && i.tags.length > 0 && i.tags.length <= 10
|
|
450
|
-
? i.tags
|
|
451
|
-
: []
|
|
452
|
-
).map((j: any) => {
|
|
453
|
-
return (
|
|
454
|
-
<TagCom
|
|
455
|
-
key={j.id}
|
|
456
|
-
i={i}
|
|
457
|
-
item={item}
|
|
458
|
-
j={j}
|
|
459
|
-
clickTag={clickTag}
|
|
460
|
-
/>
|
|
461
|
-
);
|
|
462
|
-
})}
|
|
463
|
-
</div>
|
|
464
|
-
</div>
|
|
465
|
-
)}
|
|
466
|
-
<div
|
|
467
|
-
style={{
|
|
468
|
-
flex: 1,
|
|
469
|
-
display: 'flex',
|
|
470
|
-
justifyContent: 'flex-start',
|
|
471
|
-
marginTop: '4px',
|
|
472
|
-
}}
|
|
473
|
-
>
|
|
474
|
-
{(i?.tags?.length && i.tags.length > 10 ? i.tags : []).map(
|
|
475
|
-
(j: any) => {
|
|
476
|
-
return (
|
|
477
|
-
<TagCom
|
|
478
|
-
key={j.id}
|
|
479
|
-
i={i}
|
|
480
|
-
item={item}
|
|
481
|
-
j={j}
|
|
482
|
-
clickTag={clickTag}
|
|
483
|
-
/>
|
|
484
|
-
);
|
|
485
|
-
}
|
|
486
|
-
)}
|
|
487
|
-
</div>
|
|
488
|
-
</div>
|
|
489
|
-
);
|
|
490
|
-
}
|
|
491
|
-
)}
|
|
492
|
-
</div>
|
|
493
|
-
);
|
|
494
|
-
})}
|
|
495
|
-
</div>
|
|
496
|
-
</div>
|
|
497
|
-
</div>
|
|
498
|
-
</Drawer>
|
|
499
|
-
</ConfigProvider>
|
|
500
|
-
<ConfigProvider
|
|
501
|
-
drawer={{
|
|
502
|
-
styles: {
|
|
503
|
-
body: { padding: 0 },
|
|
504
|
-
header: { display: 'none' },
|
|
505
|
-
},
|
|
506
|
-
}}
|
|
507
|
-
>
|
|
508
|
-
<Drawer
|
|
509
|
-
autoFocus={false}
|
|
510
|
-
onClose={() => setDrawerOpen(false)}
|
|
511
|
-
open={drawerOpen}
|
|
512
|
-
width={720}
|
|
513
|
-
className="overflow-x-hidden"
|
|
514
|
-
destroyOnClose
|
|
515
|
-
getContainer={false}
|
|
516
|
-
afterOpenChange={open => {
|
|
517
|
-
if (!open) {
|
|
518
|
-
setCurFileInfo(null);
|
|
519
|
-
}
|
|
520
|
-
}}
|
|
521
|
-
>
|
|
522
|
-
{drawerType === 'graphPreview' && (
|
|
523
|
-
<DrawerGraphPreview
|
|
524
|
-
curFileInfo={curFileInfo as any}
|
|
525
|
-
onClose={setDrawerOpen}
|
|
526
|
-
token={token}
|
|
527
|
-
/>
|
|
528
|
-
)}
|
|
529
|
-
{drawerType === 'mark' && (
|
|
530
|
-
<DrawerContent content={curFileInfo as any} onClose={setDrawerOpen} token={token} />
|
|
531
|
-
)}
|
|
532
|
-
{drawerType === 'preview' && (
|
|
533
|
-
<DrawerPreview curFileInfo={curFileInfo} onClose={setDrawerOpen} token={token} />
|
|
534
|
-
)}
|
|
535
|
-
{drawerType === 'database' && (
|
|
536
|
-
<DrawerDatabase curFileInfo={curFileInfo} onClose={setDrawerOpen} />
|
|
537
|
-
)}
|
|
538
|
-
</Drawer>
|
|
539
|
-
</ConfigProvider>
|
|
540
|
-
</>
|
|
541
|
-
);
|
|
542
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
|
|
3
|
-
const useAichatEvent = () => {
|
|
4
|
-
const [drawerType, setDrawerType] = useState<string>('mark');
|
|
5
|
-
const [drawerOpen, setDrawerOpen] = useState<boolean>(false);
|
|
6
|
-
const [curFileInfo, setCurFileInfo] = useState<any>({});
|
|
7
|
-
return { setDrawerType, setCurFileInfo, setDrawerOpen, drawerOpen, drawerType, curFileInfo };
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export default useAichatEvent;
|
|
File without changes
|
/package/src/{utils/gientechCommon/components → modules/chat}/referenceCom/DrawerContent.tsx
RENAMED
|
File without changes
|
/package/src/{utils/gientechCommon/components → modules/chat}/referenceCom/DrawerDatabase.tsx
RENAMED
|
File without changes
|
/package/src/{utils/gientechCommon/components → modules/chat}/referenceCom/DrawerGraphPreview.tsx
RENAMED
|
File without changes
|
/package/src/{utils/gientechCommon/components → modules/chat}/referenceCom/DrawerPreview.tsx
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|