askbot-dragon 1.0.21 → 1.0.23

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 (78) 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 +43 -43
  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/script.js +36 -36
  13. package/src/assets/less/common.css +6773 -6773
  14. package/src/assets/less/converSationContainer/common.less +191 -191
  15. package/src/assets/less/converSationContainer/converSatonContainer.less +493 -493
  16. package/src/assets/less/iconfont.css +37 -37
  17. package/src/assets/less/ticketMessage.less +211 -211
  18. package/src/components/ActionAlertIframe.vue +112 -112
  19. package/src/components/AiGuide.vue +467 -467
  20. package/src/components/AnswerDocknowledge.vue +131 -131
  21. package/src/components/AskIFrame.vue +15 -15
  22. package/src/components/ConversationContainer.vue +4658 -4658
  23. package/src/components/FileType.vue +86 -86
  24. package/src/components/Message.vue +27 -27
  25. package/src/components/actionSatisfaction.vue +107 -107
  26. package/src/components/actionSendToBot.vue +62 -62
  27. package/src/components/answerDissatisfaction.vue +62 -62
  28. package/src/components/answerRadio.vue +76 -76
  29. package/src/components/ask-components/DissatisfactionOptions.vue +57 -57
  30. package/src/components/ask-components/Msgloading.vue +37 -37
  31. package/src/components/ask-components/SatisfactionV2.vue +15 -15
  32. package/src/components/askVideo.vue +138 -138
  33. package/src/components/assetDetails.vue +370 -370
  34. package/src/components/assetMessage.vue +228 -228
  35. package/src/components/associationIntention.vue +269 -269
  36. package/src/components/botActionSatisfactor.vue +68 -68
  37. package/src/components/chatContent.vue +513 -513
  38. package/src/components/feedBack.vue +136 -136
  39. package/src/components/fielListView.vue +346 -346
  40. package/src/components/file/AliyunOssComponents.vue +108 -108
  41. package/src/components/formTemplate.vue +3344 -3344
  42. package/src/components/loadingProcess.vue +164 -164
  43. package/src/components/message/ActionAlertIframe.vue +112 -112
  44. package/src/components/message/ShopMessage.vue +164 -164
  45. package/src/components/message/TextMessage.vue +924 -924
  46. package/src/components/message/TicketMessage.vue +177 -177
  47. package/src/components/message/swiper/index.js +4 -4
  48. package/src/components/message/swiper/ticketSwiper.vue +503 -503
  49. package/src/components/message/swiper/ticketSwiperItem.vue +61 -61
  50. package/src/components/msgLoading.vue +231 -231
  51. package/src/components/myPopup.vue +70 -70
  52. package/src/components/popup.vue +227 -227
  53. package/src/components/receiverMessagePlatform.vue +65 -65
  54. package/src/components/recommend.vue +89 -89
  55. package/src/components/selector/hOption.vue +20 -20
  56. package/src/components/selector/hSelector.vue +199 -199
  57. package/src/components/selector/hWrapper.vue +216 -216
  58. package/src/components/senderMessagePlatform.vue +50 -50
  59. package/src/components/source/BotMessage.vue +24 -24
  60. package/src/components/source/CustomMessage.vue +24 -24
  61. package/src/components/test.vue +260 -260
  62. package/src/components/tree.vue +294 -275
  63. package/src/components/utils/AliyunIssUtil.js +72 -72
  64. package/src/components/utils/ckeditor.js +155 -155
  65. package/src/components/utils/ckeditorImageUpload/command.js +109 -109
  66. package/src/components/utils/ckeditorImageUpload/editing.js +11 -11
  67. package/src/components/utils/ckeditorImageUpload/plugin-image.js +11 -11
  68. package/src/components/utils/ckeditorImageUpload/toolbar-ui.js +40 -40
  69. package/src/components/utils/ckeditorfileUpload/common.js +111 -111
  70. package/src/components/utils/ckeditorfileUpload/editing.js +11 -11
  71. package/src/components/utils/ckeditorfileUpload/plugin_file.js +11 -11
  72. package/src/components/utils/ckeditorfileUpload/toolbar_ui.js +34 -34
  73. package/src/components/utils/format_date.js +25 -25
  74. package/src/components/utils/index.js +6 -6
  75. package/src/components/utils/math_utils.js +29 -29
  76. package/src/components/voiceComponent.vue +119 -119
  77. package/src/main.js +60 -60
  78. package/vue.config.js +47 -47
@@ -1,468 +1,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
- {{ aiGuide.content.description }}
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
- span {
445
- display: flex;
446
- align-items: center;
447
- flex-direction: column;
448
- i {
449
- // margin-top: 12px;
450
- }
451
- }
452
- }
453
- }
454
- .ig-change-list {
455
- padding: 8px 0;
456
- margin-top: 4px;
457
- display: flex;
458
- flex-direction: column;
459
- align-items: center;
460
- border-top: 1px solid #eeeeee;
461
- .ig-change-list-btn {
462
- font-weight: 600;
463
- color: #366aff;
464
- cursor: pointer;
465
- }
466
- }
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
+ {{ aiGuide.content.description }}
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
+ span {
445
+ display: flex;
446
+ align-items: center;
447
+ flex-direction: column;
448
+ i {
449
+ // margin-top: 12px;
450
+ }
451
+ }
452
+ }
453
+ }
454
+ .ig-change-list {
455
+ padding: 8px 0;
456
+ margin-top: 4px;
457
+ display: flex;
458
+ flex-direction: column;
459
+ align-items: center;
460
+ border-top: 1px solid #eeeeee;
461
+ .ig-change-list-btn {
462
+ font-weight: 600;
463
+ color: #366aff;
464
+ cursor: pointer;
465
+ }
466
+ }
467
+ }
468
468
  </style>