askbot-dragon 1.7.75-beta → 1.7.77-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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "askbot-dragon",
3
- "version": "1.7.75-beta",
3
+ "version": "1.7.77-beta",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -10,9 +10,8 @@
10
10
  "vue-markdown": "^2.2.4"
11
11
  },
12
12
  "devDependencies": {
13
- "@vue/cli-plugin-babel": "~4.5.0",
14
- "@vue/cli-plugin-eslint": "~4.5.0",
15
- "@vue/cli-service": "~4.5.0",
13
+ "marked": "^4.0.0",
14
+ "highlight.js": "^11.11.1",
16
15
  "audio-loader": "^1.0.3",
17
16
  "core-js": "^3.6.5",
18
17
  "install": "^0.13.0",
@@ -26,7 +25,9 @@
26
25
  "vue-resource": "^1.5.1",
27
26
  "vue-video-player": "^5.0.2",
28
27
  "weixin-js-sdk": "^1.6.0",
29
- "marked": "^12.0.0",
28
+ "@vue/cli-plugin-babel": "~4.5.0",
29
+ "@vue/cli-plugin-eslint": "~4.5.0",
30
+ "@vue/cli-service": "~4.5.0",
30
31
  "babel-eslint": "^10.1.0",
31
32
  "element-ui": "^2.15.10",
32
33
  "eslint": "^6.7.2",
@@ -216,7 +216,11 @@ function newInitWaterMark(elId, textValue) {
216
216
  mask_div.style.position = "absolute";
217
217
  //奇偶行错开,这样水印就不对齐,显的不呆板
218
218
  mask_div.style.left = x + 20 + "px";
219
- mask_div.appendChild(document.createTextNode(defaultSettings.watermark_txt));
219
+ if(defaultSettings.watermark_txt.startsWith('weWo')){
220
+ mask_div.innerHTML = `<ww-open-data type="userName" openid="${defaultSettings.watermark_txt}"></ww-open-data>`
221
+ } else {
222
+ mask_div.appendChild(document.createTextNode(defaultSettings.watermark_txt));
223
+ }
220
224
 
221
225
  mask_div.style.top = y + 10 + "px";
222
226
 
@@ -253,7 +253,7 @@ export default {
253
253
  }
254
254
  return arr;
255
255
  },
256
- sendAiGuideInfo (recommendType, cell) {
256
+ sendAiGuideInfo(recommendType, cell) {
257
257
  console.log("组件-312-3", recommendType, cell);
258
258
  this.$emit('sendAiGuide', recommendType, cell);
259
259
  },
@@ -2078,14 +2078,24 @@ export default {
2078
2078
 
2079
2079
  }
2080
2080
  let isRequired = true;
2081
- if (this.mainId == '3e83057a1bd74b79b86859ad619fdbbb' || this.mainId == 'ab0f90737c8b4f2d85ba2157e4473110' || this.mainId == '86dc09da570948d2b4841122d732f373') {
2081
+ if (this.mainId == '3e83057a1bd74b79b86859ad619fdbbb' ||
2082
+ this.mainId == 'ab0f90737c8b4f2d85ba2157e4473110' ||
2083
+ this.mainId == '86dc09da570948d2b4841122d732f373' ||
2084
+ this.mainId == 'e93c327548c94b15a4b2b71bc613ef38' // 银轮主体 id
2085
+ ) {
2082
2086
  isRequired = false
2083
2087
  }
2084
2088
  /*针对蒙牛企业在对话中系统名称字段暂时不做校验*/
2089
+ /* 2025.0228 补充银轮主体相同逻辑 */
2085
2090
  if (this.formShow.form.formFieldRelation[i].display &&
2086
2091
  (this.formShow.form.formFieldRelation[i].required || this.isRequiredFn(this.formShow.form.formFieldRelation[i].formField)) &&
2087
2092
  this.formShow.form.formFieldRelation[i].fieldId !== 'workorder_name' &&
2088
- ((!isRequired && this.formShow.form.formFieldRelation[i].fieldId !== '0feca81fce97465da537248c066e4db8' && this.formShow.form.formFieldRelation[i].fieldId !== '1d8bd21485834773a6d18eae60013000') || isRequired) &&
2093
+ (
2094
+ (!isRequired &&
2095
+ this.formShow.form.formFieldRelation[i].fieldId !== '0feca81fce97465da537248c066e4db8' &&
2096
+ this.formShow.form.formFieldRelation[i].fieldId !== '1d8bd21485834773a6d18eae60013000' &&
2097
+ this.formShow.form.formFieldRelation[i].fieldId !== '0ca7253561bb480cac9e57664e52158b'
2098
+ ) || isRequired) &&
2089
2099
  this.formShow.form.formFieldRelation[i].formField.type !== 'EXPLANATION') {
2090
2100
  let value = "";
2091
2101
  let bool = {}
@@ -182,7 +182,9 @@ export default {
182
182
  clearInterval(this.thinkTimer)
183
183
  this.thinkTimer = null
184
184
  this.thinkEnd = true
185
- this.removeLoadingNode()
185
+ setTimeout(() => {
186
+ this.removeLoadingNode()
187
+ }, 200)
186
188
  this.$emit("streamCallback", this.typedContent)
187
189
  this.$emit("sseOtherInfo", this.msgId, "start", "");
188
190
  }, 200);
@@ -282,7 +284,7 @@ export default {
282
284
  this.$emit("answerDocKnowledgeFn");
283
285
  this.eventSource = new EventSource(url);
284
286
  this.$emit("streamStatus", true, this.msgId);
285
- this.$set(this, 'showThink', true);
287
+ // this.$set(this, 'showThink', true);
286
288
  this.signSetFlag = false;
287
289
  this.thinkEnd = false
288
290
  let tempString = "";
@@ -343,7 +345,9 @@ export default {
343
345
  this.$emit("streamCallback", this.typedContent)
344
346
  this.$emit("streamStatus", false, this.msgId);
345
347
  this.appendCopyBtn()
346
- this.removeLoadingNode()
348
+ setTimeout(() => {
349
+ this.removeLoadingNode()
350
+ }, 200);
347
351
  this.$emit("sseOtherInfo", this.msgId, "start", "");
348
352
  }
349
353
 
@@ -366,6 +370,22 @@ export default {
366
370
  recommendItems = data;
367
371
  } else if (event.lastEventId === 'retry') {
368
372
  this.retryUrl = data.content;
373
+ } else if (event.lastEventId === 'generated_image') {
374
+ let imgs = JSON.parse(data.content);
375
+ let imgsStr = "";
376
+ for (let i = 0; i < imgs.length; i++) {
377
+ imgsStr += `![](${imgs[i].oss_url})`;
378
+ }
379
+ this.$set(this, "typedContent", this.typedContent + imgsStr);
380
+
381
+ // 模拟图片推送
382
+ // let imgs = JSON.parse('[{"oss_url":"https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/generated-img/generated_img_865652a94b374337b2ac703466cdea94.png"}]');
383
+ // let imgsStr = "";
384
+ // for (let i = 0; i < imgs.length; i++) {
385
+ // imgsStr += `![](${imgs[i].oss_url})`;
386
+ // }
387
+ // this.$set(this, "typedContent", this.typedContent + imgsStr);
388
+
369
389
  } else if (event.lastEventId === 'source') {
370
390
  this.$emit("changedHeadStatusValue", this.msgId, data);
371
391
  } else {
@@ -591,7 +611,7 @@ export default {
591
611
  let codeList = doc.querySelectorAll('pre code')
592
612
  codeList.forEach(ele =>{
593
613
  let list = ele.getElementsByClassName("code_copy_btn")
594
- if(list.length == 0 && ele.classList.contains("hljs")) {
614
+ if(list.length == 0 && ele.classList.contains("hljs") && !ele.classList.contains("hljs-undefined")) {
595
615
  let text = ele.innerText
596
616
  let btnId = uuidv4();
597
617
  let copy = document.createElement('div')
@@ -163,9 +163,17 @@ export default {
163
163
  newDom.forEach(doms => {
164
164
  doms.style.backgroundColor = this.colors[0];
165
165
  })
166
- newDom[0].scrollIntoView({ behavior: "smooth"})
166
+ const bodyWrapper = this.$refs.table.$el.querySelector('.el-table__body-wrapper');
167
+ const targetRow = this.$refs.table.$el.querySelector('.setBgClass' + rowId); // 获取目标行元素
168
+ const targetHeight = targetRow.offsetTop; // 目标行的高度(从上到下的距离)
169
+ bodyWrapper.scroll({
170
+ top:targetHeight,
171
+ behavior:"smooth"
172
+ }); // 滚动到目标行位置
173
+
174
+ // newDom[0].scrollIntoView({ behavior: "smooth"})
167
175
  }
168
- },500)
176
+ },800)
169
177
  });
170
178
  },
171
179
  handleCurrentChange(val){
@@ -177,132 +177,130 @@ export default {
177
177
  currentPage: 0
178
178
  }
179
179
  },
180
- mounted() {
181
- this.$i18n.locale = sessionStorage.getItem("systemLanguage") || 'cn';
182
- window.addEventListener('message', this.handleIframeMessage, false);
183
- this.isPcFun();
184
- },
185
- props: {
180
+ mounted () {
181
+ this.$i18n.locale = sessionStorage.getItem("systemLanguage") || 'cn';
182
+ window.addEventListener('message', this.handleIframeMessage, false);
183
+ this.isPcFun();
184
+ },
185
+ props: {
186
186
  url: {
187
- type: String,
188
- required: true,
187
+ type: String,
188
+ required: true,
189
189
  },
190
190
  officePreviewType: {
191
- type: String,
192
- default: ''
191
+ type: String,
192
+ default: ''
193
193
  },
194
194
  isMessageRecord: {
195
- type: Boolean,
196
- default: false,
195
+ type: Boolean,
196
+ default: false,
197
197
  },
198
198
  sourceFileType: {
199
- type: String,
200
- default: '',
199
+ type: String,
200
+ default: '',
201
201
  },
202
202
  title: {
203
- type: String,
204
- default: ''
203
+ type: String,
204
+ default: ''
205
205
  },
206
206
  isHasChat: {
207
- type: Boolean,
208
- default: false
207
+ type: Boolean,
208
+ default: false
209
209
  },
210
210
  knowledgeId: {
211
- type: String,
212
- default: '',
211
+ type: String,
212
+ default: '',
213
213
  },
214
214
  previewOssPath: {
215
- type: String,
216
- default: '',
215
+ type: String,
216
+ default: '',
217
217
  },
218
218
  folderName: {
219
- type: String,
220
- default: '',
219
+ type: String,
220
+ default: '',
221
221
  },
222
222
  folderUrl: {
223
- type: String,
224
- default: '',
223
+ type: String,
224
+ default: '',
225
225
  },
226
226
  isLiBang: {
227
- type: Boolean,
228
- default: false
227
+ type: Boolean,
228
+ default: false
229
229
  },
230
230
  formKnowledgeManagement: {
231
- type: Boolean,
232
- default: false
233
- }
234
- },
231
+ type: Boolean,
232
+ default: false
233
+ },
234
+ mainId: {
235
+ type: String,
236
+ default: ''
237
+ },
238
+ userId: {
239
+ type: String,
240
+ default: ''
241
+ },
242
+ },
235
243
  components: {
236
- NewPositionPreview,
237
- IntelligentSummary,
238
- pdfPosition
244
+ NewPositionPreview,
245
+ IntelligentSummary,
246
+ pdfPosition
239
247
  },
240
- watch: {
241
- drawer(value) {
242
- if (value) {
243
- this.$emit('open')
244
- this.$nextTick(() => {
245
- if (this.tagIds && this.tagIds.length != 0) {
246
- zoomElement(document.getElementById('pdf_container_view'))
247
- }
248
- })
249
- } else {
250
- this.$emit('close')
251
- }
252
- setTimeout(() => {
253
- let previewIframe = document.getElementsByClassName('preview_iframe')
254
- Array.from(previewIframe).forEach(item => {
255
- item.onload = () => {
256
- console.debug('previewIframe 106', previewIframe, this.drawer)
257
- item.style.backgroundImage = 'none'
258
- }
259
- })
248
+ watch: {
249
+ drawer (value) {
250
+ if (value) {
251
+ this.$emit('open')
252
+ this.$nextTick(() => {
253
+ zoomElement(document.getElementById('drawer_content_pre'))
260
254
  })
261
- },
262
- showSummary: {
263
- handler(val) {
264
- // if (!val){
265
- // this.$nextTick(() => {
266
- // let preCon = document.querySelector('.pdf_view');
267
- // if (preCon){
268
- // preCon.style.height = 'calc(100% - ' + 50 + 'px)'
269
- // }
270
- // })
271
- // } else {
272
- // this.getSummarySuccess();
273
- // }
274
- if (val) {
275
- this.getSummarySuccess();
276
- }
277
- }
278
- },
279
- knowledgeId: {
280
- handler(val) {
281
- if (val) {
282
- this.getTextWatermark();
283
- }
284
- }
255
+ } else {
256
+ this.$emit('close')
285
257
  }
286
258
  },
287
- computed: {
288
- pdfStyle() {
289
- return {
290
- paddingTop: this.isPc ? '30px' : '0', // 30px 是 加上外层的 20 流出 50的上边距展示 放大缩小操作栏
291
- paddingBottom: this.tagIds > 1 ? '60px' : '0',
292
- height: '100%'
293
- }
294
- },
295
- previewUrl() {
296
- console.debug('VUE_APP_ENV', process.env.VUE_APP_ENV)
297
- let url = process.env.VUE_APP_ENV === 'production' ? 'https://kkfileview.askbot.cn/onlinePreview?url=' : 'https://test.open.askbot.cn/kkfileview/onlinePreview?url='
298
- // if(this.url != '') {
299
- // if(/[\u4E00-\u9FA5]+/g.test(this.url)) {
300
- // url += btoa(encodeURIComponent(this.url))
301
- // } else {
302
- // url += btoa(this.url)
259
+ showSummary: {
260
+ handler (val) {
261
+ // if (!val){
262
+ // this.$nextTick(() => {
263
+ // let preCon = document.querySelector('.pdf_view');
264
+ // if (preCon){
265
+ // preCon.style.height = 'calc(100% - ' + 50 + 'px)'
303
266
  // }
267
+ // })
268
+ // } else {
269
+ // this.getSummarySuccess();
304
270
  // }
305
- url = url + this.url
271
+ if (val) {
272
+ this.getSummarySuccess();
273
+ }
274
+ }
275
+ },
276
+ knowledgeId: {
277
+ handler (val) {
278
+ if (val) {
279
+ this.getTextWatermark();
280
+ }
281
+ }
282
+ }
283
+ },
284
+ computed: {
285
+ pdfStyle () {
286
+ return {
287
+ paddingTop: this.isPc ? '30px' : '0', // 30px 是 加上外层的 20 流出 50的上边距展示 放大缩小操作栏
288
+ paddingBottom: this.tagIds > 1 ? '60px' : '0',
289
+ height: '100%'
290
+ }
291
+ },
292
+ previewUrl () {
293
+ console.debug('VUE_APP_ENV', process.env.VUE_APP_ENV)
294
+ let url = process.env.VUE_APP_ENV === 'production' ? 'https://kkfileview.askbot.cn/onlinePreview?url=' : 'https://test.open.askbot.cn/kkfileview/onlinePreview?url='
295
+ // if(this.url != '') {
296
+ // if(/[\u4E00-\u9FA5]+/g.test(this.url)) {
297
+ // url += btoa(encodeURIComponent(this.url))
298
+ // } else {
299
+ // url += btoa(this.url)
300
+ // }
301
+ // }
302
+ url = url + this.url
303
+ if (this.sourceFileType == '.ppt' || this.sourceFileType == '.pptx' || this.sourceFileType == '.pdf') {
306
304
  url += '&officePreviewType=pdf'
307
305
  if (this.watermark) {
308
306
  url = this.watermark.textWatermarkValue ? (url += '&textWatermarkValue=' + this.watermark.textWatermarkValue) : url
@@ -343,7 +341,14 @@ export default {
343
341
  iframe.onload = () => {
344
342
  this.loading = false;
345
343
  document.getElementById('drawer_content_pre').style.backgroundImage = 'none'
346
- }
344
+ window.postMessage({
345
+ type: "wx_bind",
346
+ data: {
347
+ mainId: sessionStorage.getItem('_mainId'),
348
+ userId: sessionStorage.getItem('_currentUserId'),
349
+ test: process.env.VUE_APP_ENV !== 'production'
350
+ }
351
+ }, '*')}
347
352
  }
348
353
  // let time = setInterval(() =>{
349
354
  //