bhd-components 0.11.24 → 0.11.25

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.
@@ -5,7 +5,7 @@ import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
5
5
  import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
6
6
  import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
7
7
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@ice/jsx-runtime/jsx-runtime";
8
- import React, { useEffect, useState, useRef } from "react";
8
+ import React, { useEffect, useState, useRef, useMemo } from "react";
9
9
  import { Modal, Drawer, Tooltip } from "antd";
10
10
  import message from "../message";
11
11
  import ViewImage from "../viewImage";
@@ -146,6 +146,17 @@ var CustomerService = function(props) {
146
146
  var shouqiTimer = useRef(null);
147
147
  var waitMesssageListRef = useRef([]);
148
148
  var handleRenderMsgTimer = useRef(null);
149
+ var customTitle = useMemo(function() {
150
+ if (props.customTitle) {
151
+ return props.customTitle;
152
+ }
153
+ return userData.modules.some(function(ele) {
154
+ return ele.short == "AIservice";
155
+ }) ? "AI助手" : "智能问答";
156
+ }, [
157
+ props.customTitle,
158
+ userData
159
+ ]);
149
160
  var handleRenderMsg = function() {
150
161
  if (handleRenderMsgTimer.current) return;
151
162
  var processMessages = function() {
@@ -303,6 +314,7 @@ var CustomerService = function(props) {
303
314
  try {
304
315
  newShowType.current = true;
305
316
  setImgBese64("");
317
+ //@ts-ignore
306
318
  if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
307
319
  setScreenShotType(1);
308
320
  // console.log("看看变了没有1213133");
@@ -339,6 +351,7 @@ var CustomerService = function(props) {
339
351
  },
340
352
  triggerCallback: function() {
341
353
  // 截图组件加载完毕调用此方法来完成框选区域的截图
354
+ //@ts-ignore
342
355
  screenShotPlugin.current.completeScreenshot();
343
356
  },
344
357
  cancelCallback: function(err) {
@@ -360,6 +373,7 @@ var CustomerService = function(props) {
360
373
  } else {
361
374
  setScreenShotType(2);
362
375
  // console.log("截图方式:【html2canvas】");
376
+ //@ts-ignore
363
377
  html2canvas(screenshotAreaId, {
364
378
  //__docusaurus
365
379
  useCORS: true,
@@ -2349,10 +2363,7 @@ var CustomerService = function(props) {
2349
2363
  };
2350
2364
  //显示聊天室名字
2351
2365
  var showChatRoomName = function() {
2352
- var title = "AI助手";
2353
- title = userData.modules.some(function(ele) {
2354
- return ele.short == "AIservice";
2355
- }) ? "AI助手" : "智能问答";
2366
+ var title = customTitle;
2356
2367
  var list = contactsList.filter(function(e) {
2357
2368
  return e.roomId == roomId;
2358
2369
  });
@@ -2369,8 +2380,21 @@ var CustomerService = function(props) {
2369
2380
  children: [
2370
2381
  /*#__PURE__*/ _jsx("div", {
2371
2382
  className: styles.user,
2372
- children: /*#__PURE__*/ _jsx("p", {
2373
- children: showChatRoomName()
2383
+ children: /*#__PURE__*/ _jsxs("p", {
2384
+ className: styles.user_p,
2385
+ children: [
2386
+ /*#__PURE__*/ _jsxs("i", {
2387
+ className: styles.user_icon,
2388
+ onClick: function() {
2389
+ setShowContacts(!showContacts);
2390
+ },
2391
+ children: [
2392
+ /*#__PURE__*/ _jsx(CustomContacts, {}),
2393
+ showUnreadMessage()
2394
+ ]
2395
+ }),
2396
+ showChatRoomName()
2397
+ ]
2374
2398
  })
2375
2399
  }),
2376
2400
  /*#__PURE__*/ _jsxs("div", {
@@ -2428,6 +2452,7 @@ var CustomerService = function(props) {
2428
2452
  /*#__PURE__*/ _jsx("div", {
2429
2453
  className: styles.user,
2430
2454
  children: /*#__PURE__*/ _jsxs("p", {
2455
+ className: styles.user_p,
2431
2456
  children: [
2432
2457
  showType == 1 && /*#__PURE__*/ _jsxs("i", {
2433
2458
  className: "lianxiren21",
@@ -2439,6 +2464,16 @@ var CustomerService = function(props) {
2439
2464
  showUnreadMessage()
2440
2465
  ]
2441
2466
  }),
2467
+ showType == 2 && /*#__PURE__*/ _jsxs("i", {
2468
+ className: styles.user_icon,
2469
+ onClick: function() {
2470
+ setShowContacts(!showContacts);
2471
+ },
2472
+ children: [
2473
+ /*#__PURE__*/ _jsx(CustomContacts, {}),
2474
+ showUnreadMessage()
2475
+ ]
2476
+ }),
2442
2477
  showChatRoomName()
2443
2478
  ]
2444
2479
  })
@@ -4100,7 +4135,7 @@ var CustomerService = function(props) {
4100
4135
  return /*#__PURE__*/ _jsxs(_Fragment, {
4101
4136
  children: [
4102
4137
  /*#__PURE__*/ _jsxs(Drawer, {
4103
- title: "AI助手",
4138
+ title: customTitle,
4104
4139
  width: 560,
4105
4140
  onClose: function() {
4106
4141
  onCancel();
@@ -4127,7 +4162,8 @@ var CustomerService = function(props) {
4127
4162
  switchChatRoom: switchChatRoom,
4128
4163
  // saveContactsList={saveContactsList}
4129
4164
  contactsList: contactsList,
4130
- ref: childRef
4165
+ ref: childRef,
4166
+ customTitle: customTitle
4131
4167
  })
4132
4168
  }),
4133
4169
  /*#__PURE__*/ _jsx("div", {
@@ -4182,7 +4218,8 @@ var CustomerService = function(props) {
4182
4218
  onClose: function() {
4183
4219
  setShowHistory(false);
4184
4220
  },
4185
- loadSpecifiedData: loadSpecifiedData
4221
+ loadSpecifiedData: loadSpecifiedData,
4222
+ customTitle: customTitle
4186
4223
  }),
4187
4224
  showType == 1 && showTeacherList && /*#__PURE__*/ _jsx(TeacherList, {
4188
4225
  type: showType,
@@ -4197,14 +4234,14 @@ var CustomerService = function(props) {
4197
4234
  ]
4198
4235
  }),
4199
4236
  /*#__PURE__*/ _jsxs(Modal, {
4200
- title: "AI助手",
4237
+ title: customTitle,
4201
4238
  open: showType == 2 ? true : false,
4202
4239
  onCancel: function() {
4203
4240
  onCancel();
4204
4241
  onEvent(serverName + serverUrl(), "click_智能问答_收起侧边栏", "提交");
4205
4242
  },
4206
4243
  centered: true,
4207
- width: window.innerWidth - 252 > 1214 ? window.innerWidth - 252 : 1214,
4244
+ width: 1200,
4208
4245
  // @ts-ignore
4209
4246
  height: window.innerHeight - 160,
4210
4247
  wrapClassName: styles.ChatWindow_Modal,
@@ -4217,7 +4254,7 @@ var CustomerService = function(props) {
4217
4254
  children: renderHeader()
4218
4255
  }),
4219
4256
  /*#__PURE__*/ _jsxs("div", {
4220
- className: "".concat(styles.Drawer_wrap_main),
4257
+ className: "".concat(styles.Drawer_wrap_main, " ").concat(showContacts ? "" : styles.Drawer_wrap_main_hide),
4221
4258
  onClick: function() {
4222
4259
  setKeyWordProblem("");
4223
4260
  },
@@ -4229,7 +4266,7 @@ var CustomerService = function(props) {
4229
4266
  maxHeight: "".concat(window.innerHeight - 148 - buttomHei, "px")
4230
4267
  },
4231
4268
  children: [
4232
- /*#__PURE__*/ _jsx(ContactsList, {
4269
+ showContacts && /*#__PURE__*/ _jsx(ContactsList, {
4233
4270
  type: 2,
4234
4271
  roomId: roomId,
4235
4272
  userData: userData,
@@ -4241,7 +4278,8 @@ var CustomerService = function(props) {
4241
4278
  switchChatRoom: switchChatRoom,
4242
4279
  contactsList: contactsList,
4243
4280
  // saveContactsList={saveContactsList}
4244
- ref: childRef
4281
+ ref: childRef,
4282
+ customTitle: customTitle
4245
4283
  }),
4246
4284
  /*#__PURE__*/ _jsxs("div", {
4247
4285
  className: styles.chat_content,
@@ -4279,7 +4317,8 @@ var CustomerService = function(props) {
4279
4317
  onClose: function() {
4280
4318
  setShowHistory(false);
4281
4319
  },
4282
- loadSpecifiedData: loadSpecifiedData
4320
+ loadSpecifiedData: loadSpecifiedData,
4321
+ customTitle: customTitle
4283
4322
  }),
4284
4323
  showType == 2 && showTeacherList && /*#__PURE__*/ _jsx(TeacherList, {
4285
4324
  type: showType,
@@ -4385,7 +4424,8 @@ var CustomerService = function(props) {
4385
4424
  onClose: function() {
4386
4425
  setShowHistory(false);
4387
4426
  },
4388
- loadSpecifiedData: loadSpecifiedData
4427
+ loadSpecifiedData: loadSpecifiedData,
4428
+ customTitle: customTitle
4389
4429
  }),
4390
4430
  showType == 3 && showTeacherList && /*#__PURE__*/ _jsx(TeacherList, {
4391
4431
  type: showType,
@@ -4413,7 +4453,8 @@ var CustomerService = function(props) {
4413
4453
  contactsList: contactsList,
4414
4454
  switchChatRoom: switchChatRoom,
4415
4455
  // saveContactsList={saveContactsList}
4416
- ref: childRef
4456
+ ref: childRef,
4457
+ customTitle: customTitle
4417
4458
  })
4418
4459
  })
4419
4460
  ]
@@ -4421,14 +4462,14 @@ var CustomerService = function(props) {
4421
4462
  (showType == 4 || showType == 5) && /*#__PURE__*/ _jsxs(_Fragment, {
4422
4463
  children: [
4423
4464
  /*#__PURE__*/ _jsxs(Modal, {
4424
- title: "AI助手",
4465
+ title: customTitle,
4425
4466
  open: showType == 4 ? true : false,
4426
4467
  onCancel: function() {
4427
4468
  onCancel();
4428
4469
  onEvent(serverName + serverUrl(), "click_智能问答_收起侧边栏", "提交");
4429
4470
  },
4430
4471
  centered: true,
4431
- width: window.innerWidth - 252 > 1214 ? window.innerWidth - 252 : 1214,
4472
+ width: 1200,
4432
4473
  // @ts-ignore
4433
4474
  height: window.innerHeight - 160,
4434
4475
  wrapClassName: "".concat(styles.ChatWindow_Modal),
@@ -4441,7 +4482,7 @@ var CustomerService = function(props) {
4441
4482
  children: renderHeader()
4442
4483
  }),
4443
4484
  /*#__PURE__*/ _jsxs("div", {
4444
- className: "".concat(styles.Drawer_wrap_main),
4485
+ className: "".concat(styles.Drawer_wrap_main, " ").concat(showContacts ? "" : styles.Drawer_wrap_main_hide),
4445
4486
  children: [
4446
4487
  /*#__PURE__*/ _jsxs("div", {
4447
4488
  className: "".concat(styles.Drawer_main, " ").concat(styles.Drawer_main_newlabo),
@@ -4453,7 +4494,7 @@ var CustomerService = function(props) {
4453
4494
  setKeyWordProblem("");
4454
4495
  },
4455
4496
  children: [
4456
- /*#__PURE__*/ _jsx(ContactsList, {
4497
+ showContacts && /*#__PURE__*/ _jsx(ContactsList, {
4457
4498
  type: 4,
4458
4499
  roomId: roomId,
4459
4500
  userData: userData,
@@ -4465,7 +4506,8 @@ var CustomerService = function(props) {
4465
4506
  contactsList: contactsList,
4466
4507
  switchChatRoom: switchChatRoom,
4467
4508
  // saveContactsList={saveContactsList}
4468
- ref: childRef
4509
+ ref: childRef,
4510
+ customTitle: customTitle
4469
4511
  }),
4470
4512
  /*#__PURE__*/ _jsxs("div", {
4471
4513
  className: styles.chat_content,
@@ -4503,7 +4545,8 @@ var CustomerService = function(props) {
4503
4545
  onClose: function() {
4504
4546
  setShowHistory(false);
4505
4547
  },
4506
- loadSpecifiedData: loadSpecifiedData
4548
+ loadSpecifiedData: loadSpecifiedData,
4549
+ customTitle: customTitle
4507
4550
  }),
4508
4551
  showTeacherList && /*#__PURE__*/ _jsx(TeacherList, {
4509
4552
  type: showType,
@@ -4614,7 +4657,8 @@ var CustomerService = function(props) {
4614
4657
  contactsList: contactsList,
4615
4658
  switchChatRoom: switchChatRoom,
4616
4659
  // saveContactsList={saveContactsList}
4617
- ref: childRef
4660
+ ref: childRef,
4661
+ customTitle: customTitle
4618
4662
  })
4619
4663
  })
4620
4664
  ]
@@ -68,6 +68,11 @@
68
68
  position: relative;
69
69
  padding-left: 36px;
70
70
 
71
+ .user_p{
72
+ display:flex;
73
+ align-items: center;
74
+ }
75
+
71
76
  i {
72
77
  padding-right: 16px;
73
78
  color: #111;
@@ -88,6 +93,11 @@
88
93
  font-size: 12px;
89
94
  line-height: 1.2;
90
95
  }
96
+ .user_icon{
97
+ display: flex;
98
+ line-height: 1;
99
+ position: relative;
100
+ }
91
101
  }
92
102
  .operate {
93
103
  display: flex;
@@ -177,6 +187,21 @@
177
187
  }
178
188
  }
179
189
  }
190
+ .Drawer_wrap_main{
191
+ width:100%;
192
+ &.Drawer_wrap_main_hide{
193
+ .Drawer_main{
194
+ .chat_content{
195
+ width: 100%;
196
+ margin-left: 0;
197
+ }
198
+ }
199
+ .Drawer_buttom_Issues_List{
200
+ width: 100%;
201
+ margin-left: 0;
202
+ }
203
+ }
204
+ }
180
205
  .Drawer_main {
181
206
  max-height: calc(100vh - 110px);
182
207
  overflow: hidden;
@@ -65,6 +65,11 @@
65
65
  position: relative;
66
66
  padding-left: 36px;
67
67
 
68
+ .user_p{
69
+ display:flex;
70
+ align-items: center;
71
+ }
72
+
68
73
  i {
69
74
  padding-right: 16px;
70
75
  color: #111;
@@ -85,6 +90,11 @@
85
90
  font-size: 12px;
86
91
  line-height: 1.2;
87
92
  }
93
+ .user_icon{
94
+ display: flex;
95
+ line-height: 1;
96
+ position: relative;
97
+ }
88
98
  }
89
99
  .operate {
90
100
  display: flex;
@@ -174,6 +184,21 @@
174
184
  }
175
185
  }
176
186
  }
187
+ .Drawer_wrap_main{
188
+ width:100%;
189
+ &.Drawer_wrap_main_hide{
190
+ .Drawer_main{
191
+ .chat_content{
192
+ width: 100%;
193
+ margin-left: 0;
194
+ }
195
+ }
196
+ .Drawer_buttom_Issues_List{
197
+ width: 100%;
198
+ margin-left: 0;
199
+ }
200
+ }
201
+ }
177
202
  .Drawer_main {
178
203
  max-height: calc(100vh - 110px);
179
204
  overflow: hidden;
@@ -188,7 +213,7 @@
188
213
  }
189
214
  }
190
215
  .message_con {
191
- // padding: 16px;
216
+ // padding: 16px;
192
217
  // padding-top: 0;
193
218
 
194
219
  >div{
@@ -245,7 +270,8 @@
245
270
  }
246
271
  }
247
272
  }
248
- & > li,.itemcontent {
273
+ & > li,
274
+ .itemcontent {
249
275
  position: relative;
250
276
  // margin-bottom: 24px;
251
277
  display: flex;
@@ -402,6 +428,7 @@
402
428
  }
403
429
  }
404
430
  }
431
+
405
432
  p{
406
433
  word-break: break-all;
407
434
  white-space: break-spaces;
@@ -522,6 +549,7 @@
522
549
  border-right: 1px solid #dfe6ec;
523
550
  }
524
551
  }
552
+
525
553
  pre {
526
554
  background: @color-background-fillquaternary;
527
555
  border: 1px solid @color-border-secondary-Tr;
@@ -536,7 +564,6 @@
536
564
  border-top: 1px solid rgba(0, 0, 0, 0.06);
537
565
  border-radius: 4px;
538
566
  margin:0;
539
-
540
567
  svg{
541
568
  height: auto;
542
569
  width: 100%;
@@ -547,12 +574,11 @@
547
574
  }
548
575
  }
549
576
  }
550
- }
551
-
577
+ }
552
578
  .maskZoomBox{
553
579
  position: relative;
554
580
  display: inline-block;
555
- max-width: 100%;
581
+ max-width: 100%;
556
582
  padding: 0 !important;
557
583
  margin-top: 8px;
558
584
  margin-bottom: 8px;
@@ -594,8 +620,7 @@
594
620
  display: block;
595
621
  }
596
622
  }
597
- }
598
-
623
+ }
599
624
  // 最后一行操作按钮
600
625
  .operate_modal_bottom{
601
626
  position: relative;
@@ -2273,6 +2298,6 @@ strong {
2273
2298
  i {
2274
2299
  margin-left: 8px;
2275
2300
  display: inline-flex;
2276
- align-items: center;
2301
+ align-items: center;
2277
2302
  }
2278
2303
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bhd-components",
3
- "version": "0.11.24",
3
+ "version": "0.11.25",
4
4
  "description": "组件功能描述",
5
5
  "config": {
6
6
  "commitizen": {