askbot-dragon 1.6.19-beta → 1.6.20-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,14 +1,17 @@
1
1
  {
2
2
  "name": "askbot-dragon",
3
- "version": "1.6.19-beta",
3
+ "version": "1.6.20-beta",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
7
7
  "lint": "vue-cli-service lint"
8
8
  },
9
9
  "dependencies": {
10
+ "@ckeditor/ckeditor5-ui": "^10.1.0",
11
+ "@ckeditor/ckeditor5-vue2": "^3.0.1",
10
12
  "ali-oss": "^6.2.1",
11
13
  "audio-loader": "^1.0.3",
14
+ "ckeditor": "^4.12.1",
12
15
  "core-js": "^3.6.5",
13
16
  "install": "^0.13.0",
14
17
  "jquery": "^3.5.1",
package/public/index.html CHANGED
@@ -23,11 +23,13 @@
23
23
  });
24
24
  }
25
25
  </script>
26
+ <script src="https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/ckeditor5-build-classic/0.4.4/ckeditor.js"></script>
26
27
  <!-- 项目图标 -->
27
28
  <link rel="stylesheet" href="//at.alicdn.com/t/font_1566110_3hu6pyd938i.css"/>
28
29
  <!-- guoran图标 -->
29
30
  <link rel="stylesheet" href="//at.alicdn.com/t/c/font_2913049_qtm7orae3l.css"/>
30
31
  <script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
32
+ <!-- <script src="https://static.guoranbot.com/ckeditor5-build-classic/0.3.7/build/ckeditor.js"></script> -->
31
33
 
32
34
  <!-- vue -->
33
35
  <!-- <script src="https://static.guoranbot.com/vue/2.6.11/dist/vue.min.js"></script>
@@ -3,6 +3,15 @@ export function zoomElement (el) {
3
3
  let store = {
4
4
  scale: 1
5
5
  };
6
+ if (!el){
7
+ return
8
+ }
9
+ let scale = 1;
10
+ if (el.style.transform){
11
+ let transForm = el.style.transform;
12
+ var values = transForm.split('(')[1].split(')')[0].split(',');
13
+ scale = values[0] ? values[0] : 1
14
+ }
6
15
  // 缩放事件的处理
7
16
  el.addEventListener('touchstart', function (event) {
8
17
  let touches = event.touches;
@@ -67,13 +76,15 @@ export function zoomElement (el) {
67
76
  newScale = 3;
68
77
  }
69
78
  // 最小缩放比例限制
70
- if(newScale < 1) {
71
- newScale = 1;
79
+ if(newScale < scale) {
80
+ newScale = scale;
72
81
  }
73
82
  // 记住使用的缩放值
74
83
  store.scale = newScale;
75
84
  // 图像应用缩放效果
76
85
  el.style.transform = 'scale(' + newScale + ')';
86
+ el.style.transformOrigin = 'top left'
87
+
77
88
  }
78
89
  });
79
90
  document.addEventListener('touchend', function () {
@@ -35,6 +35,13 @@
35
35
  border-radius: 6px;
36
36
  background-color: #bfceec !important;
37
37
  }
38
+ @media screen and (max-width: 767px){
39
+ ::-webkit-scrollbar {
40
+ width: 0;
41
+ height: 0;
42
+ background-color:@system_bordercolor_4;
43
+ }
44
+ }
38
45
 
39
46
  // 弹窗body
40
47
  .el-dialog__body{
@@ -26,7 +26,7 @@
26
26
  class="grzh-iframe"
27
27
  :src="actionAlertIframe.template"
28
28
  width="100%"
29
- height="95%"
29
+ height="90%"
30
30
  :scrolling="actionAlertIframe.scrolling"
31
31
  frameborder="no"
32
32
  border="0"
@@ -87,6 +87,29 @@ export default {
87
87
  this.actionAlertIframe.template = this.actionAlertIframe.template + "&iframeId=" + this.tampId
88
88
  }
89
89
  this.actionAlertIframe.template = this.actionAlertIframe.template.split("&amp;").join("&")
90
+
91
+ // 监听回退事件
92
+ let _that = this;
93
+
94
+ (function () {
95
+ console.log(95, 'addEventListener window.onpopstate');
96
+ if (window.history && window.history.pushState) {
97
+ console.log(97, 'window.history && window.history.pushState');
98
+ window.onpopstate = function (e) {
99
+ console.log(9999, 'window.onpopstate innner', e);
100
+ if (_that.showAskFullScreen) {
101
+ window.history.go(1);
102
+ }
103
+ // window.history.pushState('forward', null, '');
104
+ // window.history.forward(1);
105
+ _that.showAskFullScreen = false;
106
+ if ( e && e.stopPropagation ) {
107
+ console.log(105, 'e.stopPropagation');
108
+ e.stopPropagation();
109
+ }
110
+ };
111
+ }
112
+ })();
90
113
  },
91
114
  };
92
115
  </script>
@@ -16,7 +16,7 @@
16
16
  <span v-html="aiGuide.content.description"></span>
17
17
  </div>
18
18
  <!-- 一级分类 -->
19
- <div v-show="aiGuide.content.typesVisible" class="ig-types-f">
19
+ <div v-show="aiGuide.content.typesVisible && aiGuide.content.options && aiGuide.content.options.length > 0" class="ig-types-f">
20
20
  <span
21
21
  v-for="(fType, fTypeIndex) in aiGuide.content.options"
22
22
  :key="`f_${fTypeIndex}`"
@@ -31,9 +31,7 @@
31
31
  >
32
32
  </div>
33
33
  <!-- 二级分类 -->
34
- <div v-show="aiGuide.content.typesVisible && aiGuide.content.options[
35
- activeFirstTypeIndex
36
- ].types.length !== 0" class="ig-types-s">
34
+ <div v-if="aiGuide.content.typesVisible && aiGuide.content.options[activeFirstTypeIndex] && aiGuide.content.options[activeFirstTypeIndex].types && aiGuide.content.options[activeFirstTypeIndex].types.length !== 0" class="ig-types-s">
37
35
  <span
38
36
  v-for="(sType, sTypeIndex) in aiGuide.content.options[
39
37
  activeFirstTypeIndex
@@ -234,11 +232,11 @@ export default {
234
232
  beforeMount() {},
235
233
  mounted() {
236
234
  this.isMobile();
237
- if (this.aiGuide.content.options[0].types.length === 0) {
235
+ if (this.aiGuide.content.options[0] && this.aiGuide.content.options[0] && this.aiGuide.content.options[0].types && this.aiGuide.content.options[0].types.length === 0) {
238
236
  this.activeOtherObj = this.aiGuide.content.options[0];
239
237
  } else {
240
238
  this.activeSecondTypeIndex = 0;
241
- this.activeOtherObj = this.aiGuide.content.options[0].types[0];
239
+ this.activeOtherObj = this.aiGuide.content.options[0] && this.aiGuide.content.options[0].types && this.aiGuide.content.options[0].types[0] ? this.aiGuide.content.options[0].types[0] : [];
242
240
  }
243
241
  },
244
242
  methods: {
@@ -70,7 +70,7 @@
70
70
  </div>
71
71
  </div>
72
72
  </div>
73
- <previewPdf ref="previewPdf" :url="previewHref" :sourceFileType="sourceFileType" officePreviewType="pdf"></previewPdf>
73
+ <previewPdf ref="previewPdf" :url="previewHref" :watermark="watermark" :sourceFileType="sourceFileType" officePreviewType="pdf"></previewPdf>
74
74
  </div>
75
75
  </template>
76
76
 
@@ -154,6 +154,11 @@ export default {
154
154
  MP3: "audio",
155
155
  yqhtml: "yqhtml",
156
156
  feishuhtml:"feishuhtml"
157
+ },
158
+ watermark: {
159
+ textWatermarkValue:'',
160
+ visitorWatermarkValue:'',
161
+ source:""
157
162
  }
158
163
  }
159
164
  },
@@ -201,6 +206,9 @@ export default {
201
206
  methods: {
202
207
  //预览图片
203
208
  lookAttach(url, item, event) {
209
+ // console.log(item.knowledgeId);
210
+ // this.$http.get("/knowledge-api/internal/knowledgeBaseStructure/" + "642ffbccde420e2772f7787b")
211
+ // debugger
204
212
  event.preventDefault();
205
213
  if (this.isAskLightning == 1 && !this.isApp){
206
214
  window.parent.postMessage({
@@ -233,8 +241,10 @@ export default {
233
241
  }
234
242
  this.$http.post(httpUrl, {
235
243
  "fileInOssPath":url
236
- }).then(res =>{
244
+ }).then(async res =>{
237
245
  if(res.data.code == '0') {
246
+ this.watermark = await this.getknowledgeBaseStructure(item.knowledgeId);
247
+ this.watermark.source = item.source;
238
248
  this.previewHref = res.data.data;
239
249
  this.sourceFileType = url.substring(url.lastIndexOf('.'))
240
250
  let isOhmPc = sessionStorage.getItem('isOhmPc')
@@ -247,7 +257,18 @@ export default {
247
257
  }
248
258
  this.$refs.previewPdf.fileType = type
249
259
  this.$refs.previewPdf.tagIds = item.tagIds
250
- this.$refs.previewPdf.isMessageRecord = this.isMessageRecord ? true : false
260
+ this.$refs.previewPdf.isMessageRecord = this.isMessageRecord ? true : false ;
261
+ let index = url.indexOf("?");
262
+ let newFileInOssPath = url;
263
+ if (index !== -1){
264
+ newFileInOssPath = url.substring(0, url.indexOf("?"))
265
+ }
266
+ let fileName = newFileInOssPath.substring(newFileInOssPath.lastIndexOf('.'))
267
+ if (fileName === '.doc' || fileName === '.docx' || fileName === '.txt'|| fileName === '.html'){
268
+ this.$refs.previewPdf.fileName = fileName;
269
+ } else {
270
+ this.$refs.previewPdf.fileName = '';
271
+ }
251
272
  if(item.tagIds && item.tagIds.length != 0) {
252
273
  this.$refs.previewPdf.loading = false
253
274
  return
@@ -298,6 +319,24 @@ export default {
298
319
  // return res.data
299
320
  })
300
321
  // return imgurl
322
+ },
323
+ async getknowledgeBaseStructure(knowledgeId) {
324
+ let watermark = {
325
+ textWatermarkValue:'',
326
+ visitorWatermarkValue:''
327
+ }
328
+ await this.$http.get("/knowledge-api/internal/knowledgeBaseStructure/" + knowledgeId).then( async res =>{
329
+ if(res.data) {
330
+ watermark.textWatermarkValue = await res.data.textWatermarkValue
331
+ if(res.data.visitorWatermark) {
332
+ let userInfo = sessionStorage.getItem('userInfo') || localStorage.getItem('userInfo')
333
+ if(userInfo && userInfo !== 'null') {
334
+ watermark.visitorWatermarkValue = JSON.parse(userInfo).realName
335
+ }
336
+ }
337
+ }
338
+ })
339
+ return watermark
301
340
  }
302
341
  }
303
342
  }
@@ -408,6 +447,8 @@ export default {
408
447
  }
409
448
  }
410
449
  .alc-box-introduction-previewImage {
450
+ width: 100%;
451
+ display: block;
411
452
  overflow: hidden;
412
453
  text-overflow: ellipsis;
413
454
  display: -webkit-box;
@@ -12,15 +12,15 @@
12
12
  <loading-process :dataNote="dataNote" :finished="finished"></loading-process>
13
13
  </div>
14
14
  </div> -->
15
- <MyEditor></MyEditor>
15
+
16
16
  <!-- <form-template
17
17
  :formList="formList2"
18
18
  @submitClick="submitClick"
19
19
  ></form-template> -->
20
- <form-template
20
+ <!-- <form-template
21
21
  :formList="formList"
22
22
  @submitClick="submitClick"
23
- ></form-template>
23
+ ></form-template> -->
24
24
  <!-- <form-template
25
25
  :formList="formList3"
26
26
  @submitClick="submitClick"
@@ -77,11 +77,11 @@
77
77
  </template>
78
78
  <script>
79
79
  import TextMessage from '@/components/message/TextMessage'
80
- import FormTemplate from "@/components/formTemplate";
80
+ // import FormTemplate from "@/components/formTemplate";
81
81
 
82
82
  /*import FormTemplate from "@/components/formTemplate";
83
83
  import TextMessage from "@/components/message/TextMessage";*/
84
- import MyEditor from '@/components/MyEditor'
84
+
85
85
  // import FormTemplate from '@/components/formTemplate'
86
86
  import AnswerRadio from './answerRadio'
87
87
  // import TicketMessage from './message/TicketMessage'
@@ -119,7 +119,7 @@ export default {
119
119
  // LoadingProcess,
120
120
  // MsgLoading,
121
121
  // ActionSatisfaction,
122
- AssociationIntention,
122
+ AssociationIntention,
123
123
  /* VoiceComponent,*/
124
124
  TicketMessage,
125
125
  // AsserDeatils,
@@ -130,12 +130,11 @@ export default {
130
130
  // VoiceCompontent,
131
131
  AiGuide,
132
132
  AnswerVoice,
133
- FormTemplate,
133
+ // FormTemplate,
134
134
  // FormTemplate,
135
135
  // FileType,
136
136
  // ChatContent,
137
137
  AnswerDocknowledge,
138
- MyEditor
139
138
  },
140
139
  props: {
141
140
  messages: Array
@@ -212,7 +211,7 @@ export default {
212
211
  "knowledgeId": "658a93de63d378228271913a",
213
212
  "knowledgePartId": "ypZaqYwBD3jzLtPbz5K8",
214
213
  "from": "ppt_preview",
215
- "introduction": "Spark是什么Spark 是一个开源的大数据处理引擎,它提供了一整套开发 API,包括流计算和机器学习。它支持批处理和流处理。Spark 的一个显著特点是它能够在内存中进行迭代计算,从而加快数据处理速度。尽管 Spark 是用 Scala 开发的,但它也为 Java、Scala、Python 和 R 等高级编程语言提供了开发接口。",
214
+ "introduction": "Spark是什么Spark 是一个开源的大数据处理引擎,它提供了一整套开发 API,。",
216
215
  "previewImage": "https://askbot-pdf-all.oss-cn-zhangjiakou.aliyuncs.com/31623ccfe9dd4957bbd59c5823878bbe/2023/12/27/03/39/08/658b9c477cf604285f7cb81d/pdf-image-1913302477976388839.png"
217
216
  }
218
217
  ],
@@ -4653,6 +4652,7 @@ export default {
4653
4652
  url:
4654
4653
  'https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/2021/08/24/07/35/41221223-c180-4f3f-bdc8-94875b693965/WeChat_20210719215122.mp4',
4655
4654
  videoFlag: false,
4655
+ nodownload: false,
4656
4656
  videoUploadPercent: 0,
4657
4657
  isShowUploadVideo: true,
4658
4658
  recommend: {
@@ -15,13 +15,16 @@
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 - 139px);height: 160px;background-color: black;border-radius: 25px;max-width: 230px;padding-left: 10px"
18
+ style="object-fit: contain;width: calc(100vw - 169px);height: 160px;background-color: black;border-radius: 25px;max-width: 200px;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>
25
28
  <div id="output"></div>
26
29
  </div>
27
30
  </template>
@@ -123,6 +126,8 @@
123
126
  video::-webkit-media-controls-mute-button { display: none !important;}
124
127
  #dragon-video{
125
128
  position: relative;
129
+ width: calc(100vw - 109px);
130
+ max-width: 260px;
126
131
  #outputVideo{
127
132
  position: absolute;
128
133
  top: 0px;
@@ -134,6 +139,24 @@ video::-webkit-media-controls-mute-button { display: none !important;}
134
139
  }
135
140
 
136
141
  }
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
+ }
137
160
  }
138
161
 
139
162
  </style>
@@ -233,7 +233,7 @@
233
233
  this.$emit("onRadioClick", id, name, apikey,optionApiKey);
234
234
  },
235
235
  onImageClick(url){
236
- this.$emit('onImageClick',url)
236
+ this.$emit('onImageClick', encodeURI(url))
237
237
  },
238
238
  msgContent(content){
239
239
  console.debug('215',content)
@@ -343,6 +343,12 @@
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
+ }
346
352
  }
347
353
  /deep/.el-drawer__body{
348
354
  height: 100%;
@@ -63,20 +63,13 @@
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> -->
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}" -->
72
+ ></ckeditor>
80
73
  <file-list-view :attachmentList="attachmentList" @attachDeleteAttch="attachDeleteAttch"></file-list-view>
81
74
  </div>
82
75
  <el-date-picker
@@ -352,20 +345,13 @@
352
345
  <i class="el-icon-warning-outline"></i>
353
346
  </span>
354
347
  </div>
355
- <!-- <ckeditor
348
+ <ckeditor
356
349
  :editor="ckeditor.editor"
357
350
  v-model="item.value"
358
351
  @ready="(editor)=>currentEditor=editor"
359
352
  @focus="(zh,editor)=>currentEditor=editor"
360
353
  :config="{...ckeditor.editorConfig,placeholder:item.formField.extInfo && item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请输入'}"
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>
354
+ ></ckeditor>
369
355
  <file-list-view :attachmentList="attachmentList" @attachDeleteAttch="attachDeleteAttch"></file-list-view>
370
356
  </div>
371
357
  </div>
@@ -861,9 +847,14 @@
861
847
  <script>
862
848
  /* eslint-disable */
863
849
  import { forMatTime } from "./utils/format_date";
850
+
864
851
  let that
865
852
  import {multipartUpload,ossFileUrl} from "./utils/AliyunIssUtil";
866
- import MyEditor from './MyEditor'
853
+ import {MyCustomUploadAdapterPlugin} from "./utils/ckeditor";
854
+ // import MyimageUpload from './utils/ckeditorImageUpload/plugin-image'
855
+ import MyFileUpload from './utils/ckeditorfileUpload/plugin_file'
856
+ import CKEDITOR from 'ckeditor'
857
+
867
858
  import myPopup from "./myPopup.vue";
868
859
  import Tree from '../components/tree'
869
860
  import selectPopup from '../components/popup'
@@ -953,6 +944,21 @@ export default {
953
944
  },
954
945
  hideUploadEdit:false,
955
946
  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
+ },
956
962
  refShowPicker:false,
957
963
  refTemplateList:{},
958
964
  refList:{},
@@ -1194,8 +1200,7 @@ export default {
1194
1200
  myPopup,
1195
1201
  Tree,
1196
1202
  selectPopup,
1197
- fileListView,
1198
- MyEditor
1203
+ fileListView
1199
1204
  },
1200
1205
  mounted() {
1201
1206
 
@@ -1214,10 +1219,9 @@ export default {
1214
1219
  // }
1215
1220
  // })
1216
1221
  // }
1217
- // if (this.mainId == '8b9bd566e3e64156ab764b19defc9d48' || this.mainId == '0b73521f96e4486aaf6be42932bd7b07'){
1218
- // this.ckeditor.editorConfig.toolbar = []
1219
-
1220
- // }
1222
+ if (this.mainId == '8b9bd566e3e64156ab764b19defc9d48' || this.mainId == '0b73521f96e4486aaf6be42932bd7b07'){
1223
+ this.ckeditor.editorConfig.toolbar = []
1224
+ }
1221
1225
  if (this.mainId == '90df4764122240de939331d372546c28'){
1222
1226
  this.isBaiLi = true;
1223
1227
  }