askbot-dragon 1.7.82-beta → 1.7.84-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.
@@ -43,7 +43,7 @@
43
43
  </template>
44
44
  <div class="header_close" v-else>
45
45
  <span class="title_left">
46
- {{ title ? title : '查看详情' }}
46
+ {{ title ? title : $t('dragonCommon.viewDetails') }}
47
47
  </span>
48
48
  <section @click="close">
49
49
  <i class="iconfont guoran-shanchu"></i>
@@ -105,9 +105,10 @@
105
105
  </div>
106
106
  <new-position-preview ref="newPositionPreview"
107
107
  v-else-if="tagIds && tagIds.length != 0 && newVersion && newFileType !== 'PPT'"
108
+ :textWatermarkStr="textWatermarkStr"
108
109
  :knowledgeId="knowledgeId" :tagIds="tagIds" :url="previewHref"></new-position-preview>
109
110
  <template v-else>
110
- <div v-if="fileType == 'VIDEO'" style="width: 100%;height: 100%">
111
+ <div v-if="fileType == 'VIDEO'" style="width: 100%;">
111
112
  <video :src="url" controls width="100%;" height="98%"></video>
112
113
  </div>
113
114
  <div v-else-if="fileType == 'HTML'" style="width: 100%;">
@@ -118,7 +119,7 @@
118
119
  frameborder="no" border="0"></iframe>
119
120
  </template>
120
121
  <template v-else>
121
- <iframe class="preview_iframe_kk" :src="previewUrl" style="border:none;"
122
+ <iframe class="preview_iframe_kk" :src="previewUrl" @load="load" style="border:none;"
122
123
  :style="{ height: iframeHeight }"></iframe>
123
124
  <template v-if="!loading && (newFileType === 'PPT' && pageChunkData.length > 1)">
124
125
  <div class="btn_footer" v-if="!isPc">
@@ -153,193 +154,200 @@ import { isMobile } from "../assets/js/common";
153
154
  import { Toast } from 'vant';
154
155
  import NewPositionPreview from "./preview/newPositionPreview";
155
156
  export default {
156
- data() {
157
- return {
158
- previewShowPopup: false,
159
- fileText: '',
160
- fileType: "",
161
- isPc: false,
162
- drawer: false,
163
- tagIds: [],
164
- // '6454aa1a70573a6ead6f0f7d', '6454aa1a70573a6ead6f0f81',
165
- loading: true,
166
- fileName: '',
167
- previewKnowledgeId: "",
168
- showSummary: false,
169
- iframeHeight: "100%",
170
- isDownload: false,
171
- textWatermarkStr: "",
172
- copy: '',
173
- newVersion: '',
174
- previewHref: "",
175
- newFileType: "",
176
- numberPage: 0,
177
- pageChunkData: [],
178
- currentPage: 0
179
- }
180
- },
181
- mounted () {
182
- this.$i18n.locale = sessionStorage.getItem("systemLanguage") || 'cn';
183
- window.addEventListener('message', this.handleIframeMessage, false);
184
- this.isPcFun();
185
- },
186
- props: {
187
- url: {
188
- type: String,
189
- required: true,
190
- },
191
- officePreviewType: {
192
- type: String,
193
- default: ''
194
- },
195
- isMessageRecord: {
196
- type: Boolean,
197
- default: false,
198
- },
199
- sourceFileType: {
200
- type: String,
201
- default: '',
202
- },
203
- title: {
204
- type: String,
205
- default: ''
206
- },
207
- isHasChat: {
208
- type: Boolean,
209
- default: false
210
- },
211
- knowledgeId: {
212
- type: String,
213
- default: '',
214
- },
215
- previewOssPath: {
216
- type: String,
217
- default: '',
218
- },
219
- folderName: {
220
- type: String,
221
- default: '',
222
- },
223
- folderUrl: {
224
- type: String,
225
- default: '',
226
- },
227
- isLiBang: {
228
- type: Boolean,
229
- default: false
230
- },
231
- formKnowledgeManagement: {
232
- type: Boolean,
233
- default: false
234
- },
235
- mainId: {
236
- type: String,
237
- default: ''
238
- },
239
- userId: {
240
- type: String,
241
- default: ''
242
- }
157
+ data() {
158
+ return {
159
+ previewShowPopup: false,
160
+ fileText: '',
161
+ fileType: "",
162
+ isPc: false,
163
+ drawer: false,
164
+ tagIds: [],
165
+ // '6454aa1a70573a6ead6f0f7d', '6454aa1a70573a6ead6f0f81',
166
+ loading: true,
167
+ previewKnowledgeId: "",
168
+ showSummary: false,
169
+ iframeHeight: "100%",
170
+ isDownload: false,
171
+ textWatermarkStr: "",
172
+ copy: '',
173
+ newVersion: '',
174
+ previewHref: "",
175
+ newFileType: "",
176
+ numberPage: 0,
177
+ pageChunkData: [],
178
+ currentPage: 0
179
+ }
180
+ },
181
+ mounted() {
182
+ this.$i18n.locale = sessionStorage.getItem("systemLanguage") || 'cn';
183
+ window.addEventListener('message', this.handleIframeMessage, false);
184
+ this.isPcFun();
185
+ },
186
+ props: {
187
+ url: {
188
+ type: String,
189
+ required: true,
190
+ },
191
+ officePreviewType: {
192
+ type: String,
193
+ default: ''
194
+ },
195
+ isMessageRecord: {
196
+ type: Boolean,
197
+ default: false,
198
+ },
199
+ sourceFileType: {
200
+ type: String,
201
+ default: '',
202
+ },
203
+ title: {
204
+ type: String,
205
+ default: ''
206
+ },
207
+ isHasChat: {
208
+ type: Boolean,
209
+ default: false
210
+ },
211
+ knowledgeId: {
212
+ type: String,
213
+ default: '',
214
+ },
215
+ previewOssPath: {
216
+ type: String,
217
+ default: '',
218
+ },
219
+ folderName: {
220
+ type: String,
221
+ default: '',
222
+ },
223
+ folderUrl: {
224
+ type: String,
225
+ default: '',
226
+ },
227
+ isLiBang: {
228
+ type: Boolean,
229
+ default: false
230
+ },
231
+ mainId: {
232
+ type: String,
233
+ default: ''
234
+ },
235
+ userId: {
236
+ type: String,
237
+ default: ''
238
+ }
243
239
  },
244
240
  components: {
245
241
  NewPositionPreview,
246
242
  IntelligentSummary,
247
243
  pdfPosition
248
244
  },
249
- watch: {
250
- drawer (value) {
251
- if (value) {
252
- this.$emit('open')
253
- this.$nextTick(() => {
254
- zoomElement(document.getElementById('drawer_content_pre'))
255
- })
256
- } else {
257
- this.$emit('close')
258
- }
259
- },
260
- showSummary: {
261
- handler (val) {
262
- // if (!val){
263
- // this.$nextTick(() => {
264
- // let preCon = document.querySelector('.pdf_view');
265
- // if (preCon){
266
- // preCon.style.height = 'calc(100% - ' + 50 + 'px)'
267
- // }
268
- // })
269
- // } else {
270
- // this.getSummarySuccess();
271
- // }
272
- if (val) {
273
- this.getSummarySuccess();
274
- }
275
- }
276
- },
277
- knowledgeId: {
278
- handler (val) {
279
- if (val) {
280
- this.getTextWatermark();
281
- }
282
- }
283
- }
284
- },
285
- computed: {
286
- pdfStyle () {
287
- return {
288
- paddingTop: this.isPc ? '30px' : '0', // 30px 是 加上外层的 20 流出 50的上边距展示 放大缩小操作栏
289
- paddingBottom: this.tagIds > 1 ? '60px' : '0',
290
- height: '100%'
245
+ watch: {
246
+ drawer(value) {
247
+ if (value) {
248
+ this.$emit('open')
249
+ this.$nextTick(() => {
250
+ zoomElement(document.getElementById('drawer_content_pre'))
251
+ })
252
+ } else {
253
+ this.$emit('close')
254
+ }
255
+ },
256
+ showSummary: {
257
+ handler(val) {
258
+ // if (!val){
259
+ // this.$nextTick(() => {
260
+ // let preCon = document.querySelector('.pdf_view');
261
+ // if (preCon){
262
+ // preCon.style.height = 'calc(100% - ' + 50 + 'px)'
263
+ // }
264
+ // })
265
+ // } else {
266
+ // this.getSummarySuccess();
267
+ // }
268
+ if (val) {
269
+ this.getSummarySuccess();
270
+ }
271
+ }
272
+ },
273
+ knowledgeId: {
274
+ handler(val) {
275
+ if (val) {
276
+ this.getTextWatermark();
277
+ }
278
+ }
291
279
  }
292
280
  },
293
- previewUrl () {
294
- console.debug('VUE_APP_ENV', process.env.VUE_APP_ENV)
295
- let url = process.env.VUE_APP_ENV === 'production' ? 'https://kkfileview.askbot.cn/onlinePreview?url=' : 'https://test.open.askbot.cn/kkfileview/onlinePreview?url='
296
- // if(this.url != '') {
297
- // if(/[\u4E00-\u9FA5]+/g.test(this.url)) {
298
- // url += btoa(encodeURIComponent(this.url))
299
- // } else {
300
- // url += btoa(this.url)
301
- // }
302
- // }
303
- url = url + this.url
304
- if (this.sourceFileType == '.ppt' || this.sourceFileType == '.pptx' || this.sourceFileType == '.pdf') {
305
- url += '&officePreviewType=pdf'
306
- if (this.watermark) {
307
- url = this.watermark.textWatermarkValue ? (url += '&textWatermarkValue=' + this.watermark.textWatermarkValue) : url
308
- url = this.watermark.visitorWatermarkValue ? (url += '&visitorWatermarkValue=' + this.watermark.visitorWatermarkValue) : url
281
+ computed: {
282
+ pdfStyle() {
283
+ return {
284
+ paddingTop: this.isPc ? '30px' : '0', // 30px 是 加上外层的 20 流出 50的上边距展示 放大缩小操作栏
285
+ paddingBottom: this.tagIds > 1 ? '60px' : '0',
286
+ height: '100%'
287
+ }
288
+ },
289
+ previewUrl() {
290
+ console.debug('VUE_APP_ENV', process.env.VUE_APP_ENV)
291
+ let url = process.env.VUE_APP_ENV === 'production' ? 'https://kkfileview.askbot.cn/onlinePreview?url=' : 'https://test.open.askbot.cn/kkfileview/onlinePreview?url='
292
+ // if(this.url != '') {
293
+ // if(/[\u4E00-\u9FA5]+/g.test(this.url)) {
294
+ // url += btoa(encodeURIComponent(this.url))
295
+ // } else {
296
+ // url += btoa(this.url)
297
+ // }
298
+ // }
299
+ url = url + this.url
300
+ if (this.sourceFileType == '.ppt' || this.sourceFileType == '.pptx' || this.sourceFileType == '.pdf') {
301
+ url += '&officePreviewType=pdf'
302
+ }
303
+ if(sessionStorage.getItem('wxAuth') ) {
304
+ let wxAuth = JSON.parse(sessionStorage.getItem('wxAuth'))
305
+ let mainId = wxAuth.mainId ? wxAuth.mainId : ''
306
+ let userId = wxAuth.userId ? wxAuth.userId : ''
307
+ let test = wxAuth.test ? wxAuth.test : ''
308
+ let corpId = wxAuth.corpId ? wxAuth.corpId : ''
309
+ url += '&mainId=' + mainId + '&userId=' + userId + '&test=' + test + '&corpId=' + corpId
309
310
  }
310
- let mainId = sessionStorage.getItem('_mainId')
311
- let userId = sessionStorage.getItem('_currentUserId')
312
- let test = process.env.VUE_APP_ENV === 'production'
313
- url += '&mainId=' + mainId+ '&userId=' + userId + '&test=' + test
314
- console.log('textWatermarkStr 216', this.textWatermarkStr)
311
+ // console.log('textWatermarkStr 216', this.textWatermarkStr)
315
312
  if (this.textWatermarkStr) {
316
313
  url += '&textWatermarkValue=' + this.textWatermarkStr
317
314
  }
318
- }
319
- return url
315
+ return url
316
+ },
317
+ // fileType() {
318
+ // const fileType = this.url.substring(this.url.lastIndexOf('.'));
319
+ // if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.MOV' || fileType === '.mov') {
320
+ // return 'VIDEO'
321
+ // } else {
322
+ // return 'OTHER'
323
+ // }
320
324
 
321
- }
322
- // fileType() {
323
- // const fileType = this.url.substring(this.url.lastIndexOf('.'));
324
- // if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.MOV' || fileType === '.mov') {
325
- // return 'VIDEO'
326
- // } else {
327
- // return 'OTHER'
328
- // }
329
-
330
- // }
325
+ // }
331
326
  },
332
327
  methods: {
333
- close() {
334
- setTimeout(() => {
335
- this.previewShowPopup = false;
336
- this.fileType = ''
337
- }, 300)
338
- this.drawer = false;
339
- this.showSummary = false;
340
- },
341
- loadIframe() {
342
-
328
+ load() {
329
+ this.loading = false;
330
+ if(sessionStorage.getItem('wxAuth')){
331
+ window.postMessage({
332
+ type: "wx_bind",
333
+ data: JSON.parse(sessionStorage.getItem('wxAuth'))
334
+ }, '*')
335
+ } else {
336
+ window.postMessage({
337
+ type: "wx_bind",
338
+ data: 'pass'
339
+ }, '*')
340
+ }
341
+ },
342
+ close() {
343
+ setTimeout(() => {
344
+ this.previewShowPopup = false;
345
+ this.fileType = ''
346
+ }, 300)
347
+ this.drawer = false;
348
+ this.showSummary = false;
349
+ },
350
+ loadIframe() {
343
351
  if (this.fileType == 'VIDEO' || this.fileType == 'WECHAT' || (this.tagIds && this.tagIds.length != 0 && this.newFileType !== 'PPT')) {
344
352
  this.loading = false
345
353
  } else {
@@ -615,7 +623,7 @@ export default {
615
623
  }
616
624
  },
617
625
  beforeDestroy() {
618
- window.removeEventListener('message', this.handleIframeMessage);
626
+ window.removeEventListener('message', this.handleIframeMessage);
619
627
  }
620
628
  }
621
629
  </script>
@@ -911,26 +919,26 @@ export default {
911
919
  align-items: center;
912
920
  justify-content: space-between;
913
921
 
914
- .header-right {
915
- display: flex;
916
- }
922
+ .header-right {
923
+ display: flex;
924
+ }
917
925
 
918
- .summaryBtn {
919
- flex: none;
920
- //width: 95px;
921
- height: 26px;
922
- padding: 0 8px;
923
- background: #ffffff;
924
- display: flex;
925
- align-items: center;
926
- justify-content: center;
927
- box-sizing: border-box;
928
- border: 1px solid #a1b9ff;
929
- border-radius: 15px;
930
- cursor: pointer;
931
- color: #366aff;
932
- margin-right: 10px;
933
- font-size: 14px;
926
+ .summaryBtn {
927
+ flex: none;
928
+ //width: 95px;
929
+ height: 26px;
930
+ padding: 0 8px;
931
+ background: #ffffff;
932
+ display: flex;
933
+ align-items: center;
934
+ justify-content: center;
935
+ box-sizing: border-box;
936
+ border: 1px solid #a1b9ff;
937
+ border-radius: 15px;
938
+ cursor: pointer;
939
+ color: #366aff;
940
+ margin-right: 10px;
941
+ font-size: 14px;
934
942
 
935
943
  i {
936
944
  font-size: 14px;
@@ -1033,11 +1041,15 @@ export default {
1033
1041
  height: 100%;
1034
1042
  }
1035
1043
 
1036
- #drawer_content_pre {
1037
- overflow: auto;
1038
- height: calc(100% - 50px);
1039
- background: #FFF;
1040
- }
1044
+ #drawer_content_pre {
1045
+ overflow: auto;
1046
+ height: calc(100% - 50px);
1047
+ background: #FFF;
1048
+ background-image: url('https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif');
1049
+ background-position: center;
1050
+ background-size: 50px;
1051
+ background-repeat: no-repeat;
1052
+ }
1041
1053
 
1042
1054
  .libang_content_pre {
1043
1055
  height: calc(100% - 64px) !important;
@@ -25,7 +25,7 @@ export default {
25
25
 
26
26
  }
27
27
  },
28
- props:['source','payload',"language", 'isShow'],
28
+ props:['source','payload', 'isShow'],
29
29
  computed: {
30
30
  messagePlateform() {
31
31
  if(this.payload) {
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable */
2
- import { multipartUpload, ossFileUrl } from "../../assets/js/AliyunIssUtil";
2
+ import { multipartUpload, ossFileUrl } from "./AliyunIssUtil";
3
3
  import { v4 as uuidv4 } from "uuid";
4
4
 
5
5
  const getPrivateOssConfig = () => {
@@ -92,11 +92,7 @@ export default {
92
92
  bindCode:{
93
93
  type: String,
94
94
  default: ''
95
- },
96
- language:{
97
- type: String,
98
- default: 'en'
99
- }
95
+ }
100
96
  },
101
97
  data () {
102
98
  return {
@@ -39,11 +39,7 @@ export default {
39
39
  clickFun (item) {
40
40
  this.$emit('llmCardClickFun', item)
41
41
  }
42
- },
43
- mounted() {
44
- let languageCode = sessionStorage.getItem('languageCode');
45
- console.log('languageCode',languageCode,this.$i18n.locale,localStorage.getItem('languageCode'))
46
- }
42
+ }
47
43
  };
48
44
  </script>
49
45
 
package/src/main.js CHANGED
@@ -71,6 +71,6 @@ Vue.prototype.requestUrl = requestUrl;
71
71
  Vue.prototype.utils = utils;
72
72
 
73
73
  new Vue({
74
- i18n,
75
74
  render: h => h(App),
75
+ i18n
76
76
  }).$mount('#app')