askbot-dragon 1.7.25-beta → 1.7.28-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/package.json +14 -14
  2. package/public/index.html +10 -8
  3. package/src/assets/js/AliyunlssUtil.js +50 -51
  4. package/src/assets/js/hammer.js +2 -13
  5. package/src/assets/less/converSationContainer/common.less +0 -7
  6. package/src/components/ActionAlertIframe.vue +1 -24
  7. package/src/components/AiGuide.vue +154 -121
  8. package/src/components/AnswerDocknowledge.vue +8 -8
  9. package/src/components/ConversationContainer.vue +211 -15
  10. package/src/components/MyEditor.vue +2 -12
  11. package/src/components/actionSatisfaction.vue +3 -3
  12. package/src/components/answerRadio.vue +3 -3
  13. package/src/components/askVideo.vue +2 -25
  14. package/src/components/associationIntention.vue +7 -11
  15. package/src/components/formTemplate.vue +54 -68
  16. package/src/components/intelligentSummary.vue +15 -17
  17. package/src/components/markDownText.vue +50 -14
  18. package/src/components/message/TextMessage.vue +11 -15
  19. package/src/components/message/swiper/ticketSwiper.vue +1 -1
  20. package/src/components/pdfPosition.vue +99 -271
  21. package/src/components/popup.vue +2 -2
  22. package/src/components/previewDoc.vue +2 -6
  23. package/src/components/previewPdf.vue +136 -166
  24. package/src/components/senderMessagePlatform.vue +4 -4
  25. package/src/components/utils/AliyunIssUtil.js +33 -12
  26. package/src/components/utils/ckeditor.js +59 -48
  27. package/src/components/welcomeKnowledgeFile.vue +2 -6
  28. package/src/components/welcomeLlmCard.vue +1 -5
  29. package/src/components/welcomeSuggest.vue +1 -1
  30. package/src/locales/cn.json +24 -70
  31. package/src/locales/en.json +24 -71
  32. package/src/main.js +16 -18
  33. package/src/components/newPdfPosition.vue +0 -878
  34. package/src/locales/jp.json +0 -73
@@ -12,14 +12,14 @@
12
12
  </div>
13
13
  <div v-if="isCompany">
14
14
  <div v-if="single === true" class="editMessage">
15
- <el-input v-model="input" :placeholder="$t('common.inputPlaceholder')" class="inputClass" @input="testClick" @blur="inputBlur"></el-input>
15
+ <el-input v-model="input" placeholder="请输入内容" class="inputClass" @input="testClick" @blur="inputBlur"></el-input>
16
16
  <!-- <span @click="quedingClick" style="display: flex;align-items: center"><i class="el-icon-success" style="color: #4C61E1;font-size: 32px;cursor: pointer"></i></span>
17
17
  --> </div>
18
18
  <div v-if="date" class="editMessage">
19
19
  <el-date-picker
20
20
  v-model="dateValue"
21
21
  type="date"
22
- :placeholder="$t('common.selectDate')"
22
+ placeholder="选择日期"
23
23
  style="width: 100%;margin: 10px 0 10px 0"
24
24
  :clearable=false
25
25
  @change="dataclick"
@@ -31,7 +31,7 @@
31
31
  <div v-if="time" class="editMessage">
32
32
  <el-time-picker
33
33
  v-model="timeValue"
34
- :placeholder="$t('common.selectTime')"
34
+ placeholder="任意时间点"
35
35
  style="margin: 10px 0 10px 0;width: 100%"
36
36
  :clearable=false
37
37
  @change="dataclick"
@@ -43,7 +43,7 @@
43
43
  <el-date-picker
44
44
  v-model="dateTimeValue"
45
45
  type="datetime"
46
- :placeholder="$t('common.selectDateTime')"
46
+ placeholder="选择日期时间"
47
47
  style="width: 100%;margin: 10px 0 10px 0"
48
48
  @change="dataclick"
49
49
  >
@@ -92,7 +92,7 @@
92
92
  </div>
93
93
  <div v-if="isPhone">
94
94
  <div v-if="single" class="editMessage">
95
- <el-input v-model="input" :placeholder="$t('common.inputPlaceholder')" class="inputClass" @input="testClick" @blur="inputBlur"></el-input>
95
+ <el-input v-model="input" placeholder="请输入内容" class="inputClass" @input="testClick" @blur="inputBlur"></el-input>
96
96
  <!-- <span @click="quedingClick" style="display: flex;align-items: center"><i class="el-icon-success" style="color: #4C61E1;font-size: 32px;cursor: pointer"></i></span>
97
97
  --> </div>
98
98
  <div v-if="date">
@@ -113,7 +113,7 @@
113
113
  <van-datetime-picker
114
114
  v-model="timeValue"
115
115
  type="datetime"
116
- :title="$t('common.selectTime')"
116
+ title="选择时间"
117
117
  :min-date="minDate"
118
118
  :formatter="formatter"
119
119
  @cancel="showTimePicker = false"
@@ -134,7 +134,7 @@
134
134
  <van-datetime-picker
135
135
  v-model="dateTimeValue"
136
136
  type="datetime"
137
- :title="$t('common.selectDateTime')"
137
+ title="选择日期时间"
138
138
  :min-date="minDate"
139
139
  :formatter="formatter"
140
140
  @cancel="showDateTimePicker = false"
@@ -301,11 +301,7 @@ export default {
301
301
  },
302
302
  type:String,
303
303
  disable:Boolean,
304
- submit:Boolean,
305
- language:{
306
- type:String,
307
- default:"cn"
308
- }
304
+ submit:Boolean
309
305
  },
310
306
  mounted() {
311
307
  this.isMobile()
@@ -371,11 +367,11 @@ export default {
371
367
  }
372
368
  if(this.submit===true)
373
369
  {
374
- this.submitValue=this.$t('common.confirmed')
370
+ this.submitValue='已确认'
375
371
  }
376
372
  else
377
373
  {
378
- this.submitValue=this.$t('common.confirm')
374
+ this.submitValue='确认'
379
375
  }
380
376
  },
381
377
  methods:{
@@ -616,7 +612,7 @@ export default {
616
612
  infomation['template']=innerhtml.querySelector('#html').innerHTML
617
613
  infomation['apiKey']=this.text.apiKey
618
614
  this.$emit('submitClick',infomation,this.text.apiKey)
619
- this.submitValue=this.$t('common.confirmed')
615
+ this.submitValue='已确认'
620
616
  this.disableds=true
621
617
  },
622
618
  addZero(i){
@@ -9,7 +9,7 @@
9
9
  >
10
10
  <slot></slot>
11
11
  </div>
12
- <div v-if="device==='PC'&&content.multiple===true && content.cards && content.cards.length > 1" class="clickBtn">
12
+ <div v-if="device==='PC'&&content.multiple===true" class="clickBtn">
13
13
  <div class="preBtn" @click="preClick" style="display: flex">
14
14
  <i class="el-icon-arrow-left" style="font-size: 18px;font-weight:800;align-self: center;margin: auto"></i>
15
15
  </div>
@@ -1,29 +1,36 @@
1
1
  <template>
2
2
  <div class="pdf_view" id="pdf_view">
3
- <div class="change_scale" v-if="isPC">
4
- <section @click="changeScale('reduce')">
5
- <i class="el-icon-minus"></i>
6
- </section>
7
- <el-divider direction="vertical"></el-divider>
8
- <section @click="changeScale('zoom')">
9
- <i class="el-icon-plus"></i>
10
- </section>
11
- <el-select size="small" v-model="handScale" @change="changeScale" :placeholder="$t('common.selectPlaceholder')">
12
- <el-option v-for="item in scaleList" :key="item.value" :label="item.label" :value="item.value">
13
- </el-option>
14
- </el-select>
15
- </div>
16
- <div class="pdf_container_view" id="pdf_container_view" @scroll="pdfScroll" ref="pdfView"></div>
17
- <div class="btn_footer" v-if="tagIds.length > 1 && !isPC">
18
- <div class="prev" @click="prev">{{$t('common.previous')}}</div>
19
- <div class="next" @click="next">{{$t('common.next')}}</div>
20
- </div>
21
- <div id="pagination" v-if="tagIds.length > 1 && isPC">
22
- <el-pagination :current-page="currentPage + 1" @current-change="currentChange" @prev-click="prev"
23
- @next-click="next" layout="slot, prev, pager, next" :page-size="1" :total="tagIds.length">
24
- <span class="total-class">{{$t('previewPdf.answer')}}{{ tagIds.length }}{{$t('previewPdf.answerTip')}}</span>
25
- </el-pagination>
26
- </div>
3
+ <div class="change_scale" v-if="isPC">
4
+ <section @click="changeScale('reduce')">
5
+ <i class="el-icon-minus"></i>
6
+ </section>
7
+ <el-divider direction="vertical"></el-divider>
8
+ <section @click="changeScale('zoom')">
9
+ <i class="el-icon-plus"></i>
10
+ </section>
11
+ <el-select size="small" v-model="handScale" @change="changeScale" :placeholder="$t('dragonCommon.selectScale')">
12
+ <el-option v-for="item in scaleList" :key="item.value" :label="item.label" :value="item.value">
13
+ </el-option>
14
+ </el-select>
15
+ </div>
16
+ <div class="pdf_container_view" id="pdf_container_view" @scroll="pdfScroll" ref="pdfView"></div>
17
+ <div class="btn_footer" v-if="tagIds.length > 1 && !isPC">
18
+ <div class="prev" @click="prev">{{ $t('dragonCommon.previous') }}</div>
19
+ <div class="next" @click="next">{{ $t('dragonCommon.next') }}</div>
20
+ </div>
21
+ <div id="pagination" v-if="tagIds.length > 1 && isPC">
22
+ <el-pagination
23
+ :current-page="currentPage + 1"
24
+ @current-change="currentChange"
25
+ @prev-click="prev"
26
+ @next-click="next"
27
+ layout="slot, prev, pager, next"
28
+ :page-size="1"
29
+ :total="tagIds.length"
30
+ >
31
+ <span class="total-class">{{ $t('dragonCommon.answersGeneratedByPre') }}{{tagIds.length}}{{ $t('dragonCommon.answersGeneratedByAfter') }}</span>
32
+ </el-pagination>
33
+ </div>
27
34
  </div>
28
35
  </template>
29
36
  <script>
@@ -45,11 +52,10 @@ if (pdfjsLib) {
45
52
  // 'pdfjs-dist/build/pdf.worker';
46
53
  }
47
54
  const { TextLayerBuilder } = window['pdfjs-dist/web/pdf_viewer']
48
- const CSS_UNITS = 96.0 / 72.0
49
55
  // import { zoomElement } from '../assets/js/hammer'
50
56
  export default {
51
57
  name: 'pdfView',
52
- props: ['tagIds', 'isMessageRecord','fileName', "knowledgeItem",'textWatermarkStr'],
58
+ props: ['tagIds', 'isMessageRecord','textWatermarkStr'],
53
59
  data () {
54
60
  return {
55
61
  url: '',
@@ -96,40 +102,9 @@ export default {
96
102
  },
97
103
  isTouchMoved: false,
98
104
  transformSalce: null,
99
- defaultTransform:0.8,
100
105
  isPC: false,
101
106
  handScale: 'auto',
102
- scaleList: [
103
- {
104
- label: '自动缩放',
105
- value: 'auto'
106
- },
107
- {
108
- label: '实际比例',
109
- value: 'reality'
110
- },
111
- {
112
- label: '100%',
113
- value: 1
114
- },
115
- {
116
- label: '120%',
117
- value: 1.2
118
- },
119
- {
120
- label: '150%',
121
- value: 1.5
122
- },
123
- {
124
- label: '170%',
125
- value: 1.7
126
- }
127
- ,
128
- {
129
- label: '200%',
130
- value: 2
131
- }
132
- ],
107
+ scaleList: [],
133
108
  scrollTop: 0,
134
109
  scrollLeft: 0
135
110
  }
@@ -287,12 +262,12 @@ export default {
287
262
  const { pdfPage, pageNo, dom } = page;
288
263
  // dom 元素已存在,无须重新渲染,直接返回
289
264
  if ((dom && dom.children.length != 0) || page.loading) {
290
- return;
265
+ return;
291
266
  }
292
267
  page.loading = true
293
268
  const viewport = pdfPage.getViewport({
294
- scale: this.scale,
295
- rotation: this.rotation,
269
+ scale: this.scale,
270
+ rotation: this.rotation,
296
271
  });
297
272
  // 创建新的canvas
298
273
  const canvas = document.createElement('canvas');
@@ -341,34 +316,32 @@ export default {
341
316
  rectdom.style.top = 0
342
317
  rectdom.style.left = 0
343
318
  rectdom.classList.add('rectdom')
344
- if (lines){
345
- for (let index = 0; index < lines.length; index++) {
319
+ for (let index = 0; index < lines.length; index++) {
346
320
  if (!/^\s+$/g.test(lines[index].content)) {
347
- let postionArr = lines[index].location
348
- let div = document.createElement('div')
349
- div.style.position = 'absolute';
350
- div.style.left = postionArr[0] * this.scale + 'px',
351
- // 后端返回的坐标有基线对齐的问题,top 值是后端算好(基线top - 文字高度),在此加上文字高度的 1/9 (大致比例)为实际展示出文字的top值
352
- div.style.top = postionArr[1] * this.scale + 'px'
353
- div.style.height = postionArr[3] * this.scale + 'px';
354
- div.style.width = postionArr[2] * this.scale + 'px'
355
- div.style.backgroundColor = 'rgba(54, 106, 255, 0.3)'
356
- div.classList.add('lineHeight')
357
- rectdom.appendChild(div)
358
- if (index == 0 && j == 0) {
359
- if (this.transformSalce !== null) {
360
- rectdomTop = postionArr[1] * this.scale * this.transformSalce
361
- } else {
362
- rectdomTop = postionArr[1] * this.scale
321
+ let postionArr = lines[index].location
322
+ let div = document.createElement('div')
323
+ div.style.position = 'absolute';
324
+ div.style.left = postionArr[0] * this.scale + 'px',
325
+ // 后端返回的坐标有基线对齐的问题,top 值是后端算好(基线top - 文字高度),在此加上文字高度的 1/9 (大致比例)为实际展示出文字的top值
326
+ div.style.top = postionArr[1] * this.scale + 'px'
327
+ div.style.height = postionArr[3] * this.scale + 'px';
328
+ div.style.width = postionArr[2] * this.scale + 'px'
329
+ div.style.backgroundColor = 'rgba(54, 106, 255, 0.3)'
330
+ div.classList.add('lineHeight')
331
+ rectdom.appendChild(div)
332
+ if (index == 0 && j == 0) {
333
+ if (this.transformSalce !== null) {
334
+ rectdomTop = postionArr[1] * this.scale * this.transformSalce
335
+ } else {
336
+ rectdomTop = postionArr[1] * this.scale
337
+ }
338
+ // if(this.isPC) {
339
+ // rectdomTop = rectdomTop - 50 < 0 ? 0 : rectdomTop - 50
340
+ // }
363
341
  }
364
- // if(this.isPC) {
365
- // rectdomTop = rectdomTop - 50 < 0 ? 0 : rectdomTop - 50
366
- // }
367
- }
368
342
  }
369
- }
370
343
  }
371
- if (rectdom.children && rectdom.children.length > 0) {
344
+ if (rectdom.children.length > 0) {
372
345
  pageDom.appendChild(rectdom)
373
346
  }
374
347
  }
@@ -385,10 +358,6 @@ export default {
385
358
  page.dom = await pageDom;
386
359
  page.loading = false
387
360
  this.contentView.appendChild(pageDom);
388
- let pdf_view = document.getElementsByClassName('pdf_view');
389
- if (pdf_view && pdf_view[0]){
390
- pdf_view[0].style.backgroundImage = 'none'
391
- }
392
361
  if (this.transformSalce !== null) {
393
362
  this.contentView.style.transform = `scale(${this.transformSalce}, ${this.transformSalce})`
394
363
  }
@@ -455,7 +424,7 @@ export default {
455
424
  startNum = Math.ceil(scrollTop / (that.pageSize.height + that.PAGE_INTVERVAL))
456
425
  endNum = startNum + Math.ceil(height / (that.pageSize.height + that.PAGE_INTVERVAL))
457
426
  }
458
- for (let pageIndex = startNum; pageIndex <= endNum; pageIndex++) {
427
+ for (let pageIndex = startNum; pageIndex < endNum; pageIndex++) {
459
428
  if (pageIndex > 0 && pageIndex <= that.pages.length) {
460
429
  that.loadPdfData(pageIndex)
461
430
  }
@@ -560,7 +529,7 @@ export default {
560
529
  this.currentPage = 0
561
530
  if (!this.isPC) {
562
531
  this.$toast({
563
- message: '当前已经是第一段了',
532
+ message: this.$t('dragonCommon.firstParagraph'),
564
533
  duration: 2000,
565
534
  })
566
535
  return
@@ -579,7 +548,7 @@ export default {
579
548
  this.currentPage = this.tagIds.length - 1
580
549
  if (!this.isPC) {
581
550
  this.$toast({
582
- message: '当前已经是最后一段了',
551
+ message: this.$t('dragonCommon.lastParagraph'),
583
552
  duration: 2000,
584
553
  })
585
554
  return
@@ -699,20 +668,14 @@ export default {
699
668
  // this.currentPageAllLine[i].allLines.lines.push(item.extractInfo.lines)
700
669
  this.currentPageAllLine[i].allLines.push({
701
670
  pageCount: index,
702
- lines: item.extractInfo.lines ? item.extractInfo.lines : [{
703
- content:"测试内容填充,不必理会",
704
- location:item.extractInfo.location
705
- }]
671
+ lines: item.extractInfo.lines
706
672
  })
707
673
  } else {
708
674
  this.currentPageAllLine.push({
709
675
  page: item.page,
710
676
  allLines: [{
711
677
  pageCount: index,
712
- lines: item.extractInfo.lines ? item.extractInfo.lines : [{
713
- content:"测试内容填充,不必理会",
714
- location:item.extractInfo.location
715
- }]
678
+ lines: item.extractInfo.lines
716
679
  }],
717
680
  })
718
681
  }
@@ -854,164 +817,6 @@ export default {
854
817
  this.contentView.style.transform = 'scale(' + this.transformSalce + ')';
855
818
  // this.getpdfResloutePage(this.cachePdf[0])
856
819
  },
857
- //添加水印
858
- watermark() {
859
- //默认设置
860
- var defaultSettings = {
861
- watermark_txt:"",
862
- watermark_x: 0,//水印起始位置x轴坐标
863
- watermark_y: 0,//水印起始位置Y轴坐标
864
- watermark_rows: 0,//水印行数
865
- watermark_cols: 0,//水印列数
866
- watermark_x_space: 40,//水印x轴间隔
867
- watermark_y_space: 60,//水印y轴间隔
868
- watermark_color: 'black',//水印字体颜色
869
- watermark_alpha: .3,//水印透明度
870
- watermark_fontsize: 12,//水印字体大小
871
- watermark_font: '微软雅黑',//水印字体
872
- watermark_width: 100,//水印宽度
873
- watermark_height: 80,//水印长度
874
- watermark_angle: 20,//水印倾斜度数***
875
- visitorWatermark_txt:""
876
- };
877
- if(this.knowledgeItem.textWatermarkValue){
878
- defaultSettings.watermark_txt = this.knowledgeItem.textWatermarkValue;
879
- }
880
- if (this.knowledgeItem.visitorWatermarkValue){
881
- defaultSettings.visitorWatermark_txt = this.knowledgeItem.visitorWatermarkValue
882
- }
883
- //采用配置项替换默认值,作用类似jquery.extend
884
- if (arguments.length === 1 && typeof arguments[0] === "object") {
885
- console.log("arguments = " + JSON.stringify(arguments[0]));
886
- // 获取参数配置
887
- var src = arguments[0];
888
- for (let key in src) {
889
- if (src[key] && defaultSettings[key] && src[key] === defaultSettings[key])
890
- continue;
891
- else if (src[key])
892
- defaultSettings[key] = src[key];
893
- }
894
- }
895
- var oTemp = document.createDocumentFragment();
896
- //获取页面最大宽度
897
- console.debug('pdf_view',document.getElementById('pdf_view'))
898
- let scrollWidth = document.getElementById('pdf_view').scrollWidth;
899
- let clientWidth = document.getElementById('pdf_view').clientWidth;
900
- var page_width = Math.max(scrollWidth, clientWidth);
901
-
902
- var cutWidth = page_width * 0.0150;
903
-
904
- page_width = page_width - cutWidth;
905
-
906
- //获取页面最大高度
907
- let height = parseInt(this.totalPageCount * this.pageSize.height)
908
- var page_height = Math.max(document.getElementById('pdf_container_view').scrollHeight,height);
909
-
910
- console.debug('page_height',page_height,this.totalPageCount * this.pageSize.height);
911
-
912
- // var page_height = document.body.scrollHeight+document.body.scrollTop;
913
-
914
- //如果将水印列数设置为0,或水印列数设置过大,超过页面最大宽度,则重新计算水印列数和水印x轴间隔
915
-
916
- if (defaultSettings.watermark_cols == 0 || (parseInt(defaultSettings.watermark_x + defaultSettings
917
- .watermark_width * defaultSettings.watermark_cols + defaultSettings.watermark_x_space *
918
- (defaultSettings.watermark_cols - 1)) > page_width)) {
919
- defaultSettings.watermark_cols = parseInt((page_width - defaultSettings.watermark_x + defaultSettings
920
- .watermark_x_space) / (defaultSettings.watermark_width + defaultSettings
921
- .watermark_x_space));
922
- defaultSettings.watermark_x_space = parseInt((page_width - defaultSettings.watermark_x -
923
- defaultSettings
924
- .watermark_width * defaultSettings.watermark_cols) / (defaultSettings.watermark_cols - 1));
925
- }
926
-
927
- //如果将水印行数设置为0,或水印行数设置过大,超过页面最大长度,则重新计算水印行数和水印y轴间隔
928
-
929
- if (defaultSettings.watermark_rows == 0 || (parseInt(defaultSettings.watermark_y + defaultSettings
930
-
931
- .watermark_height * defaultSettings.watermark_rows + defaultSettings.watermark_y_space * (
932
-
933
- defaultSettings.watermark_rows - 1)) > page_height)) {
934
-
935
- defaultSettings.watermark_rows = parseInt((defaultSettings.watermark_y_space + page_height -
936
-
937
- defaultSettings
938
-
939
- .watermark_y) / (defaultSettings.watermark_height + defaultSettings.watermark_y_space));
940
-
941
- defaultSettings.watermark_y_space = parseInt(((page_height - defaultSettings.watermark_y) -
942
-
943
- defaultSettings
944
-
945
- .watermark_height * defaultSettings.watermark_rows) / (defaultSettings.watermark_rows - 1));
946
-
947
- }
948
-
949
- var x;
950
-
951
- var y;
952
-
953
- for (var i = 0; i < defaultSettings.watermark_rows; i++) {
954
- y = defaultSettings.watermark_y + (defaultSettings.watermark_y_space + defaultSettings.watermark_height) * i;
955
- for (var j = 0; j < defaultSettings.watermark_cols; j++) {
956
- x = defaultSettings.watermark_x + (defaultSettings.watermark_width + defaultSettings.watermark_x_space) * j;
957
-
958
- var mask_div = document.createElement('div');
959
- mask_div.id = 'mask_div' + i + j;
960
- mask_div.className = 'mask_div';
961
-
962
- //注意看这里加了图片水印
963
- mask_div.style.webkitTransform = "rotate(-" + defaultSettings.watermark_angle + "deg)";
964
- mask_div.style.MozTransform = "rotate(-" + defaultSettings.watermark_angle + "deg)";
965
- mask_div.style.msTransform = "rotate(-" + defaultSettings.watermark_angle + "deg)";
966
- mask_div.style.OTransform = "rotate(-" + defaultSettings.watermark_angle + "deg)";
967
- mask_div.style.transform = "rotate(-" + defaultSettings.watermark_angle + "deg)";
968
- mask_div.style.visibility = "";
969
- mask_div.style.position = "absolute";
970
- //奇偶行错开,这样水印就不对齐,显的不呆板
971
- console.debug('x',x)
972
- if (i % 2 != 0) {
973
- mask_div.style.left = x + 'px';
974
- if (j % 2 != 0 && this.knowledgeItem.visitorWatermarkValue){
975
- mask_div.appendChild(document.createTextNode(defaultSettings.visitorWatermark_txt));
976
- } else {
977
- if (!this.knowledgeItem.textWatermarkValue){
978
- mask_div.appendChild(document.createTextNode(defaultSettings.visitorWatermark_txt));
979
- } else {
980
- mask_div.appendChild(document.createTextNode(defaultSettings.watermark_txt));
981
- }
982
- }
983
- } else {
984
- mask_div.style.left = x + 'px';
985
- if (j % 2 != 0 && this.knowledgeItem.textWatermarkValue){
986
- mask_div.appendChild(document.createTextNode(defaultSettings.watermark_txt));
987
- } else {
988
- if (!this.knowledgeItem.visitorWatermarkValue){
989
- mask_div.appendChild(document.createTextNode(defaultSettings.watermark_txt));
990
- } else {
991
- mask_div.appendChild(document.createTextNode(defaultSettings.visitorWatermark_txt));
992
- }
993
- }
994
- }
995
-
996
- mask_div.style.top = y + 'px';
997
- mask_div.style.overflow = "hidden";
998
- mask_div.style.zIndex = "9999";
999
- mask_div.style.pointerEvents = 'none'; //让水印不遮挡页面的点击事件
1000
- mask_div.style.opacity = defaultSettings.watermark_alpha;
1001
- mask_div.style.fontSize = defaultSettings.watermark_fontsize;
1002
- mask_div.style.fontFamily = defaultSettings.watermark_font;
1003
- mask_div.style.color = defaultSettings.watermark_color;
1004
- mask_div.style.textAlign = "center";
1005
- mask_div.style.width = defaultSettings.watermark_width + 'px';
1006
- mask_div.style.height = defaultSettings.watermark_height + 'px';
1007
- mask_div.style.display = "block";
1008
- oTemp.appendChild(mask_div);
1009
- }
1010
- }
1011
- let pageDom = document.getElementById('pdf_container_view')
1012
- pageDom.appendChild(oTemp);
1013
-
1014
- },
1015
820
  },
1016
821
  computed: {
1017
822
  perviewUrl () {
@@ -1039,18 +844,16 @@ export default {
1039
844
  if (value && value.length) {
1040
845
  // 在 pdf_view 下创建 所有canvs的容器
1041
846
  this.contentView = document.createElement('div')
1042
- this.contentView.setAttribute('id','contentView')
1043
847
  this.contentView.style.transformOrigin = '0px 0px 0px'
1044
848
  this.contentView.setAttribute('id','contentView');
1045
-
1046
- this.$http.get('/knowledge-api/knowledge/knowledge-part-location-info/list?ids=' + value.join(',')).then(res => {
849
+ this.$http.get('/knowledge-api/knowledge/knowledge-part-location-info/list?ids=' + value.join(',')).then(res => {
1047
850
  // 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}
1048
851
  // res.data = {"data":[{"id":"64590ce1eb1320043401cc90","knowledgeId":"64590cd5017b461d67e282e1","mainId":"fb348d095c0b4fd7bbd37826563dac7d","page":2,"total":5,"pageHeight":841.8898,"pageWidth":595.30396,"publicPageFileUrl":"https://askbot-pdf-all.oss-cn-zhangjiakou.aliyuncs.com/fb348d095c0b4fd7bbd37826563dac7d/2023/05/08/10/53/20/64590ce0eb1320043401cc7b/2.pdf","extractInfo":{"location":[89.32981,638.1907,415.15512,98.63251],"content":":北京地铁 13\r号线 :藤黄\r色 :西直门站—\r东直门站 :17 :41.\r5 :6\r准\rB :2002年\r09月\r28日 ","lines":[{"content":":北京地铁 13\r号线 ","location":[89.32981,638.1907,99.44599,98.63251]},{"content":":藤黄\r色 ","location":[188.7758,638.1907,46.79959,98.63251]},{"content":":西直门站—\r东直门站 ","location":[235.5754,638.1907,86.09996,98.63251]},{"content":":17 ","location":[321.67535,638.1907,36.200012,98.63251]},{"content":":41.\r5 ","location":[357.87537,638.1907,39.400696,98.63251]},{"content":":6\r准\rB ","location":[397.27606,638.1907,41.099,98.63251]},{"content":":2002年\r09月\r28日 ","location":[438.37506,638.1907,66.10986,98.63251]}],"tagId":null}}],"code":"0","msg":null,"traceId":null}
1049
852
  // 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}
1050
853
  // res.data = {"data":[{"id":"6475eab868110215ab821a80","knowledgeId":"6475e7eac724c54c46cbfa2d","mainId":"5ecf2fcd704541149201ab9c1c31162d","page":0,"total":1,"pageHeight":0.0,"pageWidth":0.0,"publicPageFileUrl":"https://askbot-pdf-all.oss-cn-zhangjiakou.aliyuncs.com/5ecf2fcd704541149201ab9c1c31162d/2023/05/30/08/23/20/6475eab63339db423f26b196/0.html","extractInfo":{"location":null,"content":"产品:系统配置,产品型号:存储,VX30:4G+16G,VX50:16G+256G","lines":null,"tagId":"6475eab868110215ab821a80"}}],"code":"0","msg":null,"traceId":null}
1051
854
  // res.data = {"data":[{"id":"6475e9393339db423f26af01","knowledgeId":"6475e44fc724c54c46cbfa21","mainId":"5ecf2fcd704541149201ab9c1c31162d","page":2,"total":2,"pageHeight":510.25,"pageWidth":1559.05,"publicPageFileUrl":"https://askbot-pdf-all.oss-cn-zhangjiakou.aliyuncs.com/5ecf2fcd704541149201ab9c1c31162d/2023/05/30/08/00/29/6475e55d3339db423f26a9b8/2.pdf","extractInfo":{"location":[327.70532,288.0498,414.9734,12.241608],"content":"三、指示灯状态说明1.白色常亮:开机/开机中2.红色常亮:待机3.白色呼吸:息屏4.红色闪烁:升级1.LAN:通过网线连接到主机的Camera端口2.电源开关:电源切换开关","lines":[{"content":"三、指示灯状态说明","location":[634.3203,288.0498,108.3584,12.0]},{"content":"1.白色常亮:开机/开机中","location":[634.3203,320.08978,108.23407,9.0]},{"content":"2.红色常亮:待机","location":[634.3204,341.3298,78.597046,9.0]},{"content":"3.白色呼吸:息屏","location":[634.32043,362.45282,78.597046,9.0]},{"content":"4.红色闪烁:升级","location":[634.3205,383.6928,78.597046,9.0]},{"content":"1.LAN:通过网线连接到主机的","location":[327.70535,291.2914,144.35995,9.0]},{"content":"Camera端口","location":[327.70532,306.88843,55.322998,9.0]},{"content":"2.电源开关:电源切换开关","location":[482.74832,291.2914,105.36301,9.0]}],"tagId":null}}],"code":"0","msg":null,"traceId":null}
1052
855
  // if(value.length === 1) {
1053
- // this.$refs.pdfView.style.height = 'calc(100% - 50px)'
856
+ // this.$refs.pdfView.style.height = 'calc(100% - 50px)'
1054
857
  // }
1055
858
  // res.data = {
1056
859
  // "data": [
@@ -1225,23 +1028,18 @@ export default {
1225
1028
  "Content-Type": "application/json",
1226
1029
  },
1227
1030
  }).then(res => {
1228
- // 使用原声请求方式 axios会带有不需要的请求头
1031
+ // 使用原声请求方式 axios会带有不需要的请求头
1229
1032
  let xhr = new XMLHttpRequest();
1230
1033
  xhr.open('GET', res.data || res.bodyText, true);
1231
1034
  // 定义请求完成的处理函数,请求前也可以增加加载框/禁用下载按钮逻辑
1232
1035
  xhr.onload = ({ currentTarget }) => {
1233
1036
  // 请求完成
1234
1037
  if (currentTarget.status === 200) { // 返回200
1235
- let pdf_view = document.getElementsByClassName('pdf_view');
1236
- if (pdf_view && pdf_view[0]){
1237
- pdf_view[0].style.backgroundImage = 'none'
1238
- }
1239
1038
  this.contentView.innerHTML = currentTarget.response
1240
1039
  this.contentView.style.padding = '10px'
1241
1040
  // this.contentView.style.position = 'relative'
1242
1041
  this.$refs.pdfView.style.backgroundColor = '#FFFFFF'
1243
1042
  this.$refs.pdfView.appendChild(this.contentView)
1244
-
1245
1043
  let allTr = Array.from(this.$refs.pdfView.getElementsByTagName('tr'))
1246
1044
  this.allTr = []
1247
1045
  for (let index = 0; index < allTr.length; index++) {
@@ -1258,7 +1056,7 @@ export default {
1258
1056
  }
1259
1057
  } else {
1260
1058
  let div = document.createElement('div')
1261
- div.innerText = '文件加载异常'
1059
+ div.innerText = this.$t('dragonCommon.fileloadException')
1262
1060
  this.contentView.appendChild(div)
1263
1061
  this.$refs.pdfView.appendChild(this.contentView)
1264
1062
  }
@@ -1270,6 +1068,37 @@ export default {
1270
1068
  }
1271
1069
  },
1272
1070
  mounted () {
1071
+ this.scaleList = [
1072
+ {
1073
+ label: this.$t('dragonCommon.scaleAuto'),
1074
+ value: 'auto'
1075
+ },
1076
+ {
1077
+ label: this.$t('dragonCommon.scaleReality'),
1078
+ value: 'reality'
1079
+ },
1080
+ {
1081
+ label: '100%',
1082
+ value: 1
1083
+ },
1084
+ {
1085
+ label: '120%',
1086
+ value: 1.2
1087
+ },
1088
+ {
1089
+ label: '150%',
1090
+ value: 1.5
1091
+ },
1092
+ {
1093
+ label: '170%',
1094
+ value: 1.7
1095
+ }
1096
+ ,
1097
+ {
1098
+ label: '200%',
1099
+ value: 2
1100
+ }
1101
+ ]
1273
1102
  if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
1274
1103
  this.isPC = false
1275
1104
  } else {
@@ -1285,7 +1114,6 @@ export default {
1285
1114
  // height: calc(100% - 110px);
1286
1115
  height: 100%;
1287
1116
  overflow: auto;
1288
- //overflow-y: scroll;
1289
1117
  background-color: #f5f7fb;
1290
1118
  // margin-bottom: 60px;
1291
1119
  box-sizing: border-box;
@@ -1511,4 +1339,4 @@ export default {
1511
1339
  100% {
1512
1340
  background: rgba(255, 136, 0, 0.3);
1513
1341
  }
1514
- }</style>
1342
+ }</style>
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <div class="popUp">
3
3
  <div class="topBtn">
4
- <span class="cancel" @click="closeBtn">{{$t('common.cancel')}}</span>
5
- <span class="sure" @click="sure">{{$t('common.confirm')}}</span>
4
+ <span class="cancel" @click="closeBtn">取消</span>
5
+ <span class="sure" @click="sure">确定</span>
6
6
  </div>
7
7
  <slot name="popup-header" class="popup-header"></slot>
8
8
  <div class="popup-content">