askbot-dragon 1.2.9 → 1.3.11
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.
- package/README.md +27 -27
- package/babel.config.js +6 -6
- package/dragon.iml +7 -7
- package/package.json +56 -56
- package/public/index.html +43 -43
- package/src/App.vue +31 -31
- package/src/api/index.js +1 -1
- package/src/api/mock.http +2 -2
- package/src/api/requestUrl.js +185 -185
- package/src/assets/js/AliyunlssUtil.js +92 -92
- package/src/assets/js/Base64Util.js +22 -22
- package/src/assets/js/common.js +11 -11
- package/src/assets/js/script.js +36 -36
- package/src/assets/less/common.css +6773 -6773
- package/src/assets/less/converSationContainer/common.less +191 -191
- package/src/assets/less/converSationContainer/converSatonContainer.less +493 -493
- package/src/assets/less/iconfont.css +37 -37
- package/src/assets/less/ticketMessage.less +211 -211
- package/src/components/ActionAlertIframe.vue +112 -112
- package/src/components/AiGuide.vue +467 -467
- package/src/components/AnswerDocknowledge.vue +362 -362
- package/src/components/AnswerVoice.vue +256 -0
- package/src/components/AskIFrame.vue +15 -15
- package/src/components/ConversationContainer.vue +4024 -4011
- package/src/components/FileType.vue +86 -86
- package/src/components/Message.vue +27 -27
- package/src/components/actionSatisfaction.vue +107 -107
- package/src/components/actionSendToBot.vue +62 -62
- package/src/components/answerDissatisfaction.vue +62 -62
- package/src/components/answerRadio.vue +76 -76
- package/src/components/ask-components/DissatisfactionOptions.vue +57 -57
- package/src/components/ask-components/Msgloading.vue +37 -37
- package/src/components/ask-components/SatisfactionV2.vue +15 -15
- package/src/components/askVideo.vue +138 -138
- package/src/components/assetDetails.vue +370 -370
- package/src/components/assetMessage.vue +228 -228
- package/src/components/associationIntention.vue +323 -323
- package/src/components/attachmentPreview.vue +90 -90
- package/src/components/botActionSatisfactor.vue +68 -68
- package/src/components/chatContent.vue +513 -513
- package/src/components/feedBack.vue +136 -136
- package/src/components/fielListView.vue +344 -344
- package/src/components/file/AliyunOssComponents.vue +108 -108
- package/src/components/formTemplate.vue +3363 -3363
- package/src/components/loadingProcess.vue +164 -164
- package/src/components/message/ActionAlertIframe.vue +112 -112
- package/src/components/message/ShopMessage.vue +164 -164
- package/src/components/message/TextMessage.vue +924 -924
- package/src/components/message/TicketMessage.vue +177 -177
- package/src/components/message/swiper/index.js +4 -4
- package/src/components/message/swiper/ticketSwiper.vue +503 -503
- package/src/components/message/swiper/ticketSwiperItem.vue +61 -61
- package/src/components/msgLoading.vue +231 -231
- package/src/components/myPopup.vue +70 -70
- package/src/components/popup.vue +227 -227
- package/src/components/previewDoc.vue +108 -112
- package/src/components/previewPdf.vue +205 -205
- package/src/components/receiverMessagePlatform.vue +65 -65
- package/src/components/recommend.vue +89 -89
- package/src/components/selector/hOption.vue +20 -20
- package/src/components/selector/hSelector.vue +199 -199
- package/src/components/selector/hWrapper.vue +216 -216
- package/src/components/senderMessagePlatform.vue +50 -50
- package/src/components/source/BotMessage.vue +24 -24
- package/src/components/source/CustomMessage.vue +24 -24
- package/src/components/test.vue +260 -260
- package/src/components/tree.vue +294 -294
- package/src/components/utils/AliyunIssUtil.js +72 -72
- package/src/components/utils/ckeditor.js +155 -155
- package/src/components/utils/ckeditorImageUpload/command.js +109 -109
- package/src/components/utils/ckeditorImageUpload/editing.js +11 -11
- package/src/components/utils/ckeditorImageUpload/plugin-image.js +11 -11
- package/src/components/utils/ckeditorImageUpload/toolbar-ui.js +40 -40
- package/src/components/utils/ckeditorfileUpload/common.js +111 -111
- package/src/components/utils/ckeditorfileUpload/editing.js +11 -11
- package/src/components/utils/ckeditorfileUpload/plugin_file.js +11 -11
- package/src/components/utils/ckeditorfileUpload/toolbar_ui.js +34 -34
- package/src/components/utils/format_date.js +25 -25
- package/src/components/utils/index.js +6 -6
- package/src/components/utils/math_utils.js +29 -29
- package/src/components/voiceComponent.vue +119 -119
- package/src/main.js +60 -60
- package/vue.config.js +55 -55
|
@@ -1,363 +1,363 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="answer-docknowledge">
|
|
3
|
-
<div v-if="msg.content.type == 0" class="answer-text">{{ msg.content.text }}</div>
|
|
4
|
-
<div v-if="msg.content.type == 1" class="answer-text">{{ msg.content.text }}</div>
|
|
5
|
-
<div class="ad-list">
|
|
6
|
-
<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">
|
|
7
|
-
<div class="alc-title">
|
|
8
|
-
<div class="alc-box">
|
|
9
|
-
<div class="alc-source-left">
|
|
10
|
-
<span class="source-form">出自</span>
|
|
11
|
-
<img class="alc-title-icon" height="24px" width="24px" :src="item.src" alt="" srcset="">
|
|
12
|
-
<span class="alc-title-from">{{ item.from }}</span>
|
|
13
|
-
</div>
|
|
14
|
-
|
|
15
|
-
</div>
|
|
16
|
-
<div v-html="item.introduction" class="alc-box-introduction">
|
|
17
|
-
</div>
|
|
18
|
-
<div class="alc-updateTime">
|
|
19
|
-
<div v-show="docSource[item.source]" class="upload-source">
|
|
20
|
-
{{docSource[item.source]}}
|
|
21
|
-
</div>
|
|
22
|
-
<div v-show="item.url" class="alc-content-text">
|
|
23
|
-
<span @click="lookAttach(item.url, item, $event)" class="aci-view">查看 ></span>
|
|
24
|
-
</div>
|
|
25
|
-
<!-- <div class="time">
|
|
26
|
-
<span>更新时间:</span>
|
|
27
|
-
{{ new Date(item.updateTime).Format('MM-dd hh:mm') }}
|
|
28
|
-
</div> -->
|
|
29
|
-
</div>
|
|
30
|
-
<!-- <span v-if="isPC" class="alc-title-updateTime">最后更新时间: {{ item.updateTime }}</span>-->
|
|
31
|
-
</div>
|
|
32
|
-
<div class="alc-content" v-if="false">
|
|
33
|
-
<div v-if="msg.content.type == 1" class="alc-content-text">{{ item.introduction }} <span
|
|
34
|
-
@click="lookAttach(item.url, item, $event)" class="aci-view">查看原文 ></span>
|
|
35
|
-
</div>
|
|
36
|
-
<span v-if="!isPC" class="alc-title-updateTime">最后更新时间: {{ item.updateTime }}</span>
|
|
37
|
-
<div v-if="false" class="alc-content-info">
|
|
38
|
-
<div class="alcc-box">
|
|
39
|
-
<span class="aci-owner">所有者: {{ item.owner }}</span>
|
|
40
|
-
<span class="aci-enterprise">所属企业: {{ item.enterprise }}</span>
|
|
41
|
-
<span class="aci-source">文件来源: {{ item.source }}</span>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
<previewPdf ref="previewPdf" :url="previewHref" officePreviewType="pdf"></previewPdf>
|
|
48
|
-
</div>
|
|
49
|
-
</template>
|
|
50
|
-
|
|
51
|
-
<script>
|
|
52
|
-
import previewPdf from "./previewPdf";
|
|
53
|
-
import { isMobile } from "../assets/js/common";
|
|
54
|
-
export default {
|
|
55
|
-
name: "answerDocknowledge",
|
|
56
|
-
components: { previewPdf },
|
|
57
|
-
data() {
|
|
58
|
-
return {
|
|
59
|
-
isPC: true,
|
|
60
|
-
previewHref: "",
|
|
61
|
-
docSource: {
|
|
62
|
-
LOCAL_FILE: "来源于本地文件",
|
|
63
|
-
CREATED_BY_ONESELF: "来源于自建知识",
|
|
64
|
-
WECHAT: "来源于微信",
|
|
65
|
-
AUTO_SYN_FROM_LOCAL_FILE: "自动同步于本地",
|
|
66
|
-
YUQUE: "来源于语雀"
|
|
67
|
-
},
|
|
68
|
-
imageObj: {
|
|
69
|
-
PDF: 'pdf1',
|
|
70
|
-
pdf: 'pdf1',
|
|
71
|
-
TXT: 'txt1',
|
|
72
|
-
txt: 'txt1',
|
|
73
|
-
selfadd: 'selfadd1',
|
|
74
|
-
md: "md2",
|
|
75
|
-
html: 'selfadd1',
|
|
76
|
-
mode: "mode",
|
|
77
|
-
general: 'general',
|
|
78
|
-
word: "word1",
|
|
79
|
-
Word: "word1",
|
|
80
|
-
docx: "word1",
|
|
81
|
-
doc: "word1",
|
|
82
|
-
WORD: "word1",
|
|
83
|
-
Excel: 'excel1',
|
|
84
|
-
EXCEL: 'excel1',
|
|
85
|
-
excel: 'excel1',
|
|
86
|
-
PPT: 'ppt1',
|
|
87
|
-
ppt: 'ppt1',
|
|
88
|
-
pptx: 'ppt1',
|
|
89
|
-
img: "image1",
|
|
90
|
-
image: "image1",
|
|
91
|
-
video: "video",
|
|
92
|
-
audio: 'audio',
|
|
93
|
-
link: "link",
|
|
94
|
-
wechat: "wechat",
|
|
95
|
-
mp4: "video",
|
|
96
|
-
MP4: "video",
|
|
97
|
-
xlsx: "excel1",
|
|
98
|
-
xls: "excel1",
|
|
99
|
-
jpg: "image1",
|
|
100
|
-
jpeg: "image1",
|
|
101
|
-
png: "image1",
|
|
102
|
-
webp: "image1",
|
|
103
|
-
gif: "image1",
|
|
104
|
-
svg: "image1",
|
|
105
|
-
bmp: "image1",
|
|
106
|
-
avi: "video",
|
|
107
|
-
mov: "video",
|
|
108
|
-
rmvb: "video",
|
|
109
|
-
wav: "audio",
|
|
110
|
-
mp3: "audio",
|
|
111
|
-
yqhtml: "yqhtml",
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
props: ['msg','isAskLightning'],
|
|
116
|
-
beforeMounted() {
|
|
117
|
-
|
|
118
|
-
},
|
|
119
|
-
created() {
|
|
120
|
-
var system = {};
|
|
121
|
-
system.pingtai = /(Win32|Win16|WinCE|Mac68K|MacIntel|MacIntel|MacPPC|Linux mips64)/i.test(navigator.platform);
|
|
122
|
-
if (system.pingtai) {
|
|
123
|
-
//电脑
|
|
124
|
-
this.isPC = true;
|
|
125
|
-
} else {
|
|
126
|
-
//手机
|
|
127
|
-
this.isPC = false;
|
|
128
|
-
}
|
|
129
|
-
this.msg.content.list.forEach(element => {
|
|
130
|
-
element.src = 'https://static.guoranbot.com/cdn-office-website/askbot_doc/' + this.imageObj[element.format] + '.png';
|
|
131
|
-
if ((element.format === "txt" || element.format === "html") && element.source === "WECHAT") {
|
|
132
|
-
element.src = 'https://static.guoranbot.com/cdn-office-website/askbot_doc/wechat.png';
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
},
|
|
136
|
-
mounted() {
|
|
137
|
-
|
|
138
|
-
},
|
|
139
|
-
methods: {
|
|
140
|
-
//预览图片
|
|
141
|
-
lookAttach(url, item, event) {
|
|
142
|
-
event.preventDefault();
|
|
143
|
-
if (this.isAskLightning == 1){
|
|
144
|
-
window.parent.postMessage({
|
|
145
|
-
data: "bot_preview",
|
|
146
|
-
item: JSON.stringify(item),
|
|
147
|
-
url: url
|
|
148
|
-
},"*");
|
|
149
|
-
} else {
|
|
150
|
-
let index = url.lastIndexOf('?')
|
|
151
|
-
let type = ''
|
|
152
|
-
let httpUrl = '/knowledge-api/knowledge/getTemporaryCertificate'
|
|
153
|
-
if (index !== -1) {
|
|
154
|
-
url = url.substring(0, index)
|
|
155
|
-
type = this.fileType(url)
|
|
156
|
-
} else {
|
|
157
|
-
type = this.fileType(url)
|
|
158
|
-
}
|
|
159
|
-
if (type === '' || type === 'OTHER') {
|
|
160
|
-
httpUrl = httpUrl += '?needEncrypt=true'
|
|
161
|
-
} else {
|
|
162
|
-
httpUrl = httpUrl += '?needEncrypt=false'
|
|
163
|
-
}
|
|
164
|
-
this.$http.post(httpUrl, {
|
|
165
|
-
"fileInOssPath":url
|
|
166
|
-
}).then(res =>{
|
|
167
|
-
if(res.data.code == '0') {
|
|
168
|
-
this.previewHref = res.data.data;
|
|
169
|
-
if (isMobile()){
|
|
170
|
-
this.$refs.previewPdf.previewShowPopup = true;
|
|
171
|
-
} else {
|
|
172
|
-
this.$refs.previewPdf.drawer = true;
|
|
173
|
-
}
|
|
174
|
-
this.$refs.previewPdf.fileType = type
|
|
175
|
-
this.$nextTick(() =>{
|
|
176
|
-
if(item.source == 'CREATED_BY_ONESELF' || type === 'HTML') {
|
|
177
|
-
this.$refs.previewPdf.getBolb(item)
|
|
178
|
-
} else {
|
|
179
|
-
this.$refs.previewPdf.loadIframe(item)
|
|
180
|
-
}
|
|
181
|
-
})
|
|
182
|
-
}
|
|
183
|
-
})
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
},
|
|
187
|
-
fileType (url) {
|
|
188
|
-
const fileType = url.substring(url.lastIndexOf('.'));
|
|
189
|
-
if (fileType === '.mp4' || fileType === '.MP4') {
|
|
190
|
-
return 'VIDEO'
|
|
191
|
-
} else if (fileType === '.html') {
|
|
192
|
-
return 'HTML'
|
|
193
|
-
} else {
|
|
194
|
-
return 'OTHER'
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
</script>
|
|
200
|
-
|
|
201
|
-
<style scoped lang="less">
|
|
202
|
-
.answer-docknowledge {
|
|
203
|
-
min-width: 100px;
|
|
204
|
-
|
|
205
|
-
.answer-text {
|
|
206
|
-
// font-size: 13px;
|
|
207
|
-
text-align: left;
|
|
208
|
-
line-height: 25px;
|
|
209
|
-
padding: 0px 0px 12px 0px;
|
|
210
|
-
|
|
211
|
-
.aci-view {
|
|
212
|
-
// font-size: 13px;
|
|
213
|
-
display: inline-block;
|
|
214
|
-
// margin-left: 5px;
|
|
215
|
-
color: #366aff;
|
|
216
|
-
cursor: pointer;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
.ad-list {
|
|
221
|
-
.ad-list-cell {
|
|
222
|
-
border-top: solid 1px #E0E6F7;
|
|
223
|
-
padding: 10px 0 10px;
|
|
224
|
-
|
|
225
|
-
.alc-title {
|
|
226
|
-
display: flex;
|
|
227
|
-
flex-wrap: wrap;
|
|
228
|
-
align-items: center;
|
|
229
|
-
justify-content: space-between;
|
|
230
|
-
line-height: 16px;
|
|
231
|
-
|
|
232
|
-
.alc-box {
|
|
233
|
-
display: flex;
|
|
234
|
-
align-items: center;
|
|
235
|
-
justify-content: space-between;
|
|
236
|
-
// font-size: 12px;
|
|
237
|
-
width: 100%;
|
|
238
|
-
.alc-source-left{
|
|
239
|
-
display: flex;
|
|
240
|
-
align-items: center;
|
|
241
|
-
.source-form{
|
|
242
|
-
width: 34px;
|
|
243
|
-
flex: none;
|
|
244
|
-
color: #A9B3C6;
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
.alc-content-text{
|
|
248
|
-
width: 55px;
|
|
249
|
-
flex: none;
|
|
250
|
-
.aci-view{
|
|
251
|
-
color: #366aff;
|
|
252
|
-
cursor: pointer;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
.alc-title-from {
|
|
256
|
-
line-height: 22px;
|
|
257
|
-
word-break: break-all !important;
|
|
258
|
-
text-align: left;
|
|
259
|
-
flex: auto;
|
|
260
|
-
display: flex;
|
|
261
|
-
justify-content: flex-start;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
.alc-box-introduction{
|
|
265
|
-
overflow: hidden;
|
|
266
|
-
text-overflow: ellipsis;
|
|
267
|
-
display: -webkit-box;
|
|
268
|
-
-webkit-line-clamp:3;
|
|
269
|
-
-webkit-box-orient:vertical;
|
|
270
|
-
margin-top: 10px;
|
|
271
|
-
color: #616161;
|
|
272
|
-
// font-size: 12px;
|
|
273
|
-
line-height: 24px;
|
|
274
|
-
text-align: left;
|
|
275
|
-
}
|
|
276
|
-
.alc-updateTime{
|
|
277
|
-
display: flex;
|
|
278
|
-
align-items: center;
|
|
279
|
-
justify-content: space-between;
|
|
280
|
-
font-size: 13px;
|
|
281
|
-
width: 100%;
|
|
282
|
-
margin-top: 10px;
|
|
283
|
-
.upload-source{
|
|
284
|
-
flex: none;
|
|
285
|
-
height: 18px;
|
|
286
|
-
line-height: 18px;
|
|
287
|
-
background: #E9F9F8;
|
|
288
|
-
border: 1px solid #AFF2CD;
|
|
289
|
-
border-radius: 2px;
|
|
290
|
-
display: flex;
|
|
291
|
-
align-items: center;
|
|
292
|
-
justify-content: center;
|
|
293
|
-
padding: 0 8px;
|
|
294
|
-
color: #00C2BB;
|
|
295
|
-
}
|
|
296
|
-
.time{
|
|
297
|
-
color: #999999;
|
|
298
|
-
margin-left: 10px;
|
|
299
|
-
}
|
|
300
|
-
.alc-content-text {
|
|
301
|
-
color: #366aff;
|
|
302
|
-
cursor: pointer;
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
.alc-title-icon {
|
|
306
|
-
margin: 0 2px;
|
|
307
|
-
width: 18px;
|
|
308
|
-
height: 18px;
|
|
309
|
-
flex: none;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
.alc-title-updateTime {
|
|
313
|
-
text-align: right;
|
|
314
|
-
color: #999999;
|
|
315
|
-
// font-size: 13px;
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
.alc-content {
|
|
320
|
-
.alc-title-updateTime {
|
|
321
|
-
margin-top: 6px;
|
|
322
|
-
display: block;
|
|
323
|
-
text-align: right;
|
|
324
|
-
color: #999999;
|
|
325
|
-
// font-size: 13px;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
.alc-content-text {
|
|
329
|
-
margin-bottom: 6px;
|
|
330
|
-
width: 55px;
|
|
331
|
-
flex: none;
|
|
332
|
-
.aci-view {
|
|
333
|
-
display: inline-block;
|
|
334
|
-
margin-left: 30px;
|
|
335
|
-
color: #366aff;
|
|
336
|
-
cursor: pointer;
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
.alc-content-info {
|
|
341
|
-
display: flex;
|
|
342
|
-
flex-wrap: wrap;
|
|
343
|
-
justify-content: space-between;
|
|
344
|
-
|
|
345
|
-
.alcc-box {
|
|
346
|
-
display: flex;
|
|
347
|
-
flex-wrap: wrap;
|
|
348
|
-
color: #999999;
|
|
349
|
-
|
|
350
|
-
.aci-owner {
|
|
351
|
-
margin-right: 20px;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
.aci-enterprise {
|
|
355
|
-
margin-right: 20px;
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
}
|
|
1
|
+
<template>
|
|
2
|
+
<div class="answer-docknowledge">
|
|
3
|
+
<div v-if="msg.content.type == 0" class="answer-text">{{ msg.content.text }}</div>
|
|
4
|
+
<div v-if="msg.content.type == 1" class="answer-text">{{ msg.content.text }}</div>
|
|
5
|
+
<div class="ad-list">
|
|
6
|
+
<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">
|
|
7
|
+
<div class="alc-title">
|
|
8
|
+
<div class="alc-box">
|
|
9
|
+
<div class="alc-source-left">
|
|
10
|
+
<span class="source-form">出自</span>
|
|
11
|
+
<img class="alc-title-icon" height="24px" width="24px" :src="item.src" alt="" srcset="">
|
|
12
|
+
<span class="alc-title-from">{{ item.from }}</span>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
</div>
|
|
16
|
+
<div v-html="item.introduction" class="alc-box-introduction">
|
|
17
|
+
</div>
|
|
18
|
+
<div class="alc-updateTime">
|
|
19
|
+
<div v-show="docSource[item.source]" class="upload-source">
|
|
20
|
+
{{docSource[item.source]}}
|
|
21
|
+
</div>
|
|
22
|
+
<div v-show="item.url" class="alc-content-text">
|
|
23
|
+
<span @click="lookAttach(item.url, item, $event)" class="aci-view">查看 ></span>
|
|
24
|
+
</div>
|
|
25
|
+
<!-- <div class="time">
|
|
26
|
+
<span>更新时间:</span>
|
|
27
|
+
{{ new Date(item.updateTime).Format('MM-dd hh:mm') }}
|
|
28
|
+
</div> -->
|
|
29
|
+
</div>
|
|
30
|
+
<!-- <span v-if="isPC" class="alc-title-updateTime">最后更新时间: {{ item.updateTime }}</span>-->
|
|
31
|
+
</div>
|
|
32
|
+
<div class="alc-content" v-if="false">
|
|
33
|
+
<div v-if="msg.content.type == 1" class="alc-content-text">{{ item.introduction }} <span
|
|
34
|
+
@click="lookAttach(item.url, item, $event)" class="aci-view">查看原文 ></span>
|
|
35
|
+
</div>
|
|
36
|
+
<span v-if="!isPC" class="alc-title-updateTime">最后更新时间: {{ item.updateTime }}</span>
|
|
37
|
+
<div v-if="false" class="alc-content-info">
|
|
38
|
+
<div class="alcc-box">
|
|
39
|
+
<span class="aci-owner">所有者: {{ item.owner }}</span>
|
|
40
|
+
<span class="aci-enterprise">所属企业: {{ item.enterprise }}</span>
|
|
41
|
+
<span class="aci-source">文件来源: {{ item.source }}</span>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
<previewPdf ref="previewPdf" :url="previewHref" officePreviewType="pdf"></previewPdf>
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script>
|
|
52
|
+
import previewPdf from "./previewPdf";
|
|
53
|
+
import { isMobile } from "../assets/js/common";
|
|
54
|
+
export default {
|
|
55
|
+
name: "answerDocknowledge",
|
|
56
|
+
components: { previewPdf },
|
|
57
|
+
data() {
|
|
58
|
+
return {
|
|
59
|
+
isPC: true,
|
|
60
|
+
previewHref: "",
|
|
61
|
+
docSource: {
|
|
62
|
+
LOCAL_FILE: "来源于本地文件",
|
|
63
|
+
CREATED_BY_ONESELF: "来源于自建知识",
|
|
64
|
+
WECHAT: "来源于微信",
|
|
65
|
+
AUTO_SYN_FROM_LOCAL_FILE: "自动同步于本地",
|
|
66
|
+
YUQUE: "来源于语雀"
|
|
67
|
+
},
|
|
68
|
+
imageObj: {
|
|
69
|
+
PDF: 'pdf1',
|
|
70
|
+
pdf: 'pdf1',
|
|
71
|
+
TXT: 'txt1',
|
|
72
|
+
txt: 'txt1',
|
|
73
|
+
selfadd: 'selfadd1',
|
|
74
|
+
md: "md2",
|
|
75
|
+
html: 'selfadd1',
|
|
76
|
+
mode: "mode",
|
|
77
|
+
general: 'general',
|
|
78
|
+
word: "word1",
|
|
79
|
+
Word: "word1",
|
|
80
|
+
docx: "word1",
|
|
81
|
+
doc: "word1",
|
|
82
|
+
WORD: "word1",
|
|
83
|
+
Excel: 'excel1',
|
|
84
|
+
EXCEL: 'excel1',
|
|
85
|
+
excel: 'excel1',
|
|
86
|
+
PPT: 'ppt1',
|
|
87
|
+
ppt: 'ppt1',
|
|
88
|
+
pptx: 'ppt1',
|
|
89
|
+
img: "image1",
|
|
90
|
+
image: "image1",
|
|
91
|
+
video: "video",
|
|
92
|
+
audio: 'audio',
|
|
93
|
+
link: "link",
|
|
94
|
+
wechat: "wechat",
|
|
95
|
+
mp4: "video",
|
|
96
|
+
MP4: "video",
|
|
97
|
+
xlsx: "excel1",
|
|
98
|
+
xls: "excel1",
|
|
99
|
+
jpg: "image1",
|
|
100
|
+
jpeg: "image1",
|
|
101
|
+
png: "image1",
|
|
102
|
+
webp: "image1",
|
|
103
|
+
gif: "image1",
|
|
104
|
+
svg: "image1",
|
|
105
|
+
bmp: "image1",
|
|
106
|
+
avi: "video",
|
|
107
|
+
mov: "video",
|
|
108
|
+
rmvb: "video",
|
|
109
|
+
wav: "audio",
|
|
110
|
+
mp3: "audio",
|
|
111
|
+
yqhtml: "yqhtml",
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
props: ['msg','isAskLightning'],
|
|
116
|
+
beforeMounted() {
|
|
117
|
+
|
|
118
|
+
},
|
|
119
|
+
created() {
|
|
120
|
+
var system = {};
|
|
121
|
+
system.pingtai = /(Win32|Win16|WinCE|Mac68K|MacIntel|MacIntel|MacPPC|Linux mips64)/i.test(navigator.platform);
|
|
122
|
+
if (system.pingtai) {
|
|
123
|
+
//电脑
|
|
124
|
+
this.isPC = true;
|
|
125
|
+
} else {
|
|
126
|
+
//手机
|
|
127
|
+
this.isPC = false;
|
|
128
|
+
}
|
|
129
|
+
this.msg.content.list.forEach(element => {
|
|
130
|
+
element.src = 'https://static.guoranbot.com/cdn-office-website/askbot_doc/' + this.imageObj[element.format] + '.png';
|
|
131
|
+
if ((element.format === "txt" || element.format === "html") && element.source === "WECHAT") {
|
|
132
|
+
element.src = 'https://static.guoranbot.com/cdn-office-website/askbot_doc/wechat.png';
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
},
|
|
136
|
+
mounted() {
|
|
137
|
+
|
|
138
|
+
},
|
|
139
|
+
methods: {
|
|
140
|
+
//预览图片
|
|
141
|
+
lookAttach(url, item, event) {
|
|
142
|
+
event.preventDefault();
|
|
143
|
+
if (this.isAskLightning == 1){
|
|
144
|
+
window.parent.postMessage({
|
|
145
|
+
data: "bot_preview",
|
|
146
|
+
item: JSON.stringify(item),
|
|
147
|
+
url: url
|
|
148
|
+
},"*");
|
|
149
|
+
} else {
|
|
150
|
+
let index = url.lastIndexOf('?')
|
|
151
|
+
let type = ''
|
|
152
|
+
let httpUrl = '/knowledge-api/knowledge/getTemporaryCertificate'
|
|
153
|
+
if (index !== -1) {
|
|
154
|
+
url = url.substring(0, index)
|
|
155
|
+
type = this.fileType(url)
|
|
156
|
+
} else {
|
|
157
|
+
type = this.fileType(url)
|
|
158
|
+
}
|
|
159
|
+
if (type === '' || type === 'OTHER') {
|
|
160
|
+
httpUrl = httpUrl += '?needEncrypt=true'
|
|
161
|
+
} else {
|
|
162
|
+
httpUrl = httpUrl += '?needEncrypt=false'
|
|
163
|
+
}
|
|
164
|
+
this.$http.post(httpUrl, {
|
|
165
|
+
"fileInOssPath":url
|
|
166
|
+
}).then(res =>{
|
|
167
|
+
if(res.data.code == '0') {
|
|
168
|
+
this.previewHref = res.data.data;
|
|
169
|
+
if (isMobile()){
|
|
170
|
+
this.$refs.previewPdf.previewShowPopup = true;
|
|
171
|
+
} else {
|
|
172
|
+
this.$refs.previewPdf.drawer = true;
|
|
173
|
+
}
|
|
174
|
+
this.$refs.previewPdf.fileType = type
|
|
175
|
+
this.$nextTick(() =>{
|
|
176
|
+
if(item.source == 'CREATED_BY_ONESELF' || type === 'HTML') {
|
|
177
|
+
this.$refs.previewPdf.getBolb(item)
|
|
178
|
+
} else {
|
|
179
|
+
this.$refs.previewPdf.loadIframe(item)
|
|
180
|
+
}
|
|
181
|
+
})
|
|
182
|
+
}
|
|
183
|
+
})
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
},
|
|
187
|
+
fileType (url) {
|
|
188
|
+
const fileType = url.substring(url.lastIndexOf('.'));
|
|
189
|
+
if (fileType === '.mp4' || fileType === '.MP4') {
|
|
190
|
+
return 'VIDEO'
|
|
191
|
+
} else if (fileType === '.html') {
|
|
192
|
+
return 'HTML'
|
|
193
|
+
} else {
|
|
194
|
+
return 'OTHER'
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
</script>
|
|
200
|
+
|
|
201
|
+
<style scoped lang="less">
|
|
202
|
+
.answer-docknowledge {
|
|
203
|
+
min-width: 100px;
|
|
204
|
+
|
|
205
|
+
.answer-text {
|
|
206
|
+
// font-size: 13px;
|
|
207
|
+
text-align: left;
|
|
208
|
+
line-height: 25px;
|
|
209
|
+
padding: 0px 0px 12px 0px;
|
|
210
|
+
|
|
211
|
+
.aci-view {
|
|
212
|
+
// font-size: 13px;
|
|
213
|
+
display: inline-block;
|
|
214
|
+
// margin-left: 5px;
|
|
215
|
+
color: #366aff;
|
|
216
|
+
cursor: pointer;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.ad-list {
|
|
221
|
+
.ad-list-cell {
|
|
222
|
+
border-top: solid 1px #E0E6F7;
|
|
223
|
+
padding: 10px 0 10px;
|
|
224
|
+
|
|
225
|
+
.alc-title {
|
|
226
|
+
display: flex;
|
|
227
|
+
flex-wrap: wrap;
|
|
228
|
+
align-items: center;
|
|
229
|
+
justify-content: space-between;
|
|
230
|
+
line-height: 16px;
|
|
231
|
+
|
|
232
|
+
.alc-box {
|
|
233
|
+
display: flex;
|
|
234
|
+
align-items: center;
|
|
235
|
+
justify-content: space-between;
|
|
236
|
+
// font-size: 12px;
|
|
237
|
+
width: 100%;
|
|
238
|
+
.alc-source-left{
|
|
239
|
+
display: flex;
|
|
240
|
+
align-items: center;
|
|
241
|
+
.source-form{
|
|
242
|
+
width: 34px;
|
|
243
|
+
flex: none;
|
|
244
|
+
color: #A9B3C6;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
.alc-content-text{
|
|
248
|
+
width: 55px;
|
|
249
|
+
flex: none;
|
|
250
|
+
.aci-view{
|
|
251
|
+
color: #366aff;
|
|
252
|
+
cursor: pointer;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
.alc-title-from {
|
|
256
|
+
line-height: 22px;
|
|
257
|
+
word-break: break-all !important;
|
|
258
|
+
text-align: left;
|
|
259
|
+
flex: auto;
|
|
260
|
+
display: flex;
|
|
261
|
+
justify-content: flex-start;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
.alc-box-introduction{
|
|
265
|
+
overflow: hidden;
|
|
266
|
+
text-overflow: ellipsis;
|
|
267
|
+
display: -webkit-box;
|
|
268
|
+
-webkit-line-clamp:3;
|
|
269
|
+
-webkit-box-orient:vertical;
|
|
270
|
+
margin-top: 10px;
|
|
271
|
+
color: #616161;
|
|
272
|
+
// font-size: 12px;
|
|
273
|
+
line-height: 24px;
|
|
274
|
+
text-align: left;
|
|
275
|
+
}
|
|
276
|
+
.alc-updateTime{
|
|
277
|
+
display: flex;
|
|
278
|
+
align-items: center;
|
|
279
|
+
justify-content: space-between;
|
|
280
|
+
font-size: 13px;
|
|
281
|
+
width: 100%;
|
|
282
|
+
margin-top: 10px;
|
|
283
|
+
.upload-source{
|
|
284
|
+
flex: none;
|
|
285
|
+
height: 18px;
|
|
286
|
+
line-height: 18px;
|
|
287
|
+
background: #E9F9F8;
|
|
288
|
+
border: 1px solid #AFF2CD;
|
|
289
|
+
border-radius: 2px;
|
|
290
|
+
display: flex;
|
|
291
|
+
align-items: center;
|
|
292
|
+
justify-content: center;
|
|
293
|
+
padding: 0 8px;
|
|
294
|
+
color: #00C2BB;
|
|
295
|
+
}
|
|
296
|
+
.time{
|
|
297
|
+
color: #999999;
|
|
298
|
+
margin-left: 10px;
|
|
299
|
+
}
|
|
300
|
+
.alc-content-text {
|
|
301
|
+
color: #366aff;
|
|
302
|
+
cursor: pointer;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
.alc-title-icon {
|
|
306
|
+
margin: 0 2px;
|
|
307
|
+
width: 18px;
|
|
308
|
+
height: 18px;
|
|
309
|
+
flex: none;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.alc-title-updateTime {
|
|
313
|
+
text-align: right;
|
|
314
|
+
color: #999999;
|
|
315
|
+
// font-size: 13px;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.alc-content {
|
|
320
|
+
.alc-title-updateTime {
|
|
321
|
+
margin-top: 6px;
|
|
322
|
+
display: block;
|
|
323
|
+
text-align: right;
|
|
324
|
+
color: #999999;
|
|
325
|
+
// font-size: 13px;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.alc-content-text {
|
|
329
|
+
margin-bottom: 6px;
|
|
330
|
+
width: 55px;
|
|
331
|
+
flex: none;
|
|
332
|
+
.aci-view {
|
|
333
|
+
display: inline-block;
|
|
334
|
+
margin-left: 30px;
|
|
335
|
+
color: #366aff;
|
|
336
|
+
cursor: pointer;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.alc-content-info {
|
|
341
|
+
display: flex;
|
|
342
|
+
flex-wrap: wrap;
|
|
343
|
+
justify-content: space-between;
|
|
344
|
+
|
|
345
|
+
.alcc-box {
|
|
346
|
+
display: flex;
|
|
347
|
+
flex-wrap: wrap;
|
|
348
|
+
color: #999999;
|
|
349
|
+
|
|
350
|
+
.aci-owner {
|
|
351
|
+
margin-right: 20px;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.aci-enterprise {
|
|
355
|
+
margin-right: 20px;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
363
|
</style>
|