askbot-dragon 1.6.22-beta → 1.6.23-beta

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.
Files changed (90) hide show
  1. package/README.md +27 -27
  2. package/babel.config.js +6 -6
  3. package/dragon.iml +7 -7
  4. package/package.json +58 -59
  5. package/public/index.html +74 -74
  6. package/src/App.vue +31 -31
  7. package/src/api/index.js +1 -1
  8. package/src/api/mock.http +2 -2
  9. package/src/api/requestUrl.js +185 -185
  10. package/src/assets/js/AliyunlssUtil.js +92 -92
  11. package/src/assets/js/Base64Util.js +22 -22
  12. package/src/assets/js/common.js +75 -11
  13. package/src/assets/js/hammer.js +100 -89
  14. package/src/assets/js/script.js +36 -36
  15. package/src/assets/less/common.css +6773 -6773
  16. package/src/assets/less/converSationContainer/common.less +199 -192
  17. package/src/assets/less/converSationContainer/converSatonContainer.less +493 -493
  18. package/src/assets/less/iconfont.css +37 -37
  19. package/src/assets/less/ticketMessage.less +294 -294
  20. package/src/components/ActionAlertIframe.vue +177 -154
  21. package/src/components/AiGuide.vue +466 -468
  22. package/src/components/AnswerDocknowledge.vue +597 -556
  23. package/src/components/AnswerVoice.vue +285 -285
  24. package/src/components/AskIFrame.vue +15 -15
  25. package/src/components/ConversationContainer.vue +4969 -4820
  26. package/src/components/FileType.vue +86 -86
  27. package/src/components/Message.vue +27 -27
  28. package/src/components/actionSatisfaction.vue +107 -107
  29. package/src/components/actionSendToBot.vue +62 -62
  30. package/src/components/answerDissatisfaction.vue +62 -62
  31. package/src/components/answerRadio.vue +132 -132
  32. package/src/components/ask-components/DissatisfactionOptions.vue +57 -57
  33. package/src/components/ask-components/Msgloading.vue +37 -37
  34. package/src/components/ask-components/SatisfactionV2.vue +15 -15
  35. package/src/components/askVideo.vue +162 -142
  36. package/src/components/assetDetails.vue +370 -370
  37. package/src/components/assetMessage.vue +228 -228
  38. package/src/components/associationIntention.vue +355 -349
  39. package/src/components/attachmentPreview.vue +90 -90
  40. package/src/components/botActionSatisfactor.vue +68 -68
  41. package/src/components/chatContent.vue +513 -513
  42. package/src/components/feedBack.vue +136 -136
  43. package/src/components/fielListView.vue +351 -351
  44. package/src/components/file/AliyunOssComponents.vue +108 -108
  45. package/src/components/formTemplate.vue +3576 -3581
  46. package/src/components/kkview.vue +1138 -1138
  47. package/src/components/loadingProcess.vue +164 -164
  48. package/src/components/message/ActionAlertIframe.vue +112 -112
  49. package/src/components/message/ShopMessage.vue +164 -164
  50. package/src/components/message/TextMessage.vue +924 -924
  51. package/src/components/message/TicketMessage.vue +201 -201
  52. package/src/components/message/swiper/index.js +4 -4
  53. package/src/components/message/swiper/ticketSwiper.vue +503 -503
  54. package/src/components/message/swiper/ticketSwiperItem.vue +61 -61
  55. package/src/components/msgLoading.vue +231 -231
  56. package/src/components/myPopup.vue +70 -70
  57. package/src/components/newPdfPosition.vue +878 -0
  58. package/src/components/pdfPosition.vue +1508 -1328
  59. package/src/components/popup.vue +227 -227
  60. package/src/components/previewDoc.vue +242 -242
  61. package/src/components/previewPdf.vue +315 -302
  62. package/src/components/receiverMessagePlatform.vue +65 -65
  63. package/src/components/recommend.vue +80 -80
  64. package/src/components/selector/hOption.vue +20 -20
  65. package/src/components/selector/hSelector.vue +199 -199
  66. package/src/components/selector/hWrapper.vue +216 -216
  67. package/src/components/senderMessagePlatform.vue +50 -50
  68. package/src/components/source/BotMessage.vue +24 -24
  69. package/src/components/source/CustomMessage.vue +24 -24
  70. package/src/components/test.vue +260 -260
  71. package/src/components/tree.vue +294 -294
  72. package/src/components/utils/AliyunIssUtil.js +81 -81
  73. package/src/components/utils/ckeditor.js +174 -177
  74. package/src/components/utils/ckeditorImageUpload/command.js +109 -111
  75. package/src/components/utils/ckeditorImageUpload/editing.js +11 -11
  76. package/src/components/utils/ckeditorImageUpload/plugin-image.js +11 -11
  77. package/src/components/utils/ckeditorImageUpload/toolbar-ui.js +40 -40
  78. package/src/components/utils/ckeditorfileUpload/common.js +181 -174
  79. package/src/components/utils/ckeditorfileUpload/editing.js +11 -11
  80. package/src/components/utils/ckeditorfileUpload/plugin_file.js +11 -11
  81. package/src/components/utils/ckeditorfileUpload/toolbar_ui.js +35 -35
  82. package/src/components/utils/format_date.js +25 -25
  83. package/src/components/utils/index.js +6 -6
  84. package/src/components/utils/math_utils.js +29 -29
  85. package/src/components/voiceComponent.vue +119 -119
  86. package/src/components/welcomeKnowledgeFile.vue +167 -0
  87. package/src/components/welcomeLlmCard.vue +139 -0
  88. package/src/main.js +60 -60
  89. package/vue.config.js +55 -55
  90. package/src/assets/js/obsBrowser.js +0 -63
@@ -1,469 +1,467 @@
1
- <template>
2
- <div
3
- id="ai-guide"
4
- class="ai-guide"
5
- :class="{
6
- phoneClass: isPhone,
7
- companyClass: isPC,
8
- }"
9
- >
10
- <div class="ig-view-cli">
11
- <!-- 描述 -->
12
- <div
13
- v-show="aiGuide.content.descriptionVisible && aiGuide.content.description !== ''"
14
- class="ig-types-des"
15
- >
16
- <span v-html="aiGuide.content.description"></span>
17
- </div>
18
- <!-- 一级分类 -->
19
- <div v-show="aiGuide.content.typesVisible" class="ig-types-f">
20
- <span
21
- v-for="(fType, fTypeIndex) in aiGuide.content.options"
22
- :key="`f_${fTypeIndex}`"
23
- @click="changeFirstType(fTypeIndex)"
24
- :class="[
25
- 'ig-types-f-cell',
26
- activeFirstTypeIndex === fTypeIndex
27
- ? 'ig-types-f-cell-active'
28
- : '',
29
- ]"
30
- >{{ fType.name }}</span
31
- >
32
- </div>
33
- <!-- 二级分类 -->
34
- <div v-show="aiGuide.content.typesVisible && aiGuide.content.options[
35
- activeFirstTypeIndex
36
- ].types.length !== 0" class="ig-types-s">
37
- <span
38
- v-for="(sType, sTypeIndex) in aiGuide.content.options[
39
- activeFirstTypeIndex
40
- ].types"
41
- :key="`s_${sTypeIndex}`"
42
- @click="changeLastType(sTypeIndex)"
43
- :class="[
44
- 'ig-types-s-cell',
45
- activeSecondTypeIndex === sTypeIndex
46
- ? 'ig-types-s-cell-active'
47
- : '',
48
- ]"
49
- >{{ sType.name }}</span
50
- >
51
- </div>
52
- <!-- 横向排版 -->
53
- <div
54
- v-show="
55
- activeOtherObj.recommendType == 0 &&
56
- aiGuide.content.typesetting === 'horizontal'
57
- "
58
- class="ig-types-tags"
59
- >
60
- <span
61
- v-for="(
62
- intentCell, intentCellIndex
63
- ) in recommendIntentPageList(activeOtherObj)"
64
- @click="
65
- sendAiGuideInfo(
66
- activeOtherObj.recommendType,
67
- intentCell
68
- )
69
- "
70
- :key="`i_${intentCellIndex}`"
71
- class="ig-types-tags-cell"
72
- >{{ intentCell.questionName }}</span
73
- >
74
- </div>
75
- <!-- 竖向排版 -->
76
- <div
77
- v-show="
78
- activeOtherObj.recommendType == 0 &&
79
- aiGuide.content.typesetting === 'vertical'
80
- "
81
- class="ig-types-list"
82
- >
83
- <span
84
- v-for="(
85
- intentCell, intentCellIndex
86
- ) in recommendIntentPageList(activeOtherObj)"
87
- @click="
88
- sendAiGuideInfo(
89
- activeOtherObj.recommendType,
90
- intentCell
91
- )
92
- "
93
- :key="`i_${intentCellIndex}`"
94
- class="ig-types-list-cell"
95
- >
96
- <span>{{ intentCell.questionName }}</span>
97
- <span><i class="el-icon-arrow-right"></i></span
98
- ></span>
99
- </div>
100
- <!-- 横向排版 -->
101
- <div
102
- v-show="
103
- activeOtherObj.recommendType == 1 &&
104
- aiGuide.content.typesetting === 'horizontal'
105
- "
106
- class="ig-types-tags"
107
- >
108
- <span
109
- v-for="(intentCell, intentCellIndex) in recommendIntentPageList(activeOtherObj)"
110
- :key="`i_${intentCellIndex}`"
111
- @click="
112
- sendAiGuideInfo(
113
- activeOtherObj.recommendType,
114
- intentCell
115
- )
116
- "
117
- class="ig-types-tags-cell"
118
- >{{ intentCell.exampleQuestion }}</span
119
- >
120
- </div>
121
- <!-- 竖向排版 -->
122
- <div
123
- v-show="
124
- activeOtherObj.recommendType == 1 &&
125
- aiGuide.content.typesetting === 'vertical'
126
- "
127
- class="ig-types-list"
128
- >
129
- <span
130
- v-for="(intentCell, intentCellIndex) in recommendIntentPageList(activeOtherObj)"
131
- :key="`i_${intentCellIndex}`"
132
- @click="
133
- sendAiGuideInfo(
134
- activeOtherObj.recommendType,
135
- intentCell
136
- )
137
- "
138
- class="ig-types-list-cell"
139
- >
140
- <span>{{ intentCell.exampleQuestion }}</span>
141
- <span><i class="el-icon-arrow-right"></i></span
142
- ></span>
143
- </div>
144
- <!-- 横向排版 -->
145
- <div
146
- v-show="
147
- activeOtherObj.recommendType == 2 &&
148
- aiGuide.content.typesetting === 'horizontal'
149
- "
150
- class="ig-types-tags"
151
- >
152
- <span
153
- v-for="(intentCell, intentCellIndex) in recommendIntentPageList(activeOtherObj)"
154
- :key="`i_${intentCellIndex}`"
155
- @click="
156
- sendAiGuideInfo(
157
- activeOtherObj.recommendType,
158
- intentCell
159
- )
160
- "
161
- class="ig-types-tags-cell"
162
- >{{ intentCell.exampleQuestion }}</span
163
- >
164
- </div>
165
- <!-- 竖向排版 -->
166
- <div
167
- v-show="
168
- activeOtherObj.recommendType == 2 &&
169
- aiGuide.content.typesetting === 'vertical'
170
- "
171
- class="ig-types-list"
172
- >
173
- <span
174
- v-for="(intentCell, intentCellIndex) in recommendIntentPageList(activeOtherObj)"
175
- :key="`i_${intentCellIndex}`"
176
- @click="
177
- sendAiGuideInfo(
178
- activeOtherObj.recommendType,
179
- intentCell
180
- )
181
- "
182
- class="ig-types-list-cell"
183
- >
184
- <span>{{ intentCell.exampleQuestion }}</span>
185
- <span><i class="el-icon-arrow-right"></i></span
186
- ></span>
187
- </div>
188
- <div
189
- v-if="aiGuide.content.groupVisible && totalPage > 1"
190
- class="ig-change-list"
191
- >
192
- <span @click="changeIntellectGuide" class="ig-change-list-btn">
193
- <i class="el-icon-refresh">换一批</i></span
194
- >
195
- </div>
196
- </div>
197
- </div>
198
- </template>
199
- <script>
200
- export default {
201
- name: "aiGuide",
202
- data() {
203
- return {
204
- isPhone: false,
205
- isPC: false,
206
-
207
- activeFirstTypeIndex: 0,
208
- activeSecondTypeIndex: 0,
209
- activeOtherObj: {
210
- name: "",
211
- recommendType: 0, // 0 关联意图 1 高频推荐意图 2 智能推荐
212
- recommendIntentList: [], // recommendType = 0
213
- highFrequency: {
214
- // recommendType = 1
215
- rang: [], // 推荐范围
216
- number: 20, // 最多推荐问题数
217
- question: [],
218
- },
219
- intelligenceRecommend: {
220
- // recommendType = 2
221
- recommendStrategy: [0, 1], // 0 根据与当前用户咨询过相同意图的用户所问的意图进行推荐 1 根据当前用户部门的其他用户咨询过的意图进行推荐
222
- rang: [], // 推荐范围
223
- number: 20, // 最多推荐问题数
224
- question: [],
225
- },
226
- },
227
- activePage: 1,
228
- totalPage: 1,
229
- };
230
- },
231
- props: {
232
- aiGuide: Object,
233
- },
234
- beforeMount() {},
235
- mounted() {
236
- this.isMobile();
237
- if (this.aiGuide.content.options[0].types.length === 0) {
238
- this.activeOtherObj = this.aiGuide.content.options[0];
239
- } else {
240
- this.activeSecondTypeIndex = 0;
241
- this.activeOtherObj = this.aiGuide.content.options[0].types[0];
242
- }
243
- },
244
- methods: {
245
- isMobile() {
246
- let flag = navigator.userAgent.match(
247
- /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
248
- );
249
- if (flag) {
250
- this.isPhone = true;
251
- } else {
252
- this.isPC = true;
253
- }
254
- },
255
- changeIntellectGuide() {
256
- if (this.activePage === this.totalPage) {
257
- this.activePage = 1;
258
- } else {
259
- this.activePage++;
260
- }
261
- },
262
- changeFirstType(fTypeIndex) {
263
- this.activeFirstTypeIndex = fTypeIndex;
264
- if (this.aiGuide.content.options[fTypeIndex].types.length === 0) {
265
- this.activeOtherObj = this.aiGuide.content.options[fTypeIndex];
266
- } else {
267
- this.activeSecondTypeIndex = 0;
268
- this.activeOtherObj =
269
- this.aiGuide.content.options[fTypeIndex].types[0];
270
- }
271
- this.activePage = 1;
272
- },
273
- changeLastType(sTypeIndex) {
274
- this.activeSecondTypeIndex = sTypeIndex;
275
- this.activeOtherObj =
276
- this.aiGuide.content.options[this.activeFirstTypeIndex].types[
277
- sTypeIndex
278
- ];
279
- this.activePage = 1;
280
- },
281
- // 根据当前分组数页数返回展示列表
282
- recommendIntentPageList(obj) {
283
- let list = [];
284
- if (obj.recommendType === 0) {
285
- list = obj.recommendIntentList;
286
- }
287
- if (obj.recommendType === 1) {
288
- list = obj.highFrequency.question;
289
- }
290
- if (obj.recommendType === 2) {
291
- list = obj.intelligenceRecommend.question;
292
- }
293
- let arr = [];
294
- let len = 0;
295
- if (list) {
296
- len = list.length;
297
-
298
- // 每组展示数
299
- let groupNumber = this.aiGuide.content.groupNumber;
300
-
301
- this.totalPage = Math.ceil(len / groupNumber);
302
- if (this.aiGuide.content.groupVisible) {
303
- arr = list.slice(
304
- (this.activePage - 1) * groupNumber,
305
- this.activePage * groupNumber
306
- );
307
- } else {
308
- arr = list;
309
- }
310
- }
311
- return arr;
312
- },
313
- sendAiGuideInfo(recommendType, cell) {
314
- console.log("组件-312-3", recommendType, cell);
315
- this.$emit('sendAiGuide', recommendType, cell);
316
- },
317
- },
318
- };
319
- </script>
320
-
321
- <style scoped lang="less">
322
- .ig-view-cli {
323
- // background: #fbfcfd;
324
- font-size: 0.9em;
325
- border-radius: 5px;
326
- position: relative;
327
- .ig-view-example {
328
- position: absolute;
329
- right: -10px;
330
- top: -10px;
331
- opacity: 0.5;
332
- img {
333
- height: 50px;
334
- }
335
- }
336
- .ig-types-des {
337
- padding: 12px 16px 0px;
338
- text-align: left;
339
- }
340
- .ig-types-f {
341
- display: flex;
342
- justify-content: flex-start;
343
- flex-wrap: wrap;
344
- padding: 4px 8px;
345
- .ig-types-f-cell {
346
- height: 1.8em;
347
- line-height: 1.8em;
348
- padding: 0 12px;
349
- margin-left: 5px;
350
- margin-right: 5px;
351
- margin-top: 4px;
352
- background: #ffffff;
353
- border: 1px solid #e0e6f7;
354
- border-radius: 1em;
355
- color: #a3adc6;
356
- cursor: pointer;
357
- overflow: hidden;
358
- text-overflow: ellipsis;
359
- white-space: nowrap;
360
- &:hover {
361
- border: 1px solid #366aff;
362
- color: #366aff;
363
- }
364
- &-active {
365
- background-color: #366aff;
366
- border: 1px solid #366aff;
367
- color: white;
368
- }
369
- }
370
- .ig-types-f-cell-active {
371
- &:hover {
372
- color: white;
373
- }
374
- }
375
- }
376
- .ig-types-s {
377
- display: flex;
378
- justify-content: flex-start;
379
- flex-wrap: wrap;
380
- margin: 0px 16px 4px;
381
- border-bottom: solid 1px #e0e6f7;
382
- .ig-types-s-cell {
383
- height: 2.2em;
384
- line-height: 2.2em;
385
- margin-right: 18px;
386
- color: #b2c2d8;
387
- cursor: pointer;
388
- margin-bottom: -1px;
389
- overflow: hidden;
390
- text-overflow: ellipsis;
391
- white-space: nowrap;
392
- &:hover {
393
- color: #366aff;
394
- }
395
- &-active {
396
- border-bottom: 2px solid #366aff;
397
- color: #366aff;
398
- }
399
- }
400
- }
401
- .ig-types-tags {
402
- margin: 0 16px;
403
- padding: 0 0 12px;
404
- display: flex;
405
- justify-content: flex-start;
406
- flex-wrap: wrap;
407
- .ig-types-tags-cell {
408
- line-height: 1.4em;
409
- padding: 2px 8px;
410
- margin-right: 6px;
411
- margin-top: 4px;
412
- color: #366aff;
413
- background: #ffffff;
414
- border: 1px solid #a1b9ff;
415
- border-radius: 5px;
416
- cursor: pointer;
417
- }
418
- }
419
- .ig-high-frequency-empty {
420
- margin: 6px 15px;
421
- height: 40px;
422
- line-height: 40px;
423
- background: #fff8f4;
424
- border-radius: 5px;
425
- color: #ff9555;
426
- padding: 0 12px;
427
- text-align: left;
428
- }
429
- .ig-types-list {
430
- margin: 0 16px;
431
- padding: 0 0 8px 0;
432
- display: flex;
433
- flex-direction: column;
434
- justify-content: flex-start;
435
- .ig-types-list-cell {
436
- line-height: 1.1em;
437
- padding: 8px 0;
438
- overflow: hidden;
439
- display: flex;
440
- justify-content: space-between;
441
- color: #366aff;
442
- cursor: pointer;
443
- align-items: center;
444
- text-align: left;
445
- span {
446
- display: flex;
447
- align-items: center;
448
- flex-direction: column;
449
- i {
450
- // margin-top: 12px;
451
- }
452
- }
453
- }
454
- }
455
- .ig-change-list {
456
- padding: 8px 0;
457
- margin-top: 4px;
458
- display: flex;
459
- flex-direction: column;
460
- align-items: center;
461
- border-top: 1px solid #eeeeee;
462
- .ig-change-list-btn {
463
- font-weight: 600;
464
- color: #366aff;
465
- cursor: pointer;
466
- }
467
- }
468
- }
1
+ <template>
2
+ <div
3
+ id="ai-guide"
4
+ class="ai-guide"
5
+ :class="{
6
+ phoneClass: isPhone,
7
+ companyClass: isPC,
8
+ }"
9
+ >
10
+ <div class="ig-view-cli">
11
+ <!-- 描述 -->
12
+ <div
13
+ v-show="aiGuide.content.descriptionVisible && aiGuide.content.description !== ''"
14
+ class="ig-types-des"
15
+ >
16
+ <span v-html="aiGuide.content.description"></span>
17
+ </div>
18
+ <!-- 一级分类 -->
19
+ <div v-show="aiGuide.content.typesVisible && aiGuide.content.options && aiGuide.content.options.length > 0" class="ig-types-f">
20
+ <span
21
+ v-for="(fType, fTypeIndex) in aiGuide.content.options"
22
+ :key="`f_${fTypeIndex}`"
23
+ @click="changeFirstType(fTypeIndex)"
24
+ :class="[
25
+ 'ig-types-f-cell',
26
+ activeFirstTypeIndex === fTypeIndex
27
+ ? 'ig-types-f-cell-active'
28
+ : '',
29
+ ]"
30
+ >{{ fType.name }}</span
31
+ >
32
+ </div>
33
+ <!-- 二级分类 -->
34
+ <div v-if="aiGuide.content.typesVisible && aiGuide.content.options[activeFirstTypeIndex] && aiGuide.content.options[activeFirstTypeIndex].types && aiGuide.content.options[activeFirstTypeIndex].types.length !== 0" class="ig-types-s">
35
+ <span
36
+ v-for="(sType, sTypeIndex) in aiGuide.content.options[
37
+ activeFirstTypeIndex
38
+ ].types"
39
+ :key="`s_${sTypeIndex}`"
40
+ @click="changeLastType(sTypeIndex)"
41
+ :class="[
42
+ 'ig-types-s-cell',
43
+ activeSecondTypeIndex === sTypeIndex
44
+ ? 'ig-types-s-cell-active'
45
+ : '',
46
+ ]"
47
+ >{{ sType.name }}</span
48
+ >
49
+ </div>
50
+ <!-- 横向排版 -->
51
+ <div
52
+ v-show="
53
+ activeOtherObj.recommendType == 0 &&
54
+ aiGuide.content.typesetting === 'horizontal'
55
+ "
56
+ class="ig-types-tags"
57
+ >
58
+ <span
59
+ v-for="(
60
+ intentCell, intentCellIndex
61
+ ) in recommendIntentPageList(activeOtherObj)"
62
+ @click="
63
+ sendAiGuideInfo(
64
+ activeOtherObj.recommendType,
65
+ intentCell
66
+ )
67
+ "
68
+ :key="`i_${intentCellIndex}`"
69
+ class="ig-types-tags-cell"
70
+ >{{ intentCell.questionName }}</span
71
+ >
72
+ </div>
73
+ <!-- 竖向排版 -->
74
+ <div
75
+ v-show="
76
+ activeOtherObj.recommendType == 0 &&
77
+ aiGuide.content.typesetting === 'vertical'
78
+ "
79
+ class="ig-types-list"
80
+ >
81
+ <span
82
+ v-for="(
83
+ intentCell, intentCellIndex
84
+ ) in recommendIntentPageList(activeOtherObj)"
85
+ @click="
86
+ sendAiGuideInfo(
87
+ activeOtherObj.recommendType,
88
+ intentCell
89
+ )
90
+ "
91
+ :key="`i_${intentCellIndex}`"
92
+ class="ig-types-list-cell"
93
+ >
94
+ <span>{{ intentCell.questionName }}</span>
95
+ <span><i class="el-icon-arrow-right"></i></span
96
+ ></span>
97
+ </div>
98
+ <!-- 横向排版 -->
99
+ <div
100
+ v-show="
101
+ activeOtherObj.recommendType == 1 &&
102
+ aiGuide.content.typesetting === 'horizontal'
103
+ "
104
+ class="ig-types-tags"
105
+ >
106
+ <span
107
+ v-for="(intentCell, intentCellIndex) in recommendIntentPageList(activeOtherObj)"
108
+ :key="`i_${intentCellIndex}`"
109
+ @click="
110
+ sendAiGuideInfo(
111
+ activeOtherObj.recommendType,
112
+ intentCell
113
+ )
114
+ "
115
+ class="ig-types-tags-cell"
116
+ >{{ intentCell.exampleQuestion }}</span
117
+ >
118
+ </div>
119
+ <!-- 竖向排版 -->
120
+ <div
121
+ v-show="
122
+ activeOtherObj.recommendType == 1 &&
123
+ aiGuide.content.typesetting === 'vertical'
124
+ "
125
+ class="ig-types-list"
126
+ >
127
+ <span
128
+ v-for="(intentCell, intentCellIndex) in recommendIntentPageList(activeOtherObj)"
129
+ :key="`i_${intentCellIndex}`"
130
+ @click="
131
+ sendAiGuideInfo(
132
+ activeOtherObj.recommendType,
133
+ intentCell
134
+ )
135
+ "
136
+ class="ig-types-list-cell"
137
+ >
138
+ <span>{{ intentCell.exampleQuestion }}</span>
139
+ <span><i class="el-icon-arrow-right"></i></span
140
+ ></span>
141
+ </div>
142
+ <!-- 横向排版 -->
143
+ <div
144
+ v-show="
145
+ activeOtherObj.recommendType == 2 &&
146
+ aiGuide.content.typesetting === 'horizontal'
147
+ "
148
+ class="ig-types-tags"
149
+ >
150
+ <span
151
+ v-for="(intentCell, intentCellIndex) in recommendIntentPageList(activeOtherObj)"
152
+ :key="`i_${intentCellIndex}`"
153
+ @click="
154
+ sendAiGuideInfo(
155
+ activeOtherObj.recommendType,
156
+ intentCell
157
+ )
158
+ "
159
+ class="ig-types-tags-cell"
160
+ >{{ intentCell.exampleQuestion }}</span
161
+ >
162
+ </div>
163
+ <!-- 竖向排版 -->
164
+ <div
165
+ v-show="
166
+ activeOtherObj.recommendType == 2 &&
167
+ aiGuide.content.typesetting === 'vertical'
168
+ "
169
+ class="ig-types-list"
170
+ >
171
+ <span
172
+ v-for="(intentCell, intentCellIndex) in recommendIntentPageList(activeOtherObj)"
173
+ :key="`i_${intentCellIndex}`"
174
+ @click="
175
+ sendAiGuideInfo(
176
+ activeOtherObj.recommendType,
177
+ intentCell
178
+ )
179
+ "
180
+ class="ig-types-list-cell"
181
+ >
182
+ <span>{{ intentCell.exampleQuestion }}</span>
183
+ <span><i class="el-icon-arrow-right"></i></span
184
+ ></span>
185
+ </div>
186
+ <div
187
+ v-if="aiGuide.content.groupVisible && totalPage > 1"
188
+ class="ig-change-list"
189
+ >
190
+ <span @click="changeIntellectGuide" class="ig-change-list-btn">
191
+ <i class="el-icon-refresh">换一批</i></span
192
+ >
193
+ </div>
194
+ </div>
195
+ </div>
196
+ </template>
197
+ <script>
198
+ export default {
199
+ name: "aiGuide",
200
+ data() {
201
+ return {
202
+ isPhone: false,
203
+ isPC: false,
204
+
205
+ activeFirstTypeIndex: 0,
206
+ activeSecondTypeIndex: 0,
207
+ activeOtherObj: {
208
+ name: "",
209
+ recommendType: 0, // 0 关联意图 1 高频推荐意图 2 智能推荐
210
+ recommendIntentList: [], // recommendType = 0
211
+ highFrequency: {
212
+ // recommendType = 1
213
+ rang: [], // 推荐范围
214
+ number: 20, // 最多推荐问题数
215
+ question: [],
216
+ },
217
+ intelligenceRecommend: {
218
+ // recommendType = 2
219
+ recommendStrategy: [0, 1], // 0 根据与当前用户咨询过相同意图的用户所问的意图进行推荐 1 根据当前用户部门的其他用户咨询过的意图进行推荐
220
+ rang: [], // 推荐范围
221
+ number: 20, // 最多推荐问题数
222
+ question: [],
223
+ },
224
+ },
225
+ activePage: 1,
226
+ totalPage: 1,
227
+ };
228
+ },
229
+ props: {
230
+ aiGuide: Object,
231
+ },
232
+ beforeMount() {},
233
+ mounted() {
234
+ this.isMobile();
235
+ if (this.aiGuide.content.options[0] && this.aiGuide.content.options[0] && this.aiGuide.content.options[0].types && this.aiGuide.content.options[0].types.length === 0) {
236
+ this.activeOtherObj = this.aiGuide.content.options[0];
237
+ } else {
238
+ this.activeSecondTypeIndex = 0;
239
+ this.activeOtherObj = this.aiGuide.content.options[0] && this.aiGuide.content.options[0].types && this.aiGuide.content.options[0].types[0] ? this.aiGuide.content.options[0].types[0] : [];
240
+ }
241
+ },
242
+ methods: {
243
+ isMobile() {
244
+ let flag = navigator.userAgent.match(
245
+ /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
246
+ );
247
+ if (flag) {
248
+ this.isPhone = true;
249
+ } else {
250
+ this.isPC = true;
251
+ }
252
+ },
253
+ changeIntellectGuide() {
254
+ if (this.activePage === this.totalPage) {
255
+ this.activePage = 1;
256
+ } else {
257
+ this.activePage++;
258
+ }
259
+ },
260
+ changeFirstType(fTypeIndex) {
261
+ this.activeFirstTypeIndex = fTypeIndex;
262
+ if (this.aiGuide.content.options[fTypeIndex].types.length === 0) {
263
+ this.activeOtherObj = this.aiGuide.content.options[fTypeIndex];
264
+ } else {
265
+ this.activeSecondTypeIndex = 0;
266
+ this.activeOtherObj =
267
+ this.aiGuide.content.options[fTypeIndex].types[0];
268
+ }
269
+ this.activePage = 1;
270
+ },
271
+ changeLastType(sTypeIndex) {
272
+ this.activeSecondTypeIndex = sTypeIndex;
273
+ this.activeOtherObj =
274
+ this.aiGuide.content.options[this.activeFirstTypeIndex].types[
275
+ sTypeIndex
276
+ ];
277
+ this.activePage = 1;
278
+ },
279
+ // 根据当前分组数页数返回展示列表
280
+ recommendIntentPageList(obj) {
281
+ let list = [];
282
+ if (obj.recommendType === 0) {
283
+ list = obj.recommendIntentList;
284
+ }
285
+ if (obj.recommendType === 1) {
286
+ list = obj.highFrequency.question;
287
+ }
288
+ if (obj.recommendType === 2) {
289
+ list = obj.intelligenceRecommend.question;
290
+ }
291
+ let arr = [];
292
+ let len = 0;
293
+ if (list) {
294
+ len = list.length;
295
+
296
+ // 每组展示数
297
+ let groupNumber = this.aiGuide.content.groupNumber;
298
+
299
+ this.totalPage = Math.ceil(len / groupNumber);
300
+ if (this.aiGuide.content.groupVisible) {
301
+ arr = list.slice(
302
+ (this.activePage - 1) * groupNumber,
303
+ this.activePage * groupNumber
304
+ );
305
+ } else {
306
+ arr = list;
307
+ }
308
+ }
309
+ return arr;
310
+ },
311
+ sendAiGuideInfo(recommendType, cell) {
312
+ console.log("组件-312-3", recommendType, cell);
313
+ this.$emit('sendAiGuide', recommendType, cell);
314
+ },
315
+ },
316
+ };
317
+ </script>
318
+
319
+ <style scoped lang="less">
320
+ .ig-view-cli {
321
+ // background: #fbfcfd;
322
+ font-size: 0.9em;
323
+ border-radius: 5px;
324
+ position: relative;
325
+ .ig-view-example {
326
+ position: absolute;
327
+ right: -10px;
328
+ top: -10px;
329
+ opacity: 0.5;
330
+ img {
331
+ height: 50px;
332
+ }
333
+ }
334
+ .ig-types-des {
335
+ padding: 12px 16px 0px;
336
+ text-align: left;
337
+ }
338
+ .ig-types-f {
339
+ display: flex;
340
+ justify-content: flex-start;
341
+ flex-wrap: wrap;
342
+ padding: 4px 8px;
343
+ .ig-types-f-cell {
344
+ height: 1.8em;
345
+ line-height: 1.8em;
346
+ padding: 0 12px;
347
+ margin-left: 5px;
348
+ margin-right: 5px;
349
+ margin-top: 4px;
350
+ background: #ffffff;
351
+ border: 1px solid #e0e6f7;
352
+ border-radius: 1em;
353
+ color: #a3adc6;
354
+ cursor: pointer;
355
+ overflow: hidden;
356
+ text-overflow: ellipsis;
357
+ white-space: nowrap;
358
+ &:hover {
359
+ border: 1px solid #366aff;
360
+ color: #366aff;
361
+ }
362
+ &-active {
363
+ background-color: #366aff;
364
+ border: 1px solid #366aff;
365
+ color: white;
366
+ }
367
+ }
368
+ .ig-types-f-cell-active {
369
+ &:hover {
370
+ color: white;
371
+ }
372
+ }
373
+ }
374
+ .ig-types-s {
375
+ display: flex;
376
+ justify-content: flex-start;
377
+ flex-wrap: wrap;
378
+ margin: 0px 16px 4px;
379
+ border-bottom: solid 1px #e0e6f7;
380
+ .ig-types-s-cell {
381
+ height: 2.2em;
382
+ line-height: 2.2em;
383
+ margin-right: 18px;
384
+ color: #b2c2d8;
385
+ cursor: pointer;
386
+ margin-bottom: -1px;
387
+ overflow: hidden;
388
+ text-overflow: ellipsis;
389
+ white-space: nowrap;
390
+ &:hover {
391
+ color: #366aff;
392
+ }
393
+ &-active {
394
+ border-bottom: 2px solid #366aff;
395
+ color: #366aff;
396
+ }
397
+ }
398
+ }
399
+ .ig-types-tags {
400
+ margin: 0 16px;
401
+ padding: 0 0 12px;
402
+ display: flex;
403
+ justify-content: flex-start;
404
+ flex-wrap: wrap;
405
+ .ig-types-tags-cell {
406
+ line-height: 1.4em;
407
+ padding: 2px 8px;
408
+ margin-right: 6px;
409
+ margin-top: 4px;
410
+ color: #366aff;
411
+ background: #ffffff;
412
+ border: 1px solid #a1b9ff;
413
+ border-radius: 5px;
414
+ cursor: pointer;
415
+ }
416
+ }
417
+ .ig-high-frequency-empty {
418
+ margin: 6px 15px;
419
+ height: 40px;
420
+ line-height: 40px;
421
+ background: #fff8f4;
422
+ border-radius: 5px;
423
+ color: #ff9555;
424
+ padding: 0 12px;
425
+ text-align: left;
426
+ }
427
+ .ig-types-list {
428
+ margin: 0 16px;
429
+ padding: 0 0 8px 0;
430
+ display: flex;
431
+ flex-direction: column;
432
+ justify-content: flex-start;
433
+ .ig-types-list-cell {
434
+ line-height: 1.1em;
435
+ padding: 8px 0;
436
+ overflow: hidden;
437
+ display: flex;
438
+ justify-content: space-between;
439
+ color: #366aff;
440
+ cursor: pointer;
441
+ align-items: center;
442
+ text-align: left;
443
+ span {
444
+ display: flex;
445
+ align-items: center;
446
+ flex-direction: column;
447
+ i {
448
+ // margin-top: 12px;
449
+ }
450
+ }
451
+ }
452
+ }
453
+ .ig-change-list {
454
+ padding: 8px 0;
455
+ margin-top: 4px;
456
+ display: flex;
457
+ flex-direction: column;
458
+ align-items: center;
459
+ border-top: 1px solid #eeeeee;
460
+ .ig-change-list-btn {
461
+ font-weight: 600;
462
+ color: #366aff;
463
+ cursor: pointer;
464
+ }
465
+ }
466
+ }
469
467
  </style>