yt-chat-components 1.5.7 → 1.5.8

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.
@@ -0,0 +1,712 @@
1
+ /* global wx */
2
+ import React from 'react';
3
+ import aiAvatarPng from '../../assets/aicenter/aiavatar.png';
4
+ import closePng from '../../assets/aicenter/close.png';
5
+ import {getFlowInfo, getHistoryList, getQaInfo, getSceneInfo} from '../chatWidget/chatWindow/controllers/index';
6
+ import './index.module.css'
7
+ import { v4 as uuidv4 } from 'uuid';
8
+ import historyListEmptyPng from '../../assets/aicenter/history-list-empty.png';
9
+ import {isEmpty, isFunction} from "lodash";
10
+ import {Button, message as messageTip, Progress, Skeleton, Drawer, Tabs, message} from 'antd'
11
+ import moreAi from '../../assets/aicenter/moreAi.png';
12
+ import icon_history from '../../assets/aicenter/icon_history.png';
13
+ import icon_history_headerbg from '../../assets/aicenter/icon_history_headerbg.png';
14
+ import ChatWidget from "../chatWidget";
15
+ import {knowledgeInfo} from "../previewDialogV2";
16
+ import styles from './index.module.css';
17
+
18
+
19
+ const style=`
20
+ .ant-thought-chain-item-content-box {
21
+ max-width: 100% !important;
22
+ }
23
+ .ant-thought-chain-item-content{
24
+ width: calc(100% + 20px)!important;
25
+ }
26
+ .ant-thought-chain.ant-thought-chain-small{
27
+ max-width: 100% !important;
28
+ }
29
+
30
+ .p_closeImg {
31
+ width: 14px;
32
+ cursor: pointer;
33
+ }
34
+
35
+ .p_toolDialog {
36
+ display: flex;
37
+ flex-direction: column;
38
+ height:100%;
39
+ background:url('https://trans-from-yuntu-resourse.oss-cn-beijing.aliyuncs.com/smartSchool/appCreator/ai/ai_modal_bg.png');
40
+ background-size: cover;
41
+ border-radius:8px;
42
+ }
43
+
44
+ .p_toolDialog .p_toolLeft {
45
+ display: flex;
46
+ flex-direction: column;
47
+ align-items: center;
48
+ width: 300px;
49
+ padding: 1.7rem 1.6rem 1.7rem 1.6rem;
50
+
51
+ border-top-left-radius: 8px;
52
+ border-bottom-left-radius: 8px;
53
+ }
54
+
55
+ .p_toolDialog .p_toolLeft .p_toolLogo {
56
+ user-select: none;
57
+ display: flex;
58
+ align-items: center;
59
+ }
60
+
61
+ .p_toolDialog .p_toolLeft .p_toolLogo .p_logoImg {
62
+ width: 48px;
63
+ }
64
+
65
+ .p_toolDialog .p_toolLeft .p_toolLogo .p_logoText {
66
+ font-weight: bold;
67
+ margin-left: 10px;
68
+ font-size: 30px;
69
+ background: linear-gradient(to right, #1551FF, #8F4BFF);
70
+ -webkit-background-clip: text;
71
+ -webkit-text-fill-color: transparent;
72
+ }
73
+
74
+ .p_toolDialog .p_toolLeft .p_historyDialog {
75
+ user-select: none;
76
+ margin-top: 20px;
77
+ margin-bottom: 20px;
78
+ border-radius: 10px;
79
+ flex: 1;
80
+ width: 100%;
81
+ background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%);
82
+ border-image: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0)) 1 1;
83
+ backdrop-filter: blur(10px);
84
+ position: relative;
85
+ max-height:calc(100% - 5.5rem - 60px);
86
+ }
87
+
88
+ .p_toolDialog .p_toolLeft .p_historyDialog ::-webkit-scrollbar-thumb {
89
+ border-radius: 10px;
90
+ -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
91
+ background: #535353 !important;
92
+ }
93
+
94
+ .p_toolDialog .p_toolLeft .p_historyDialog .p_historyTitle {
95
+ padding: 1.3rem 16px 0 16px;
96
+ display: flex;
97
+ align-items: center;
98
+ }
99
+
100
+ .p_toolDialog .p_toolLeft .p_historyDialog .p_historyTitle .p_historyImg {
101
+ width: 25px;
102
+ }
103
+
104
+ .p_toolDialog .p_toolLeft .p_historyDialog .p_historyTitle .p_dialogTitle {
105
+ margin-left: 10px;
106
+ font-weight: 500;
107
+ font-size: 18px;
108
+ color: #333333;
109
+ line-height: 16px;
110
+ text-align: left;
111
+ font-style: normal;
112
+ }
113
+
114
+ .p_toolDialog .p_toolLeft .p_historyDialog .p_historyListEmpty {
115
+ position: absolute;
116
+ top: 50%;
117
+ left: 50%;
118
+ transform: translate(-50%, -50%);
119
+ text-align: center;
120
+ font-size: 12px;
121
+ color: #999999;
122
+ max-height: calc(100% - 3rem);
123
+
124
+ }
125
+
126
+ .p_toolDialog .p_toolLeft .p_historyDialog .p_historyList {
127
+ height: calc(100% - 3rem);
128
+ margin-top: 10px;
129
+ overflow-y: auto;
130
+ scrollbar-width: none !important; /* firefox */
131
+ }
132
+
133
+ .p_toolDialog .p_toolLeft .p_historyDialog .p_historyList::-webkit-scrollbar{
134
+ display:none;
135
+ }
136
+
137
+ .p_toolDialog .p_toolLeft .p_historyDialog .p_historyList:hover {
138
+ scrollbar-width: thin !important; /* firefox */
139
+ scrollbar-color: #ced4e3 transparent;
140
+ }
141
+
142
+ .p_toolDialog .p_toolLeft .p_historyDialog .p_historyList .p_historyItem {
143
+ padding: 7px 16px;
144
+ }
145
+
146
+ .p_toolDialog .p_toolLeft .p_historyDialog .p_historyList .p_historyItem .p_activeHistoryName {
147
+ color: #1552FF !important;
148
+ }
149
+
150
+ .p_toolDialog .p_toolLeft .p_historyDialog .p_historyList .p_historyItem .p_historyName {
151
+ color: #333333;
152
+ overflow: hidden;
153
+ text-overflow: ellipsis;
154
+ white-space: nowrap;
155
+ cursor: pointer;
156
+ }
157
+
158
+ .p_toolDialog .p_toolLeft .p_historyDialog .p_historyList .p_historyItem .p_historyName:hover {
159
+ color: #171717;
160
+ }
161
+
162
+ .p_toolDialog .p_toolRight {
163
+ height: calc(100vh - 60px);
164
+ width: 100%;
165
+ max-width: 100%;
166
+ }
167
+
168
+ .p_toolRightToRight {
169
+ width:300px;
170
+ display:flex;
171
+ flex-direction:column;
172
+ padding:2rem 1.6rem 1.8rem 1.6rem
173
+ }
174
+ .rightInnerContainer{
175
+ height:calc(100% - 80px);
176
+ flex:1;
177
+ display:flex;
178
+ flex-direction:column;
179
+ justify-content: space-between;
180
+ }
181
+ .p_toolRightToRight .rightSideTitle{
182
+ margin-bottom:1.4rem;
183
+ margin-top:10px;
184
+ margin-top:0;
185
+ font-size:18px;
186
+ font-weight:500;
187
+ display:flex;
188
+ align-items: center;
189
+ }
190
+ .p_toolRightToRight .rightSideTitle img{
191
+ margin-right:4px;
192
+ }
193
+
194
+ .p_toolRightToRight .rightSideTitle .titleSideColumn{
195
+ color:#1551FF;
196
+ }
197
+
198
+ .p_toolRightToRight .rightSkillContainer{
199
+ min-height:40%;
200
+ }
201
+ .p_toolRightToRight .rightSkillContainer .rightSkillList{
202
+ display: flex;
203
+ flex-wrap: wrap;
204
+ grid-template-columns: repeat(3, 1fr);
205
+ gap: 10px;
206
+ }
207
+ .p_toolRightToRight .rightSkillContainer .rightSkillList .rightSkillItem{
208
+ text-align: center;
209
+ cursor:pointer;
210
+ width:30%;
211
+ }
212
+ .p_toolRightToRight .rightSkillContainer .rightSkillList .rightSkillItem img{
213
+ width: 40px;
214
+ height: 40px;
215
+ border-radius:10px;
216
+ }
217
+ .p_toolRightToRight .rightSkillContainer .rightSkillList .rightSkillItem p{
218
+ margin-top:0px;
219
+ margin-bottom:4px;
220
+ overflow: hidden;
221
+ text-overflow: ellipsis;
222
+ white-space: nowrap;
223
+ color: #333333;
224
+ }
225
+ .p_toolRightToRight .rightKnowledgeTitle{
226
+ nargin-top: 2.2rem;
227
+ margin-bottom: 1.4rem;
228
+ font-size:18px;
229
+ font-weight:500;
230
+ display:flex;
231
+ align-items: center;
232
+ }
233
+
234
+ .p_toolRightToRight .rightKnowledgeTitle img{
235
+ margin-right:4px;
236
+ }
237
+
238
+ .p_toolRightToRight .rightKnowledgeContainer{
239
+ position:relative;
240
+ }
241
+ .p_toolRightToRight .rightMoreButton{
242
+ background: url(${moreAi});
243
+ background-size: 85% auto;
244
+ background-repeat: no-repeat;
245
+ background-position: bottom;
246
+ position: absolute;
247
+ bottom: 8px;
248
+ left: 0;
249
+ width: 100%;
250
+ height: 100%;
251
+ z-index: 1;
252
+ display: flex;
253
+ justify-content: center;
254
+ align-items: flex-end;
255
+ }
256
+ .p_toolRightToRight .rightMoreButton div{
257
+ width:calc(100% - 50px);
258
+ padding: 16px 16px 10px 20px;
259
+ font-weight: 500;
260
+ color: #ffffff;
261
+ line-height: 17px;
262
+ font-size: 12px;
263
+ cursor:pointer;
264
+ }
265
+
266
+ .p_newDialog {
267
+ width: 252px;
268
+ height: 40px;
269
+ min-height:40px;
270
+ background: linear-gradient( 45deg, #1551FF 0%, #8F4BFF 100%);
271
+ border-radius: 20px;
272
+ cursor: pointer;
273
+ display: flex;
274
+ align-items: center;
275
+ justify-content: center;
276
+ }
277
+
278
+ .p_newDialog img {
279
+ width: 18px;
280
+ }
281
+
282
+ .p_newDialog .p_newDialogText {
283
+ color: #fff;
284
+ margin-left: 6px;
285
+ }
286
+
287
+ .drawer-history-header {
288
+ margin-top: 40px;
289
+ }
290
+
291
+ .drawer-history-header-title {
292
+ display: flex;
293
+ flex-direction: row;
294
+ align-items: center;
295
+
296
+ > img {
297
+ width:35px
298
+ }
299
+
300
+ > span {
301
+ }
302
+ }
303
+
304
+ .drawer-history-header .drawer-history-header-tool {
305
+
306
+ > img {
307
+ }
308
+
309
+ > span {
310
+ }
311
+ }
312
+
313
+ .drawer-history-content {
314
+ }
315
+ .drawer-history-footer {
316
+ }
317
+
318
+ `
319
+
320
+ const defaultList = [
321
+ {
322
+ backgroundImg: 'https://trans-from-yuntu-resourse.oss-cn-beijing.aliyuncs.com/smartSchool/appCreator/ai/drop-down-item-card-01.png',
323
+ title: '我这学期的课程安排是什么样?',
324
+ },
325
+ {
326
+ backgroundImg: 'https://trans-from-yuntu-resourse.oss-cn-beijing.aliyuncs.com/smartSchool/appCreator/ai/drop-down-item-card-02.png',
327
+ title: '我上个学期的成绩是多少?',
328
+ },
329
+ {
330
+ backgroundImg: 'https://trans-from-yuntu-resourse.oss-cn-beijing.aliyuncs.com/smartSchool/appCreator/ai/drop-down-item-card-03.png',
331
+ title: '哪里可以找到心理咨询服务?',
332
+ },
333
+ ];
334
+
335
+ const api_key = 'sk-mniUFDpcWwvNF3iFzssXa6etN-S_Y4AApyHYcBU44L0';
336
+ const drawerTabs = [
337
+ // {id:'agent', name:'专项技能',icon:'https://trans-from-yuntu-resourse.oss-cn-beijing.aliyuncs.com/smartSchool/appCreator/ai/icon/icon_tab_agent.png',activeIcon:'https://trans-from-yuntu-resourse.oss-cn-beijing.aliyuncs.com/smartSchool/appCreator/ai/icon/icon_tab_agent_1.png'},
338
+ {id:'history', name:'对话记录',icon:'https://trans-from-yuntu-resourse.oss-cn-beijing.aliyuncs.com/smartSchool/appCreator/ai/icon/icon_tab_history.png',activeIcon:'https://trans-from-yuntu-resourse.oss-cn-beijing.aliyuncs.com/smartSchool/appCreator/ai/icon/icon_tab_history_1.png'}
339
+ ]
340
+ export const MethodContext = React.createContext();
341
+
342
+ export class MobileChatPageV2 extends React.Component {
343
+ sessionUserInfo = {};
344
+ state = {
345
+ historyList: [], // 历史对话列表
346
+ sessionId: uuidv4(), // 当前激活的对话对应的sessionId
347
+ dropDownList: [],
348
+ sceneInfo: {},
349
+ currentFlow: {},
350
+ currentTabKey:'agent',
351
+ historyDrawerVisible: false, // 抽屉历史记录状态
352
+ agentDrawerVisible: false, // 多智能体切换抽屉状态
353
+ knowledgeInfo: {},
354
+ };
355
+
356
+ constructor(props) {
357
+ super(props);
358
+ this.dragging = false;
359
+ }
360
+
361
+ componentWillMount() {
362
+ const { userInfo = {} } = this.props;
363
+ const { sessionId } = this.state;
364
+ if (isEmpty(userInfo.code)) {
365
+ const code = sessionId.replaceAll("-", "").slice(2);
366
+ this.sessionUserInfo.code = code;
367
+ this.sessionUserInfo.id = code;
368
+ this.sessionUserInfo.name = code;
369
+ }else{
370
+ this.sessionUserInfo = userInfo;
371
+ }
372
+ }
373
+
374
+ async componentDidMount() {
375
+ this.getHistoryList(true);
376
+ }
377
+
378
+ setWindowTitle = (title) => {
379
+ if (!isEmpty(title)){
380
+ }
381
+ }
382
+
383
+ getCurrentFlowHistory=(flowId)=>{
384
+ let { userInfo = {} } = this.props;
385
+ const { sessionId } = this.state;
386
+ const operationId = this.sessionUserInfo['code'] || '';
387
+ getHistoryList(this.props.hostUrl, flowId, operationId).then((res) => {
388
+ if(res.status === 200 && typeof res.data !== "string" && typeof res.data !== "string"){
389
+ this.setState({ historyList: res.data });
390
+ }
391
+ });
392
+ }
393
+
394
+ // 获取历史对话列表
395
+ getHistoryList = (isRefreshWords) => {
396
+ const {appId: flowId, isShowSideLeft} = this.props;
397
+ // 单独组件情况
398
+ if (isRefreshWords) {
399
+ this.getFlowInfo().then(currentFlow => {
400
+ const dropDownList = this.getDropDownList(currentFlow.welcome_words||[]);
401
+ this.setState({dropDownList, currentFlow})
402
+ })
403
+ }
404
+ if (isShowSideLeft) {
405
+ this.getCurrentFlowHistory(flowId)
406
+ }
407
+ }
408
+
409
+ getFlowInfo = async () => {
410
+ const res = await getFlowInfo(this.props.hostUrl, this.props.appId, api_key);
411
+ if(res.status === 200 && typeof res.data !== "string") {
412
+ // 查询知识库相关信息用作预置问题
413
+ getQaInfo(this.props.hostUrl, this.props.appId, api_key).then(res => {
414
+ if (res.status === 200 && typeof res.data !== "string") {
415
+ if ( !isEmpty(res.data) && !isEmpty(res.data.media) && !isEmpty(res.data.question)) {
416
+ this.setState({ knowledgeInfo: res.data })
417
+ } else if ( !isEmpty(this.props.knowledgeInfo)) {
418
+ this.setState({ knowledgeInfo: this.props.knowledgeInfo })
419
+ } else {
420
+ this.setState({ knowledgeInfo: knowledgeInfo })
421
+ }
422
+ }
423
+ }).catch(e => {
424
+ console.log(e);
425
+ });
426
+ this.setState({ currentFlow: res.data });
427
+ }
428
+ return res.data;
429
+ }
430
+
431
+ // 新建对话
432
+ newDialog = () => {
433
+ if(this.state.dropDownList) {
434
+ messageTip.info("当前已是最新对话")
435
+ return;
436
+ }
437
+ this.setState({ sessionId: uuidv4() });
438
+ this.setState({ dropDownList: this.getDropDownList(this.state.currentFlow.welcome_words), drawerVisible: false })
439
+ }
440
+
441
+ updateSessionId = (sessionId) => {
442
+ this.setState({ sessionId });
443
+ };
444
+
445
+ registerChatMethods = ({ isActiveMessage, handleSendMessage }) => {
446
+ this.handleSendMessage = handleSendMessage;
447
+ this.isActiveMessage = isActiveMessage;
448
+ }
449
+
450
+ handleClick = (word) => {
451
+ if(!this.isActiveMessage()){
452
+ this.handleSendMessage(word);
453
+ }else{
454
+ message.destroy();
455
+ message.info("请等待回复结束后再发送")
456
+ }
457
+ };
458
+
459
+ getDropDownList = (welcome_words)=>{
460
+ if(isEmpty(welcome_words)){
461
+ return defaultList;
462
+ }
463
+ return welcome_words.slice(0,3).map((question,index)=>(
464
+ {
465
+ backgroundImg:defaultList[index].backgroundImg,
466
+ title:question,
467
+ }
468
+ ))
469
+ }
470
+
471
+ renderCustomDropDown=(dropDownList)=>{
472
+ return null;
473
+ }
474
+
475
+ render() {
476
+ const {
477
+ title,
478
+ appId: flowId,
479
+ hostUrl,
480
+ setDialogVisible,
481
+ userInfo,
482
+ boxStyle,
483
+ isShowSideRight,
484
+ isShowSideLeft = true,
485
+ tags = [],
486
+ agentUrl = aiAvatarPng,
487
+ agentName = '校园智多星',
488
+ logoWidth = '42px',
489
+ logoFontSize = '26px',
490
+ isTitleSideIcon = false,// 是否将左侧历史顶部icon移到中间顶部左侧蓝点位置
491
+ assetMap,
492
+ modalIndex,
493
+ isShowVoiceButton,
494
+ isShowUploadButton,
495
+ dropManUrl,
496
+ modalWidth,
497
+ isLogin = false,
498
+ isShowLogin = false,
499
+ loginBtnClick,
500
+ tipTitle,
501
+ tipContent,
502
+ isShowReadIcon,
503
+ signUrl,
504
+ headerName,
505
+ isShowMobileInputArea,
506
+ } = this.props;
507
+ const { currentFlow = {} } = this.state;
508
+ return (
509
+ <div style={boxStyle}>
510
+ <style dangerouslySetInnerHTML={{ __html: style }}></style>
511
+ <div className="p_toolDialog" style={{borderRadius:0, backgroundImage:'url(https://trans-from-yuntu-resourse.oss-cn-beijing.aliyuncs.com/kai_yuan/yt/agent_list_bg2.png)'}}>
512
+ {
513
+ isShowSideLeft && (
514
+ <>
515
+ <img
516
+ src={icon_history}
517
+ style={{
518
+ width: '40px',
519
+ height: '40px',
520
+ position: 'absolute',
521
+ left: '0px',
522
+ top: '0px',
523
+ zIndex: 1000,
524
+ display: 'none',
525
+ }}
526
+ onClick={() => this.setState({drawerVisible: true})}
527
+ />
528
+ <Drawer
529
+ title={null}
530
+ closable={false}
531
+ placement="left"
532
+ width={'80%'}
533
+ bodyStyle={{padding: 0}}
534
+ onClose={() => this.setState({drawerVisible: false})}
535
+ open={this.state.drawerVisible}
536
+ >
537
+ <div className="drawer-history-header" style={{marginTop:0, padding: '54px 14px 14px 14px', background: 'linear-gradient( 71deg, #E1E9FF 0%, #FFFFFF 100%)', position: "relative"}}>
538
+ <img src={icon_history_headerbg} style={{position: 'absolute', right: 0, bottom: 0, width: '40%', zIndex:0}}/>
539
+ <div className="drawer-history-header-title" style={{display: 'flex', flexDirection: 'row', alignItems: 'center'}}>
540
+ <img style={{width: 35}} src={agentUrl}/>
541
+ <span style={{fontSize: 24, marginLeft: 10}}>{agentName}</span>
542
+ </div>
543
+ </div>
544
+ <div
545
+ className="p_historyDialog"
546
+ style={{
547
+ height: 'calc(100% - 146px - 50px)',
548
+ boxSizing: 'border-box',
549
+ userSelect: 'none',
550
+ flex: 1,
551
+ background: 'linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%)',
552
+ borderImage: 'linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0)) 1 1',
553
+ backdropFilter: 'blur(10px)',
554
+ position: 'relative',
555
+ }}
556
+ >
557
+ <div style={{display: 'flex', flexDirection: 'row', justifyContent: 'space-between'}}>
558
+ {
559
+ drawerTabs.map((item, index) => (
560
+ <div id={item.id} style={{
561
+ width:'50%',
562
+ display: 'flex',
563
+ WebkitTapHighlightColor: 'transparent',
564
+ userSelect: 'none',
565
+ WebkitUserSelect: 'none',
566
+ WebkitTouchCallout: 'none',
567
+ flexDirection: 'row',
568
+ alignItems: 'center',
569
+ justifyContent: 'center',
570
+ cursor: 'pointer',
571
+ padding: '30px 14px 15px 14px',
572
+ borderBottom: this.state.currentTabKey === item.id ? '2px solid #2850FF' : '2px solid #fff'
573
+ }}
574
+ onClick={() => this.setState({currentTabKey: item.id})}
575
+ >
576
+ <img style={{width:16, marginRight: 8}} src={this.state.currentTabKey === item.id ? item.activeIcon : item.icon} />
577
+ <div style={{fontSize:16, fontWeight: 'bold', color: this.state.currentTabKey === item.id ? '#2850FF' : '#333'}}>{item.name}</div>
578
+ </div>
579
+ ))
580
+ }
581
+ </div>
582
+ {/*对话记录*/}
583
+ {
584
+ this.state.currentTabKey === 'history' &&
585
+ (this.state.historyList.length > 0 ? (
586
+ <div className="p_historyList" style={{overflowY: 'auto', height: 'calc(100% - 70px)'}}>
587
+ {this.state.historyList?.map((item) => (
588
+ <div
589
+ key={item.session_id}
590
+ className="p_historyItem"
591
+ style={{
592
+ display: 'flex',
593
+ height: 44,
594
+ alignItems: 'center',
595
+ paddingLeft: 30,
596
+ paddingRight: 30,
597
+ fontWeight: 400,
598
+ fontSize: 14,
599
+ color: '#333',
600
+ borderRadius: 10,
601
+ background: item.session_id === this.state.sessionId ? '#F5F5FF' : '#fff',
602
+ }}
603
+ onClick={() => {
604
+ this.setState({dropDownList: undefined, drawerVisible: false})
605
+ this.updateSessionId(item.session_id);
606
+ }}
607
+ >
608
+ <div
609
+ className={`p_historyName ${
610
+ item.session_id === this.state.sessionId ? 'p_activeHistoryName' : ''
611
+ }`}
612
+ style={{
613
+ whiteSpace: 'nowrap',
614
+ overflow: 'hidden',
615
+ textOverflow: 'ellipsis',
616
+ color: item.session_id === this.state.sessionId ? '#1551FF' : '#333',
617
+ }}
618
+ >
619
+ {item.text}
620
+ </div>
621
+ </div>
622
+ ))}
623
+ </div>
624
+ ) : (
625
+ <div className="p_historyListEmpty" style={{display: 'flex', flexDirection: 'column', alignItems: 'center', marginTop: 50}}>
626
+ <img src={historyListEmptyPng} style={{width: '100px', height: '100px', marginBottom: 20}}/>
627
+ <div className="p_historyListEmptyText" style={{fontSize: 16, color: '#999' }}>暂无对话记录</div>
628
+ </div>
629
+ ))
630
+ }
631
+ </div>
632
+ <div style={{
633
+ display: 'flex',
634
+ justifyContent: 'center',
635
+ alignItems: 'center',
636
+ marginTop: 10,
637
+ marginBottom: 20
638
+ }}>
639
+ <div
640
+ style={{
641
+ display: 'flex',
642
+ justifyContent: 'center',
643
+ alignItems: 'center',
644
+ width: '80%',
645
+ height: 44,
646
+ color: '#fff',
647
+ background: 'linear-gradient( 30deg, #1551FF 0%, #8F4BFF 100%)',
648
+ borderRadius: 10
649
+ }}
650
+ onClick={() => {
651
+ this.setState({drawerVisible: false})
652
+ this.newDialog()
653
+ }}
654
+ >
655
+ 新建对话
656
+ </div>
657
+ </div>
658
+ </Drawer>
659
+ </>
660
+ )
661
+ }
662
+ {/*对话上边的学校标志,定位到左上角header上端*/}
663
+ <div className={styles.mobile_nav}>
664
+ <div className={styles.title}>{headerName}</div>
665
+ <div></div>
666
+ </div>
667
+
668
+ <div className="p_toolRight">
669
+ <ChatWidget
670
+ window_title={currentFlow?.name || title}
671
+ flow_id={currentFlow?.id || flowId}
672
+ tags={currentFlow?.keywords || tags}
673
+ input_container_style={{zIndex: 2}}
674
+ is_enable_call={currentFlow?.is_enable_call || false}
675
+ host_url={hostUrl}
676
+ api_key={api_key}
677
+ session_id={this.state.sessionId}
678
+ userInfo={this.sessionUserInfo}
679
+ getHistoryList={this.getHistoryList}
680
+ setDropDownList={(list) => this.setState({ dropDownList: list })}
681
+ dropDownList={this.state.dropDownList}
682
+ baseConfig={{ isTitleSideIcon, logoWidth, agentUrl, ...assetMap }}
683
+ isShowUploadButton={isShowUploadButton}
684
+ isShowVoiceButton={isShowVoiceButton}
685
+ dropManUrl={currentFlow.character}
686
+ modalWidth={modalWidth}
687
+ isShowReadIcon={isShowReadIcon}
688
+ isShowChatHeader={false}
689
+ renderCustomDropDown={this.renderCustomDropDown}
690
+ isTagsHidden={true}
691
+ placeholder={'请输入您想咨询的问题'}
692
+ isEnableForV1={false}
693
+ questions={this.state.knowledgeInfo?.question || []}
694
+ voice={currentFlow.call_voice}
695
+ onSmartRobotClick={() => {
696
+ this.setState({drawerVisible: true})
697
+ }}
698
+ chat_window_style={{paddingTop: 0}}
699
+ bot_message_style={{background: '#fff', maxWidth:'100%'}}
700
+ isMobile={true}
701
+ tipTitle={tipTitle}
702
+ tipContent={tipContent}
703
+ isShowMobileInputArea={isShowMobileInputArea}
704
+ />
705
+ </div>
706
+ </div>
707
+ </div>
708
+ );
709
+ }
710
+ }
711
+
712
+ export default MobileChatPageV2;