askbot-dragon 1.5.78-beta → 1.5.78

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