askbot-dragon 1.6.76-beta → 1.6.78-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 (84) 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 +55 -55
  5. package/public/index.html +72 -72
  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 +252 -252
  13. package/src/assets/js/hammer.js +100 -100
  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 -199
  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 -177
  21. package/src/components/AiGuide.vue +466 -466
  22. package/src/components/AnswerDocknowledge.vue +1059 -1059
  23. package/src/components/AnswerVoice.vue +285 -285
  24. package/src/components/AskIFrame.vue +15 -15
  25. package/src/components/ConversationContainer.vue +4934 -4934
  26. package/src/components/FileType.vue +86 -86
  27. package/src/components/Message.vue +27 -27
  28. package/src/components/MyEditor.vue +351 -351
  29. package/src/components/actionSatisfaction.vue +107 -107
  30. package/src/components/actionSendToBot.vue +62 -62
  31. package/src/components/answerDissatisfaction.vue +62 -62
  32. package/src/components/answerRadio.vue +186 -186
  33. package/src/components/ask-components/DissatisfactionOptions.vue +57 -57
  34. package/src/components/ask-components/Msgloading.vue +37 -37
  35. package/src/components/ask-components/SatisfactionV2.vue +15 -15
  36. package/src/components/askVideo.vue +162 -162
  37. package/src/components/assetDetails.vue +378 -378
  38. package/src/components/assetMessage.vue +228 -228
  39. package/src/components/associationIntention.vue +355 -355
  40. package/src/components/attachmentPreview.vue +90 -90
  41. package/src/components/botActionSatisfactor.vue +68 -68
  42. package/src/components/chatContent.vue +513 -513
  43. package/src/components/feedBack.vue +136 -136
  44. package/src/components/fielListView.vue +351 -351
  45. package/src/components/file/AliyunOssComponents.vue +108 -108
  46. package/src/components/formTemplate.vue +3572 -3572
  47. package/src/components/intelligentSummary.vue +227 -227
  48. package/src/components/kkview.vue +1138 -1138
  49. package/src/components/loadingProcess.vue +164 -164
  50. package/src/components/message/ActionAlertIframe.vue +112 -112
  51. package/src/components/message/ShopMessage.vue +164 -164
  52. package/src/components/message/TextMessage.vue +924 -924
  53. package/src/components/message/TicketMessage.vue +201 -201
  54. package/src/components/message/swiper/index.js +4 -4
  55. package/src/components/message/swiper/ticketSwiper.vue +503 -503
  56. package/src/components/message/swiper/ticketSwiperItem.vue +61 -61
  57. package/src/components/msgLoading.vue +231 -231
  58. package/src/components/myPopup.vue +70 -70
  59. package/src/components/newPdfPosition.vue +877 -877
  60. package/src/components/pdfPosition.vue +1508 -1506
  61. package/src/components/popup.vue +227 -227
  62. package/src/components/previewDoc.vue +247 -247
  63. package/src/components/previewPdf.vue +791 -757
  64. package/src/components/receiverMessagePlatform.vue +65 -65
  65. package/src/components/recommend.vue +80 -80
  66. package/src/components/selector/hOption.vue +20 -20
  67. package/src/components/selector/hSelector.vue +199 -199
  68. package/src/components/selector/hWrapper.vue +216 -216
  69. package/src/components/senderMessagePlatform.vue +50 -50
  70. package/src/components/source/BotMessage.vue +24 -24
  71. package/src/components/source/CustomMessage.vue +24 -24
  72. package/src/components/test.vue +260 -260
  73. package/src/components/tree.vue +294 -294
  74. package/src/components/utils/AliyunIssUtil.js +81 -81
  75. package/src/components/utils/ckeditor.js +174 -174
  76. package/src/components/utils/format_date.js +25 -25
  77. package/src/components/utils/index.js +6 -6
  78. package/src/components/utils/math_utils.js +29 -29
  79. package/src/components/voiceComponent.vue +119 -119
  80. package/src/components/welcomeKnowledgeFile.vue +340 -340
  81. package/src/components/welcomeLlmCard.vue +140 -140
  82. package/src/components/welcomeSuggest.vue +97 -97
  83. package/src/main.js +57 -57
  84. package/vue.config.js +54 -54
@@ -1,467 +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 && 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
- }
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
+ }
467
467
  </style>