askbot-dragon 1.7.83-beta → 1.7.85-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 +60 -60
  5. package/public/index.html +73 -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 +141 -141
  11. package/src/assets/js/Base64Util.js +22 -22
  12. package/src/assets/js/common.js +261 -261
  13. package/src/assets/js/hammer.js +100 -100
  14. package/src/assets/js/script.js +36 -36
  15. package/src/assets/less/common.css +6773 -6773
  16. package/src/assets/less/converSationContainer/common.less +199 -199
  17. package/src/assets/less/converSationContainer/converSatonContainer.less +493 -493
  18. package/src/assets/less/iconfont.css +37 -37
  19. package/src/assets/less/ticketMessage.less +294 -294
  20. package/src/components/ActionAlertIframe.vue +178 -178
  21. package/src/components/AiGuide.vue +434 -434
  22. package/src/components/AnswerDocknowledge.vue +1203 -1203
  23. package/src/components/AnswerVoice.vue +285 -285
  24. package/src/components/AskIFrame.vue +15 -15
  25. package/src/components/ConversationContainer.vue +10684 -10684
  26. package/src/components/FileType.vue +86 -86
  27. package/src/components/Message.vue +27 -27
  28. package/src/components/MyEditor.vue +342 -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 +259 -259
  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 +162 -162
  38. package/src/components/assetDetails.vue +378 -378
  39. package/src/components/assetMessage.vue +229 -229
  40. package/src/components/associationIntention.vue +378 -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 +3522 -3522
  48. package/src/components/imgView.vue +31 -31
  49. package/src/components/intelligentSummary.vue +234 -234
  50. package/src/components/kkview.vue +1128 -1128
  51. package/src/components/loadingProcess.vue +164 -164
  52. package/src/components/markDownText.vue +959 -960
  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 +928 -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/newPdfPosition.vue +877 -877
  63. package/src/components/pagination.vue +128 -128
  64. package/src/components/pdfPosition.vue +1514 -1514
  65. package/src/components/popup.vue +228 -228
  66. package/src/components/preview/docView.vue +122 -113
  67. package/src/components/preview/excelView.vue +206 -198
  68. package/src/components/preview/newPositionPreview.vue +390 -388
  69. package/src/components/preview/pdfView.vue +831 -831
  70. package/src/components/previewDoc.vue +252 -252
  71. package/src/components/previewPdf.vue +1119 -1119
  72. package/src/components/receiverMessagePlatform.vue +69 -69
  73. package/src/components/recommend.vue +80 -80
  74. package/src/components/selector/hOption.vue +20 -20
  75. package/src/components/selector/hSelector.vue +199 -199
  76. package/src/components/selector/hWrapper.vue +216 -216
  77. package/src/components/senderMessagePlatform.vue +58 -58
  78. package/src/components/source/BotMessage.vue +24 -24
  79. package/src/components/source/CustomMessage.vue +24 -24
  80. package/src/components/test.vue +260 -260
  81. package/src/components/tree.vue +307 -307
  82. package/src/components/utils/AliyunIssUtil.js +103 -103
  83. package/src/components/utils/ckeditor.js +185 -185
  84. package/src/components/utils/format_date.js +25 -25
  85. package/src/components/utils/index.js +6 -6
  86. package/src/components/utils/math_utils.js +29 -29
  87. package/src/components/voiceComponent.vue +119 -119
  88. package/src/components/welcomeKnowledgeFile.vue +347 -347
  89. package/src/components/welcomeLlmCard.vue +144 -144
  90. package/src/components/welcomeSuggest.vue +97 -97
  91. package/src/locales/cn.json +98 -98
  92. package/src/locales/en.json +98 -98
  93. package/src/locales/jp.json +72 -72
  94. package/src/main.js +76 -76
  95. package/vue.config.js +54 -54
@@ -1,1203 +1,1203 @@
1
- <!--
2
- isLiBang 字段判断 是否为立邦主体
3
- 立邦有自己单独的组件分支,但考虑到后期结构改动如果较大改动会不方便,所以还是在推荐知识消息中 在此判断是否是立邦主体。方便后期维护
4
- -->
5
- <template>
6
- <div class="answer-docknowledge">
7
- <div :class="['answer-docknowledge-header', msg.content.isKnowledgeSummary ? 'bgc' : '']">
8
- <div v-if="msg.content.isKnowledgeSummary" class="tips">{{$t('dragonCommon.summaryGeneratedByAI')}}</div>
9
- <!-- <div v-if="msg.content.type == 0" class="answer-text">
10
- <template v-if="msg.content.renderType == 1">
11
- <p v-html="msg.content.text"></p>
12
- </template>
13
- <template v-else>{{ msg.content.text }}</template>
14
- </div> -->
15
- <div class="answer-text">
16
- <template v-if="msg.content.renderType == 1">
17
- <p v-html="msg.content.text"></p>
18
- </template>
19
- <template v-else-if="msg.content.renderType == 2">
20
- <!-- <markDownText :chainValues="msg.content.text" :isHistory="isHistory"></markDownText> -->
21
- <markDownText
22
- :chainValues="msg.content.text || ''"
23
- :whetherRequestStream="msg.content.whetherRequestStream"
24
- @sseOtherInfo="sseOtherInfo"
25
- @answerDocKnowledgeFn="answerDocKnowledgeFn"
26
- :streamRequestUrl="msg.content.streamRequestUrl"
27
- :msgId="msg.id"
28
- :isHistory="isHistory">
29
- </markDownText>
30
- </template>
31
- <template v-else-if="msg.content.renderType == null">
32
- <!-- <markDownText :chainValues="msg.content.text" :isHistory="isHistory"></markDownText> -->
33
- <markDownText
34
- :chainValues="msg.content.text || ''"
35
- :whetherRequestStream="msg.content.whetherRequestStream"
36
- @sseOtherInfo="sseOtherInfo"
37
- @answerDocKnowledgeFn="answerDocKnowledgeFn"
38
- :streamRequestUrl="msg.content.streamRequestUrl"
39
- :msgId="msg.id"
40
- :isHistory="isHistory">
41
- </markDownText>
42
- </template>
43
- <template v-else>{{ msg.content.text }}</template>
44
- </div>
45
- <template v-if="isPC">
46
- <div v-if="msg.content.images && msg.content.images.length != 0" class="answer-kn-image-box-pc">
47
- <img v-for="(imageItem, imageItemIndex) in msg.content.images"
48
- style="max-width: 230px;" :src="imageItem.url"
49
- v-show="showImage || imageItemIndex < 2"
50
- :key="imageItemIndex" alt @click="lookAttach(imageItem.url, imageItem, $event)" />
51
- <div class="img-placeholder" v-if="msg.content.images.length > 2 && !showImage" @click="showImage = true">
52
- +{{ msg.content.images.length - 2 }}
53
- </div>
54
- </div>
55
- </template>
56
- <template v-else>
57
- <div v-if="msg.content.images && msg.content.images.length != 0" class="answer-kn-image-box-mobile">
58
- <img v-for="(imageItem, imageItemIndex) in msg.content.images"
59
- style="max-width: 230px;" :src="imageItem.url"
60
- :key="imageItemIndex" alt @click="lookAttach(imageItem.url, imageItem, $event)" />
61
- </div>
62
- </template>
63
- </div>
64
- <template v-if="!isLiBang">
65
- <div class="ad-list" :class="msg.content.type == 0 || msg.content.type == 2 ? 'ad-list-recognition' : ''">
66
- <template v-if="msg.content.type == 1">
67
- <div v-for="(item, itemIndex) in msg.content.list" :key="itemIndex"
68
- :style="{ paddingBottom: itemIndex === msg.content.list.length - 1 ? 0 : '10px' }" class="ad-list-cell">
69
- <div class="alc-title">
70
- <div class="alc-box">
71
- <div class="alc-source-left">
72
- <span class="source-form">{{$t('dragonCommon.from')}}</span>
73
- <img class="alc-title-icon" height="24px" width="24px" :src="getIconSrc(item)" alt=""
74
- srcset="">
75
- <span class="alc-title-from">{{ item.from }}</span>
76
- </div>
77
- </div>
78
- <div v-html="item.introduction" v-if="!srcContentTypeIMG(item)" class="alc-box-introduction">
79
- </div>
80
- <div v-else class="alc-box-introduction">
81
- <img :src="item.expiredUrl" alt="" @click="lookAttach(item.url, item, $event)">
82
- </div>
83
- <div v-if="item.previewImage" class="alc-box-introduction-previewImage">
84
- <img :src="item.previewImage" alt=""
85
- @click="lookAttach(item.previewImage, { url: item.previewImage }, $event)">
86
- </div>
87
- <div class="alc-updateTime">
88
- <div v-show="docSource[item.source]" class="upload-source">
89
- {{ docSource[item.source] }}
90
- </div>
91
- <div v-show="item.url" class="alc-content-text">
92
- <span @click="lookAttach(item.url, item, $event)" class="aci-view">{{$t('dragonCommon.check')}} ></span>
93
- </div>
94
- </div>
95
- </div>
96
- <div class="alc-content" v-if="false">
97
- <div v-if="msg.content.type == 1" class="alc-content-text">
98
- {{ item.introduction }}
99
- <span @click="lookAttach(item.url, item, $event)" class="aci-view">{{$t('dragonCommon.viewOriginal')}} ></span>
100
- </div>
101
- <span v-if="!isPC" class="alc-title-updateTime">{{$t('dragonCommon.lastUpdateTime')}}: {{ item.updateTime }}</span>
102
- <div v-if="false" class="alc-content-info">
103
- <div class="alcc-box">
104
- <span class="aci-owner">{{$t('dragonCommon.owner')}}: {{ item.owner }}</span>
105
- <span class="aci-enterprise">{{$t('dragonCommon.enterprise')}}: {{ item.enterprise }}</span>
106
- <span class="aci-source">{{$t('dragonCommon.source')}}: {{ item.source }}</span>
107
- </div>
108
- </div>
109
- </div>
110
- </div>
111
- </template>
112
- <template v-if="msg.content.type == 0 || msg.content.type == 2">
113
- <div v-for="(item, itemIndex) in msg.content.list" :key="itemIndex" class="ad-list-cell-recognition" :id="item.knowledgeId + knowledgeIndex">
114
- <div class="alc-source-name" @click="lookAttach(item.url, item, $event)">
115
- <img class="alc-title-icon" height="18px" width="18px" :src="getIconSrc(item)" alt srcset />
116
- <span class="alc-title-from">{{ item.from }}</span>&nbsp;-&nbsp;
117
- <div v-show="docSource[item.source]" class="upload-source">
118
- {{ docSource[item.source] }}
119
- </div>
120
- <i class="iconfont guoran-right"></i>
121
- </div>
122
- </div>
123
- </template>
124
- <div class="ad-loadmore" v-if="loadMoreFlag" @click="lazyLoadKnowledegList">{{$t('dragonCommon.viewMore')}}</div>
125
- </div>
126
- </template>
127
- <template v-if="isLiBang">
128
- <div class="libang_list" :class="msg.content.type == 0 ? 'libang_list_recognition' : ''">
129
- <template v-if="msg.content.type == 1">
130
- <div v-for="(item, itemIndex) in msg.content.list" :key="itemIndex" class="libang_list_cell">
131
- <div class="libang_title">
132
- <div class="libang_box">
133
- <div class="libang_source_left">
134
- <span class="source-form">{{$t('dragonCommon.from')}}</span>
135
- <img class="libang_title_icon" height="24px" width="24px" :src="getIconSrc(item)" alt=""
136
- srcset="">
137
- <span class="libang_title_from">{{ item.from }}</span>
138
- </div>
139
- </div>
140
- <div v-html="item.introduction" v-if="!srcContentTypeIMG(item)" class="libang_box_introduction">
141
- </div>
142
- <div v-else class="libang_box_introduction">
143
- <img :src="item.expiredUrl" alt="" @click="lookAttach(item.url, item, $event)">
144
- </div>
145
- <div v-if="item.previewImage" class="libang_box_introduction_previewImage">
146
- <img :src="item.previewImage" alt=""
147
- @click="lookAttach(item.previewImage, { url: item.previewImage }, $event)">
148
- </div>
149
- <div class="libang_updateTime">
150
- <div class="libang_updataTime_left">
151
- <div v-show="docSource[item.source]" class="upload-source">
152
- {{ docSource[item.source] }}
153
- </div>
154
- <div class="libang_floder" @click.stop="clickFloder(item)">
155
- <i class="iconfont guoran-tongyichicun-wenjianjia-zhankaizhuangtai--folderOpen"></i>
156
- {{ item.folderName }}
157
- </div>
158
- </div>
159
- <div v-show="item.url" class="libang_content_text">
160
- <span @click="lookAttach(item.url, item, $event)" class="aci-view">{{$t('dragonCommon.check')}} ></span>
161
- </div>
162
- </div>
163
- </div>
164
- <!-- <div class="alc-content" v-if="false">
165
- <div v-if="msg.content.type == 1" class="alc-content-text">
166
- {{ item.introduction }}
167
- <span @click="lookAttach(item.url, item, $event)" class="aci-view">查看原文 ></span>
168
- </div>
169
- <span v-if="!isPC" class="alc-title-updateTime">最后更新时间: {{ item.updateTime }}</span>
170
- <div v-if="false" class="alc-content-info">
171
- <div class="alcc-box">
172
- <span class="aci-owner">所有者: {{ item.owner }}</span>
173
- <span class="aci-enterprise">所属企业: {{ item.enterprise }}</span>
174
- <span class="aci-source">文件来源: {{ item.source }}</span>
175
- </div>
176
- </div>
177
- </div> -->
178
- </div>
179
- </template>
180
- <template v-if="msg.content.type == 0 || msg.content.type == 2">
181
- <div v-for="(item, itemIndex) in msg.content.list" :key="itemIndex"
182
- class="libang_list_cell_recognition" @click="lookAttach(item.url, item, $event)" :id="item.knowledgeId + knowledgeIndex">
183
- <div class="libang_list_cell_left" >
184
- <div class="libang_source_name" >
185
- <img class="libang_title_icon" height="18px" width="18px" :src="getIconSrc(item)" alt srcset />
186
- <span class="libang_title_from">{{ item.from }}</span>&nbsp;-&nbsp;
187
- <div v-show="docSource[item.source]" class="upload_source">
188
- {{ docSource[item.source] }}
189
- </div>
190
- </div>
191
- <div class="libang_source_floder" @click.stop="clickFloder(item)">
192
- <i class="iconfont guoran-tongyichicun-wenjianjia-zhankaizhuangtai--folderOpen"></i>
193
- {{ item.folderName }}
194
- </div>
195
- </div>
196
- <i class="iconfont guoran-right" @click="lookAttach(item.url, item, $event)"></i>
197
- </div>
198
- </template>
199
- <div class="ad-loadmore" v-if="loadMoreFlag" @click="lazyLoadKnowledegList">{{$t('dragonCommon.viewMore')}}</div>
200
- </div>
201
- </template>
202
-
203
- <previewPdf ref="previewPdf" :url="previewHref" :previewOssPath="previewOssPath" :title="title"
204
- :folderName="folderName" :folderUrl="folderUrl"
205
- :sourceFileType="sourceFileType" officePreviewType="pdf" @previewToDialog="previewToDialog"
206
- @recommendQues="recommendQues" @close="close" @open="open" :isHasChat="isHasChat"
207
- :knowledgeId="previewKnowledgeId" :isLiBang="isLiBang" @previewClickFloder="previewClickFloder"></previewPdf>
208
- </div>
209
- </template>
210
-
211
- <script>
212
- /* eslint-disable */
213
- import previewPdf from "./previewPdf";
214
- import { isMobile } from "../assets/js/common";
215
- import markDownText from "./markDownText.vue";
216
- export default {
217
- name: "answerDocknowledge",
218
- components: { previewPdf, markDownText },
219
- data () {
220
- return {
221
- isPC: true,
222
- previewHref: "",
223
- sourceFileType: '',
224
- // docSource: {
225
- // LOCAL_FILE: "来源于本地文件",
226
- // CREATED_BY_ONESELF: "来源于自建知识",
227
- // WECHAT: "来源于微信",
228
- // AUTO_SYN_FROM_LOCAL_FILE: "自动同步于本地",
229
- // YUQUE: "来源于语雀",
230
- // CORP_LOCAL_FILE: '来源于企业知识库',
231
- // FEISHU: '来源于飞书-云文档'
232
- // },
233
- docSource: {},
234
- imageObj: {
235
- PDF: 'pdf1',
236
- pdf: 'pdf1',
237
- TXT: 'txt1',
238
- txt: 'txt1',
239
- selfadd: 'selfadd1',
240
- md: "md2",
241
- html: 'selfadd1',
242
- mode: "mode",
243
- general: 'general',
244
- word: "word1",
245
- Word: "word1",
246
- docx: "word1",
247
- doc: "word1",
248
- WORD: "word1",
249
- Excel: 'excel1',
250
- EXCEL: 'excel1',
251
- excel: 'excel1',
252
- PPT: 'ppt1',
253
- ppt: 'ppt1',
254
- pptx: 'ppt1',
255
- img: "image1",
256
- image: "image1",
257
- video: "video",
258
- audio: 'audio',
259
- link: "link",
260
- wechat: "wechat",
261
- mp4: "video",
262
- MP4: "video",
263
- xlsx: "excel1",
264
- SLSX: "excel1",
265
- xls: "excel1",
266
- XLS: "excel1",
267
- jpg: "image1",
268
- JPG: "image1",
269
- jpeg: "image1",
270
- JPEG: "image1",
271
- png: "image1",
272
- PNG: "image1",
273
- webp: "image1",
274
- WEBP: "image1",
275
- gif: "image1",
276
- GIF: "image1",
277
- svg: "image1",
278
- SVG: "image1",
279
- bmp: "image1",
280
- BMP: "image1",
281
- avi: "video",
282
- AVI: "video",
283
- mov: "video",
284
- MOV: "video",
285
- rmvb: "video",
286
- RMVB: "video",
287
- wav: "audio",
288
- WAV: "audio",
289
- mp3: "audio",
290
- MP3: "audio",
291
- yqhtml: "yqhtml",
292
- feishuhtml: "feishuhtml"
293
- },
294
- allKnowledgeList: [],
295
- loadMoreFlag: false,
296
- title: '',
297
- folderName: '',
298
- folderUrl: '',
299
- previewKnowledgeId: "",
300
- previewKnowledge: {},
301
- previewOssPath: "",
302
- showImage: false
303
- }
304
- },
305
- props: ['msg', 'isAskLightning', 'isMessageRecord', "isApp", "isHasChat", "activeKnowledgeId", "isLiBang","language","isHistory","knowledgeIndex"],
306
- beforeMounted () {
307
- },
308
- watch: {
309
- // msg: {
310
- // handler (n) {
311
- // console.log(n, 'answerDocknowledge');
312
- // n.content.list.forEach(element => {
313
- // console.log(this.imageObj[element.format], 1111);
314
- // element.src = 'https://static.guoranbot.com/cdn-office-website/askbot_doc/' + this.imageObj[element.format] + '.png';
315
- // if ((element.format === "txt" || element.format === "html") && element.source === "WECHAT") {
316
- // element.src = 'https://static.guoranbot.com/cdn-office-website/askbot_doc/wechat.png';
317
- // }
318
- // });
319
- // },
320
- // deep: true,
321
- // immediate: true
322
- // }
323
- },
324
- created () {
325
- // var system = {};
326
- // system.pingtai = /(Win32|Win16|WinCE|Mac68K|MacIntel|MacIntel|MacPPC|Linux mips64)/i.test(navigator.platform);
327
- // if (system.pingtai) {
328
- // //电脑
329
- // this.isPC = true;
330
- // } else {
331
- // //手机
332
- // this.isPC = false;
333
- // }
334
- this.isPC = !isMobile()
335
- // this.msg.content.list.forEach(element => {
336
- // console.log(this.imageObj[element.format],1111);
337
- // element.src = 'https://static.guoranbot.com/cdn-office-website/askbot_doc/' + this.imageObj[element.format] + '.png';
338
- // if ((element.format === "txt" || element.format === "html") && element.source === "WECHAT") {
339
- // element.src = 'https://static.guoranbot.com/cdn-office-website/askbot_doc/wechat.png';
340
- // }
341
- // });
342
- },
343
- mounted () {
344
- this.$i18n.locale = sessionStorage.getItem("systemLanguage") || 'cn';
345
- this.docSource = {
346
- LOCAL_FILE: this.$t('dragonCommon.personalknowledge'),
347
- CREATED_BY_ONESELF: this.$t('dragonCommon.personalknowledge'),
348
- WECHAT: this.$t('dragonCommon.personalknowledge'),
349
- AUTO_SYN_FROM_LOCAL_FILE: this.$t('dragonCommon.personalknowledge'),
350
- YUQUE: this.$t('dragonCommon.enterpriseknowledge'),
351
- CORP_LOCAL_FILE: this.$t('dragonCommon.enterpriseknowledge'),
352
- FEISHU: this.$t('dragonCommon.enterpriseknowledge'),
353
- }
354
- console.log(this.msg.content, 'this.msg.content');
355
- // if(this.msg.content.type == 1) {
356
-
357
- // }
358
- if (this.msg.content.list && this.msg.content.list.length > 0) {
359
- this.loadMoreFlag = true
360
- this.allKnowledgeList = JSON.parse(JSON.stringify(this.msg.content.list))
361
- // console.log(this.allKnowledgeList.length, 'this.allKnowledgeList');
362
- this.msg.content.list = []
363
- this.lazyLoadKnowledegList()
364
- }
365
- },
366
- methods: {
367
- answerDocKnowledgeFn(){
368
- console.log(
369
- "answerDocKnowledgeFn 2"
370
- );
371
- this.$emit('answerDocKnowledgeFn');
372
- },
373
- // 知识类型消息 推荐、关联文档、图片
374
- sseOtherInfo(msgId, eventId, data){
375
- if (eventId === "matched") {
376
- console.log("matched: ", this.msg.content.type);
377
-
378
- if (JSON.parse(data.content).length > 0) {
379
- this.$set(this.msg.content, "list", JSON.parse(data.content));
380
- }
381
- } else {
382
- this.$emit("sseOtherInfo",msgId, eventId, data);
383
- }
384
- },
385
- getIconSrc (element) {
386
- if ((element.format === "txt" || element.format === "html") && element.source === "WECHAT") {
387
- return require("../assets/image/filtType/wechat.png")
388
- } else {
389
- return require("../assets/image/filtType/" + this.imageObj[element.format] + '.png')
390
-
391
- }
392
- },
393
- //预览图片
394
- lookAttach (url, item, event) {
395
- // console.log(item.knowledgeId);
396
- // this.$http.get("/knowledge-api/internal/knowledgeBaseStructure/" + "642ffbccde420e2772f7787b")
397
- // debugger
398
- event.preventDefault();
399
- if (this.isAskLightning == 1 && !this.isApp) {
400
- window.parent.postMessage({
401
- data: "bot_preview",
402
- item: JSON.stringify(item),
403
- url: url
404
- }, "*");
405
- } else {
406
- // if (isMobile()) {
407
- // this.$refs.previewPdf.drawer = true;
408
- // this.$refs.previewPdf.previewShowPopup = false;
409
- // } else {
410
- // this.$refs.previewPdf.drawer = false;
411
- // }
412
- //该事件是为了打开新的弹框时关闭上一个弹框
413
- window.parent.postMessage({
414
- type: "close_drawer",
415
- data:this.knowledgeIndex
416
- }, "*");
417
- this.title = item.from || item.name
418
- this.folderName = item.folderName
419
- this.folderUrl = item.folderUrl
420
- this.previewKnowledge = item;
421
- this.previewKnowledgeId = item.knowledgeId
422
- this.$refs.previewPdf.previewShowPopup = false;
423
- this.$refs.previewPdf.drawer = false;
424
- this.previewOssPath = url;
425
- let index = url.lastIndexOf('?')
426
- let type = ''
427
- let httpUrl = '/knowledge-api/knowledge/getTemporaryCertificate'
428
- if (index !== -1) {
429
- url = url.substring(0, index)
430
- type = this.fileType(url)
431
- } else {
432
- type = this.fileType(url)
433
- }
434
- if (type === '' || type === 'OTHER' || type == 'IMAGE') {
435
- httpUrl = httpUrl += '?needEncrypt=true'
436
- } else {
437
- httpUrl = httpUrl += '?needEncrypt=false'
438
- }
439
- this.$refs.previewPdf.getOssPath(url);
440
- this.$http.post(httpUrl, {
441
- "fileInOssPath": url
442
- }).then(res => {
443
- if (res.data.code == '0') {
444
- this.previewHref = res.data.data;
445
- this.sourceFileType = url.substring(url.lastIndexOf('.'))
446
- let isOhmPc = sessionStorage.getItem('isOhmPc')
447
- if (isMobile() || isOhmPc == 'true') {
448
- this.$refs.previewPdf.drawer = true;
449
- this.$refs.previewPdf.previewShowPopup = true;
450
- } else {
451
- this.$refs.previewPdf.previewShowPopup = false;
452
- this.$refs.previewPdf.drawer = true;
453
- }
454
- //聊一聊按钮的选中状态
455
- if (this.activeKnowledgeId == item.knowledgeId) {
456
- this.$refs.previewPdf.previewKnowledgeId = this.activeKnowledgeId
457
- } else {
458
- this.$refs.previewPdf.previewKnowledgeId = ""
459
- }
460
- this.$refs.previewPdf.fileType = type
461
- this.$refs.previewPdf.tagIds = item.tagIds;
462
- if (item.tagIds && item.tagIds.length > 0){
463
- this.$refs.previewPdf.getLocationInfo();
464
- }
465
- this.$refs.previewPdf.isMessageRecord = this.isMessageRecord ? true : false;
466
- let index = url.indexOf("?");
467
- let newFileInOssPath = url;
468
- if (index !== -1) {
469
- newFileInOssPath = url.substring(0, url.indexOf("?"))
470
- }
471
- let fileName = newFileInOssPath.substring(newFileInOssPath.lastIndexOf('.'))
472
- if (fileName === '.doc' || fileName === '.docx' || fileName === '.txt' || fileName === '.html') {
473
- this.$refs.previewPdf.fileName = fileName;
474
- } else {
475
- this.$refs.previewPdf.fileName = '';
476
- }
477
- if (item.tagIds && item.tagIds.length != 0 && this.$refs.previewPdf.newFileType !== 'PPT') {
478
- this.$refs.previewPdf.loading = false
479
- return
480
- }
481
- this.$nextTick(() => {
482
- if (item.source == 'CREATED_BY_ONESELF' || type === 'HTML') {
483
- this.$refs.previewPdf.getBolb(item)
484
- }
485
- this.$refs.previewPdf.loadIframe(item)
486
- this.$refs.previewPdf.showSummary = false;
487
- })
488
- }
489
- })
490
- }
491
- },
492
- open () {
493
- this.$emit('openPreviewDialog')
494
- },
495
- close () {
496
- this.$emit('closePreviewDialog')
497
- },
498
- fileType (url) {
499
- const fileType = url.substring(url.lastIndexOf('.'));
500
- if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.MOV' || fileType === '.MOVC' || fileType === '.mov' || fileType === '.movc' || fileType === '.mav' || fileType === '.MAV' || fileType == '.mp3' || fileType == '.MP3' || fileType === '.wav') {
501
- return 'VIDEO'
502
- } else if (fileType === '.html') {
503
- return 'HTML'
504
- } else if (fileType === '.png' || fileType === '.jpg' || fileType === '.jpeg') {
505
- return 'IMAGE'
506
- } else {
507
- return 'OTHER'
508
- }
509
- },
510
- srcContentTypeIMG (item) {
511
- let url = item.url || '';
512
- const type = url.substring(url.lastIndexOf('.'));
513
- if (type === '.jpg' || type === '.jpeg' || type === '.png' || type === '.gif') {
514
- this.getSrc(item)
515
- return true
516
- } else {
517
- return false
518
- }
519
- },
520
- getSrc (item) {
521
- // let imgurl = ''
522
- this.$http.post(
523
- '/knowledge-api/temporary-certificate/or-origin?expired=30',
524
- item.url,
525
- {
526
- headers: {
527
- "Content-Type": "application/json",
528
- },
529
- }).then(res => {
530
- console.log(res, '=====');
531
- // imgurl = await res.bodyText
532
- this.$set(item, 'expiredUrl', res.data ? res.data : res.bodyText)
533
- // return res.data
534
- })
535
- // return imgurl
536
- },
537
- lazyLoadKnowledegList () {
538
- if (this.allKnowledgeList.length !== 0) {
539
- let arr = this.allKnowledgeList.splice(0, 5)
540
- if (arr.length < 5) {
541
- this.loadMoreFlag = false
542
- this.msg.content.list = [...this.msg.content.list, ...arr]
543
- return
544
- }
545
- if (this.allKnowledgeList.length == 0) {
546
- this.loadMoreFlag = false
547
- }
548
- this.msg.content.list = [...this.msg.content.list, ...arr]
549
- return
550
- }
551
- },
552
- previewToDialog (flag) {
553
- if (!flag) {
554
- this.$refs.previewPdf.previewKnowledgeId = ""
555
- } else {
556
- this.$refs.previewPdf.previewKnowledgeId = this.previewKnowledgeId
557
- }
558
- this.$emit('previewToDialog', flag, this.previewKnowledgeId, this.previewKnowledge)
559
- },
560
- clearKnowledgeId () {
561
- this.previewKnowledgeId = "";
562
- },
563
- recommendQues (item, knowledgeId) {
564
- this.$emit('recommendQues', item, knowledgeId)
565
- },
566
- clickFloder (item) {
567
- this.$emit('clickFloder', item)
568
- },
569
- previewClickFloder () {
570
- let item = null
571
- this.msg.content.list.forEach(element => {
572
- if (element.knowledgeId == this.previewKnowledgeId) {
573
- item = element
574
- }
575
- });
576
- this.$emit('clickFloder', item)
577
- }
578
- }
579
- }
580
- </script>
581
-
582
- <style scoped lang="less">
583
- .answer-docknowledge {
584
- min-width: 100px;
585
- background: #ffffff;
586
-
587
- .answer-docknowledge-header {
588
- .tips {
589
- width: 154px;
590
- height: 22px;
591
- background: #366aff;
592
- border-radius: 5px;
593
- text-align: center;
594
- line-height: 22px;
595
- color: #fff;
596
- font-size: 12px;
597
- margin-bottom: 7px;
598
- }
599
-
600
- .answer-text {
601
- // font-size: 13px;
602
- text-align: left;
603
- line-height: 25px;
604
- padding: 0px 0px 12px 0px;
605
-
606
- .aci-view {
607
- // font-size: 13px;
608
- display: inline-block;
609
- // margin-left: 5px;
610
- color: #366aff;
611
- cursor: pointer;
612
- }
613
- }
614
-
615
- &.bgc {
616
- padding: 10px;
617
- background: #eef1ff;
618
- border-radius: 10px;
619
- margin-bottom: 16px;
620
-
621
- .answer-text {
622
- padding: 0;
623
- }
624
- }
625
-
626
- // .answer-kn-image-box {
627
- // margin-bottom: 10px;
628
- // }
629
- .answer-kn-image-box-pc {
630
- margin-bottom: 10px;
631
- display: flex;
632
- width: 100%;
633
- overflow: hidden;
634
- overflow-x: auto;
635
- img {
636
- width: 120px;
637
- height: 120px;
638
- border-radius: 5px;
639
- object-fit: cover;
640
- margin-right: 10px;
641
- margin-bottom: 10px;
642
- cursor: pointer;
643
- flex: none;
644
- }
645
- .img-placeholder {
646
- width: 120px;
647
- height: 120px;
648
- border-radius: 5px;
649
- margin-right: 10px;
650
- margin-bottom: 10px;
651
- cursor: pointer;
652
- border: 1px dashed #d9d9d9;
653
- color: #366aff;
654
- flex: none;
655
- display: flex;
656
- align-items: center;
657
- justify-content: center;
658
- font-size: 22px;
659
- }
660
- .img-placeholder:hover {
661
- border: 1px dashed #366aff;
662
- }
663
- }
664
- .answer-kn-image-box-mobile {
665
- margin-bottom: 10px;
666
- display: flex;
667
- width: 100%;
668
- overflow: hidden;
669
- overflow-x: auto;
670
- img {
671
- width: 35vw;
672
- height: 35vw;
673
- border-radius: 5px;
674
- object-fit: cover;
675
- margin-right: 10px;
676
- margin-bottom: 10px;
677
- flex: none;
678
- }
679
- }
680
- }
681
-
682
-
683
- .ad-list-recognition {
684
- display: flex;
685
- align-items: center;
686
- flex-wrap: wrap;
687
- }
688
-
689
- .libang_list_recognition {
690
- display: flex;
691
- align-items: center;
692
- flex-wrap: wrap;
693
- }
694
-
695
- .ad-list {
696
- .ad-list-cell {
697
- border-top: solid 1px #eeeeee;
698
- padding: 10px 0 10px;
699
-
700
- .alc-title {
701
- display: flex;
702
- flex-wrap: wrap;
703
- align-items: center;
704
- justify-content: space-between;
705
- line-height: 16px;
706
-
707
- .alc-box {
708
- display: flex;
709
- align-items: center;
710
- justify-content: space-between;
711
- // font-size: 12px;
712
- width: 100%;
713
-
714
- .alc-source-left {
715
- display: flex;
716
- align-items: center;
717
-
718
- .source-form {
719
- width: 34px;
720
- flex: none;
721
- color: #a9b3c6;
722
- }
723
- }
724
-
725
- .alc-content-text {
726
- width: 55px;
727
- flex: none;
728
-
729
- .aci-view {
730
- color: #366aff;
731
- cursor: pointer;
732
- }
733
- }
734
-
735
- .alc-title-from {
736
- line-height: 22px;
737
- word-break: break-all !important;
738
- text-align: left;
739
- flex: auto;
740
- display: flex;
741
- justify-content: flex-start;
742
- }
743
- .upload-source {
744
- // flex: none;
745
- }
746
- }
747
-
748
- .alc-box-introduction {
749
- overflow: hidden;
750
- text-overflow: ellipsis;
751
- display: -webkit-box;
752
- -webkit-line-clamp: 3;
753
- -webkit-box-orient: vertical;
754
- margin-top: 10px;
755
- color: #616161;
756
- // font-size: 12px;
757
- line-height: 24px;
758
- text-align: left;
759
-
760
- img {
761
- width: 50px;
762
- height: 50px;
763
- margin: 10px;
764
- cursor: pointer;
765
- }
766
- }
767
-
768
- .alc-box-introduction-previewImage {
769
- width: 100%;
770
- display: block;
771
- overflow: hidden;
772
- text-overflow: ellipsis;
773
- display: -webkit-box;
774
- -webkit-line-clamp: 3;
775
- -webkit-box-orient: vertical;
776
- margin-top: 10px;
777
- color: #616161;
778
- // font-size: 12px;
779
- line-height: 24px;
780
- text-align: left;
781
-
782
- img {
783
- max-width: 300px;
784
- width: 100%;
785
- max-height: 150px;
786
- margin: 10px;
787
- cursor: pointer;
788
- }
789
- }
790
-
791
- .alc-updateTime {
792
- display: flex;
793
- align-items: center;
794
- justify-content: space-between;
795
- font-size: 13px;
796
- width: 100%;
797
- margin-top: 10px;
798
-
799
- .upload-source {
800
- flex: none;
801
- height: 18px;
802
- line-height: 18px;
803
- background: #e9f9f8;
804
- border: 1px solid #aff2cd;
805
- border-radius: 2px;
806
- display: flex;
807
- align-items: center;
808
- justify-content: center;
809
- padding: 0 8px;
810
- color: #00c2bb;
811
- }
812
-
813
- .time {
814
- color: #999999;
815
- margin-left: 10px;
816
- }
817
-
818
- .alc-content-text {
819
- color: #366aff;
820
- cursor: pointer;
821
- }
822
- }
823
-
824
- .alc-title-icon {
825
- margin: 0 2px;
826
- width: 18px;
827
- height: 18px;
828
- flex: none;
829
- }
830
-
831
- .alc-title-updateTime {
832
- text-align: right;
833
- color: #999999;
834
- // font-size: 13px;
835
- }
836
- }
837
-
838
- .alc-content {
839
- .alc-title-updateTime {
840
- margin-top: 6px;
841
- display: block;
842
- text-align: right;
843
- color: #999999;
844
- // font-size: 13px;
845
- }
846
-
847
- .alc-content-text {
848
- margin-bottom: 6px;
849
- width: 55px;
850
- flex: none;
851
-
852
- .aci-view {
853
- display: inline-block;
854
- margin-left: 30px;
855
- color: #366aff;
856
- cursor: pointer;
857
- }
858
- }
859
-
860
- .alc-content-info {
861
- display: flex;
862
- flex-wrap: wrap;
863
- justify-content: space-between;
864
-
865
- .alcc-box {
866
- display: flex;
867
- flex-wrap: wrap;
868
- color: #999999;
869
-
870
- .aci-owner {
871
- margin-right: 20px;
872
- }
873
-
874
- .aci-enterprise {
875
- margin-right: 20px;
876
- }
877
- }
878
- }
879
- }
880
- }
881
-
882
- .ad-list-cell-recognition {
883
- max-width: 270px;
884
- margin-right: 12px;
885
- font-size: 12px;
886
- .alc-source-name {
887
- flex: none;
888
- padding: 3px;
889
- margin-right: 5px;
890
- margin-bottom: 5px;
891
- background: #f2f6ff;
892
- border-radius: 5px;
893
- display: flex;
894
- align-items: center;
895
- justify-content: space-between;
896
- cursor: pointer;
897
-
898
- img {
899
- vertical-align: middle;
900
- // width: 16px;
901
- // height: 16px;
902
- margin: 0 3px 0 5px;
903
- }
904
-
905
- .alc-title-from {
906
- // margin-right: 5px;
907
- max-width: 240px;
908
- overflow: hidden;
909
- text-overflow: ellipsis;
910
- white-space: nowrap;
911
- }
912
-
913
- .upload-source {
914
- margin-right: 5px;
915
- flex: none;
916
- }
917
-
918
- i {
919
- font-size: 12px;
920
- }
921
- }
922
- }
923
-
924
- .ad-loadmore {
925
- width: 100%;
926
- height: 40px;
927
- display: flex;
928
- align-items: center;
929
- justify-content: center;
930
- // background: #FFFFFF;
931
- color: #366aff;
932
- font-size: 14px;
933
- margin-top: 8px;
934
- cursor: pointer;
935
- }
936
- }
937
-
938
- .libang_list {
939
- .libang_list_cell {
940
- border-top: solid 1px #eeeeee;
941
- padding: 10px 0 10px;
942
- font-size: 12px;
943
- .libang_title {
944
- display: flex;
945
- flex-wrap: wrap;
946
- align-items: center;
947
- justify-content: space-between;
948
- line-height: 16px;
949
-
950
- .libang_box {
951
- display: flex;
952
- align-items: center;
953
- justify-content: space-between;
954
- // font-size: 12px;
955
- width: 100%;
956
-
957
- .libang_source_left {
958
- display: flex;
959
- align-items: center;
960
-
961
- .source-form {
962
- width: 34px;
963
- flex: none;
964
- color: #a9b3c6;
965
- }
966
- }
967
-
968
- .alc-content-text {
969
- width: 55px;
970
- flex: none;
971
-
972
- .aci-view {
973
- color: #366aff;
974
- cursor: pointer;
975
- }
976
- }
977
-
978
- .libang_title_from {
979
- line-height: 22px;
980
- word-break: break-all !important;
981
- text-align: left;
982
- flex: auto;
983
- display: flex;
984
- justify-content: flex-start;
985
- }
986
- }
987
-
988
- .libang_box_introduction {
989
- overflow: hidden;
990
- text-overflow: ellipsis;
991
- display: -webkit-box;
992
- -webkit-line-clamp: 3;
993
- -webkit-box-orient: vertical;
994
- margin-top: 10px;
995
- color: #616161;
996
- // font-size: 12px;
997
- line-height: 24px;
998
- text-align: left;
999
-
1000
- img {
1001
- width: 50px;
1002
- height: 50px;
1003
- margin: 10px;
1004
- cursor: pointer;
1005
- }
1006
- }
1007
-
1008
- .libang_box_introduction_previewImage {
1009
- overflow: hidden;
1010
- text-overflow: ellipsis;
1011
- display: -webkit-box;
1012
- -webkit-line-clamp: 3;
1013
- -webkit-box-orient: vertical;
1014
- margin-top: 10px;
1015
- color: #616161;
1016
- // font-size: 12px;
1017
- line-height: 24px;
1018
- text-align: left;
1019
-
1020
- img {
1021
- max-width: 300px;
1022
- width: 100%;
1023
- max-height: 150px;
1024
- margin: 10px;
1025
- cursor: pointer;
1026
- }
1027
- }
1028
-
1029
- .libang_updateTime {
1030
- display: flex;
1031
- align-items: center;
1032
- justify-content: space-between;
1033
- font-size: 13px;
1034
- width: 100%;
1035
- margin-top: 10px;
1036
- .libang_updataTime_left {
1037
- width: calc(100% - 40px);
1038
- display: flex;
1039
- align-items: center;
1040
- .upload-source {
1041
- flex: none;
1042
- height: 18px;
1043
- line-height: 18px;
1044
- background: #e9f9f8;
1045
- border: 1px solid #aff2cd;
1046
- border-radius: 2px;
1047
- display: flex;
1048
- align-items: center;
1049
- justify-content: center;
1050
- padding: 0 8px;
1051
- color: #00c2bb;
1052
- }
1053
- .libang_floder {
1054
- width:calc(100% - 90px);
1055
- // margin-left: 10px;
1056
- overflow: hidden;
1057
- text-overflow: ellipsis;
1058
- white-space: nowrap;
1059
- color: #366aff;
1060
- cursor: pointer;
1061
- text-align: left;
1062
- i {
1063
- margin-left: 8px;
1064
- }
1065
- }
1066
- }
1067
- .libang_content_text {
1068
- color: #366aff;
1069
- cursor: pointer;
1070
- }
1071
- .time {
1072
- color: #999999;
1073
- margin-left: 10px;
1074
- }
1075
- }
1076
- .alc-title-icon {
1077
- margin: 0 2px;
1078
- width: 18px;
1079
- height: 18px;
1080
- flex: none;
1081
- }
1082
-
1083
- .alc-title-updateTime {
1084
- text-align: right;
1085
- color: #999999;
1086
- // font-size: 13px;
1087
- }
1088
- }
1089
-
1090
- .alc-content {
1091
- .alc-title-updateTime {
1092
- margin-top: 6px;
1093
- display: block;
1094
- text-align: right;
1095
- color: #999999;
1096
- // font-size: 13px;
1097
- }
1098
-
1099
- .alc-content-text {
1100
- margin-bottom: 6px;
1101
- width: 55px;
1102
- flex: none;
1103
-
1104
- .aci-view {
1105
- display: inline-block;
1106
- margin-left: 30px;
1107
- color: #366aff;
1108
- cursor: pointer;
1109
- }
1110
- }
1111
-
1112
- .alc-content-info {
1113
- display: flex;
1114
- flex-wrap: wrap;
1115
- justify-content: space-between;
1116
-
1117
- .alcc-box {
1118
- display: flex;
1119
- flex-wrap: wrap;
1120
- color: #999999;
1121
-
1122
- .aci-owner {
1123
- margin-right: 20px;
1124
- }
1125
-
1126
- .aci-enterprise {
1127
- margin-right: 20px;
1128
- }
1129
- }
1130
- }
1131
- }
1132
- }
1133
-
1134
- .libang_list_cell_recognition {
1135
- background: #f2f6ff;
1136
- display: flex;
1137
- align-items: center;
1138
- justify-content: space-between;
1139
- padding: 3px;
1140
- margin-right: 5px;
1141
- margin-bottom: 5px;
1142
- border-radius: 5px;
1143
- cursor: pointer;
1144
- font-size: 12px;
1145
-
1146
- .libang_list_cell_left {
1147
- margin-right: 5px;
1148
- .libang_source_name {
1149
- display: flex;
1150
- align-items: center;
1151
- height: 20px;
1152
- margin-bottom: 2px;
1153
- img {
1154
- vertical-align: middle;
1155
- // width: 16px;
1156
- // height: 16px;
1157
- margin: 0 3px;
1158
- }
1159
-
1160
- .libang_title_from {
1161
- max-width: 226px;
1162
- overflow: hidden;
1163
- text-overflow: ellipsis;
1164
- white-space: nowrap;
1165
- line-height: 20px;
1166
- }
1167
- .upload_source {
1168
- flex: none;
1169
- }
1170
- }
1171
- .libang_source_floder {
1172
- max-width: calc(226px - 24px);
1173
- text-align: left;
1174
- color: #366aff;
1175
- overflow: hidden;
1176
- text-overflow: ellipsis;
1177
- white-space: nowrap;
1178
- cursor: pointer;
1179
- .iconfont {
1180
- margin: 0 5px;
1181
- font-size: 14px
1182
- }
1183
- }
1184
- }
1185
- i {
1186
- font-size: 12px;
1187
- }
1188
- }
1189
-
1190
- .ad-loadmore {
1191
- width: 100%;
1192
- height: 40px;
1193
- display: flex;
1194
- align-items: center;
1195
- justify-content: center;
1196
- // background: #FFFFFF;
1197
- color: #366aff;
1198
- font-size: 14px;
1199
- margin-top: 8px;
1200
- cursor: pointer;
1201
- }
1202
- }
1203
- }</style>
1
+ <!--
2
+ isLiBang 字段判断 是否为立邦主体
3
+ 立邦有自己单独的组件分支,但考虑到后期结构改动如果较大改动会不方便,所以还是在推荐知识消息中 在此判断是否是立邦主体。方便后期维护
4
+ -->
5
+ <template>
6
+ <div class="answer-docknowledge">
7
+ <div :class="['answer-docknowledge-header', msg.content.isKnowledgeSummary ? 'bgc' : '']">
8
+ <div v-if="msg.content.isKnowledgeSummary" class="tips">{{$t('dragonCommon.summaryGeneratedByAI')}}</div>
9
+ <!-- <div v-if="msg.content.type == 0" class="answer-text">
10
+ <template v-if="msg.content.renderType == 1">
11
+ <p v-html="msg.content.text"></p>
12
+ </template>
13
+ <template v-else>{{ msg.content.text }}</template>
14
+ </div> -->
15
+ <div class="answer-text">
16
+ <template v-if="msg.content.renderType == 1">
17
+ <p v-html="msg.content.text"></p>
18
+ </template>
19
+ <template v-else-if="msg.content.renderType == 2">
20
+ <!-- <markDownText :chainValues="msg.content.text" :isHistory="isHistory"></markDownText> -->
21
+ <markDownText
22
+ :chainValues="msg.content.text || ''"
23
+ :whetherRequestStream="msg.content.whetherRequestStream"
24
+ @sseOtherInfo="sseOtherInfo"
25
+ @answerDocKnowledgeFn="answerDocKnowledgeFn"
26
+ :streamRequestUrl="msg.content.streamRequestUrl"
27
+ :msgId="msg.id"
28
+ :isHistory="isHistory">
29
+ </markDownText>
30
+ </template>
31
+ <template v-else-if="msg.content.renderType == null">
32
+ <!-- <markDownText :chainValues="msg.content.text" :isHistory="isHistory"></markDownText> -->
33
+ <markDownText
34
+ :chainValues="msg.content.text || ''"
35
+ :whetherRequestStream="msg.content.whetherRequestStream"
36
+ @sseOtherInfo="sseOtherInfo"
37
+ @answerDocKnowledgeFn="answerDocKnowledgeFn"
38
+ :streamRequestUrl="msg.content.streamRequestUrl"
39
+ :msgId="msg.id"
40
+ :isHistory="isHistory">
41
+ </markDownText>
42
+ </template>
43
+ <template v-else>{{ msg.content.text }}</template>
44
+ </div>
45
+ <template v-if="isPC">
46
+ <div v-if="msg.content.images && msg.content.images.length != 0" class="answer-kn-image-box-pc">
47
+ <img v-for="(imageItem, imageItemIndex) in msg.content.images"
48
+ style="max-width: 230px;" :src="imageItem.url"
49
+ v-show="showImage || imageItemIndex < 2"
50
+ :key="imageItemIndex" alt @click="lookAttach(imageItem.url, imageItem, $event)" />
51
+ <div class="img-placeholder" v-if="msg.content.images.length > 2 && !showImage" @click="showImage = true">
52
+ +{{ msg.content.images.length - 2 }}
53
+ </div>
54
+ </div>
55
+ </template>
56
+ <template v-else>
57
+ <div v-if="msg.content.images && msg.content.images.length != 0" class="answer-kn-image-box-mobile">
58
+ <img v-for="(imageItem, imageItemIndex) in msg.content.images"
59
+ style="max-width: 230px;" :src="imageItem.url"
60
+ :key="imageItemIndex" alt @click="lookAttach(imageItem.url, imageItem, $event)" />
61
+ </div>
62
+ </template>
63
+ </div>
64
+ <template v-if="!isLiBang">
65
+ <div class="ad-list" :class="msg.content.type == 0 || msg.content.type == 2 ? 'ad-list-recognition' : ''">
66
+ <template v-if="msg.content.type == 1">
67
+ <div v-for="(item, itemIndex) in msg.content.list" :key="itemIndex"
68
+ :style="{ paddingBottom: itemIndex === msg.content.list.length - 1 ? 0 : '10px' }" class="ad-list-cell">
69
+ <div class="alc-title">
70
+ <div class="alc-box">
71
+ <div class="alc-source-left">
72
+ <span class="source-form">{{$t('dragonCommon.from')}}</span>
73
+ <img class="alc-title-icon" height="24px" width="24px" :src="getIconSrc(item)" alt=""
74
+ srcset="">
75
+ <span class="alc-title-from">{{ item.from }}</span>
76
+ </div>
77
+ </div>
78
+ <div v-html="item.introduction" v-if="!srcContentTypeIMG(item)" class="alc-box-introduction">
79
+ </div>
80
+ <div v-else class="alc-box-introduction">
81
+ <img :src="item.expiredUrl" alt="" @click="lookAttach(item.url, item, $event)">
82
+ </div>
83
+ <div v-if="item.previewImage" class="alc-box-introduction-previewImage">
84
+ <img :src="item.previewImage" alt=""
85
+ @click="lookAttach(item.previewImage, { url: item.previewImage }, $event)">
86
+ </div>
87
+ <div class="alc-updateTime">
88
+ <div v-show="docSource[item.source]" class="upload-source">
89
+ {{ docSource[item.source] }}
90
+ </div>
91
+ <div v-show="item.url" class="alc-content-text">
92
+ <span @click="lookAttach(item.url, item, $event)" class="aci-view">{{$t('dragonCommon.check')}} ></span>
93
+ </div>
94
+ </div>
95
+ </div>
96
+ <div class="alc-content" v-if="false">
97
+ <div v-if="msg.content.type == 1" class="alc-content-text">
98
+ {{ item.introduction }}
99
+ <span @click="lookAttach(item.url, item, $event)" class="aci-view">{{$t('dragonCommon.viewOriginal')}} ></span>
100
+ </div>
101
+ <span v-if="!isPC" class="alc-title-updateTime">{{$t('dragonCommon.lastUpdateTime')}}: {{ item.updateTime }}</span>
102
+ <div v-if="false" class="alc-content-info">
103
+ <div class="alcc-box">
104
+ <span class="aci-owner">{{$t('dragonCommon.owner')}}: {{ item.owner }}</span>
105
+ <span class="aci-enterprise">{{$t('dragonCommon.enterprise')}}: {{ item.enterprise }}</span>
106
+ <span class="aci-source">{{$t('dragonCommon.source')}}: {{ item.source }}</span>
107
+ </div>
108
+ </div>
109
+ </div>
110
+ </div>
111
+ </template>
112
+ <template v-if="msg.content.type == 0 || msg.content.type == 2">
113
+ <div v-for="(item, itemIndex) in msg.content.list" :key="itemIndex" class="ad-list-cell-recognition" :id="item.knowledgeId + knowledgeIndex">
114
+ <div class="alc-source-name" @click="lookAttach(item.url, item, $event)">
115
+ <img class="alc-title-icon" height="18px" width="18px" :src="getIconSrc(item)" alt srcset />
116
+ <span class="alc-title-from">{{ item.from }}</span>&nbsp;-&nbsp;
117
+ <div v-show="docSource[item.source]" class="upload-source">
118
+ {{ docSource[item.source] }}
119
+ </div>
120
+ <i class="iconfont guoran-right"></i>
121
+ </div>
122
+ </div>
123
+ </template>
124
+ <div class="ad-loadmore" v-if="loadMoreFlag" @click="lazyLoadKnowledegList">{{$t('dragonCommon.viewMore')}}</div>
125
+ </div>
126
+ </template>
127
+ <template v-if="isLiBang">
128
+ <div class="libang_list" :class="msg.content.type == 0 ? 'libang_list_recognition' : ''">
129
+ <template v-if="msg.content.type == 1">
130
+ <div v-for="(item, itemIndex) in msg.content.list" :key="itemIndex" class="libang_list_cell">
131
+ <div class="libang_title">
132
+ <div class="libang_box">
133
+ <div class="libang_source_left">
134
+ <span class="source-form">{{$t('dragonCommon.from')}}</span>
135
+ <img class="libang_title_icon" height="24px" width="24px" :src="getIconSrc(item)" alt=""
136
+ srcset="">
137
+ <span class="libang_title_from">{{ item.from }}</span>
138
+ </div>
139
+ </div>
140
+ <div v-html="item.introduction" v-if="!srcContentTypeIMG(item)" class="libang_box_introduction">
141
+ </div>
142
+ <div v-else class="libang_box_introduction">
143
+ <img :src="item.expiredUrl" alt="" @click="lookAttach(item.url, item, $event)">
144
+ </div>
145
+ <div v-if="item.previewImage" class="libang_box_introduction_previewImage">
146
+ <img :src="item.previewImage" alt=""
147
+ @click="lookAttach(item.previewImage, { url: item.previewImage }, $event)">
148
+ </div>
149
+ <div class="libang_updateTime">
150
+ <div class="libang_updataTime_left">
151
+ <div v-show="docSource[item.source]" class="upload-source">
152
+ {{ docSource[item.source] }}
153
+ </div>
154
+ <div class="libang_floder" @click.stop="clickFloder(item)">
155
+ <i class="iconfont guoran-tongyichicun-wenjianjia-zhankaizhuangtai--folderOpen"></i>
156
+ {{ item.folderName }}
157
+ </div>
158
+ </div>
159
+ <div v-show="item.url" class="libang_content_text">
160
+ <span @click="lookAttach(item.url, item, $event)" class="aci-view">{{$t('dragonCommon.check')}} ></span>
161
+ </div>
162
+ </div>
163
+ </div>
164
+ <!-- <div class="alc-content" v-if="false">
165
+ <div v-if="msg.content.type == 1" class="alc-content-text">
166
+ {{ item.introduction }}
167
+ <span @click="lookAttach(item.url, item, $event)" class="aci-view">查看原文 ></span>
168
+ </div>
169
+ <span v-if="!isPC" class="alc-title-updateTime">最后更新时间: {{ item.updateTime }}</span>
170
+ <div v-if="false" class="alc-content-info">
171
+ <div class="alcc-box">
172
+ <span class="aci-owner">所有者: {{ item.owner }}</span>
173
+ <span class="aci-enterprise">所属企业: {{ item.enterprise }}</span>
174
+ <span class="aci-source">文件来源: {{ item.source }}</span>
175
+ </div>
176
+ </div>
177
+ </div> -->
178
+ </div>
179
+ </template>
180
+ <template v-if="msg.content.type == 0 || msg.content.type == 2">
181
+ <div v-for="(item, itemIndex) in msg.content.list" :key="itemIndex"
182
+ class="libang_list_cell_recognition" @click="lookAttach(item.url, item, $event)" :id="item.knowledgeId + knowledgeIndex">
183
+ <div class="libang_list_cell_left" >
184
+ <div class="libang_source_name" >
185
+ <img class="libang_title_icon" height="18px" width="18px" :src="getIconSrc(item)" alt srcset />
186
+ <span class="libang_title_from">{{ item.from }}</span>&nbsp;-&nbsp;
187
+ <div v-show="docSource[item.source]" class="upload_source">
188
+ {{ docSource[item.source] }}
189
+ </div>
190
+ </div>
191
+ <div class="libang_source_floder" @click.stop="clickFloder(item)">
192
+ <i class="iconfont guoran-tongyichicun-wenjianjia-zhankaizhuangtai--folderOpen"></i>
193
+ {{ item.folderName }}
194
+ </div>
195
+ </div>
196
+ <i class="iconfont guoran-right" @click="lookAttach(item.url, item, $event)"></i>
197
+ </div>
198
+ </template>
199
+ <div class="ad-loadmore" v-if="loadMoreFlag" @click="lazyLoadKnowledegList">{{$t('dragonCommon.viewMore')}}</div>
200
+ </div>
201
+ </template>
202
+
203
+ <previewPdf ref="previewPdf" :url="previewHref" :previewOssPath="previewOssPath" :title="title"
204
+ :folderName="folderName" :folderUrl="folderUrl"
205
+ :sourceFileType="sourceFileType" officePreviewType="pdf" @previewToDialog="previewToDialog"
206
+ @recommendQues="recommendQues" @close="close" @open="open" :isHasChat="isHasChat"
207
+ :knowledgeId="previewKnowledgeId" :isLiBang="isLiBang" @previewClickFloder="previewClickFloder"></previewPdf>
208
+ </div>
209
+ </template>
210
+
211
+ <script>
212
+ /* eslint-disable */
213
+ import previewPdf from "./previewPdf";
214
+ import { isMobile } from "../assets/js/common";
215
+ import markDownText from "./markDownText.vue";
216
+ export default {
217
+ name: "answerDocknowledge",
218
+ components: { previewPdf, markDownText },
219
+ data () {
220
+ return {
221
+ isPC: true,
222
+ previewHref: "",
223
+ sourceFileType: '',
224
+ // docSource: {
225
+ // LOCAL_FILE: "来源于本地文件",
226
+ // CREATED_BY_ONESELF: "来源于自建知识",
227
+ // WECHAT: "来源于微信",
228
+ // AUTO_SYN_FROM_LOCAL_FILE: "自动同步于本地",
229
+ // YUQUE: "来源于语雀",
230
+ // CORP_LOCAL_FILE: '来源于企业知识库',
231
+ // FEISHU: '来源于飞书-云文档'
232
+ // },
233
+ docSource: {},
234
+ imageObj: {
235
+ PDF: 'pdf1',
236
+ pdf: 'pdf1',
237
+ TXT: 'txt1',
238
+ txt: 'txt1',
239
+ selfadd: 'selfadd1',
240
+ md: "md2",
241
+ html: 'selfadd1',
242
+ mode: "mode",
243
+ general: 'general',
244
+ word: "word1",
245
+ Word: "word1",
246
+ docx: "word1",
247
+ doc: "word1",
248
+ WORD: "word1",
249
+ Excel: 'excel1',
250
+ EXCEL: 'excel1',
251
+ excel: 'excel1',
252
+ PPT: 'ppt1',
253
+ ppt: 'ppt1',
254
+ pptx: 'ppt1',
255
+ img: "image1",
256
+ image: "image1",
257
+ video: "video",
258
+ audio: 'audio',
259
+ link: "link",
260
+ wechat: "wechat",
261
+ mp4: "video",
262
+ MP4: "video",
263
+ xlsx: "excel1",
264
+ SLSX: "excel1",
265
+ xls: "excel1",
266
+ XLS: "excel1",
267
+ jpg: "image1",
268
+ JPG: "image1",
269
+ jpeg: "image1",
270
+ JPEG: "image1",
271
+ png: "image1",
272
+ PNG: "image1",
273
+ webp: "image1",
274
+ WEBP: "image1",
275
+ gif: "image1",
276
+ GIF: "image1",
277
+ svg: "image1",
278
+ SVG: "image1",
279
+ bmp: "image1",
280
+ BMP: "image1",
281
+ avi: "video",
282
+ AVI: "video",
283
+ mov: "video",
284
+ MOV: "video",
285
+ rmvb: "video",
286
+ RMVB: "video",
287
+ wav: "audio",
288
+ WAV: "audio",
289
+ mp3: "audio",
290
+ MP3: "audio",
291
+ yqhtml: "yqhtml",
292
+ feishuhtml: "feishuhtml"
293
+ },
294
+ allKnowledgeList: [],
295
+ loadMoreFlag: false,
296
+ title: '',
297
+ folderName: '',
298
+ folderUrl: '',
299
+ previewKnowledgeId: "",
300
+ previewKnowledge: {},
301
+ previewOssPath: "",
302
+ showImage: false
303
+ }
304
+ },
305
+ props: ['msg', 'isAskLightning', 'isMessageRecord', "isApp", "isHasChat", "activeKnowledgeId", "isLiBang","language","isHistory","knowledgeIndex"],
306
+ beforeMounted () {
307
+ },
308
+ watch: {
309
+ // msg: {
310
+ // handler (n) {
311
+ // console.log(n, 'answerDocknowledge');
312
+ // n.content.list.forEach(element => {
313
+ // console.log(this.imageObj[element.format], 1111);
314
+ // element.src = 'https://static.guoranbot.com/cdn-office-website/askbot_doc/' + this.imageObj[element.format] + '.png';
315
+ // if ((element.format === "txt" || element.format === "html") && element.source === "WECHAT") {
316
+ // element.src = 'https://static.guoranbot.com/cdn-office-website/askbot_doc/wechat.png';
317
+ // }
318
+ // });
319
+ // },
320
+ // deep: true,
321
+ // immediate: true
322
+ // }
323
+ },
324
+ created () {
325
+ // var system = {};
326
+ // system.pingtai = /(Win32|Win16|WinCE|Mac68K|MacIntel|MacIntel|MacPPC|Linux mips64)/i.test(navigator.platform);
327
+ // if (system.pingtai) {
328
+ // //电脑
329
+ // this.isPC = true;
330
+ // } else {
331
+ // //手机
332
+ // this.isPC = false;
333
+ // }
334
+ this.isPC = !isMobile()
335
+ // this.msg.content.list.forEach(element => {
336
+ // console.log(this.imageObj[element.format],1111);
337
+ // element.src = 'https://static.guoranbot.com/cdn-office-website/askbot_doc/' + this.imageObj[element.format] + '.png';
338
+ // if ((element.format === "txt" || element.format === "html") && element.source === "WECHAT") {
339
+ // element.src = 'https://static.guoranbot.com/cdn-office-website/askbot_doc/wechat.png';
340
+ // }
341
+ // });
342
+ },
343
+ mounted () {
344
+ this.$i18n.locale = sessionStorage.getItem("systemLanguage") || 'cn';
345
+ this.docSource = {
346
+ LOCAL_FILE: this.$t('dragonCommon.personalknowledge'),
347
+ CREATED_BY_ONESELF: this.$t('dragonCommon.personalknowledge'),
348
+ WECHAT: this.$t('dragonCommon.personalknowledge'),
349
+ AUTO_SYN_FROM_LOCAL_FILE: this.$t('dragonCommon.personalknowledge'),
350
+ YUQUE: this.$t('dragonCommon.enterpriseknowledge'),
351
+ CORP_LOCAL_FILE: this.$t('dragonCommon.enterpriseknowledge'),
352
+ FEISHU: this.$t('dragonCommon.enterpriseknowledge'),
353
+ }
354
+ console.log(this.msg.content, 'this.msg.content');
355
+ // if(this.msg.content.type == 1) {
356
+
357
+ // }
358
+ if (this.msg.content.list && this.msg.content.list.length > 0) {
359
+ this.loadMoreFlag = true
360
+ this.allKnowledgeList = JSON.parse(JSON.stringify(this.msg.content.list))
361
+ // console.log(this.allKnowledgeList.length, 'this.allKnowledgeList');
362
+ this.msg.content.list = []
363
+ this.lazyLoadKnowledegList()
364
+ }
365
+ },
366
+ methods: {
367
+ answerDocKnowledgeFn(){
368
+ console.log(
369
+ "answerDocKnowledgeFn 2"
370
+ );
371
+ this.$emit('answerDocKnowledgeFn');
372
+ },
373
+ // 知识类型消息 推荐、关联文档、图片
374
+ sseOtherInfo(msgId, eventId, data){
375
+ if (eventId === "matched") {
376
+ console.log("matched: ", this.msg.content.type);
377
+
378
+ if (JSON.parse(data.content).length > 0) {
379
+ this.$set(this.msg.content, "list", JSON.parse(data.content));
380
+ }
381
+ } else {
382
+ this.$emit("sseOtherInfo",msgId, eventId, data);
383
+ }
384
+ },
385
+ getIconSrc (element) {
386
+ if ((element.format === "txt" || element.format === "html") && element.source === "WECHAT") {
387
+ return require("../assets/image/filtType/wechat.png")
388
+ } else {
389
+ return require("../assets/image/filtType/" + this.imageObj[element.format] + '.png')
390
+
391
+ }
392
+ },
393
+ //预览图片
394
+ lookAttach (url, item, event) {
395
+ // console.log(item.knowledgeId);
396
+ // this.$http.get("/knowledge-api/internal/knowledgeBaseStructure/" + "642ffbccde420e2772f7787b")
397
+ // debugger
398
+ event.preventDefault();
399
+ if (this.isAskLightning == 1 && !this.isApp) {
400
+ window.parent.postMessage({
401
+ data: "bot_preview",
402
+ item: JSON.stringify(item),
403
+ url: url
404
+ }, "*");
405
+ } else {
406
+ // if (isMobile()) {
407
+ // this.$refs.previewPdf.drawer = true;
408
+ // this.$refs.previewPdf.previewShowPopup = false;
409
+ // } else {
410
+ // this.$refs.previewPdf.drawer = false;
411
+ // }
412
+ //该事件是为了打开新的弹框时关闭上一个弹框
413
+ window.parent.postMessage({
414
+ type: "close_drawer",
415
+ data:this.knowledgeIndex
416
+ }, "*");
417
+ this.title = item.from || item.name
418
+ this.folderName = item.folderName
419
+ this.folderUrl = item.folderUrl
420
+ this.previewKnowledge = item;
421
+ this.previewKnowledgeId = item.knowledgeId
422
+ this.$refs.previewPdf.previewShowPopup = false;
423
+ this.$refs.previewPdf.drawer = false;
424
+ this.previewOssPath = url;
425
+ let index = url.lastIndexOf('?')
426
+ let type = ''
427
+ let httpUrl = '/knowledge-api/knowledge/getTemporaryCertificate'
428
+ if (index !== -1) {
429
+ url = url.substring(0, index)
430
+ type = this.fileType(url)
431
+ } else {
432
+ type = this.fileType(url)
433
+ }
434
+ if (type === '' || type === 'OTHER' || type == 'IMAGE') {
435
+ httpUrl = httpUrl += '?needEncrypt=true'
436
+ } else {
437
+ httpUrl = httpUrl += '?needEncrypt=false'
438
+ }
439
+ this.$refs.previewPdf.getOssPath(url);
440
+ this.$http.post(httpUrl, {
441
+ "fileInOssPath": url
442
+ }).then(res => {
443
+ if (res.data.code == '0') {
444
+ this.previewHref = res.data.data;
445
+ this.sourceFileType = url.substring(url.lastIndexOf('.'))
446
+ let isOhmPc = sessionStorage.getItem('isOhmPc')
447
+ if (isMobile() || isOhmPc == 'true') {
448
+ this.$refs.previewPdf.drawer = true;
449
+ this.$refs.previewPdf.previewShowPopup = true;
450
+ } else {
451
+ this.$refs.previewPdf.previewShowPopup = false;
452
+ this.$refs.previewPdf.drawer = true;
453
+ }
454
+ //聊一聊按钮的选中状态
455
+ if (this.activeKnowledgeId == item.knowledgeId) {
456
+ this.$refs.previewPdf.previewKnowledgeId = this.activeKnowledgeId
457
+ } else {
458
+ this.$refs.previewPdf.previewKnowledgeId = ""
459
+ }
460
+ this.$refs.previewPdf.fileType = type
461
+ this.$refs.previewPdf.tagIds = item.tagIds;
462
+ if (item.tagIds && item.tagIds.length > 0){
463
+ this.$refs.previewPdf.getLocationInfo();
464
+ }
465
+ this.$refs.previewPdf.isMessageRecord = this.isMessageRecord ? true : false;
466
+ let index = url.indexOf("?");
467
+ let newFileInOssPath = url;
468
+ if (index !== -1) {
469
+ newFileInOssPath = url.substring(0, url.indexOf("?"))
470
+ }
471
+ let fileName = newFileInOssPath.substring(newFileInOssPath.lastIndexOf('.'))
472
+ if (fileName === '.doc' || fileName === '.docx' || fileName === '.txt' || fileName === '.html') {
473
+ this.$refs.previewPdf.fileName = fileName;
474
+ } else {
475
+ this.$refs.previewPdf.fileName = '';
476
+ }
477
+ if (item.tagIds && item.tagIds.length != 0 && this.$refs.previewPdf.newFileType !== 'PPT') {
478
+ this.$refs.previewPdf.loading = false
479
+ return
480
+ }
481
+ this.$nextTick(() => {
482
+ if (item.source == 'CREATED_BY_ONESELF' || type === 'HTML') {
483
+ this.$refs.previewPdf.getBolb(item)
484
+ }
485
+ this.$refs.previewPdf.loadIframe(item)
486
+ this.$refs.previewPdf.showSummary = false;
487
+ })
488
+ }
489
+ })
490
+ }
491
+ },
492
+ open () {
493
+ this.$emit('openPreviewDialog')
494
+ },
495
+ close () {
496
+ this.$emit('closePreviewDialog')
497
+ },
498
+ fileType (url) {
499
+ const fileType = url.substring(url.lastIndexOf('.'));
500
+ if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.MOV' || fileType === '.MOVC' || fileType === '.mov' || fileType === '.movc' || fileType === '.mav' || fileType === '.MAV' || fileType == '.mp3' || fileType == '.MP3' || fileType === '.wav') {
501
+ return 'VIDEO'
502
+ } else if (fileType === '.html') {
503
+ return 'HTML'
504
+ } else if (fileType === '.png' || fileType === '.jpg' || fileType === '.jpeg') {
505
+ return 'IMAGE'
506
+ } else {
507
+ return 'OTHER'
508
+ }
509
+ },
510
+ srcContentTypeIMG (item) {
511
+ let url = item.url || '';
512
+ const type = url.substring(url.lastIndexOf('.'));
513
+ if (type === '.jpg' || type === '.jpeg' || type === '.png' || type === '.gif') {
514
+ this.getSrc(item)
515
+ return true
516
+ } else {
517
+ return false
518
+ }
519
+ },
520
+ getSrc (item) {
521
+ // let imgurl = ''
522
+ this.$http.post(
523
+ '/knowledge-api/temporary-certificate/or-origin?expired=30',
524
+ item.url,
525
+ {
526
+ headers: {
527
+ "Content-Type": "application/json",
528
+ },
529
+ }).then(res => {
530
+ console.log(res, '=====');
531
+ // imgurl = await res.bodyText
532
+ this.$set(item, 'expiredUrl', res.data ? res.data : res.bodyText)
533
+ // return res.data
534
+ })
535
+ // return imgurl
536
+ },
537
+ lazyLoadKnowledegList () {
538
+ if (this.allKnowledgeList.length !== 0) {
539
+ let arr = this.allKnowledgeList.splice(0, 5)
540
+ if (arr.length < 5) {
541
+ this.loadMoreFlag = false
542
+ this.msg.content.list = [...this.msg.content.list, ...arr]
543
+ return
544
+ }
545
+ if (this.allKnowledgeList.length == 0) {
546
+ this.loadMoreFlag = false
547
+ }
548
+ this.msg.content.list = [...this.msg.content.list, ...arr]
549
+ return
550
+ }
551
+ },
552
+ previewToDialog (flag) {
553
+ if (!flag) {
554
+ this.$refs.previewPdf.previewKnowledgeId = ""
555
+ } else {
556
+ this.$refs.previewPdf.previewKnowledgeId = this.previewKnowledgeId
557
+ }
558
+ this.$emit('previewToDialog', flag, this.previewKnowledgeId, this.previewKnowledge)
559
+ },
560
+ clearKnowledgeId () {
561
+ this.previewKnowledgeId = "";
562
+ },
563
+ recommendQues (item, knowledgeId) {
564
+ this.$emit('recommendQues', item, knowledgeId)
565
+ },
566
+ clickFloder (item) {
567
+ this.$emit('clickFloder', item)
568
+ },
569
+ previewClickFloder () {
570
+ let item = null
571
+ this.msg.content.list.forEach(element => {
572
+ if (element.knowledgeId == this.previewKnowledgeId) {
573
+ item = element
574
+ }
575
+ });
576
+ this.$emit('clickFloder', item)
577
+ }
578
+ }
579
+ }
580
+ </script>
581
+
582
+ <style scoped lang="less">
583
+ .answer-docknowledge {
584
+ min-width: 100px;
585
+ background: #ffffff;
586
+
587
+ .answer-docknowledge-header {
588
+ .tips {
589
+ width: 154px;
590
+ height: 22px;
591
+ background: #366aff;
592
+ border-radius: 5px;
593
+ text-align: center;
594
+ line-height: 22px;
595
+ color: #fff;
596
+ font-size: 12px;
597
+ margin-bottom: 7px;
598
+ }
599
+
600
+ .answer-text {
601
+ // font-size: 13px;
602
+ text-align: left;
603
+ line-height: 25px;
604
+ padding: 0px 0px 12px 0px;
605
+
606
+ .aci-view {
607
+ // font-size: 13px;
608
+ display: inline-block;
609
+ // margin-left: 5px;
610
+ color: #366aff;
611
+ cursor: pointer;
612
+ }
613
+ }
614
+
615
+ &.bgc {
616
+ padding: 10px;
617
+ background: #eef1ff;
618
+ border-radius: 10px;
619
+ margin-bottom: 16px;
620
+
621
+ .answer-text {
622
+ padding: 0;
623
+ }
624
+ }
625
+
626
+ // .answer-kn-image-box {
627
+ // margin-bottom: 10px;
628
+ // }
629
+ .answer-kn-image-box-pc {
630
+ margin-bottom: 10px;
631
+ display: flex;
632
+ width: 100%;
633
+ overflow: hidden;
634
+ overflow-x: auto;
635
+ img {
636
+ width: 120px;
637
+ height: 120px;
638
+ border-radius: 5px;
639
+ object-fit: cover;
640
+ margin-right: 10px;
641
+ margin-bottom: 10px;
642
+ cursor: pointer;
643
+ flex: none;
644
+ }
645
+ .img-placeholder {
646
+ width: 120px;
647
+ height: 120px;
648
+ border-radius: 5px;
649
+ margin-right: 10px;
650
+ margin-bottom: 10px;
651
+ cursor: pointer;
652
+ border: 1px dashed #d9d9d9;
653
+ color: #366aff;
654
+ flex: none;
655
+ display: flex;
656
+ align-items: center;
657
+ justify-content: center;
658
+ font-size: 22px;
659
+ }
660
+ .img-placeholder:hover {
661
+ border: 1px dashed #366aff;
662
+ }
663
+ }
664
+ .answer-kn-image-box-mobile {
665
+ margin-bottom: 10px;
666
+ display: flex;
667
+ width: 100%;
668
+ overflow: hidden;
669
+ overflow-x: auto;
670
+ img {
671
+ width: 35vw;
672
+ height: 35vw;
673
+ border-radius: 5px;
674
+ object-fit: cover;
675
+ margin-right: 10px;
676
+ margin-bottom: 10px;
677
+ flex: none;
678
+ }
679
+ }
680
+ }
681
+
682
+
683
+ .ad-list-recognition {
684
+ display: flex;
685
+ align-items: center;
686
+ flex-wrap: wrap;
687
+ }
688
+
689
+ .libang_list_recognition {
690
+ display: flex;
691
+ align-items: center;
692
+ flex-wrap: wrap;
693
+ }
694
+
695
+ .ad-list {
696
+ .ad-list-cell {
697
+ border-top: solid 1px #eeeeee;
698
+ padding: 10px 0 10px;
699
+
700
+ .alc-title {
701
+ display: flex;
702
+ flex-wrap: wrap;
703
+ align-items: center;
704
+ justify-content: space-between;
705
+ line-height: 16px;
706
+
707
+ .alc-box {
708
+ display: flex;
709
+ align-items: center;
710
+ justify-content: space-between;
711
+ // font-size: 12px;
712
+ width: 100%;
713
+
714
+ .alc-source-left {
715
+ display: flex;
716
+ align-items: center;
717
+
718
+ .source-form {
719
+ width: 34px;
720
+ flex: none;
721
+ color: #a9b3c6;
722
+ }
723
+ }
724
+
725
+ .alc-content-text {
726
+ width: 55px;
727
+ flex: none;
728
+
729
+ .aci-view {
730
+ color: #366aff;
731
+ cursor: pointer;
732
+ }
733
+ }
734
+
735
+ .alc-title-from {
736
+ line-height: 22px;
737
+ word-break: break-all !important;
738
+ text-align: left;
739
+ flex: auto;
740
+ display: flex;
741
+ justify-content: flex-start;
742
+ }
743
+ .upload-source {
744
+ // flex: none;
745
+ }
746
+ }
747
+
748
+ .alc-box-introduction {
749
+ overflow: hidden;
750
+ text-overflow: ellipsis;
751
+ display: -webkit-box;
752
+ -webkit-line-clamp: 3;
753
+ -webkit-box-orient: vertical;
754
+ margin-top: 10px;
755
+ color: #616161;
756
+ // font-size: 12px;
757
+ line-height: 24px;
758
+ text-align: left;
759
+
760
+ img {
761
+ width: 50px;
762
+ height: 50px;
763
+ margin: 10px;
764
+ cursor: pointer;
765
+ }
766
+ }
767
+
768
+ .alc-box-introduction-previewImage {
769
+ width: 100%;
770
+ display: block;
771
+ overflow: hidden;
772
+ text-overflow: ellipsis;
773
+ display: -webkit-box;
774
+ -webkit-line-clamp: 3;
775
+ -webkit-box-orient: vertical;
776
+ margin-top: 10px;
777
+ color: #616161;
778
+ // font-size: 12px;
779
+ line-height: 24px;
780
+ text-align: left;
781
+
782
+ img {
783
+ max-width: 300px;
784
+ width: 100%;
785
+ max-height: 150px;
786
+ margin: 10px;
787
+ cursor: pointer;
788
+ }
789
+ }
790
+
791
+ .alc-updateTime {
792
+ display: flex;
793
+ align-items: center;
794
+ justify-content: space-between;
795
+ font-size: 13px;
796
+ width: 100%;
797
+ margin-top: 10px;
798
+
799
+ .upload-source {
800
+ flex: none;
801
+ height: 18px;
802
+ line-height: 18px;
803
+ background: #e9f9f8;
804
+ border: 1px solid #aff2cd;
805
+ border-radius: 2px;
806
+ display: flex;
807
+ align-items: center;
808
+ justify-content: center;
809
+ padding: 0 8px;
810
+ color: #00c2bb;
811
+ }
812
+
813
+ .time {
814
+ color: #999999;
815
+ margin-left: 10px;
816
+ }
817
+
818
+ .alc-content-text {
819
+ color: #366aff;
820
+ cursor: pointer;
821
+ }
822
+ }
823
+
824
+ .alc-title-icon {
825
+ margin: 0 2px;
826
+ width: 18px;
827
+ height: 18px;
828
+ flex: none;
829
+ }
830
+
831
+ .alc-title-updateTime {
832
+ text-align: right;
833
+ color: #999999;
834
+ // font-size: 13px;
835
+ }
836
+ }
837
+
838
+ .alc-content {
839
+ .alc-title-updateTime {
840
+ margin-top: 6px;
841
+ display: block;
842
+ text-align: right;
843
+ color: #999999;
844
+ // font-size: 13px;
845
+ }
846
+
847
+ .alc-content-text {
848
+ margin-bottom: 6px;
849
+ width: 55px;
850
+ flex: none;
851
+
852
+ .aci-view {
853
+ display: inline-block;
854
+ margin-left: 30px;
855
+ color: #366aff;
856
+ cursor: pointer;
857
+ }
858
+ }
859
+
860
+ .alc-content-info {
861
+ display: flex;
862
+ flex-wrap: wrap;
863
+ justify-content: space-between;
864
+
865
+ .alcc-box {
866
+ display: flex;
867
+ flex-wrap: wrap;
868
+ color: #999999;
869
+
870
+ .aci-owner {
871
+ margin-right: 20px;
872
+ }
873
+
874
+ .aci-enterprise {
875
+ margin-right: 20px;
876
+ }
877
+ }
878
+ }
879
+ }
880
+ }
881
+
882
+ .ad-list-cell-recognition {
883
+ max-width: 270px;
884
+ margin-right: 12px;
885
+ font-size: 12px;
886
+ .alc-source-name {
887
+ flex: none;
888
+ padding: 3px;
889
+ margin-right: 5px;
890
+ margin-bottom: 5px;
891
+ background: #f2f6ff;
892
+ border-radius: 5px;
893
+ display: flex;
894
+ align-items: center;
895
+ justify-content: space-between;
896
+ cursor: pointer;
897
+
898
+ img {
899
+ vertical-align: middle;
900
+ // width: 16px;
901
+ // height: 16px;
902
+ margin: 0 3px 0 5px;
903
+ }
904
+
905
+ .alc-title-from {
906
+ // margin-right: 5px;
907
+ max-width: 240px;
908
+ overflow: hidden;
909
+ text-overflow: ellipsis;
910
+ white-space: nowrap;
911
+ }
912
+
913
+ .upload-source {
914
+ margin-right: 5px;
915
+ flex: none;
916
+ }
917
+
918
+ i {
919
+ font-size: 12px;
920
+ }
921
+ }
922
+ }
923
+
924
+ .ad-loadmore {
925
+ width: 100%;
926
+ height: 40px;
927
+ display: flex;
928
+ align-items: center;
929
+ justify-content: center;
930
+ // background: #FFFFFF;
931
+ color: #366aff;
932
+ font-size: 14px;
933
+ margin-top: 8px;
934
+ cursor: pointer;
935
+ }
936
+ }
937
+
938
+ .libang_list {
939
+ .libang_list_cell {
940
+ border-top: solid 1px #eeeeee;
941
+ padding: 10px 0 10px;
942
+ font-size: 12px;
943
+ .libang_title {
944
+ display: flex;
945
+ flex-wrap: wrap;
946
+ align-items: center;
947
+ justify-content: space-between;
948
+ line-height: 16px;
949
+
950
+ .libang_box {
951
+ display: flex;
952
+ align-items: center;
953
+ justify-content: space-between;
954
+ // font-size: 12px;
955
+ width: 100%;
956
+
957
+ .libang_source_left {
958
+ display: flex;
959
+ align-items: center;
960
+
961
+ .source-form {
962
+ width: 34px;
963
+ flex: none;
964
+ color: #a9b3c6;
965
+ }
966
+ }
967
+
968
+ .alc-content-text {
969
+ width: 55px;
970
+ flex: none;
971
+
972
+ .aci-view {
973
+ color: #366aff;
974
+ cursor: pointer;
975
+ }
976
+ }
977
+
978
+ .libang_title_from {
979
+ line-height: 22px;
980
+ word-break: break-all !important;
981
+ text-align: left;
982
+ flex: auto;
983
+ display: flex;
984
+ justify-content: flex-start;
985
+ }
986
+ }
987
+
988
+ .libang_box_introduction {
989
+ overflow: hidden;
990
+ text-overflow: ellipsis;
991
+ display: -webkit-box;
992
+ -webkit-line-clamp: 3;
993
+ -webkit-box-orient: vertical;
994
+ margin-top: 10px;
995
+ color: #616161;
996
+ // font-size: 12px;
997
+ line-height: 24px;
998
+ text-align: left;
999
+
1000
+ img {
1001
+ width: 50px;
1002
+ height: 50px;
1003
+ margin: 10px;
1004
+ cursor: pointer;
1005
+ }
1006
+ }
1007
+
1008
+ .libang_box_introduction_previewImage {
1009
+ overflow: hidden;
1010
+ text-overflow: ellipsis;
1011
+ display: -webkit-box;
1012
+ -webkit-line-clamp: 3;
1013
+ -webkit-box-orient: vertical;
1014
+ margin-top: 10px;
1015
+ color: #616161;
1016
+ // font-size: 12px;
1017
+ line-height: 24px;
1018
+ text-align: left;
1019
+
1020
+ img {
1021
+ max-width: 300px;
1022
+ width: 100%;
1023
+ max-height: 150px;
1024
+ margin: 10px;
1025
+ cursor: pointer;
1026
+ }
1027
+ }
1028
+
1029
+ .libang_updateTime {
1030
+ display: flex;
1031
+ align-items: center;
1032
+ justify-content: space-between;
1033
+ font-size: 13px;
1034
+ width: 100%;
1035
+ margin-top: 10px;
1036
+ .libang_updataTime_left {
1037
+ width: calc(100% - 40px);
1038
+ display: flex;
1039
+ align-items: center;
1040
+ .upload-source {
1041
+ flex: none;
1042
+ height: 18px;
1043
+ line-height: 18px;
1044
+ background: #e9f9f8;
1045
+ border: 1px solid #aff2cd;
1046
+ border-radius: 2px;
1047
+ display: flex;
1048
+ align-items: center;
1049
+ justify-content: center;
1050
+ padding: 0 8px;
1051
+ color: #00c2bb;
1052
+ }
1053
+ .libang_floder {
1054
+ width:calc(100% - 90px);
1055
+ // margin-left: 10px;
1056
+ overflow: hidden;
1057
+ text-overflow: ellipsis;
1058
+ white-space: nowrap;
1059
+ color: #366aff;
1060
+ cursor: pointer;
1061
+ text-align: left;
1062
+ i {
1063
+ margin-left: 8px;
1064
+ }
1065
+ }
1066
+ }
1067
+ .libang_content_text {
1068
+ color: #366aff;
1069
+ cursor: pointer;
1070
+ }
1071
+ .time {
1072
+ color: #999999;
1073
+ margin-left: 10px;
1074
+ }
1075
+ }
1076
+ .alc-title-icon {
1077
+ margin: 0 2px;
1078
+ width: 18px;
1079
+ height: 18px;
1080
+ flex: none;
1081
+ }
1082
+
1083
+ .alc-title-updateTime {
1084
+ text-align: right;
1085
+ color: #999999;
1086
+ // font-size: 13px;
1087
+ }
1088
+ }
1089
+
1090
+ .alc-content {
1091
+ .alc-title-updateTime {
1092
+ margin-top: 6px;
1093
+ display: block;
1094
+ text-align: right;
1095
+ color: #999999;
1096
+ // font-size: 13px;
1097
+ }
1098
+
1099
+ .alc-content-text {
1100
+ margin-bottom: 6px;
1101
+ width: 55px;
1102
+ flex: none;
1103
+
1104
+ .aci-view {
1105
+ display: inline-block;
1106
+ margin-left: 30px;
1107
+ color: #366aff;
1108
+ cursor: pointer;
1109
+ }
1110
+ }
1111
+
1112
+ .alc-content-info {
1113
+ display: flex;
1114
+ flex-wrap: wrap;
1115
+ justify-content: space-between;
1116
+
1117
+ .alcc-box {
1118
+ display: flex;
1119
+ flex-wrap: wrap;
1120
+ color: #999999;
1121
+
1122
+ .aci-owner {
1123
+ margin-right: 20px;
1124
+ }
1125
+
1126
+ .aci-enterprise {
1127
+ margin-right: 20px;
1128
+ }
1129
+ }
1130
+ }
1131
+ }
1132
+ }
1133
+
1134
+ .libang_list_cell_recognition {
1135
+ background: #f2f6ff;
1136
+ display: flex;
1137
+ align-items: center;
1138
+ justify-content: space-between;
1139
+ padding: 3px;
1140
+ margin-right: 5px;
1141
+ margin-bottom: 5px;
1142
+ border-radius: 5px;
1143
+ cursor: pointer;
1144
+ font-size: 12px;
1145
+
1146
+ .libang_list_cell_left {
1147
+ margin-right: 5px;
1148
+ .libang_source_name {
1149
+ display: flex;
1150
+ align-items: center;
1151
+ height: 20px;
1152
+ margin-bottom: 2px;
1153
+ img {
1154
+ vertical-align: middle;
1155
+ // width: 16px;
1156
+ // height: 16px;
1157
+ margin: 0 3px;
1158
+ }
1159
+
1160
+ .libang_title_from {
1161
+ max-width: 226px;
1162
+ overflow: hidden;
1163
+ text-overflow: ellipsis;
1164
+ white-space: nowrap;
1165
+ line-height: 20px;
1166
+ }
1167
+ .upload_source {
1168
+ flex: none;
1169
+ }
1170
+ }
1171
+ .libang_source_floder {
1172
+ max-width: calc(226px - 24px);
1173
+ text-align: left;
1174
+ color: #366aff;
1175
+ overflow: hidden;
1176
+ text-overflow: ellipsis;
1177
+ white-space: nowrap;
1178
+ cursor: pointer;
1179
+ .iconfont {
1180
+ margin: 0 5px;
1181
+ font-size: 14px
1182
+ }
1183
+ }
1184
+ }
1185
+ i {
1186
+ font-size: 12px;
1187
+ }
1188
+ }
1189
+
1190
+ .ad-loadmore {
1191
+ width: 100%;
1192
+ height: 40px;
1193
+ display: flex;
1194
+ align-items: center;
1195
+ justify-content: center;
1196
+ // background: #FFFFFF;
1197
+ color: #366aff;
1198
+ font-size: 14px;
1199
+ margin-top: 8px;
1200
+ cursor: pointer;
1201
+ }
1202
+ }
1203
+ }</style>