askbot-dragon 1.5.58-beta → 1.5.59-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 -2
- package/src/assets/js/hammer.js +13 -2
- package/src/assets/less/converSationContainer/common.less +7 -0
- package/src/components/AnswerDocknowledge.vue +14 -2
- package/src/components/ConversationContainer.vue +45 -14
- package/src/components/answerRadio.vue +29 -28
- package/src/components/askVideo.vue +2 -5
- package/src/components/associationIntention.vue +3 -3
- package/src/components/formTemplate.vue +19 -24
- package/src/components/message/TicketMessage.vue +1 -1
- package/src/components/newPdfPosition.vue +878 -0
- package/src/components/pdfPosition.vue +95 -59
- package/src/components/previewPdf.vue +14 -6
- package/src/components/recommend.vue +9 -18
- package/src/components/utils/ckeditor.js +7 -10
- package/src/components/utils/ckeditorImageUpload/command.js +7 -9
- package/src/components/utils/ckeditorfileUpload/common.js +17 -10
- package/src/assets/js/obsBrowser.js +0 -63
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div id="pdf_view" class="pdf_view" :style="{
|
|
3
3
|
marginTop: isPC ? '50px' : '',
|
|
4
4
|
marginBottom: tagIds.length > 1 ? '60px' : '0px',
|
|
5
5
|
height: setHeight
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
</el-option>
|
|
18
18
|
</el-select>
|
|
19
19
|
</div>
|
|
20
|
+
<div class="pdf_container_view" id="pdf_container_view" @scroll="pdfScroll" ref="pdfView"></div>
|
|
20
21
|
<div class="btn_footer" v-if="tagIds.length > 1 && !isPC">
|
|
21
22
|
<div class="prev" @click="prev">上一段</div>
|
|
22
23
|
<div class="next" @click="next">下一段</div>
|
|
@@ -44,10 +45,11 @@ if (pdfjsLib) {
|
|
|
44
45
|
// 'pdfjs-dist/build/pdf.worker';
|
|
45
46
|
}
|
|
46
47
|
const { TextLayerBuilder } = window['pdfjs-dist/web/pdf_viewer']
|
|
48
|
+
const CSS_UNITS = 96.0 / 72.0
|
|
47
49
|
// import { zoomElement } from '../assets/js/hammer'
|
|
48
50
|
export default {
|
|
49
51
|
name: 'pdfView',
|
|
50
|
-
props: ['tagIds', 'isMessageRecord'],
|
|
52
|
+
props: ['tagIds', 'isMessageRecord','fileName'],
|
|
51
53
|
data () {
|
|
52
54
|
return {
|
|
53
55
|
url: '',
|
|
@@ -94,6 +96,7 @@ export default {
|
|
|
94
96
|
},
|
|
95
97
|
isTouchMoved: false,
|
|
96
98
|
transformSalce: null,
|
|
99
|
+
defaultTransform:0.8,
|
|
97
100
|
isPC: false,
|
|
98
101
|
handScale: 'auto',
|
|
99
102
|
scaleList: [
|
|
@@ -248,12 +251,13 @@ export default {
|
|
|
248
251
|
if (this.$refs.pdfView.clientWidth / this.pageSize.width >= 1 || this.isMessageRecord) {
|
|
249
252
|
this.contentView.style.width = `${pageSize.width - 10}px`;
|
|
250
253
|
this.contentView.style.height = `${(this.totalPageCount * (pageSize.height + this.PAGE_INTVERVAL)) + this.PAGE_INTVERVAL}px`;
|
|
254
|
+
this.contentView.style.margin = '0 auto 0'
|
|
251
255
|
} else {
|
|
252
|
-
this.transformSalce = this.$refs.pdfView.clientWidth / this.pageSize.width
|
|
256
|
+
this.transformSalce = this.$refs.pdfView.clientWidth / this.pageSize.width / CSS_UNITS
|
|
253
257
|
this.contentView.style.width = `${pageSize.width * this.transformSalce - 10}px`;
|
|
254
258
|
this.contentView.style.height = `${(this.totalPageCount * (pageSize.height * (this.transformSalce) + this.PAGE_INTVERVAL)) + this.PAGE_INTVERVAL}px`;
|
|
255
259
|
}
|
|
256
|
-
this.contentView.style.margin = '0 auto 0'
|
|
260
|
+
// this.contentView.style.margin = '0 auto 0'
|
|
257
261
|
this.contentView.style.position = 'relative'
|
|
258
262
|
this.contentView.style.paddingBottom = '60px'
|
|
259
263
|
// contentView.style.overflowY = 'auto'
|
|
@@ -281,36 +285,41 @@ export default {
|
|
|
281
285
|
const { pdfPage, pageNo, dom } = page;
|
|
282
286
|
// dom 元素已存在,无须重新渲染,直接返回
|
|
283
287
|
if ((dom && dom.children.length != 0) || page.loading) {
|
|
284
|
-
|
|
288
|
+
return;
|
|
285
289
|
}
|
|
286
290
|
page.loading = true
|
|
287
291
|
const viewport = pdfPage.getViewport({
|
|
288
|
-
|
|
289
|
-
|
|
292
|
+
scale: this.scale,
|
|
293
|
+
rotation: this.rotation,
|
|
290
294
|
});
|
|
291
295
|
// 创建新的canvas
|
|
292
296
|
const canvas = document.createElement('canvas');
|
|
293
297
|
const context = canvas.getContext('2d');
|
|
294
298
|
// canvas.getContext('2d');
|
|
295
|
-
canvas.height = this.pageSize.height;
|
|
296
|
-
canvas.width = this.pageSize.width;
|
|
299
|
+
canvas.height = this.pageSize.height * (this.fileName ? CSS_UNITS : 1);
|
|
300
|
+
canvas.width = this.pageSize.width * (this.fileName ? CSS_UNITS : 1);
|
|
297
301
|
canvas.style.position = 'relative'
|
|
298
302
|
canvas.style.top = -3 + 'px'
|
|
299
303
|
// 创建渲染的dom
|
|
300
304
|
const pageDom = document.createElement('div');
|
|
301
305
|
pageDom.style.position = 'absolute';
|
|
302
|
-
pageDom.style.top = `${((pageNo - 1) * (this.pageSize.height + this.PAGE_INTVERVAL)) + this.PAGE_INTVERVAL}px`;
|
|
303
|
-
pageDom.style.width = `${this.pageSize.width}px`;
|
|
304
|
-
pageDom.style.height = `${this.pageSize.height}px`;
|
|
306
|
+
pageDom.style.top = `${((pageNo - 1) * (this.pageSize.height + this.PAGE_INTVERVAL) * (this.fileName ? CSS_UNITS : 1)) + this.PAGE_INTVERVAL}px`;
|
|
307
|
+
pageDom.style.width = `${this.pageSize.width * (this.fileName ? CSS_UNITS : 1)}px`;
|
|
308
|
+
pageDom.style.height = `${this.pageSize.height * (this.fileName ? CSS_UNITS : 1)}px`;
|
|
305
309
|
pageDom.setAttribute('data-id', 'page' + pageNo)
|
|
306
|
-
pageDom.appendChild(canvas);
|
|
310
|
+
// pageDom.appendChild(canvas);
|
|
307
311
|
// 渲染内容
|
|
308
312
|
let renderContext = {
|
|
309
313
|
canvasContext: context,
|
|
310
314
|
viewport: viewport,
|
|
315
|
+
transform: this.fileName ? [CSS_UNITS, 0, 0, CSS_UNITS, 0, 0] : '',
|
|
311
316
|
}
|
|
312
317
|
await pdfPage.render(renderContext).promise.then(() => {
|
|
313
|
-
|
|
318
|
+
const html = canvas.toDataURL();
|
|
319
|
+
let image = document.createElement('img');
|
|
320
|
+
image.setAttribute('src',html)
|
|
321
|
+
pageDom.appendChild(image);
|
|
322
|
+
return pdfPage.getTextContent()
|
|
314
323
|
}).then(async (textContent) => {
|
|
315
324
|
const textLayerDiv = document.createElement('div');
|
|
316
325
|
textLayerDiv.setAttribute('class', 'textLayer');
|
|
@@ -340,36 +349,35 @@ export default {
|
|
|
340
349
|
let postionArr = lines[index].location
|
|
341
350
|
let div = document.createElement('div')
|
|
342
351
|
div.style.position = 'absolute';
|
|
343
|
-
div.style.left = postionArr[0] * this.scale + 'px',
|
|
352
|
+
div.style.left = postionArr[0] * this.scale * (this.fileName ? CSS_UNITS : 1) + 'px',
|
|
344
353
|
// 后端返回的坐标有基线对齐的问题,top 值是后端算好(基线top - 文字高度),在此加上文字高度的 1/9 (大致比例)为实际展示出文字的top值
|
|
345
|
-
div.style.top = postionArr[1] * this.scale + 'px'
|
|
346
|
-
div.style.height = postionArr[3] * this.scale + 'px';
|
|
347
|
-
div.style.width = postionArr[2] * this.scale + 'px'
|
|
354
|
+
div.style.top = postionArr[1] * this.scale * (this.fileName ? CSS_UNITS : 1) + 'px'
|
|
355
|
+
div.style.height = postionArr[3] * this.scale * (this.fileName ? CSS_UNITS : 1) + 'px';
|
|
356
|
+
div.style.width = postionArr[2] * this.scale * (this.fileName ? CSS_UNITS : 1) + 'px'
|
|
348
357
|
div.style.backgroundColor = 'rgba(54, 106, 255, 0.3)'
|
|
349
358
|
div.classList.add('lineHeight')
|
|
350
359
|
rectdom.appendChild(div)
|
|
351
360
|
if (index == 0 && j == 0) {
|
|
352
361
|
if (this.transformSalce !== null) {
|
|
353
|
-
rectdomTop = postionArr[1]
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
if (rectdom.children.length > 0) {
|
|
364
|
-
pageDom.appendChild(rectdom)
|
|
365
|
-
}
|
|
362
|
+
rectdomTop = postionArr[1]* this.scale * (this.fileName ? CSS_UNITS : 1) * this.transformSalce
|
|
363
|
+
} else {
|
|
364
|
+
rectdomTop = postionArr[1] * this.scale * (this.fileName ? CSS_UNITS : 1) * this.defaultTransform
|
|
365
|
+
}
|
|
366
|
+
// if(this.isPC) {
|
|
367
|
+
// rectdomTop = rectdomTop - 50 < 0 ? 0 : rectdomTop - 50
|
|
368
|
+
// }
|
|
366
369
|
}
|
|
370
|
+
}
|
|
367
371
|
}
|
|
372
|
+
if (rectdom.children.length > 0) {
|
|
373
|
+
pageDom.appendChild(rectdom)
|
|
374
|
+
}
|
|
375
|
+
}
|
|
368
376
|
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
377
|
+
}
|
|
378
|
+
textLayer.setTextContent(textContent);
|
|
379
|
+
textLayer.render()
|
|
380
|
+
pageDom.appendChild(textLayerDiv);
|
|
373
381
|
let backgroundDom = document.getElementById('backgroundLoad' + pageNo)
|
|
374
382
|
if (backgroundDom) {
|
|
375
383
|
this.contentView.removeChild(backgroundDom);
|
|
@@ -377,8 +385,22 @@ export default {
|
|
|
377
385
|
page.dom = await pageDom;
|
|
378
386
|
page.loading = false
|
|
379
387
|
this.contentView.appendChild(pageDom);
|
|
380
|
-
|
|
381
|
-
|
|
388
|
+
let pdf_view = document.getElementsByClassName('pdf_view');
|
|
389
|
+
if (pdf_view && pdf_view[0]){
|
|
390
|
+
pdf_view[0].style.backgroundImage = 'none'
|
|
391
|
+
}
|
|
392
|
+
let postionArr = []
|
|
393
|
+
if (findPage){
|
|
394
|
+
let AllLines = findPage.allLines
|
|
395
|
+
if (AllLines.length){
|
|
396
|
+
postionArr = AllLines[0].lines[0].location
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
if(this.transformSalce !== null && this.fileName) {
|
|
400
|
+
this.contentView.style.transform = `scale(${this.transformSalce}, ${this.transformSalce})`
|
|
401
|
+
} else {
|
|
402
|
+
this.contentView.style.transform = `scale(${this.defaultTransform})`;
|
|
403
|
+
|
|
382
404
|
}
|
|
383
405
|
if (this.changetoolbar) {
|
|
384
406
|
setTimeout(() => {
|
|
@@ -390,22 +412,21 @@ export default {
|
|
|
390
412
|
setTimeout(() => {
|
|
391
413
|
let pageoffsetHeight = 0
|
|
392
414
|
if (this.transformSalce !== null) {
|
|
393
|
-
pageoffsetHeight = (this.pageSize.height + this.PAGE_INTVERVAL) * this.transformSalce
|
|
415
|
+
pageoffsetHeight = (this.pageSize.height + this.PAGE_INTVERVAL) * this.transformSalce * (this.fileName ? CSS_UNITS : 1)
|
|
394
416
|
} else {
|
|
395
|
-
pageoffsetHeight = (this.pageSize.height + this.PAGE_INTVERVAL)
|
|
417
|
+
pageoffsetHeight = (this.pageSize.height + this.PAGE_INTVERVAL) * this.defaultTransform *(this.fileName ? CSS_UNITS : 1)
|
|
396
418
|
}
|
|
397
419
|
if (this.$refs.pdfView.clientHeight - pageoffsetHeight > 0 && pageIndex == 1) {
|
|
398
420
|
const height = this.$refs.pdfView.clientHeight;
|
|
399
421
|
let startNum = 0
|
|
400
422
|
let endNum = 0
|
|
401
423
|
if (this.transformSalce !== null) {
|
|
402
|
-
startNum = Math.ceil(this.$refs.pdfView.scrollTop / ((this.pageSize.height + this.PAGE_INTVERVAL) * this.transformSalce))
|
|
403
|
-
endNum = startNum + Math.ceil(height / ((this.pageSize.height + this.PAGE_INTVERVAL) * this.transformSalce))
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
endNum = startNum + Math.ceil(height / (this.pageSize.height + this.PAGE_INTVERVAL))
|
|
407
|
-
|
|
408
|
-
}
|
|
424
|
+
startNum = Math.ceil(this.$refs.pdfView.scrollTop / ((this.pageSize.height + this.PAGE_INTVERVAL) * this.transformSalce* (this.fileName ? CSS_UNITS : 1)))
|
|
425
|
+
endNum = startNum + Math.ceil(height / ((this.pageSize.height + this.PAGE_INTVERVAL) * this.transformSalce* (this.fileName ? CSS_UNITS : 1)))
|
|
426
|
+
} else {
|
|
427
|
+
startNum = Math.ceil(this.$refs.pdfView.scrollTop / ((this.pageSize.height + this.PAGE_INTVERVAL) * (this.fileName ? CSS_UNITS : 1) * this.defaultTransform))
|
|
428
|
+
endNum = startNum + Math.ceil(height / ((this.pageSize.height + this.PAGE_INTVERVAL) * (this.fileName ? CSS_UNITS : 1) * this.defaultTransform))}
|
|
429
|
+
console.log(this.$refs.pdfView.scrollTop, startNum, endNum, 'endNumendNum');
|
|
409
430
|
for (let pageIndex = startNum; pageIndex <= endNum; pageIndex++) {
|
|
410
431
|
if (pageIndex > 0 && pageIndex <= this.pages.length) {
|
|
411
432
|
this.loadPdfData(pageIndex)
|
|
@@ -437,14 +458,14 @@ export default {
|
|
|
437
458
|
let startNum = 0
|
|
438
459
|
let endNum = 0
|
|
439
460
|
if (this.transformSalce !== null) {
|
|
440
|
-
startNum = Math.ceil(scrollTop / ((that.pageSize.height + that.PAGE_INTVERVAL) * this.transformSalce))
|
|
441
|
-
endNum = startNum + Math.ceil(height / ((that.pageSize.height + that.PAGE_INTVERVAL) * this.transformSalce))
|
|
461
|
+
startNum = Math.ceil(scrollTop / ((that.pageSize.height + that.PAGE_INTVERVAL) * this.transformSalce * (this.fileName ? CSS_UNITS : 1)))
|
|
462
|
+
endNum = startNum + Math.ceil(height / ((that.pageSize.height + that.PAGE_INTVERVAL) * this.transformSalce * (this.fileName ? CSS_UNITS : 1)))
|
|
442
463
|
} else {
|
|
443
|
-
startNum = Math.ceil(scrollTop / (that.pageSize.height + that.PAGE_INTVERVAL))
|
|
444
|
-
endNum = startNum + Math.ceil(height / (that.pageSize.height + that.PAGE_INTVERVAL))
|
|
464
|
+
startNum = Math.ceil(scrollTop / ((that.pageSize.height + that.PAGE_INTVERVAL) * (this.fileName ? CSS_UNITS : 1) * this.defaultTransform))
|
|
465
|
+
endNum = startNum + Math.ceil(height / ((that.pageSize.height + that.PAGE_INTVERVAL) * (this.fileName ? CSS_UNITS : 1) * this.defaultTransform))
|
|
445
466
|
}
|
|
446
|
-
for (let pageIndex = startNum; pageIndex
|
|
447
|
-
if (pageIndex > 0 && pageIndex
|
|
467
|
+
for (let pageIndex = startNum; pageIndex <= endNum; pageIndex++) {
|
|
468
|
+
if (pageIndex > 0 && pageIndex <= that.pages.length) {
|
|
448
469
|
that.loadPdfData(pageIndex)
|
|
449
470
|
}
|
|
450
471
|
}
|
|
@@ -529,10 +550,10 @@ export default {
|
|
|
529
550
|
return
|
|
530
551
|
}
|
|
531
552
|
const pageDom = document.createElement('div');
|
|
532
|
-
pageDom.style.width = `${this.pageSize.width}px`;
|
|
533
|
-
pageDom.style.height = `${this.pageSize.height}px`;
|
|
553
|
+
pageDom.style.width = `${this.pageSize.width * (this.fileName ? CSS_UNITS : 1)}px`;
|
|
554
|
+
pageDom.style.height = `${this.pageSize.height * (this.fileName ? CSS_UNITS : 1)}px`;
|
|
534
555
|
pageDom.style.position = 'absolute';
|
|
535
|
-
pageDom.style.top = `${((pageNo - 1) * (this.pageSize.height + this.PAGE_INTVERVAL)) + this.PAGE_INTVERVAL
|
|
556
|
+
pageDom.style.top = `${((pageNo - 1) * (this.pageSize.height + this.PAGE_INTVERVAL) * (this.fileName ? CSS_UNITS : 1)) + this.PAGE_INTVERVAL
|
|
536
557
|
}px`;
|
|
537
558
|
pageDom.style.backgroundImage = `url('https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif')`
|
|
538
559
|
pageDom.style.backgroundPosition = 'center'
|
|
@@ -607,9 +628,9 @@ export default {
|
|
|
607
628
|
this.renderHighlights()
|
|
608
629
|
})
|
|
609
630
|
if (this.transformSalce !== null) {
|
|
610
|
-
this.$refs.pdfView.scrollTop = `${((pdfResloute.page - 1) * (this.pageSize.height + this.PAGE_INTVERVAL) * this.transformSalce) + (this.identifyTextPostion.top * this.scale * this.transformSalce)}`
|
|
631
|
+
this.$refs.pdfView.scrollTop = `${((pdfResloute.page - 1) * (this.pageSize.height + this.PAGE_INTVERVAL) * this.transformSalce * (this.fileName ? CSS_UNITS : 1)) + (this.identifyTextPostion.top * this.scale * this.transformSalce * (this.fileName ? CSS_UNITS : 1))}`
|
|
611
632
|
} else {
|
|
612
|
-
this.$refs.pdfView.scrollTop = `${((pdfResloute.page - 1) * (this.pageSize.height + this.PAGE_INTVERVAL)) + (this.identifyTextPostion.top * this.scale * this.
|
|
633
|
+
this.$refs.pdfView.scrollTop = `${((pdfResloute.page - 1) * (this.pageSize.height + this.PAGE_INTVERVAL) * this.defaultTransform * (this.fileName ? CSS_UNITS : 1)) + (this.identifyTextPostion.top * this.scale * this.defaultTransform * (this.fileName ? CSS_UNITS : 1))}`
|
|
613
634
|
}
|
|
614
635
|
},
|
|
615
636
|
scrollToExcalTop (currentPage) {
|
|
@@ -863,6 +884,7 @@ export default {
|
|
|
863
884
|
if (value && value.length) {
|
|
864
885
|
// 在 pdf_view 下创建 所有canvs的容器
|
|
865
886
|
this.contentView = document.createElement('div')
|
|
887
|
+
this.contentView.setAttribute('id','contentView')
|
|
866
888
|
this.contentView.style.transformOrigin = '0px 0px 0px'
|
|
867
889
|
this.$http.get('/knowledge-api/knowledge/knowledge-part-location-info/list?ids=' + value.join(',')).then(res => {
|
|
868
890
|
// res.data = {"data":[{"id":"64591b7d8bb8ab1b91c65f24","knowledgeId":"64591a9c8da27649473f3b4b","mainId":"fb348d095c0b4fd7bbd37826563dac7d","page":3,"total":18,"pageHeight":540.0,"pageWidth":960.00946,"publicPageFileUrl":"https://askbot-pdf-all.oss-cn-zhangjiakou.aliyuncs.com/fb348d095c0b4fd7bbd37826563dac7d/2023/05/08/11/55/18/64591b638bb8ab1b91c65eed/3.pdf","extractInfo":{"location":[280.488,161.32,398.71573,61.99298],"content":"黄花城水长城旅游区位于北京市怀柔区九渡河镇境内,距北京市区65公里,是以奇而著称,融山川、碧水、古长城为一体的旅游休闲胜地。而这里的“三绝景”更是引人入","lines":[{"content":"黄花城水长城旅游区位于北京市怀柔区九渡河镇境内,距","location":[280.488,161.32,398.71573,15.9869995]},{"content":"北京市区65公里,是以奇而著称,融山川、碧水、古长","location":[283.691,184.30899,392.3055,15.9869995]},{"content":"城为一体的旅游休闲胜地。而这里的“三绝景”更是引人入","location":[282.699,207.32599,394.3033,15.9869995]}],"tagId":null}}],"code":"0","msg":null,"traceId":null}
|
|
@@ -1053,11 +1075,16 @@ export default {
|
|
|
1053
1075
|
xhr.onload = ({ currentTarget }) => {
|
|
1054
1076
|
// 请求完成
|
|
1055
1077
|
if (currentTarget.status === 200) { // 返回200
|
|
1078
|
+
let pdf_view = document.getElementsByClassName('pdf_view');
|
|
1079
|
+
if (pdf_view && pdf_view[0]){
|
|
1080
|
+
pdf_view[0].style.backgroundImage = 'none'
|
|
1081
|
+
}
|
|
1056
1082
|
this.contentView.innerHTML = currentTarget.response
|
|
1057
1083
|
this.contentView.style.padding = '10px'
|
|
1058
1084
|
// this.contentView.style.position = 'relative'
|
|
1059
1085
|
this.$refs.pdfView.style.backgroundColor = '#FFFFFF'
|
|
1060
1086
|
this.$refs.pdfView.appendChild(this.contentView)
|
|
1087
|
+
|
|
1061
1088
|
let allTr = Array.from(this.$refs.pdfView.getElementsByTagName('tr'))
|
|
1062
1089
|
this.allTr = []
|
|
1063
1090
|
for (let index = 0; index < allTr.length; index++) {
|
|
@@ -1100,10 +1127,14 @@ export default {
|
|
|
1100
1127
|
width: 100%;
|
|
1101
1128
|
height: calc(100% - 110px);
|
|
1102
1129
|
overflow: auto;
|
|
1130
|
+
//overflow-y: scroll;
|
|
1103
1131
|
background-color: #f5f7fb;
|
|
1104
1132
|
// margin-bottom: 60px;
|
|
1105
1133
|
box-sizing: border-box;
|
|
1106
|
-
|
|
1134
|
+
background-image: url('https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif');
|
|
1135
|
+
background-position: center;
|
|
1136
|
+
background-size: 50px;
|
|
1137
|
+
background-repeat: no-repeat;
|
|
1107
1138
|
// position: relative;
|
|
1108
1139
|
// > div {
|
|
1109
1140
|
// width: 100%;
|
|
@@ -1292,6 +1323,12 @@ export default {
|
|
|
1292
1323
|
background: rgba(221, 222, 223, 1);
|
|
1293
1324
|
}
|
|
1294
1325
|
}
|
|
1326
|
+
.pdf_container_view{
|
|
1327
|
+
height: 100%;
|
|
1328
|
+
width: 100%;
|
|
1329
|
+
position: relative;
|
|
1330
|
+
overflow: auto;
|
|
1331
|
+
}
|
|
1295
1332
|
}
|
|
1296
1333
|
</style>
|
|
1297
1334
|
<style lang="less">
|
|
@@ -1304,7 +1341,6 @@ export default {
|
|
|
1304
1341
|
0% {
|
|
1305
1342
|
background: rgba(255, 136, 0, 0.3);
|
|
1306
1343
|
}
|
|
1307
|
-
|
|
1308
1344
|
25% {
|
|
1309
1345
|
background: rgba(255, 136, 0, 0.6);
|
|
1310
1346
|
}
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
</div>
|
|
55
55
|
<div id="drawer_content_pre">
|
|
56
56
|
<template v-if="tagIds && tagIds.length != 0 && drawer">
|
|
57
|
-
<pdfPosition :tagIds="tagIds" :isMessageRecord="isMessageRecord"></pdfPosition>
|
|
57
|
+
<pdfPosition :tagIds="tagIds" :isMessageRecord="isMessageRecord" :fileName="fileName" ref="pdfPosition"></pdfPosition>
|
|
58
58
|
</template>
|
|
59
59
|
<template v-else>
|
|
60
60
|
<div v-if="fileType == 'VIDEO'" style="width: 100%;">
|
|
@@ -97,6 +97,7 @@ export default {
|
|
|
97
97
|
tagIds: [],
|
|
98
98
|
// '6454aa1a70573a6ead6f0f7d', '6454aa1a70573a6ead6f0f81',
|
|
99
99
|
loading:true,
|
|
100
|
+
fileName:''
|
|
100
101
|
}
|
|
101
102
|
},
|
|
102
103
|
mounted() {
|
|
@@ -126,9 +127,20 @@ export default {
|
|
|
126
127
|
drawer(value) {
|
|
127
128
|
if(value) {
|
|
128
129
|
this.$nextTick(() =>{
|
|
129
|
-
|
|
130
|
+
if (this.tagIds && this.tagIds.length != 0){
|
|
131
|
+
zoomElement(document.getElementById('pdf_container_view'))
|
|
132
|
+
}
|
|
130
133
|
})
|
|
131
134
|
}
|
|
135
|
+
setTimeout(() => {
|
|
136
|
+
let previewIframe = document.getElementsByClassName('preview_iframe')
|
|
137
|
+
Array.from(previewIframe).forEach(item =>{
|
|
138
|
+
item.onload = () =>{
|
|
139
|
+
console.debug('previewIframe 106',previewIframe,this.drawer)
|
|
140
|
+
item.style.backgroundImage = 'none'
|
|
141
|
+
}
|
|
142
|
+
})
|
|
143
|
+
})
|
|
132
144
|
}
|
|
133
145
|
},
|
|
134
146
|
computed:{
|
|
@@ -282,10 +294,6 @@ export default {
|
|
|
282
294
|
overflow: auto;
|
|
283
295
|
height: calc(100% - 50px);
|
|
284
296
|
background: #FFF;
|
|
285
|
-
background-image: url('https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif');
|
|
286
|
-
background-position: center;
|
|
287
|
-
background-size: 50px;
|
|
288
|
-
background-repeat: no-repeat;
|
|
289
297
|
}
|
|
290
298
|
}
|
|
291
299
|
@media screen and (min-width: 768px) {
|
|
@@ -8,23 +8,9 @@
|
|
|
8
8
|
class="options-item"
|
|
9
9
|
:class="index!==msg.recommend.list.length -1?'recommend-item':'last-item'"
|
|
10
10
|
:key="msg.nodeId + '_' + index"
|
|
11
|
-
@click="
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
'recdNodeId' +
|
|
15
|
-
'_' +
|
|
16
|
-
index +
|
|
17
|
-
'_' +
|
|
18
|
-
option.id +
|
|
19
|
-
'_' +
|
|
20
|
-
option.text,
|
|
21
|
-
option.text,
|
|
22
|
-
msg.apiKey
|
|
23
|
-
)
|
|
24
|
-
"
|
|
25
|
-
>
|
|
26
|
-
{{ option.text
|
|
27
|
-
}}<i class="arsenal_icon arsenalangle-right-solid"></i>
|
|
11
|
+
@click="radioClick(option,index,msg)">
|
|
12
|
+
{{ option.text}}
|
|
13
|
+
<i class="arsenal_icon arsenalangle-right-solid"></i>
|
|
28
14
|
</p>
|
|
29
15
|
</div>
|
|
30
16
|
</div>
|
|
@@ -35,7 +21,12 @@
|
|
|
35
21
|
|
|
36
22
|
export default {
|
|
37
23
|
name: "recommend",
|
|
38
|
-
props: ["msg"]
|
|
24
|
+
props: ["msg"],
|
|
25
|
+
methods:{
|
|
26
|
+
radioClick(option,index,msg){
|
|
27
|
+
this.$emit('onRadioClickReco','recdNodeId' + '_' + index + '_' + option.id + '_' + option.text, option.text, msg.apiKey,option.apiKey)
|
|
28
|
+
},
|
|
29
|
+
}
|
|
39
30
|
}
|
|
40
31
|
</script>
|
|
41
32
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
import {multipartUpload, ossFileUrl} from "./AliyunIssUtil";
|
|
3
3
|
import { v4 as uuidv4 } from "uuid";
|
|
4
|
-
import { putObject } from "../../assets/js/obsBrowser";
|
|
5
4
|
const ossConfig = {
|
|
6
5
|
region: "oss-cn-zhangjiakou",
|
|
7
6
|
//云账号AccessKey有所有API访问权限,建议遵循阿里云安全最佳实践,创建并使用STS方式来进行API访问
|
|
@@ -56,16 +55,14 @@ class MyUploadAdapter {
|
|
|
56
55
|
let imgInfo = {
|
|
57
56
|
url:'',
|
|
58
57
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
let res = putObject(file);
|
|
58
|
+
let res = multipartUpload(
|
|
59
|
+
ossConfig,
|
|
60
|
+
file,
|
|
61
|
+
null,
|
|
62
|
+
imgInfo
|
|
63
|
+
);
|
|
66
64
|
res.then(resp=>{
|
|
67
|
-
|
|
68
|
-
imgInfo.url = resp.url;
|
|
65
|
+
imgInfo.url = ossFileUrl(ossConfig, resp.name)
|
|
69
66
|
let root = this.editor.model.document.getRoot()
|
|
70
67
|
let children = root.getChildren()
|
|
71
68
|
for(let child of children){
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import Command from "@ckeditor/ckeditor5-core/src/command";
|
|
2
2
|
import { multipartUpload, ossFileUrl } from "../AliyunIssUtil";
|
|
3
|
-
import { putObject } from "../../../assets/js/obsBrowser";
|
|
4
3
|
const ossConfig = {
|
|
5
4
|
region: "oss-cn-zhangjiakou",
|
|
6
5
|
//云账号AccessKey有所有API访问权限,建议遵循阿里云安全最佳实践,创建并使用STS方式来进行API访问
|
|
@@ -92,16 +91,15 @@ export default class ImageCommand extends Command {
|
|
|
92
91
|
let imgInfo = {
|
|
93
92
|
url: '',
|
|
94
93
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
let res = putObject(file)
|
|
94
|
+
let res = multipartUpload(
|
|
95
|
+
ossConfig,
|
|
96
|
+
file,
|
|
97
|
+
null,
|
|
98
|
+
imgInfo
|
|
99
|
+
);
|
|
102
100
|
console.log(res,'resprespresp');
|
|
103
101
|
res.then(resp => {
|
|
104
|
-
imgInfo.url = resp.
|
|
102
|
+
imgInfo.url = ossFileUrl(ossConfig, resp.name)
|
|
105
103
|
console.log(resp,'resprespresp');
|
|
106
104
|
console.log(imgInfo)
|
|
107
105
|
resolve({
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import Command from "@ckeditor/ckeditor5-core/src/command";
|
|
2
|
+
import { multipartUpload, ossFileUrl } from "../AliyunIssUtil";
|
|
2
3
|
import { v4 as uuidv4 } from "uuid";
|
|
3
|
-
|
|
4
|
+
|
|
5
|
+
const ossConfig = {
|
|
6
|
+
region: "oss-cn-zhangjiakou",
|
|
7
|
+
//云账号AccessKey有所有API访问权限,建议遵循阿里云安全最佳实践,创建并使用STS方式来进行API访问
|
|
8
|
+
accessKeyId: "LTAI4G3QtdEdwkEbihBngAsK",
|
|
9
|
+
accessKeySecret: "OwgdVfc5PeCkIgqIdug660xmiSPchn",
|
|
10
|
+
// stsToken: '<Your securityToken(STS)>',
|
|
11
|
+
bucket: "guoranopen-zjk",
|
|
12
|
+
}
|
|
4
13
|
|
|
5
14
|
function findListener(askPluginListeners, type) {
|
|
6
15
|
for (let i = 0, len = askPluginListeners.length; i < len; i++) {
|
|
@@ -155,16 +164,14 @@ export default class FileCommand extends Command {
|
|
|
155
164
|
let imgInfo = {
|
|
156
165
|
url: '',
|
|
157
166
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
let res = putObject(file);
|
|
167
|
+
let res = multipartUpload(
|
|
168
|
+
ossConfig,
|
|
169
|
+
file,
|
|
170
|
+
null,
|
|
171
|
+
imgInfo
|
|
172
|
+
);
|
|
165
173
|
res.then(resp => {
|
|
166
|
-
|
|
167
|
-
imgInfo.url = resp.url;
|
|
174
|
+
imgInfo.url = ossFileUrl(ossConfig, resp.name)
|
|
168
175
|
resolve({
|
|
169
176
|
name: resp.name,
|
|
170
177
|
default: imgInfo.url
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// 创建ObsClient实例
|
|
2
|
-
import ObsClient from 'esdk-obs-browserjs';
|
|
3
|
-
const obsClient = new ObsClient({
|
|
4
|
-
access_key_id: "EE4MAFWH4YLQSQF7NNIP",
|
|
5
|
-
secret_access_key: "Dq9giqqwZoX77dqSIzhA1Yhhe9tarA3LRBGBF4eO",
|
|
6
|
-
server : 'https://obs.cn-east-3.myhuaweicloud.com',
|
|
7
|
-
timeout : 1000
|
|
8
|
-
});
|
|
9
|
-
let mainId = sessionStorage.getItem('_mainId') ? sessionStorage.getItem('_mainId') : "";
|
|
10
|
-
let IDX = 256, HEX = [], SIZE = 256, BUFFER;
|
|
11
|
-
while (IDX--) HEX[IDX] = (IDX + 256).toString(16).substring(1);
|
|
12
|
-
function uid(len) {
|
|
13
|
-
let i = 0, tmp = (len || 11);
|
|
14
|
-
if (!BUFFER || ((IDX + tmp) > SIZE * 2)) {
|
|
15
|
-
for (BUFFER = '', IDX = 0; i < SIZE; i++) {
|
|
16
|
-
BUFFER += HEX[Math.random() * 256 | 0];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return BUFFER.substring(IDX, IDX++ + tmp);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function dataFormat(fmt, date = new Date()) {
|
|
24
|
-
const o = {
|
|
25
|
-
"M+": date.getMonth() + 1, //月份
|
|
26
|
-
"d+": date.getDate(), //日
|
|
27
|
-
"h+": date.getHours(), //小时
|
|
28
|
-
"m+": date.getMinutes(), //分
|
|
29
|
-
"s+": date.getSeconds(), //秒
|
|
30
|
-
"q+": Math.floor((date.getMonth() + 3) / 3), //季度
|
|
31
|
-
"S": date.getMilliseconds() //毫秒
|
|
32
|
-
};
|
|
33
|
-
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
|
|
34
|
-
for (const k in o)
|
|
35
|
-
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
|
36
|
-
return fmt;
|
|
37
|
-
}
|
|
38
|
-
async function putObject(file,callback){
|
|
39
|
-
let fileUrl = ''
|
|
40
|
-
let objName = (process.env.VUE_APP_ENV === 'development' ? 'dev_' : 'pro_') + file.name;
|
|
41
|
-
let fileName = "front-oss/" + mainId + '/' + dataFormat("yyyy/MM/dd/hh/mm/") + uid(32) + "/" + objName;
|
|
42
|
-
await obsClient.putObject({
|
|
43
|
-
Bucket: 'askbot-uat',
|
|
44
|
-
Key : fileName,
|
|
45
|
-
SourceFile : file,
|
|
46
|
-
ACL : obsClient.enums.AclPublicRead,
|
|
47
|
-
ProgressCallback: callback
|
|
48
|
-
}).then(function(result) {
|
|
49
|
-
if(result.CommonMsg.Status < 300){
|
|
50
|
-
console.log('Create object:' + JSON.stringify(result) + ' successfully!\n',process.env.VUE_APP_ENV);
|
|
51
|
-
let domain = process.env.VUE_APP_ENV ==='development' ? 'https://askbot-uat.obs.cn-east-3.myhuaweicloud.com/' : ''
|
|
52
|
-
fileUrl = {
|
|
53
|
-
url: domain + fileName,
|
|
54
|
-
name:file.name
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
return fileUrl
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export {
|
|
62
|
-
putObject
|
|
63
|
-
}
|