askbot-dragon 1.6.83-beta → 1.6.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.
- package/package.json +1 -1
- package/public/index.html +8 -8
- package/src/assets/js/hammer.js +13 -2
- package/src/assets/less/converSationContainer/common.less +7 -0
- package/src/components/ActionAlertIframe.vue +24 -1
- package/src/components/AiGuide.vue +4 -6
- package/src/components/AnswerDocknowledge.vue +2 -0
- package/src/components/ConversationContainer.vue +9 -201
- package/src/components/MyEditor.vue +1 -0
- package/src/components/answerRadio.vue +16 -7
- package/src/components/askVideo.vue +24 -1
- package/src/components/associationIntention.vue +7 -1
- package/src/components/intelligentSummary.vue +5 -1
- package/src/components/message/swiper/ticketSwiper.vue +1 -1
- package/src/components/newPdfPosition.vue +878 -0
- package/src/components/pdfPosition.vue +205 -31
- package/src/components/previewPdf.vue +151 -126
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
-->
|
|
7
7
|
<template>
|
|
8
8
|
<el-drawer title="我是标题" :visible.sync="drawer" :with-header="false" :append-to-body="true" :destroy-on-close="true"
|
|
9
|
-
:modal="false" :direction="previewShowPopup ? 'btt' : 'rtl'" :size="previewShowPopup ? '90%' : '65%'"
|
|
9
|
+
:modal="formKnowledgeManagement ? true : false" :direction="previewShowPopup ? 'btt' : 'rtl'" :size="previewShowPopup ? '90%' : '65%'"
|
|
10
10
|
custom-class="pdf-preview-drawer" v-if="drawer">
|
|
11
11
|
<!-- v-else-if="drawer" -->
|
|
12
12
|
<div class="drawer-header" :class="isLiBang ? 'libang_head' : ''" v-if="!isPc">
|
|
13
13
|
<div class="header-btn btn_position">
|
|
14
|
-
<div class="onload_btn" v-if="isDownload
|
|
14
|
+
<div class="onload_btn" v-if="isDownload" @click="downLoad">
|
|
15
15
|
下载
|
|
16
16
|
</div>
|
|
17
|
-
<div class="summaryBtn" :class="showSummary ? 'summaryActiveBtn' : ''" @click="summaryFun" v-if="isHasChat
|
|
17
|
+
<div class="summaryBtn" :class="showSummary ? 'summaryActiveBtn' : ''" @click="summaryFun" v-if="isHasChat">
|
|
18
18
|
<i class="iconfont guoran-tongyichicun-write-29-jiqiren"></i>
|
|
19
19
|
<span>智能摘要</span>
|
|
20
20
|
</div>
|
|
21
|
-
<template v-if="isHasChat
|
|
21
|
+
<template v-if="isHasChat">
|
|
22
22
|
<div class="chat" @click="previewToDialog(true)" v-if="!previewKnowledgeId">
|
|
23
23
|
<i class="iconfont guoran-wendapingjia"></i>
|
|
24
24
|
聊一聊
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
下载
|
|
57
57
|
</div>
|
|
58
58
|
<div class="summaryBtn" :class="showSummary ? 'summaryActiveBtn' : ''" @click="summaryFun"
|
|
59
|
-
v-if="isHasChat ||
|
|
59
|
+
v-if="isHasChat || formKnowledgeManagement">
|
|
60
60
|
<i class="iconfont guoran-tongyichicun-write-29-jiqiren"></i>
|
|
61
61
|
<span>智能摘要</span>
|
|
62
62
|
</div>
|
|
63
|
-
<template v-if="isHasChat
|
|
63
|
+
<template v-if="isHasChat">
|
|
64
64
|
<div class="chat" @click="previewToDialog(true)" v-if="!previewKnowledgeId">
|
|
65
65
|
<i class="iconfont guoran-wendapingjia"></i>
|
|
66
66
|
聊一聊
|
|
@@ -84,7 +84,11 @@
|
|
|
84
84
|
</div>
|
|
85
85
|
<div id="drawer_content_pre" :class="isLiBang && folderName ? 'libang_content_pre' : ''">
|
|
86
86
|
<!-- :style="{marginTop:tagIds && tagIds.length != 0 && isPc ? '50px' : ''}" -->
|
|
87
|
-
<intelligent-summary
|
|
87
|
+
<intelligent-summary
|
|
88
|
+
v-show="showSummary && (isHasChat || formKnowledgeManagement) && fileType !== 'VIDEO' && fileType !== 'IMAGE'"
|
|
89
|
+
:tagIds="tagIds"
|
|
90
|
+
:knowledgeId="knowledgeId"
|
|
91
|
+
:formKnowledgeManagement="formKnowledgeManagement"
|
|
88
92
|
@closeSummary="closeSummary" @recommendQues="recommendQues"
|
|
89
93
|
@getSummarySuccess="getSummarySuccess"></intelligent-summary>
|
|
90
94
|
<div class="pdf_positon" :style="pdfStyle" v-if="tagIds && tagIds.length != 0 && drawer">
|
|
@@ -92,7 +96,7 @@
|
|
|
92
96
|
</pdfPosition>
|
|
93
97
|
</div>
|
|
94
98
|
<template v-else>
|
|
95
|
-
<div v-if="fileType == 'VIDEO'" style="width: 100%;">
|
|
99
|
+
<div v-if="fileType == 'VIDEO'" style="width: 100%;height: 100%">
|
|
96
100
|
<video :src="url" controls width="100%;" height="98%"></video>
|
|
97
101
|
</div>
|
|
98
102
|
<div v-else-if="fileType == 'HTML'" style="width: 100%;">
|
|
@@ -129,59 +133,59 @@ import { Toast } from 'vant';
|
|
|
129
133
|
export default {
|
|
130
134
|
data () {
|
|
131
135
|
return {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
},
|
|
148
|
-
mounted () {
|
|
149
|
-
window.addEventListener('message', this.handleIframeMessage, false);
|
|
150
|
-
this.isPcFun();
|
|
151
|
-
},
|
|
152
|
-
props: {
|
|
153
|
-
url: {
|
|
154
|
-
type: String,
|
|
155
|
-
required: true,
|
|
136
|
+
previewShowPopup: false,
|
|
137
|
+
fileText: '',
|
|
138
|
+
fileType: "",
|
|
139
|
+
isPc: false,
|
|
140
|
+
drawer: false,
|
|
141
|
+
tagIds: [],
|
|
142
|
+
// '6454aa1a70573a6ead6f0f7d', '6454aa1a70573a6ead6f0f81',
|
|
143
|
+
loading: true,
|
|
144
|
+
fileName:'',
|
|
145
|
+
previewKnowledgeId:"",
|
|
146
|
+
showSummary:true,
|
|
147
|
+
iframeHeight:"100%",
|
|
148
|
+
isDownload: false,
|
|
149
|
+
textWatermarkStr:"",
|
|
150
|
+
copy:''}
|
|
156
151
|
},
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
},
|
|
161
|
-
isMessageRecord: {
|
|
162
|
-
type: Boolean,
|
|
163
|
-
default: false,
|
|
164
|
-
},
|
|
165
|
-
sourceFileType: {
|
|
166
|
-
type: String,
|
|
167
|
-
default: '',
|
|
168
|
-
},
|
|
169
|
-
title: {
|
|
170
|
-
type: String,
|
|
171
|
-
default: ''
|
|
172
|
-
},
|
|
173
|
-
isHasChat: {
|
|
174
|
-
type: Boolean,
|
|
175
|
-
default: false
|
|
176
|
-
},
|
|
177
|
-
knowledgeId: {
|
|
178
|
-
type: String,
|
|
179
|
-
default: '',
|
|
180
|
-
},
|
|
181
|
-
previewOssPath: {
|
|
182
|
-
type: String,
|
|
183
|
-
default: '',
|
|
152
|
+
mounted() {
|
|
153
|
+
window.addEventListener('message',this.handleIframeMessage,false);
|
|
154
|
+
this.isPcFun();
|
|
184
155
|
},
|
|
156
|
+
props:{
|
|
157
|
+
url:{
|
|
158
|
+
type: String,
|
|
159
|
+
required: true,
|
|
160
|
+
},
|
|
161
|
+
officePreviewType:{
|
|
162
|
+
type: String,
|
|
163
|
+
default: ''
|
|
164
|
+
},
|
|
165
|
+
isMessageRecord:{
|
|
166
|
+
type: Boolean,
|
|
167
|
+
default:false,
|
|
168
|
+
},
|
|
169
|
+
sourceFileType:{
|
|
170
|
+
type: String,
|
|
171
|
+
default: '',
|
|
172
|
+
},
|
|
173
|
+
title: {
|
|
174
|
+
type: String,
|
|
175
|
+
default: ''
|
|
176
|
+
},
|
|
177
|
+
isHasChat:{
|
|
178
|
+
type:Boolean,
|
|
179
|
+
default:false
|
|
180
|
+
},
|
|
181
|
+
knowledgeId:{
|
|
182
|
+
type: String,
|
|
183
|
+
default: '',
|
|
184
|
+
},
|
|
185
|
+
previewOssPath:{
|
|
186
|
+
type: String,
|
|
187
|
+
default: '',
|
|
188
|
+
},
|
|
185
189
|
folderName: {
|
|
186
190
|
type: String,
|
|
187
191
|
default: '',
|
|
@@ -193,7 +197,12 @@ export default {
|
|
|
193
197
|
isLiBang: {
|
|
194
198
|
type: Boolean,
|
|
195
199
|
default: false
|
|
196
|
-
}
|
|
200
|
+
},
|
|
201
|
+
formKnowledgeManagement:{
|
|
202
|
+
type: Boolean,
|
|
203
|
+
default: false
|
|
204
|
+
}
|
|
205
|
+
},
|
|
197
206
|
components: {
|
|
198
207
|
IntelligentSummary,
|
|
199
208
|
pdfPosition
|
|
@@ -203,58 +212,71 @@ export default {
|
|
|
203
212
|
if (value) {
|
|
204
213
|
this.$emit('open')
|
|
205
214
|
this.$nextTick(() => {
|
|
206
|
-
|
|
215
|
+
if (this.tagIds && this.tagIds.length != 0){
|
|
216
|
+
zoomElement(document.getElementById('pdf_container_view'))
|
|
217
|
+
}
|
|
218
|
+
})
|
|
219
|
+
} else {
|
|
220
|
+
this.$emit('close')
|
|
221
|
+
}
|
|
222
|
+
setTimeout(() => {
|
|
223
|
+
let previewIframe = document.getElementsByClassName('preview_iframe')
|
|
224
|
+
Array.from(previewIframe).forEach(item =>{
|
|
225
|
+
item.onload = () =>{
|
|
226
|
+
console.debug('previewIframe 106',previewIframe,this.drawer)
|
|
227
|
+
item.style.backgroundImage = 'none'
|
|
228
|
+
}
|
|
229
|
+
})
|
|
207
230
|
})
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
if (val) {
|
|
225
|
-
this.getSummarySuccess();
|
|
231
|
+
},
|
|
232
|
+
showSummary:{
|
|
233
|
+
handler(val){
|
|
234
|
+
// if (!val){
|
|
235
|
+
// this.$nextTick(() => {
|
|
236
|
+
// let preCon = document.querySelector('.pdf_view');
|
|
237
|
+
// if (preCon){
|
|
238
|
+
// preCon.style.height = 'calc(100% - ' + 50 + 'px)'
|
|
239
|
+
// }
|
|
240
|
+
// })
|
|
241
|
+
// } else {
|
|
242
|
+
// this.getSummarySuccess();
|
|
243
|
+
// }
|
|
244
|
+
if(val) {
|
|
245
|
+
this.getSummarySuccess();
|
|
246
|
+
}
|
|
226
247
|
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
248
|
+
},
|
|
249
|
+
knowledgeId:{
|
|
250
|
+
handler(val){
|
|
251
|
+
if (val){
|
|
252
|
+
this.getTextWatermark();
|
|
253
|
+
}
|
|
233
254
|
}
|
|
234
255
|
}
|
|
235
|
-
}
|
|
236
|
-
},
|
|
237
|
-
computed: {
|
|
238
|
-
pdfStyle () {
|
|
239
|
-
return {
|
|
240
|
-
paddingTop: this.isPc ? '30px' : '0', // 30px 是 加上外层的 20 流出 50的上边距展示 放大缩小操作栏
|
|
241
|
-
paddingBottom: this.tagIds > 1 ? '60px' : '0',
|
|
242
|
-
height: '100%'
|
|
243
|
-
}
|
|
244
256
|
},
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
257
|
+
computed:{
|
|
258
|
+
pdfStyle() {
|
|
259
|
+
return {
|
|
260
|
+
paddingTop: this.isPc ? '30px' : '0', // 30px 是 加上外层的 20 流出 50的上边距展示 放大缩小操作栏
|
|
261
|
+
paddingBottom: this.tagIds > 1 ? '60px' : '0',
|
|
262
|
+
height: '100%'
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
previewUrl() {
|
|
266
|
+
console.debug('VUE_APP_ENV',process.env.VUE_APP_ENV)
|
|
267
|
+
let url = process.env.VUE_APP_ENV === 'production' ? 'https://kkfileview.askbot.cn/onlinePreview?url=' : 'https://test.open.askbot.cn/kkfileview/onlinePreview?url='
|
|
268
|
+
// if(this.url != '') {
|
|
269
|
+
// if(/[\u4E00-\u9FA5]+/g.test(this.url)) {
|
|
270
|
+
// url += btoa(encodeURIComponent(this.url))
|
|
271
|
+
// } else {
|
|
272
|
+
// url += btoa(this.url)
|
|
273
|
+
// }
|
|
274
|
+
// }
|
|
275
|
+
url = url + this.url
|
|
276
|
+
url += '&officePreviewType=pdf'
|
|
277
|
+
if(this.watermark) {
|
|
278
|
+
url = this.watermark.textWatermarkValue ? (url += '&textWatermarkValue=' + this.watermark.textWatermarkValue) : url
|
|
279
|
+
url = this.watermark.visitorWatermarkValue ? (url += '&visitorWatermarkValue=' + this.watermark.visitorWatermarkValue) : url
|
|
258
280
|
}
|
|
259
281
|
console.log('textWatermarkStr 216', this.textWatermarkStr)
|
|
260
282
|
if (this.textWatermarkStr) {
|
|
@@ -373,6 +395,10 @@ export default {
|
|
|
373
395
|
})
|
|
374
396
|
},
|
|
375
397
|
downLoad () {
|
|
398
|
+
if (this.formKnowledgeManagement){
|
|
399
|
+
this.$emit('downLoad',this.previewOssPath);
|
|
400
|
+
return
|
|
401
|
+
}
|
|
376
402
|
let url = this.previewOssPath
|
|
377
403
|
if (decodeURIComponent(url) != url) {
|
|
378
404
|
url = decodeURIComponent(url)
|
|
@@ -384,7 +410,7 @@ export default {
|
|
|
384
410
|
}
|
|
385
411
|
}).then(res => {
|
|
386
412
|
console.log('downLoad 341', res)
|
|
387
|
-
if (res.data
|
|
413
|
+
if (res.data|| res.bodyText) {
|
|
388
414
|
if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
|
|
389
415
|
this.copy = res.data
|
|
390
416
|
if (isMobile()) {
|
|
@@ -413,16 +439,17 @@ export default {
|
|
|
413
439
|
// }, 2000)
|
|
414
440
|
// window.open(res.data,'下载', 'noopener')
|
|
415
441
|
if (isMobile()) {
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
|
|
442
|
+
|
|
443
|
+
const iframe = document.createElement("iframe");
|
|
444
|
+
iframe.setAttribute("hidden", "hidden");
|
|
445
|
+
iframe.onload = () => {
|
|
446
|
+
if (iframe) {
|
|
447
|
+
console.log("iframe onload....")
|
|
448
|
+
iframe.setAttribute('src', 'about:blank');
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
document.body.insertBefore(iframe, null);
|
|
452
|
+
iframe.setAttribute("src", res.data );
|
|
426
453
|
} else {
|
|
427
454
|
let a = document.createElement('a')
|
|
428
455
|
a.href = res.data
|
|
@@ -430,7 +457,7 @@ export default {
|
|
|
430
457
|
a.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, view: window }))
|
|
431
458
|
}
|
|
432
459
|
this.close()
|
|
433
|
-
|
|
460
|
+
}
|
|
434
461
|
}
|
|
435
462
|
})
|
|
436
463
|
},
|
|
@@ -511,6 +538,7 @@ export default {
|
|
|
511
538
|
height: 100%;
|
|
512
539
|
}
|
|
513
540
|
|
|
541
|
+
|
|
514
542
|
.preview_iframe_html {
|
|
515
543
|
width: 100%;
|
|
516
544
|
height: 100%;
|
|
@@ -606,6 +634,7 @@ justify-content: space-between;
|
|
|
606
634
|
.header-right {
|
|
607
635
|
display: flex;
|
|
608
636
|
}
|
|
637
|
+
|
|
609
638
|
.summaryBtn {
|
|
610
639
|
flex: none;
|
|
611
640
|
//width: 95px;
|
|
@@ -672,9 +701,9 @@ justify-content: space-between;
|
|
|
672
701
|
justify-content: space-between;
|
|
673
702
|
line-height: 26px;
|
|
674
703
|
.title_left {
|
|
675
|
-
white-space: nowrap; /* 确保文本不会换行 */
|
|
676
|
-
overflow: hidden; /* 隐藏超出容器的文本 */
|
|
677
|
-
text-overflow: ellipsis; /* 当文本超出容器时显示省略号 */
|
|
704
|
+
white-space: nowrap; /* 确保文本不会换行 */
|
|
705
|
+
overflow: hidden; /* 隐藏超出容器的文本 */
|
|
706
|
+
text-overflow: ellipsis; /* 当文本超出容器时显示省略号 */
|
|
678
707
|
margin-right: 8px;
|
|
679
708
|
}
|
|
680
709
|
}
|
|
@@ -707,10 +736,6 @@ justify-content: space-between;
|
|
|
707
736
|
overflow: auto;
|
|
708
737
|
height: calc(100% - 50px);
|
|
709
738
|
background: #FFF;
|
|
710
|
-
background-image: url('https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif');
|
|
711
|
-
background-position: center;
|
|
712
|
-
background-size: 50px;
|
|
713
|
-
background-repeat: no-repeat;
|
|
714
739
|
}
|
|
715
740
|
|
|
716
741
|
.libang_content_pre {
|