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