askbot-dragon 1.6.17-beta → 1.6.18-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.
@@ -15,16 +15,13 @@
15
15
  :controlslist="nodownload&&'nodownload'"
16
16
  :raw-controls="true"
17
17
  x5-video-player-type="h5-page"
18
- style="object-fit: contain;width: calc(100vw - 169px);height: 160px;background-color: black;border-radius: 25px;max-width: 200px;padding-left: 10px"
18
+ style="object-fit: contain;width: calc(100vw - 139px);height: 160px;background-color: black;border-radius: 25px;max-width: 230px;padding-left: 10px"
19
19
  preload
20
20
  :poster="videoSrc+'?spm=qipa250&x-oss-process=video/snapshot,t_1000,f_jpg,w_0,h_0,m_fast'"
21
21
  class="video-player vjs-custom-skin"
22
22
  :id="msg.id+'key'">
23
23
  <source :src="videoSrc"/>
24
24
  </video>
25
- <div v-show="!nodownload" class="dragon-video-download">
26
- <a :href="msg.content.url" download><span class="el-icon-download"></span></a>
27
- </div>
28
25
  <div id="output"></div>
29
26
  </div>
30
27
  </template>
@@ -126,8 +123,6 @@
126
123
  video::-webkit-media-controls-mute-button { display: none !important;}
127
124
  #dragon-video{
128
125
  position: relative;
129
- width: calc(100vw - 109px);
130
- max-width: 260px;
131
126
  #outputVideo{
132
127
  position: absolute;
133
128
  top: 0px;
@@ -139,24 +134,6 @@ video::-webkit-media-controls-mute-button { display: none !important;}
139
134
  }
140
135
 
141
136
  }
142
- .dragon-video-download{
143
- position: absolute;
144
- width: 40px;
145
- height: 26px;
146
- background-color: rgba(54, 106, 255, 0.5);
147
- border-radius: 13px;
148
- text-align: center;
149
- bottom: 2px;
150
- right: 6px;
151
- a {
152
- span {
153
- height: 26px;
154
- line-height: 26px;
155
- display: block;
156
- color: white;
157
- }
158
- }
159
- }
160
137
  }
161
138
 
162
139
  </style>
@@ -233,7 +233,7 @@
233
233
  this.$emit("onRadioClick", id, name, apikey,optionApiKey);
234
234
  },
235
235
  onImageClick(url){
236
- this.$emit('onImageClick', encodeURI(url))
236
+ this.$emit('onImageClick',url)
237
237
  },
238
238
  msgContent(content){
239
239
  console.debug('215',content)
@@ -343,12 +343,6 @@
343
343
  display: block;
344
344
  }
345
345
  }
346
- /deep/ img {
347
- height: auto;
348
- width: calc(100vw - 137px);
349
- border-radius: 25px;
350
- max-width: 230px;
351
- }
352
346
  }
353
347
  /deep/.el-drawer__body{
354
348
  height: 100%;
@@ -63,13 +63,20 @@
63
63
  v-if="item.formField.type==='TEXTAREA'&& item.fieldId!=='workorder_description'"
64
64
  ></el-input>
65
65
  <div v-else-if="item.fieldId === 'workorder_description'">
66
- <ckeditor
66
+ <!-- <ckeditor
67
67
  :editor="ckeditor.editor"
68
68
  v-model="item.value"
69
69
  :config="{...ckeditor.editorConfig,placeholder:item.formField.extInfo && item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请输入'}"
70
70
  @ready="(editor)=>currentEditor=editor"
71
71
  @focus="(zh,editor)=>currentEditor=editor"
72
- ></ckeditor>
72
+ ></ckeditor> -->
73
+ <MyEditor
74
+ v-model="item.value"
75
+ :placeholder="item.formField.extInfo && item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请输入'"
76
+ @fileUploadCallback="desUploadImageAndFile"
77
+ :havToolbar="mainId !== '8b9bd566e3e64156ab764b19defc9d48' && mainId !== '0b73521f96e4486aaf6be42932bd7b07'">
78
+ </MyEditor>
79
+ <!-- @input="(value) =>{item.value = value}" -->
73
80
  <file-list-view :attachmentList="attachmentList" @attachDeleteAttch="attachDeleteAttch"></file-list-view>
74
81
  </div>
75
82
  <el-date-picker
@@ -345,13 +352,20 @@
345
352
  <i class="el-icon-warning-outline"></i>
346
353
  </span>
347
354
  </div>
348
- <ckeditor
355
+ <!-- <ckeditor
349
356
  :editor="ckeditor.editor"
350
357
  v-model="item.value"
351
358
  @ready="(editor)=>currentEditor=editor"
352
359
  @focus="(zh,editor)=>currentEditor=editor"
353
360
  :config="{...ckeditor.editorConfig,placeholder:item.formField.extInfo && item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请输入'}"
354
- ></ckeditor>
361
+ ></ckeditor> -->
362
+ <MyEditor
363
+ v-model="item.value"
364
+ :placeholder="item.formField.extInfo && item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请输入'"
365
+ @fileUploadCallback="desUploadImageAndFile"
366
+ :havToolbar="mainId !== '8b9bd566e3e64156ab764b19defc9d48' && mainId !== '0b73521f96e4486aaf6be42932bd7b07' "
367
+ >
368
+ </MyEditor>
355
369
  <file-list-view :attachmentList="attachmentList" @attachDeleteAttch="attachDeleteAttch"></file-list-view>
356
370
  </div>
357
371
  </div>
@@ -847,14 +861,11 @@
847
861
  <script>
848
862
  /* eslint-disable */
849
863
  import { forMatTime } from "./utils/format_date";
850
-
851
864
  let that
852
865
  import {multipartUpload,ossFileUrl} from "./utils/AliyunIssUtil";
853
- import {MyCustomUploadAdapterPlugin} from "./utils/ckeditor";
854
866
  // import MyimageUpload from './utils/ckeditorImageUpload/plugin-image'
855
867
  import MyFileUpload from './utils/ckeditorfileUpload/plugin_file'
856
- import CKEDITOR from 'ckeditor'
857
-
868
+ import MyEditor from './MyEditor'
858
869
  import myPopup from "./myPopup.vue";
859
870
  import Tree from '../components/tree'
860
871
  import selectPopup from '../components/popup'
@@ -944,21 +955,6 @@ export default {
944
955
  },
945
956
  hideUploadEdit:false,
946
957
  limitNum:1,
947
- ckeditor: {
948
- editor: CKEDITOR.ClassicEditor,
949
- editorConfig: {
950
- extraPlugins: [MyFileUpload,MyCustomUploadAdapterPlugin],
951
- toolbar: [
952
- 'MyFileUpload'
953
- ],
954
- askPluginListener:[
955
- {
956
- event: 'UPLOAD',
957
- process: this.desUploadImageAndFile,
958
- }
959
- ]
960
- },
961
- },
962
958
  refShowPicker:false,
963
959
  refTemplateList:{},
964
960
  refList:{},
@@ -1200,7 +1196,8 @@ export default {
1200
1196
  myPopup,
1201
1197
  Tree,
1202
1198
  selectPopup,
1203
- fileListView
1199
+ fileListView,
1200
+ MyEditor
1204
1201
  },
1205
1202
  mounted() {
1206
1203
 
@@ -1219,9 +1216,10 @@ export default {
1219
1216
  // }
1220
1217
  // })
1221
1218
  // }
1222
- if (this.mainId == '8b9bd566e3e64156ab764b19defc9d48' || this.mainId == '0b73521f96e4486aaf6be42932bd7b07'){
1223
- this.ckeditor.editorConfig.toolbar = []
1224
- }
1219
+ // if (this.mainId == '8b9bd566e3e64156ab764b19defc9d48' || this.mainId == '0b73521f96e4486aaf6be42932bd7b07'){
1220
+ // this.ckeditor.editorConfig.toolbar = []
1221
+
1222
+ // }
1225
1223
  if (this.mainId == '90df4764122240de939331d372546c28'){
1226
1224
  this.isBaiLi = true;
1227
1225
  }
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="pdf_view" id="pdf_view" :style="{
2
+ <div class="pdf_view" ref="pdfView" @scroll="pdfScroll" :style="{
3
3
  marginTop: isPC ? '50px' : '',
4
4
  marginBottom: tagIds.length > 1 ? '60px' : '0px',
5
5
  height: setHeight
@@ -17,7 +17,6 @@
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>
21
20
  <div class="btn_footer" v-if="tagIds.length > 1 && !isPC">
22
21
  <div class="prev" @click="prev">上一段</div>
23
22
  <div class="next" @click="next">下一段</div>
@@ -45,11 +44,10 @@ if (pdfjsLib) {
45
44
  // 'pdfjs-dist/build/pdf.worker';
46
45
  }
47
46
  const { TextLayerBuilder } = window['pdfjs-dist/web/pdf_viewer']
48
- const CSS_UNITS = 96.0 / 72.0
49
47
  // import { zoomElement } from '../assets/js/hammer'
50
48
  export default {
51
49
  name: 'pdfView',
52
- props: ['tagIds', 'isMessageRecord','fileName', "knowledgeItem"],
50
+ props: ['tagIds', 'isMessageRecord'],
53
51
  data () {
54
52
  return {
55
53
  url: '',
@@ -96,7 +94,6 @@ export default {
96
94
  },
97
95
  isTouchMoved: false,
98
96
  transformSalce: null,
99
- defaultTransform:0.8,
100
97
  isPC: false,
101
98
  handScale: 'auto',
102
99
  scaleList: [
@@ -261,9 +258,6 @@ export default {
261
258
  this.contentView.style.paddingBottom = '60px'
262
259
  // contentView.style.overflowY = 'auto'
263
260
  this.$refs.pdfView.appendChild(this.contentView);
264
- if (this.knowledgeItem && (this.knowledgeItem.source === 'CORP_LOCAL_FILE' || this.knowledgeItem.source === 'YUQUE' || this.knowledgeItem.source === 'FEISHU') && (this.knowledgeItem.visitorWatermarkValue || this.knowledgeItem.textWatermarkValue)){
265
- this.watermark()
266
- }
267
261
  }
268
262
  this.renderPages(pageIndex)
269
263
  },
@@ -287,12 +281,12 @@ export default {
287
281
  const { pdfPage, pageNo, dom } = page;
288
282
  // dom 元素已存在,无须重新渲染,直接返回
289
283
  if ((dom && dom.children.length != 0) || page.loading) {
290
- return;
284
+ return;
291
285
  }
292
286
  page.loading = true
293
287
  const viewport = pdfPage.getViewport({
294
- scale: this.scale,
295
- rotation: this.rotation,
288
+ scale: this.scale,
289
+ rotation: this.rotation,
296
290
  });
297
291
  // 创建新的canvas
298
292
  const canvas = document.createElement('canvas');
@@ -383,10 +377,6 @@ export default {
383
377
  page.dom = await pageDom;
384
378
  page.loading = false
385
379
  this.contentView.appendChild(pageDom);
386
- let pdf_view = document.getElementsByClassName('pdf_view');
387
- if (pdf_view && pdf_view[0]){
388
- pdf_view[0].style.backgroundImage = 'none'
389
- }
390
380
  if (this.transformSalce !== null) {
391
381
  this.contentView.style.transform = `scale(${this.transformSalce}, ${this.transformSalce})`
392
382
  }
@@ -453,8 +443,8 @@ export default {
453
443
  startNum = Math.ceil(scrollTop / (that.pageSize.height + that.PAGE_INTVERVAL))
454
444
  endNum = startNum + Math.ceil(height / (that.pageSize.height + that.PAGE_INTVERVAL))
455
445
  }
456
- for (let pageIndex = startNum; pageIndex <= endNum; pageIndex++) {
457
- if (pageIndex > 0 && pageIndex <= that.pages.length) {
446
+ for (let pageIndex = startNum; pageIndex < endNum; pageIndex++) {
447
+ if (pageIndex > 0 && pageIndex < that.pages.length) {
458
448
  that.loadPdfData(pageIndex)
459
449
  }
460
450
  }
@@ -846,164 +836,6 @@ export default {
846
836
  this.contentView.style.transform = 'scale(' + this.transformSalce + ')';
847
837
  // this.getpdfResloutePage(this.cachePdf[0])
848
838
  },
849
- //添加水印
850
- watermark() {
851
- //默认设置
852
- var defaultSettings = {
853
- watermark_txt:"",
854
- watermark_x: 0,//水印起始位置x轴坐标
855
- watermark_y: 0,//水印起始位置Y轴坐标
856
- watermark_rows: 0,//水印行数
857
- watermark_cols: 0,//水印列数
858
- watermark_x_space: 40,//水印x轴间隔
859
- watermark_y_space: 60,//水印y轴间隔
860
- watermark_color: 'black',//水印字体颜色
861
- watermark_alpha: .3,//水印透明度
862
- watermark_fontsize: 12,//水印字体大小
863
- watermark_font: '微软雅黑',//水印字体
864
- watermark_width: 100,//水印宽度
865
- watermark_height: 80,//水印长度
866
- watermark_angle: 20,//水印倾斜度数***
867
- visitorWatermark_txt:""
868
- };
869
- if(this.knowledgeItem.textWatermarkValue){
870
- defaultSettings.watermark_txt = this.knowledgeItem.textWatermarkValue;
871
- }
872
- if (this.knowledgeItem.visitorWatermarkValue){
873
- defaultSettings.visitorWatermark_txt = this.knowledgeItem.visitorWatermarkValue
874
- }
875
- //采用配置项替换默认值,作用类似jquery.extend
876
- if (arguments.length === 1 && typeof arguments[0] === "object") {
877
- console.log("arguments = " + JSON.stringify(arguments[0]));
878
- // 获取参数配置
879
- var src = arguments[0];
880
- for (let key in src) {
881
- if (src[key] && defaultSettings[key] && src[key] === defaultSettings[key])
882
- continue;
883
- else if (src[key])
884
- defaultSettings[key] = src[key];
885
- }
886
- }
887
- var oTemp = document.createDocumentFragment();
888
- //获取页面最大宽度
889
- console.debug('pdf_view',document.getElementById('pdf_view'))
890
- let scrollWidth = document.getElementById('pdf_view').scrollWidth;
891
- let clientWidth = document.getElementById('pdf_view').clientWidth;
892
- var page_width = Math.max(scrollWidth, clientWidth);
893
-
894
- var cutWidth = page_width * 0.0150;
895
-
896
- page_width = page_width - cutWidth;
897
-
898
- //获取页面最大高度
899
- let height = parseInt(this.totalPageCount * this.pageSize.height)
900
- var page_height = Math.max(document.getElementById('pdf_container_view').scrollHeight,height);
901
-
902
- console.debug('page_height',page_height,this.totalPageCount * this.pageSize.height);
903
-
904
- // var page_height = document.body.scrollHeight+document.body.scrollTop;
905
-
906
- //如果将水印列数设置为0,或水印列数设置过大,超过页面最大宽度,则重新计算水印列数和水印x轴间隔
907
-
908
- if (defaultSettings.watermark_cols == 0 || (parseInt(defaultSettings.watermark_x + defaultSettings
909
- .watermark_width * defaultSettings.watermark_cols + defaultSettings.watermark_x_space *
910
- (defaultSettings.watermark_cols - 1)) > page_width)) {
911
- defaultSettings.watermark_cols = parseInt((page_width - defaultSettings.watermark_x + defaultSettings
912
- .watermark_x_space) / (defaultSettings.watermark_width + defaultSettings
913
- .watermark_x_space));
914
- defaultSettings.watermark_x_space = parseInt((page_width - defaultSettings.watermark_x -
915
- defaultSettings
916
- .watermark_width * defaultSettings.watermark_cols) / (defaultSettings.watermark_cols - 1));
917
- }
918
-
919
- //如果将水印行数设置为0,或水印行数设置过大,超过页面最大长度,则重新计算水印行数和水印y轴间隔
920
-
921
- if (defaultSettings.watermark_rows == 0 || (parseInt(defaultSettings.watermark_y + defaultSettings
922
-
923
- .watermark_height * defaultSettings.watermark_rows + defaultSettings.watermark_y_space * (
924
-
925
- defaultSettings.watermark_rows - 1)) > page_height)) {
926
-
927
- defaultSettings.watermark_rows = parseInt((defaultSettings.watermark_y_space + page_height -
928
-
929
- defaultSettings
930
-
931
- .watermark_y) / (defaultSettings.watermark_height + defaultSettings.watermark_y_space));
932
-
933
- defaultSettings.watermark_y_space = parseInt(((page_height - defaultSettings.watermark_y) -
934
-
935
- defaultSettings
936
-
937
- .watermark_height * defaultSettings.watermark_rows) / (defaultSettings.watermark_rows - 1));
938
-
939
- }
940
-
941
- var x;
942
-
943
- var y;
944
-
945
- for (var i = 0; i < defaultSettings.watermark_rows; i++) {
946
- y = defaultSettings.watermark_y + (defaultSettings.watermark_y_space + defaultSettings.watermark_height) * i;
947
- for (var j = 0; j < defaultSettings.watermark_cols; j++) {
948
- x = defaultSettings.watermark_x + (defaultSettings.watermark_width + defaultSettings.watermark_x_space) * j;
949
-
950
- var mask_div = document.createElement('div');
951
- mask_div.id = 'mask_div' + i + j;
952
- mask_div.className = 'mask_div';
953
-
954
- //注意看这里加了图片水印
955
- mask_div.style.webkitTransform = "rotate(-" + defaultSettings.watermark_angle + "deg)";
956
- mask_div.style.MozTransform = "rotate(-" + defaultSettings.watermark_angle + "deg)";
957
- mask_div.style.msTransform = "rotate(-" + defaultSettings.watermark_angle + "deg)";
958
- mask_div.style.OTransform = "rotate(-" + defaultSettings.watermark_angle + "deg)";
959
- mask_div.style.transform = "rotate(-" + defaultSettings.watermark_angle + "deg)";
960
- mask_div.style.visibility = "";
961
- mask_div.style.position = "absolute";
962
- //奇偶行错开,这样水印就不对齐,显的不呆板
963
- console.debug('x',x)
964
- if (i % 2 != 0) {
965
- mask_div.style.left = x + 'px';
966
- if (j % 2 != 0 && this.knowledgeItem.visitorWatermarkValue){
967
- mask_div.appendChild(document.createTextNode(defaultSettings.visitorWatermark_txt));
968
- } else {
969
- if (!this.knowledgeItem.textWatermarkValue){
970
- mask_div.appendChild(document.createTextNode(defaultSettings.visitorWatermark_txt));
971
- } else {
972
- mask_div.appendChild(document.createTextNode(defaultSettings.watermark_txt));
973
- }
974
- }
975
- } else {
976
- mask_div.style.left = x + 'px';
977
- if (j % 2 != 0 && this.knowledgeItem.textWatermarkValue){
978
- mask_div.appendChild(document.createTextNode(defaultSettings.watermark_txt));
979
- } else {
980
- if (!this.knowledgeItem.visitorWatermarkValue){
981
- mask_div.appendChild(document.createTextNode(defaultSettings.watermark_txt));
982
- } else {
983
- mask_div.appendChild(document.createTextNode(defaultSettings.visitorWatermark_txt));
984
- }
985
- }
986
- }
987
-
988
- mask_div.style.top = y + 'px';
989
- mask_div.style.overflow = "hidden";
990
- mask_div.style.zIndex = "9999";
991
- mask_div.style.pointerEvents = 'none'; //让水印不遮挡页面的点击事件
992
- mask_div.style.opacity = defaultSettings.watermark_alpha;
993
- mask_div.style.fontSize = defaultSettings.watermark_fontsize;
994
- mask_div.style.fontFamily = defaultSettings.watermark_font;
995
- mask_div.style.color = defaultSettings.watermark_color;
996
- mask_div.style.textAlign = "center";
997
- mask_div.style.width = defaultSettings.watermark_width + 'px';
998
- mask_div.style.height = defaultSettings.watermark_height + 'px';
999
- mask_div.style.display = "block";
1000
- oTemp.appendChild(mask_div);
1001
- }
1002
- }
1003
- let pageDom = document.getElementById('pdf_container_view')
1004
- pageDom.appendChild(oTemp);
1005
-
1006
- },
1007
839
  },
1008
840
  computed: {
1009
841
  perviewUrl () {
@@ -1031,11 +863,8 @@ export default {
1031
863
  if (value && value.length) {
1032
864
  // 在 pdf_view 下创建 所有canvs的容器
1033
865
  this.contentView = document.createElement('div')
1034
- this.contentView.setAttribute('id','contentView')
1035
866
  this.contentView.style.transformOrigin = '0px 0px 0px'
1036
- this.contentView.setAttribute('id','contentView');
1037
-
1038
- this.$http.get('/knowledge-api/knowledge/knowledge-part-location-info/list?ids=' + value.join(',')).then(res => {
867
+ this.$http.get('/knowledge-api/knowledge/knowledge-part-location-info/list?ids=' + value.join(',')).then(res => {
1039
868
  // 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}
1040
869
  // 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}
1041
870
  // 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}
@@ -1201,9 +1030,9 @@ export default {
1201
1030
  // tagIds 会按照gpt识别的生成有序的数组,前端直接按照下标的顺序取就可以了
1202
1031
  // 缓存拿到的所有数据
1203
1032
  this.cachePdf = res.data.data
1204
- let publicPageFileUrl = res.data.data && res.data.data[0] ? res.data.data[0].publicPageFileUrl : ''
1033
+ let publicPageFileUrl = res.data.data[0].publicPageFileUrl
1205
1034
  this.currentPage = 0
1206
- if (publicPageFileUrl && publicPageFileUrl.substring(publicPageFileUrl.lastIndexOf('.')) === '.pdf') {
1035
+ if (publicPageFileUrl.substring(publicPageFileUrl.lastIndexOf('.')) === '.pdf') {
1207
1036
  this.preViewType = 'pdf'
1208
1037
  this.setPageAllLine(this.cachePdf)
1209
1038
  this.getpdfResloutePage(res.data.data[0])
@@ -1224,16 +1053,11 @@ export default {
1224
1053
  xhr.onload = ({ currentTarget }) => {
1225
1054
  // 请求完成
1226
1055
  if (currentTarget.status === 200) { // 返回200
1227
- let pdf_view = document.getElementsByClassName('pdf_view');
1228
- if (pdf_view && pdf_view[0]){
1229
- pdf_view[0].style.backgroundImage = 'none'
1230
- }
1231
1056
  this.contentView.innerHTML = currentTarget.response
1232
1057
  this.contentView.style.padding = '10px'
1233
1058
  // this.contentView.style.position = 'relative'
1234
1059
  this.$refs.pdfView.style.backgroundColor = '#FFFFFF'
1235
1060
  this.$refs.pdfView.appendChild(this.contentView)
1236
-
1237
1061
  let allTr = Array.from(this.$refs.pdfView.getElementsByTagName('tr'))
1238
1062
  this.allTr = []
1239
1063
  for (let index = 0; index < allTr.length; index++) {
@@ -1276,14 +1100,10 @@ export default {
1276
1100
  width: 100%;
1277
1101
  height: calc(100% - 110px);
1278
1102
  overflow: auto;
1279
- //overflow-y: scroll;
1280
1103
  background-color: #f5f7fb;
1281
1104
  // margin-bottom: 60px;
1282
1105
  box-sizing: border-box;
1283
- background-image: url('https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif');
1284
- background-position: center;
1285
- background-size: 50px;
1286
- background-repeat: no-repeat;
1106
+
1287
1107
  // position: relative;
1288
1108
  // > div {
1289
1109
  // width: 100%;
@@ -1472,12 +1292,6 @@ export default {
1472
1292
  background: rgba(221, 222, 223, 1);
1473
1293
  }
1474
1294
  }
1475
- .pdf_container_view{
1476
- height: 100%;
1477
- width: 100%;
1478
- position: relative;
1479
- overflow: auto;
1480
- }
1481
1295
  }
1482
1296
  </style>
1483
1297
  <style lang="less">
@@ -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" :fileName="fileName" :knowledgeItem="watermark" ref="pdfPosition"></pdfPosition>
57
+ <pdfPosition :tagIds="tagIds" :isMessageRecord="isMessageRecord"></pdfPosition>
58
58
  </template>
59
59
  <template v-else>
60
60
  <div v-if="fileType == 'VIDEO'" style="width: 100%;">
@@ -97,7 +97,6 @@ export default {
97
97
  tagIds: [],
98
98
  // '6454aa1a70573a6ead6f0f7d', '6454aa1a70573a6ead6f0f81',
99
99
  loading:true,
100
- fileName:''
101
100
  }
102
101
  },
103
102
  mounted() {
@@ -118,9 +117,6 @@ export default {
118
117
  sourceFileType:{
119
118
  type: String,
120
119
  default: '',
121
- },
122
- watermark:{
123
- type: Object
124
120
  }
125
121
  },
126
122
  components:{
@@ -130,20 +126,9 @@ export default {
130
126
  drawer(value) {
131
127
  if(value) {
132
128
  this.$nextTick(() =>{
133
- if (this.tagIds && this.tagIds.length != 0){
134
- zoomElement(document.getElementById('pdf_container_view'))
135
- }
129
+ zoomElement(document.getElementById('drawer_content_pre'))
136
130
  })
137
131
  }
138
- setTimeout(() => {
139
- let previewIframe = document.getElementsByClassName('preview_iframe')
140
- Array.from(previewIframe).forEach(item =>{
141
- item.onload = () =>{
142
- console.debug('previewIframe 106',previewIframe,this.drawer)
143
- item.style.backgroundImage = 'none'
144
- }
145
- })
146
- })
147
132
  }
148
133
  },
149
134
  computed:{
@@ -158,10 +143,8 @@ export default {
158
143
  // }
159
144
  // }
160
145
  url = url + this.url
161
- url += '&officePreviewType=pdf'
162
- if(this.watermark) {
163
- url = this.watermark.textWatermarkValue ? (url += '&textWatermarkValue=' + this.watermark.textWatermarkValue) : url
164
- url = this.watermark.visitorWatermarkValue ? (url += '&visitorWatermarkValue=' + this.watermark.visitorWatermarkValue) : url
146
+ if(this.sourceFileType == '.ppt' || this.sourceFileType == '.pptx') {
147
+ url += '&officePreviewType=pdf'
165
148
  }
166
149
  return url
167
150
  },
@@ -299,6 +282,10 @@ export default {
299
282
  overflow: auto;
300
283
  height: calc(100% - 50px);
301
284
  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;
302
289
  }
303
290
  }
304
291
  @media screen and (min-width: 768px) {
package/src/main.js CHANGED
@@ -10,9 +10,6 @@ import 'video.js/dist/video-js.css'
10
10
  import Vant from 'vant';
11
11
  import 'vant/lib/index.css';
12
12
 
13
- import CKEditor from '@ckeditor/ckeditor5-vue2';
14
- Vue.use(CKEditor);
15
-
16
13
  /*import VConsole from 'vconsole'
17
14
  const vConsole = new VConsole();
18
15
  Vue.use(vConsole);*/
package/vue.config.js CHANGED
@@ -49,7 +49,6 @@ module.exports = {
49
49
  // 不去 node_modules 中找,而是去找 全局变量 ELEMENT
50
50
  // 'element-ui': 'ELEMENT',
51
51
  // 'vant': 'Vant',
52
- 'ckeditor': 'ClassicEditor',
53
52
  },
54
53
  },
55
54