askbot-dragon 1.7.0-beta → 1.7.11-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 (87) 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 +56 -56
  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 +471 -471
  22. package/src/components/AnswerDocknowledge.vue +1071 -1071
  23. package/src/components/AnswerVoice.vue +285 -285
  24. package/src/components/AskIFrame.vue +15 -15
  25. package/src/components/ConversationContainer.vue +4948 -4948
  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 +110 -110
  30. package/src/components/actionSendToBot.vue +62 -62
  31. package/src/components/answerDissatisfaction.vue +62 -62
  32. package/src/components/answerRadio.vue +204 -204
  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 +381 -381
  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 +3577 -3577
  47. package/src/components/intelligentSummary.vue +231 -231
  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 +929 -929
  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 -1508
  61. package/src/components/popup.vue +227 -227
  62. package/src/components/previewDoc.vue +252 -252
  63. package/src/components/previewPdf.vue +804 -804
  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 +53 -53
  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 +347 -347
  81. package/src/components/welcomeLlmCard.vue +140 -140
  82. package/src/components/welcomeSuggest.vue +97 -97
  83. package/src/locales/cn.json +71 -71
  84. package/src/locales/en.json +72 -72
  85. package/src/locales/jp.json +72 -72
  86. package/src/main.js +74 -74
  87. package/vue.config.js +54 -54
@@ -1,472 +1,472 @@
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">{{$t('common.changeBatch')}}</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
- language:{
232
- type:String,
233
- default:"cn"
234
- }
235
- },
236
- beforeMount() {},
237
- mounted() {
238
- this.isMobile();
239
- 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) {
240
- this.activeOtherObj = this.aiGuide.content.options[0];
241
- } else {
242
- this.activeSecondTypeIndex = 0;
243
- 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] : [];
244
- }
245
- this.$i18n.locale = this.language;
246
- },
247
- methods: {
248
- isMobile() {
249
- let flag = navigator.userAgent.match(
250
- /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
251
- );
252
- if (flag) {
253
- this.isPhone = true;
254
- } else {
255
- this.isPC = true;
256
- }
257
- },
258
- changeIntellectGuide() {
259
- if (this.activePage === this.totalPage) {
260
- this.activePage = 1;
261
- } else {
262
- this.activePage++;
263
- }
264
- },
265
- changeFirstType(fTypeIndex) {
266
- this.activeFirstTypeIndex = fTypeIndex;
267
- if (this.aiGuide.content.options[fTypeIndex].types.length === 0) {
268
- this.activeOtherObj = this.aiGuide.content.options[fTypeIndex];
269
- } else {
270
- this.activeSecondTypeIndex = 0;
271
- this.activeOtherObj =
272
- this.aiGuide.content.options[fTypeIndex].types[0];
273
- }
274
- this.activePage = 1;
275
- },
276
- changeLastType(sTypeIndex) {
277
- this.activeSecondTypeIndex = sTypeIndex;
278
- this.activeOtherObj =
279
- this.aiGuide.content.options[this.activeFirstTypeIndex].types[
280
- sTypeIndex
281
- ];
282
- this.activePage = 1;
283
- },
284
- // 根据当前分组数页数返回展示列表
285
- recommendIntentPageList(obj) {
286
- let list = [];
287
- if (obj.recommendType === 0) {
288
- list = obj.recommendIntentList;
289
- }
290
- if (obj.recommendType === 1) {
291
- list = obj.highFrequency.question;
292
- }
293
- if (obj.recommendType === 2) {
294
- list = obj.intelligenceRecommend.question;
295
- }
296
- let arr = [];
297
- let len = 0;
298
- if (list) {
299
- len = list.length;
300
-
301
- // 每组展示数
302
- let groupNumber = this.aiGuide.content.groupNumber;
303
-
304
- this.totalPage = Math.ceil(len / groupNumber);
305
- if (this.aiGuide.content.groupVisible) {
306
- arr = list.slice(
307
- (this.activePage - 1) * groupNumber,
308
- this.activePage * groupNumber
309
- );
310
- } else {
311
- arr = list;
312
- }
313
- }
314
- return arr;
315
- },
316
- sendAiGuideInfo(recommendType, cell) {
317
- console.log("组件-312-3", recommendType, cell);
318
- this.$emit('sendAiGuide', recommendType, cell);
319
- },
320
- },
321
- };
322
- </script>
323
-
324
- <style scoped lang="less">
325
- .ig-view-cli {
326
- // background: #fbfcfd;
327
- font-size: 0.9em;
328
- border-radius: 5px;
329
- position: relative;
330
- .ig-view-example {
331
- position: absolute;
332
- right: -10px;
333
- top: -10px;
334
- opacity: 0.5;
335
- img {
336
- height: 50px;
337
- }
338
- }
339
- .ig-types-des {
340
- padding: 12px 16px 0px;
341
- text-align: left;
342
- }
343
- .ig-types-f {
344
- display: flex;
345
- justify-content: flex-start;
346
- flex-wrap: wrap;
347
- padding: 4px 8px;
348
- .ig-types-f-cell {
349
- height: 1.8em;
350
- line-height: 1.8em;
351
- padding: 0 12px;
352
- margin-left: 5px;
353
- margin-right: 5px;
354
- margin-top: 4px;
355
- background: #ffffff;
356
- border: 1px solid #e0e6f7;
357
- border-radius: 1em;
358
- color: #a3adc6;
359
- cursor: pointer;
360
- overflow: hidden;
361
- text-overflow: ellipsis;
362
- white-space: nowrap;
363
- &:hover {
364
- border: 1px solid #366aff;
365
- color: #366aff;
366
- }
367
- &-active {
368
- background-color: #366aff;
369
- border: 1px solid #366aff;
370
- color: white;
371
- }
372
- }
373
- .ig-types-f-cell-active {
374
- &:hover {
375
- color: white;
376
- }
377
- }
378
- }
379
- .ig-types-s {
380
- display: flex;
381
- justify-content: flex-start;
382
- flex-wrap: wrap;
383
- margin: 0px 16px 4px;
384
- border-bottom: solid 1px #e0e6f7;
385
- .ig-types-s-cell {
386
- height: 2.2em;
387
- line-height: 2.2em;
388
- margin-right: 18px;
389
- color: #b2c2d8;
390
- cursor: pointer;
391
- margin-bottom: -1px;
392
- overflow: hidden;
393
- text-overflow: ellipsis;
394
- white-space: nowrap;
395
- &:hover {
396
- color: #366aff;
397
- }
398
- &-active {
399
- border-bottom: 2px solid #366aff;
400
- color: #366aff;
401
- }
402
- }
403
- }
404
- .ig-types-tags {
405
- margin: 0 16px;
406
- padding: 0 0 12px;
407
- display: flex;
408
- justify-content: flex-start;
409
- flex-wrap: wrap;
410
- .ig-types-tags-cell {
411
- line-height: 1.4em;
412
- padding: 2px 8px;
413
- margin-right: 6px;
414
- margin-top: 4px;
415
- color: #366aff;
416
- background: #ffffff;
417
- border: 1px solid #a1b9ff;
418
- border-radius: 5px;
419
- cursor: pointer;
420
- }
421
- }
422
- .ig-high-frequency-empty {
423
- margin: 6px 15px;
424
- height: 40px;
425
- line-height: 40px;
426
- background: #fff8f4;
427
- border-radius: 5px;
428
- color: #ff9555;
429
- padding: 0 12px;
430
- text-align: left;
431
- }
432
- .ig-types-list {
433
- margin: 0 16px;
434
- padding: 0 0 8px 0;
435
- display: flex;
436
- flex-direction: column;
437
- justify-content: flex-start;
438
- .ig-types-list-cell {
439
- line-height: 1.1em;
440
- padding: 8px 0;
441
- overflow: hidden;
442
- display: flex;
443
- justify-content: space-between;
444
- color: #366aff;
445
- cursor: pointer;
446
- align-items: center;
447
- text-align: left;
448
- span {
449
- display: flex;
450
- align-items: center;
451
- flex-direction: column;
452
- i {
453
- // margin-top: 12px;
454
- }
455
- }
456
- }
457
- }
458
- .ig-change-list {
459
- padding: 8px 0;
460
- margin-top: 4px;
461
- display: flex;
462
- flex-direction: column;
463
- align-items: center;
464
- border-top: 1px solid #eeeeee;
465
- .ig-change-list-btn {
466
- font-weight: 600;
467
- color: #366aff;
468
- cursor: pointer;
469
- }
470
- }
471
- }
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">{{$t('common.changeBatch')}}</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
+ language:{
232
+ type:String,
233
+ default:"cn"
234
+ }
235
+ },
236
+ beforeMount() {},
237
+ mounted() {
238
+ this.isMobile();
239
+ 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) {
240
+ this.activeOtherObj = this.aiGuide.content.options[0];
241
+ } else {
242
+ this.activeSecondTypeIndex = 0;
243
+ 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] : [];
244
+ }
245
+ this.$i18n.locale = this.language;
246
+ },
247
+ methods: {
248
+ isMobile() {
249
+ let flag = navigator.userAgent.match(
250
+ /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
251
+ );
252
+ if (flag) {
253
+ this.isPhone = true;
254
+ } else {
255
+ this.isPC = true;
256
+ }
257
+ },
258
+ changeIntellectGuide() {
259
+ if (this.activePage === this.totalPage) {
260
+ this.activePage = 1;
261
+ } else {
262
+ this.activePage++;
263
+ }
264
+ },
265
+ changeFirstType(fTypeIndex) {
266
+ this.activeFirstTypeIndex = fTypeIndex;
267
+ if (this.aiGuide.content.options[fTypeIndex].types.length === 0) {
268
+ this.activeOtherObj = this.aiGuide.content.options[fTypeIndex];
269
+ } else {
270
+ this.activeSecondTypeIndex = 0;
271
+ this.activeOtherObj =
272
+ this.aiGuide.content.options[fTypeIndex].types[0];
273
+ }
274
+ this.activePage = 1;
275
+ },
276
+ changeLastType(sTypeIndex) {
277
+ this.activeSecondTypeIndex = sTypeIndex;
278
+ this.activeOtherObj =
279
+ this.aiGuide.content.options[this.activeFirstTypeIndex].types[
280
+ sTypeIndex
281
+ ];
282
+ this.activePage = 1;
283
+ },
284
+ // 根据当前分组数页数返回展示列表
285
+ recommendIntentPageList(obj) {
286
+ let list = [];
287
+ if (obj.recommendType === 0) {
288
+ list = obj.recommendIntentList;
289
+ }
290
+ if (obj.recommendType === 1) {
291
+ list = obj.highFrequency.question;
292
+ }
293
+ if (obj.recommendType === 2) {
294
+ list = obj.intelligenceRecommend.question;
295
+ }
296
+ let arr = [];
297
+ let len = 0;
298
+ if (list) {
299
+ len = list.length;
300
+
301
+ // 每组展示数
302
+ let groupNumber = this.aiGuide.content.groupNumber;
303
+
304
+ this.totalPage = Math.ceil(len / groupNumber);
305
+ if (this.aiGuide.content.groupVisible) {
306
+ arr = list.slice(
307
+ (this.activePage - 1) * groupNumber,
308
+ this.activePage * groupNumber
309
+ );
310
+ } else {
311
+ arr = list;
312
+ }
313
+ }
314
+ return arr;
315
+ },
316
+ sendAiGuideInfo(recommendType, cell) {
317
+ console.log("组件-312-3", recommendType, cell);
318
+ this.$emit('sendAiGuide', recommendType, cell);
319
+ },
320
+ },
321
+ };
322
+ </script>
323
+
324
+ <style scoped lang="less">
325
+ .ig-view-cli {
326
+ // background: #fbfcfd;
327
+ font-size: 0.9em;
328
+ border-radius: 5px;
329
+ position: relative;
330
+ .ig-view-example {
331
+ position: absolute;
332
+ right: -10px;
333
+ top: -10px;
334
+ opacity: 0.5;
335
+ img {
336
+ height: 50px;
337
+ }
338
+ }
339
+ .ig-types-des {
340
+ padding: 12px 16px 0px;
341
+ text-align: left;
342
+ }
343
+ .ig-types-f {
344
+ display: flex;
345
+ justify-content: flex-start;
346
+ flex-wrap: wrap;
347
+ padding: 4px 8px;
348
+ .ig-types-f-cell {
349
+ height: 1.8em;
350
+ line-height: 1.8em;
351
+ padding: 0 12px;
352
+ margin-left: 5px;
353
+ margin-right: 5px;
354
+ margin-top: 4px;
355
+ background: #ffffff;
356
+ border: 1px solid #e0e6f7;
357
+ border-radius: 1em;
358
+ color: #a3adc6;
359
+ cursor: pointer;
360
+ overflow: hidden;
361
+ text-overflow: ellipsis;
362
+ white-space: nowrap;
363
+ &:hover {
364
+ border: 1px solid #366aff;
365
+ color: #366aff;
366
+ }
367
+ &-active {
368
+ background-color: #366aff;
369
+ border: 1px solid #366aff;
370
+ color: white;
371
+ }
372
+ }
373
+ .ig-types-f-cell-active {
374
+ &:hover {
375
+ color: white;
376
+ }
377
+ }
378
+ }
379
+ .ig-types-s {
380
+ display: flex;
381
+ justify-content: flex-start;
382
+ flex-wrap: wrap;
383
+ margin: 0px 16px 4px;
384
+ border-bottom: solid 1px #e0e6f7;
385
+ .ig-types-s-cell {
386
+ height: 2.2em;
387
+ line-height: 2.2em;
388
+ margin-right: 18px;
389
+ color: #b2c2d8;
390
+ cursor: pointer;
391
+ margin-bottom: -1px;
392
+ overflow: hidden;
393
+ text-overflow: ellipsis;
394
+ white-space: nowrap;
395
+ &:hover {
396
+ color: #366aff;
397
+ }
398
+ &-active {
399
+ border-bottom: 2px solid #366aff;
400
+ color: #366aff;
401
+ }
402
+ }
403
+ }
404
+ .ig-types-tags {
405
+ margin: 0 16px;
406
+ padding: 0 0 12px;
407
+ display: flex;
408
+ justify-content: flex-start;
409
+ flex-wrap: wrap;
410
+ .ig-types-tags-cell {
411
+ line-height: 1.4em;
412
+ padding: 2px 8px;
413
+ margin-right: 6px;
414
+ margin-top: 4px;
415
+ color: #366aff;
416
+ background: #ffffff;
417
+ border: 1px solid #a1b9ff;
418
+ border-radius: 5px;
419
+ cursor: pointer;
420
+ }
421
+ }
422
+ .ig-high-frequency-empty {
423
+ margin: 6px 15px;
424
+ height: 40px;
425
+ line-height: 40px;
426
+ background: #fff8f4;
427
+ border-radius: 5px;
428
+ color: #ff9555;
429
+ padding: 0 12px;
430
+ text-align: left;
431
+ }
432
+ .ig-types-list {
433
+ margin: 0 16px;
434
+ padding: 0 0 8px 0;
435
+ display: flex;
436
+ flex-direction: column;
437
+ justify-content: flex-start;
438
+ .ig-types-list-cell {
439
+ line-height: 1.1em;
440
+ padding: 8px 0;
441
+ overflow: hidden;
442
+ display: flex;
443
+ justify-content: space-between;
444
+ color: #366aff;
445
+ cursor: pointer;
446
+ align-items: center;
447
+ text-align: left;
448
+ span {
449
+ display: flex;
450
+ align-items: center;
451
+ flex-direction: column;
452
+ i {
453
+ // margin-top: 12px;
454
+ }
455
+ }
456
+ }
457
+ }
458
+ .ig-change-list {
459
+ padding: 8px 0;
460
+ margin-top: 4px;
461
+ display: flex;
462
+ flex-direction: column;
463
+ align-items: center;
464
+ border-top: 1px solid #eeeeee;
465
+ .ig-change-list-btn {
466
+ font-weight: 600;
467
+ color: #366aff;
468
+ cursor: pointer;
469
+ }
470
+ }
471
+ }
472
472
  </style>