askbot-dragon 1.7.57-beta → 1.7.61-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 -57
  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 +155 -178
  21. package/src/components/AiGuide.vue +471 -434
  22. package/src/components/AnswerDocknowledge.vue +1128 -1104
  23. package/src/components/AnswerVoice.vue +285 -285
  24. package/src/components/AskIFrame.vue +15 -15
  25. package/src/components/ConversationContainer.vue +10873 -10764
  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 +302 -302
  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 +213 -213
  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 +229 -229
  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 +3498 -3502
  48. package/src/components/imgView.vue +31 -31
  49. package/src/components/intelligentSummary.vue +230 -234
  50. package/src/components/kkview.vue +1138 -1138
  51. package/src/components/loadingProcess.vue +164 -164
  52. package/src/components/markDownText.vue +363 -198
  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 +73 -73
  62. package/src/components/pdfPosition.vue +1343 -1523
  63. package/src/components/popup.vue +228 -228
  64. package/src/components/previewDoc.vue +248 -252
  65. package/src/components/previewPdf.vue +775 -1104
  66. package/src/components/receiverMessagePlatform.vue +69 -69
  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 +58 -58
  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 +343 -347
  83. package/src/components/welcomeLlmCard.vue +140 -144
  84. package/src/components/welcomeSuggest.vue +97 -97
  85. package/src/locales/cn.json +61 -61
  86. package/src/locales/en.json +61 -61
  87. package/src/main.js +76 -76
  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 -114
  92. package/src/components/preview/excelView.vue +0 -187
  93. package/src/components/preview/newPositionPreview.vue +0 -370
  94. package/src/components/preview/pdfView.vue +0 -824
  95. package/src/locales/jp.json +0 -73
@@ -1,435 +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" 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>
132
- {{$t('dragonCommon.refresh')}}</span
133
- >
134
- </div>
135
- </div>
136
- </div>
137
- </template>
138
- <script>
139
- export default {
140
- name: "aiGuide",
141
- data () {
142
- return {
143
- isPhone: false,
144
- isPC: false,
145
-
146
- activeFirstTypeIndex: 0,
147
- activeSecondTypeIndex: 0,
148
- activeOtherObj: {
149
- name: "",
150
- recommendType: 0, // 0 关联意图 1 高频推荐意图 2 智能推荐
151
- recommendIntentList: [], // recommendType = 0
152
- highFrequency: {
153
- // recommendType = 1
154
- rang: [], // 推荐范围
155
- number: 20, // 最多推荐问题数
156
- question: [],
157
- },
158
- intelligenceRecommend: {
159
- // recommendType = 2
160
- recommendStrategy: [0, 1], // 0 根据与当前用户咨询过相同意图的用户所问的意图进行推荐 1 根据当前用户部门的其他用户咨询过的意图进行推荐
161
- rang: [], // 推荐范围
162
- number: 20, // 最多推荐问题数
163
- question: [],
164
- },
165
- },
166
- activePage: 1,
167
- totalPage: 1,
168
- };
169
- },
170
- props: {
171
- aiGuide: Object,
172
- language: {
173
- type: String,
174
- default: "cn"
175
- }
176
- },
177
- beforeMount () { },
178
- mounted () {
179
- this.isMobile();
180
- 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) {
181
- this.activeOtherObj = this.aiGuide.content.options[0];
182
- } else {
183
- this.activeSecondTypeIndex = 0;
184
- 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] : [];
185
- }
186
- },
187
- methods: {
188
- isMobile () {
189
- let flag = navigator.userAgent.match(
190
- /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
191
- );
192
- if (flag) {
193
- this.isPhone = true;
194
- } else {
195
- this.isPC = true;
196
- }
197
- },
198
- changeIntellectGuide () {
199
- if (this.activePage === this.totalPage) {
200
- this.activePage = 1;
201
- } else {
202
- this.activePage++;
203
- }
204
- },
205
- changeFirstType (fTypeIndex) {
206
- this.activeFirstTypeIndex = fTypeIndex;
207
- if (this.aiGuide.content.options[fTypeIndex].types.length === 0) {
208
- this.activeOtherObj = this.aiGuide.content.options[fTypeIndex];
209
- } else {
210
- this.activeSecondTypeIndex = 0;
211
- this.activeOtherObj =
212
- this.aiGuide.content.options[fTypeIndex].types[0];
213
- }
214
- this.activePage = 1;
215
- },
216
- changeLastType (sTypeIndex) {
217
- this.activeSecondTypeIndex = sTypeIndex;
218
- this.activeOtherObj =
219
- this.aiGuide.content.options[this.activeFirstTypeIndex].types[
220
- sTypeIndex
221
- ];
222
- this.activePage = 1;
223
- },
224
- // 根据当前分组数页数返回展示列表
225
- recommendIntentPageList (obj) {
226
- let list = [];
227
- if (obj.recommendType === 0) {
228
- list = obj.recommendIntentList;
229
- }
230
- if (obj.recommendType === 1) {
231
- list = obj.highFrequency.question;
232
- }
233
- if (obj.recommendType === 2) {
234
- list = obj.intelligenceRecommend.question;
235
- }
236
- let arr = [];
237
- let len = 0;
238
- if (list) {
239
- len = list.length;
240
-
241
- // 每组展示数
242
- let groupNumber = this.aiGuide.content.groupNumber;
243
-
244
- this.totalPage = Math.ceil(len / groupNumber);
245
- if (this.aiGuide.content.groupVisible) {
246
- arr = list.slice(
247
- (this.activePage - 1) * groupNumber,
248
- this.activePage * groupNumber
249
- );
250
- } else {
251
- arr = list;
252
- }
253
- }
254
- return arr;
255
- },
256
- sendAiGuideInfo (recommendType, cell) {
257
- console.log("组件-312-3", recommendType, cell);
258
- this.$emit('sendAiGuide', recommendType, cell);
259
- },
260
- },
261
- };
262
- </script>
263
-
264
- <style scoped lang="less">
265
- .ig-view-cli {
266
- // background: #fbfcfd;
267
- font-size: 0.9em;
268
- border-radius: 5px;
269
- position: relative;
270
-
271
- .ig-view-example {
272
- position: absolute;
273
- right: -10px;
274
- top: -10px;
275
- opacity: 0.5;
276
-
277
- img {
278
- height: 50px;
279
- }
280
- }
281
-
282
- .ig-types-des {
283
- padding: 12px 16px 0px;
284
- text-align: left;
285
- }
286
-
287
- .ig-types-f {
288
- display: flex;
289
- justify-content: flex-start;
290
- flex-wrap: wrap;
291
- padding: 4px 8px;
292
-
293
- .ig-types-f-cell {
294
- height: 1.8em;
295
- line-height: 1.8em;
296
- padding: 0 12px;
297
- margin-left: 5px;
298
- margin-right: 5px;
299
- margin-top: 4px;
300
- background: #ffffff;
301
- border: 1px solid #e0e6f7;
302
- border-radius: 1em;
303
- color: #a3adc6;
304
- cursor: pointer;
305
- overflow: hidden;
306
- text-overflow: ellipsis;
307
- white-space: nowrap;
308
-
309
- &:hover {
310
- border: 1px solid #366aff;
311
- color: #366aff;
312
- }
313
-
314
- &-active {
315
- background-color: #366aff;
316
- border: 1px solid #366aff;
317
- color: white;
318
- }
319
- }
320
-
321
- .ig-types-f-cell-active {
322
- &:hover {
323
- color: white;
324
- }
325
- }
326
- }
327
-
328
- .ig-types-s {
329
- display: flex;
330
- justify-content: flex-start;
331
- flex-wrap: wrap;
332
- margin: 0px 16px 4px;
333
- border-bottom: solid 1px #e0e6f7;
334
-
335
- .ig-types-s-cell {
336
- height: 2.2em;
337
- line-height: 2.2em;
338
- margin-right: 18px;
339
- color: #b2c2d8;
340
- cursor: pointer;
341
- margin-bottom: -1px;
342
- overflow: hidden;
343
- text-overflow: ellipsis;
344
- white-space: nowrap;
345
-
346
- &:hover {
347
- color: #366aff;
348
- }
349
-
350
- &-active {
351
- border-bottom: 2px solid #366aff;
352
- color: #366aff;
353
- }
354
- }
355
- }
356
-
357
- .ig-types-tags {
358
- margin: 0 16px;
359
- padding: 0 0 12px;
360
- display: flex;
361
- justify-content: flex-start;
362
- flex-wrap: wrap;
363
-
364
- .ig-types-tags-cell {
365
- line-height: 1.4em;
366
- padding: 2px 8px;
367
- margin-right: 6px;
368
- margin-top: 4px;
369
- color: #366aff;
370
- background: #ffffff;
371
- border: 1px solid #a1b9ff;
372
- border-radius: 5px;
373
- cursor: pointer;
374
- }
375
- }
376
-
377
- .ig-high-frequency-empty {
378
- margin: 6px 15px;
379
- height: 40px;
380
- line-height: 40px;
381
- background: #fff8f4;
382
- border-radius: 5px;
383
- color: #ff9555;
384
- padding: 0 12px;
385
- text-align: left;
386
- }
387
-
388
- .ig-types-list {
389
- margin: 0 16px;
390
- padding: 0 0 8px 0;
391
- display: flex;
392
- flex-direction: column;
393
- justify-content: flex-start;
394
-
395
- .ig-types-list-cell {
396
- line-height: 1.1em;
397
- padding: 8px 0;
398
- overflow: hidden;
399
- display: flex;
400
- justify-content: space-between;
401
- color: #366aff;
402
- cursor: pointer;
403
- align-items: center;
404
- text-align: left;
405
-
406
- span {
407
- display: flex;
408
- align-items: center;
409
- flex-direction: column;
410
-
411
- i {
412
- // margin-top: 12px;
413
- }
414
- }
415
- }
416
- }
417
-
418
- .ig-change-list {
419
- padding: 8px 0;
420
- margin-top: 4px;
421
- display: flex;
422
- flex-direction: column;
423
- align-items: center;
424
- border-top: 1px solid #eeeeee;
425
-
426
- .ig-change-list-btn {
427
- font-weight: 600;
428
- color: #366aff;
429
- cursor: pointer;
430
- display: flex;
431
- align-items: center;
432
- }
433
- }
434
- }
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
+ }
435
472
  </style>