askbot-dragon 1.5.78-beta → 1.5.80-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.5.78-beta",
3
+ "version": "1.5.80-beta",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -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{
@@ -67,7 +67,7 @@
67
67
  </div>
68
68
  </div>
69
69
  </div>
70
- <previewPdf ref="previewPdf" :url="previewHref" :sourceFileType="sourceFileType" officePreviewType="pdf"></previewPdf>
70
+ <previewPdf ref="previewPdf" :url="previewHref" :watermark="watermark" :sourceFileType="sourceFileType" officePreviewType="pdf"></previewPdf>
71
71
  </div>
72
72
  </template>
73
73
 
@@ -151,6 +151,11 @@ export default {
151
151
  MP3: "audio",
152
152
  yqhtml: "yqhtml",
153
153
  feishuhtml:"feishuhtml"
154
+ },
155
+ watermark: {
156
+ textWatermarkValue:'',
157
+ visitorWatermarkValue:'',
158
+ source:""
154
159
  }
155
160
  }
156
161
  },
@@ -198,6 +203,9 @@ export default {
198
203
  methods: {
199
204
  //预览图片
200
205
  lookAttach(url, item, event) {
206
+ // console.log(item.knowledgeId);
207
+ // this.$http.get("/knowledge-api/internal/knowledgeBaseStructure/" + "642ffbccde420e2772f7787b")
208
+ // debugger
201
209
  event.preventDefault();
202
210
  if (this.isAskLightning == 1 && !this.isApp){
203
211
  window.parent.postMessage({
@@ -230,8 +238,10 @@ export default {
230
238
  }
231
239
  this.$http.post(httpUrl, {
232
240
  "fileInOssPath":url
233
- }).then(res =>{
241
+ }).then(async res =>{
234
242
  if(res.data.code == '0') {
243
+ this.watermark = await this.getknowledgeBaseStructure(item.knowledgeId);
244
+ this.watermark.source = item.source;
235
245
  this.previewHref = res.data.data;
236
246
  this.sourceFileType = url.substring(url.lastIndexOf('.'))
237
247
  let isOhmPc = sessionStorage.getItem('isOhmPc')
@@ -244,7 +254,18 @@ export default {
244
254
  }
245
255
  this.$refs.previewPdf.fileType = type
246
256
  this.$refs.previewPdf.tagIds = item.tagIds
247
- this.$refs.previewPdf.isMessageRecord = this.isMessageRecord ? true : false
257
+ this.$refs.previewPdf.isMessageRecord = this.isMessageRecord ? true : false ;
258
+ let index = url.indexOf("?");
259
+ let newFileInOssPath = url;
260
+ if (index !== -1){
261
+ newFileInOssPath = url.substring(0, url.indexOf("?"))
262
+ }
263
+ let fileName = newFileInOssPath.substring(newFileInOssPath.lastIndexOf('.'))
264
+ if (fileName === '.doc' || fileName === '.docx' || fileName === '.txt'|| fileName === '.html'){
265
+ this.$refs.previewPdf.fileName = fileName;
266
+ } else {
267
+ this.$refs.previewPdf.fileName = '';
268
+ }
248
269
  if(item.tagIds && item.tagIds.length != 0) {
249
270
  this.$refs.previewPdf.loading = false
250
271
  return
@@ -295,6 +316,24 @@ export default {
295
316
  // return res.data
296
317
  })
297
318
  // return imgurl
319
+ },
320
+ async getknowledgeBaseStructure(knowledgeId) {
321
+ let watermark = {
322
+ textWatermarkValue:'',
323
+ visitorWatermarkValue:''
324
+ }
325
+ await this.$http.get("/knowledge-api/internal/knowledgeBaseStructure/" + knowledgeId).then( async res =>{
326
+ if(res.data) {
327
+ watermark.textWatermarkValue = await res.data.textWatermarkValue
328
+ if(res.data.visitorWatermark) {
329
+ let userInfo = sessionStorage.getItem('userInfo') || localStorage.getItem('userInfo')
330
+ if(userInfo && userInfo !== 'null') {
331
+ watermark.visitorWatermarkValue = JSON.parse(userInfo).realName
332
+ }
333
+ }
334
+ }
335
+ })
336
+ return watermark
298
337
  }
299
338
  }
300
339
  }
@@ -34,7 +34,7 @@
34
34
  </div> -->
35
35
 
36
36
  <text-message :text="text" @submitClick="submitClick"></text-message>
37
- <!-- <answer-docknowledge :isAskLightning="2" :msg="answerDocknowledge"></answer-docknowledge> -->
37
+ <answer-docknowledge :isAskLightning="2" :msg="answerDocknowledge"></answer-docknowledge>
38
38
  <!-- <voice-component @closeVoice="closeVoice">
39
39
  <div slot="voiceTip">
40
40
  松开发送
@@ -108,7 +108,7 @@ import AnswerVoice from "@/components/AnswerVoice";
108
108
  // import ChatContent from "./chatContent";
109
109
  // import FeedBack from '@/components/feedBack'
110
110
  // 知识类型
111
- // import AnswerDocknowledge from "./AnswerDocknowledge.vue";
111
+ import AnswerDocknowledge from "./AnswerDocknowledge.vue";
112
112
  export default {
113
113
  name: 'ConversationContainer',
114
114
  components: {
@@ -134,7 +134,7 @@ export default {
134
134
  FormTemplate,
135
135
  // FileType,
136
136
  // ChatContent,
137
- // AnswerDocknowledge,
137
+ AnswerDocknowledge,
138
138
  },
139
139
  props: {
140
140
  messages: Array
@@ -191,17 +191,48 @@ export default {
191
191
  answerDocknowledge:
192
192
  // {"content":{"knowledgeId":"64915d6e098ec248701da267","actionType":"answer_doc_knowledge","text":"跳舞不仅要有实力,还要有好的穿搭,本文针对街舞爱好者提供了穿搭指南,给你带来灵感和帮助!","list":[{"tagIds":[],"format":"html","updateTime":"2023-06-20 16:03:58","source":"WECHAT","url":"https://guoranwisdom.oss-cn-zhangjiakou.aliyuncs.com/137993c6d830416696bbd771fc61d423/1937/2023/06/20/16/03/微信同步/52720/501775e41a724d7da06e66b3b4686407.html","knowledgeId":"64915d6e098ec248701da267","from":"跳舞要有范儿,穿搭占一半!快来get你的街舞穿搭指南~"}],"renderType":0,"type":0,"isKnowledgeSummary":true},"type":"answer_doc_knowledge","sessionId":1687251699065,"keyId":"1a079f48-ace3-4064-89b4-8a292c6a8a93_________","isKnowledgeSummary":true},
193
193
 
194
- {
195
- "content": {
196
- "images": [{ url: 'https://static.guoranbot.com/images/knowledge/e0f6898c6b0d47fa98e8f71ceab1bde8/安全标志--禁止标志.png' }],
197
- "actionType": "answer_doc_knowledge",
198
- "text": "中国的省份名称有湖北省、广西壮族自治区等。",
199
- "list": [{ "tagIds": [], "format": "yqhtml", "srcContentId": "8ee0fa9bb5a89ea01f588843589bf931", "updateTime": "2023-04-14 20:15:50", "source": "YUQUE", "srcContent": "功能概述分院科室的建立。分院科室医生关联。分院科室建立时,科室编码需要与集团提供的科室编码保持一致。科室维护进入扁鹊基础配置模块,如图进入科室维护界面进行科室新增输入科室信息进行科室增加。", "url": "https://guoranwisdom.oss-cn-zhangjiakou.aliyuncs.com/yuque/7faaefde11374c7992c377731ea4dddc/dinga77cc098b0b5e113ee0f45d8e4f7c288/2023/4/14/19/54/31/acc2421dcfd04db39eba0c37e7d3b580.html", "knowledgeId": "643940bb6cbe816b83ebbaaf", "knowledgePartId": "lPexf4cBYkmDoUE2eSUt", "from": "2.3 科室", "introduction": "功能概述分院科室的建立。分院科室医生关联。分院科室建立时,科室编码需要与集团提供的科室编码保持一致。科室维护进入扁鹊基础配置模块,如图进入科室维护界面进行科室新增输入科室信息进行科室增加。" }, { "tagIds": [], "format": "feishuhtml", "srcContentId": "8ee0fa9bb5a89ea01f588843589bf931", "updateTime": "2023-04-13 23:19:48", "source": "YUQUE", "srcContent": "功能概述分院科室的建立。分院科室医生关联。分院科室建立时,科室编码需要与集团提供的科室编码保持一致。科室维护进入扁鹊基础配置模块,如图进入科室维护界面进行科室新增输入科室信息进行科室增加。", "url": "https://guoranwisdom.oss-cn-zhangjiakou.aliyuncs.com/yuque/7faaefde11374c7992c377731ea4dddc/dinga77cc098b0b5e113ee0f45d8e4f7c288/2023/4/13/22/20/40/0e48cc7b15b34d2f84fe49fd1a89d606.html", "knowledgeId": "643817509ab4545bef50db64", "knowledgePartId": "NeYze4cBh77-s6lwjWOl", "from": "2.12 重要异常科室对照", "introduction": "功能概述分院科室的建立。分院科室医生关联。分院科室建立时,科室编码需要与集团提供的科室编码保持一致。科室维护进入扁鹊基础配置模块,如图进入科室维护界面进行科室新增输入科室信息进行科室增加。" }, { "tagIds": ['12312313123'], "format": "yqhtml", "srcContentId": "8ee0fa9bb5a89ea01f588843589bf931", "updateTime": "2023-04-13 23:19:02", "source": "YUQUE", "srcContent": "功能概述分院科室的建立。分院科室医生关联。分院科室建立时,科室编码需要与集团提供的科室编码保持一致。科室维护进入扁鹊基础配置模块,如图进入科室维护界面进行科室新增输入科室信息进行科室增加。", "url": "https://guoranwisdom.oss-cn-zhangjiakou.aliyuncs.com/yuque/7faaefde11374c7992c377731ea4dddc/dinga77cc098b0b5e113ee0f45d8e4f7c288/2023/4/13/22/20/18/5cdf1295ec1649f6ab73948aa82ea810.html", "knowledgeId": "643817509ab4545bef50db58", "knowledgePartId": "Hvcye4cBYkmDoUE21h6V", "from": "2.3 科室", "introduction": "功能概述分院科室的建立。分院科室医生关联。分院科室建立时,科室编码需要与集团提供的科室编码保持一致。科室维护进入扁鹊基础配置模块,如图进入科室维护界面进行科室新增输入科室信息进行科室增加。" }, { "tagId": "6475eab868110215ab821a7c", "tagIds": ["6475eab868110215ab821a7c"], "format": "xlsx", "srcContentId": "0bf639060655ff3ec217484a2fc7827d", "updateTime": "2023-05-30 20:28:21", "source": "CORP_LOCAL_FILE", "srcContent": "产品:外观,解释:VX50有两种套餐可下单: 套餐一:只购买VX50终端设备,不包含摄像头、麦克风 套餐二:除购买VX50终端设备外,可选购SC701云台摄像头及MC30/MC31麦克风", "url": "https://guoranwisdom.oss-cn-zhangjiakou.aliyuncs.com/5ecf2fcd704541149201ab9c1c31162d/2023/05/30/20/11/85b7b2a5f61e2b060387656e88c02d50/VX30与VX50对比表.xlsx", "knowledgeId": "6475e7eac724c54c46cbfa2d", "knowledgePartId": "T_uhbIgB3v-0X8BLeDAh", "from": "VX30与VX50对比表", "introduction": "产品:外观,解释:VX50有两种套餐可下单: 套餐一:只购买VX50终端设备,不包含摄像头、麦克风 套餐二:除购买VX50终端设备外,可选购SC701云台摄像头及MC30/MC31麦克风" },],
200
- "renderType": 0,
201
- "type": 0
202
- },
203
- "type": "answer_doc_knowledge"
204
- },
194
+ {
195
+ "conditionList": null,
196
+ "apiKey": null,
197
+ "effectiveTime": null,
198
+ "intentId": null,
199
+ "msgId": null,
200
+ "actionCategory": null,
201
+ "id": null,
202
+ "type": "answer_doc_knowledge",
203
+ "nodeId": null,
204
+ "content": {
205
+ "knowledgeId": null,
206
+ "actionType": "answer_doc_knowledge",
207
+ "images": null,
208
+ "knowledgePartId": null,
209
+ "srcContentId": null,
210
+ "text": "新能源车是指采用新型能源的轿车、客车、货车等机动车辆,包括纯电动汽车、插电式混合动力汽车和燃料电池汽车。根据数据显示,2020年我国新能源汽车销售量达到139万辆,同比增长10.9%。预计2021年新能源车市场将继续保持高速增长,销售量有望超过200万辆。政府对新能源汽车实行补贴政策,同时逐步放松对新能源车的限购和限行政策。此外,中国汽车企业在新能源车领域的技术研发能力也不断提升,各大品牌纷纷推出新能源车型,采用更优秀的动力电池和电控系统,提高了车辆的续航里程。因此,新能源车市场发展前景广阔。",
211
+ "list": [
212
+ {
213
+ "owner": null,
214
+ "tagId": "6525183560177f6223d52a14",
215
+ "enterprise": null,
216
+ "tagIds": [
217
+ "6525183560177f6223d52a14"
218
+ ],
219
+ "format": "docx",
220
+ "srcContentId": "99cada54a02161f979acc28c5b8b913e",
221
+ "updateTime": "2023-10-10 17:24:05",
222
+ "source": "CORP_LOCAL_FILE",
223
+ "srcContent": "新能源车指的是采用新型能源的轿车、客车、货车等机动车辆。目前主要的新能源车包括纯电动汽车、插电式混合动力汽车、燃料电池汽车等。以下是对新能源车的分析报告:市场发展趋势:随着环保和能源安全意识的增强,新能源车市场呈现快速发展态势。数据显示,2020年我国新能源汽车销售量达到139万辆,同比增长10.9%。预计2021年新能源车市场仍将保持高速增长,销售量有望达到200万辆以上。政策扶持力度加大:我国政府对新能源汽车实行补贴政策,以鼓励消费者选择绿色出行方式。此外,对新能源车限购、限行等政策也逐步放松。政策扶持的加大将进一步促进新能",
224
+ "url": "http://guoranwisdom.oss-cn-zhangjiakou.aliyuncs.com/43aadcaac45f4be19b63fd18ca68f2e6/2023/10/10/17/23/a27c5c1dd534d180c5512c907d5c9888/新能源车分析报告 (1).docx?uploadId=0921CB01AB5847E8BEF44730EE5DACF7",
225
+ "knowledgeId": "6525182f002ff5198983a90c",
226
+ "knowledgePartId": "YfHmGIsBvcIPGxbfkvwK",
227
+ "from": "新能源车分析报告 (1)",
228
+ "introduction": "新能源车指的是采用新型能源的轿车、客车、货车等机动车辆。目前主要的新能源车包括纯电动汽车、插电式混合动力汽车、燃料电池汽车等。以下是对新能源车的分析报告:市场发展趋势:随着环保和能源安全意识的增强,新能源车市场呈现快速发展态势。数据显示,2020年我国新能源汽车销售量达到139万辆,同比增长10.9%。预计2021年新能源车市场仍将保持高速增长,销售量有望达到200万辆以上。政策扶持力度加大:我国政府对新能源汽车实行补贴政策,以鼓励消费者选择绿色出行方式。此外,对新能源车限购、限行等政策也逐步放松。政策扶持的加大将进一步促进新能"
229
+ }
230
+ ],
231
+ "renderType": 0,
232
+ "type": 0,
233
+ "srcContent": null
234
+ }
235
+ },
205
236
  ActionAiGuideObj: {
206
237
  // 智能引导
207
238
  type: "answer_intellect_guide",
@@ -4634,6 +4665,7 @@ export default {
4634
4665
  url:
4635
4666
  'https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/2021/08/24/07/35/41221223-c180-4f3f-bdc8-94875b693965/WeChat_20210719215122.mp4',
4636
4667
  videoFlag: false,
4668
+ nodownload: false,
4637
4669
  videoUploadPercent: 0,
4638
4670
  isShowUploadVideo: true,
4639
4671
  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)
@@ -2080,8 +2080,10 @@ export default {
2080
2080
  let textFlag = true
2081
2081
  let imageFlag = true
2082
2082
  let attachmentFlag = true
2083
+ let imageOrAttachment = true
2083
2084
  let errorText = ''
2084
2085
  let checkDescription = {
2086
+ checkImageOrAttachment:this.workOrderDestail.checkImageOrAttachment ? this.workOrderDestail.checkImageOrAttachment : false,
2085
2087
  checkText:this.workOrderDestail.checkText ? this.workOrderDestail.checkText : false,
2086
2088
  checkImage:this.workOrderDestail.checkImage ? this.workOrderDestail.checkImage : false,
2087
2089
  checkAttachment:this.workOrderDestail.checkAttachment ? this.workOrderDestail.checkAttachment : false,
@@ -2099,16 +2101,24 @@ export default {
2099
2101
  d = null
2100
2102
  }
2101
2103
  }
2104
+ if(checkDescription.checkImageOrAttachment) {
2105
+ if(!this.workOrderDestail.value.includes('img') && this.attachmentList.length == 0) {
2106
+ imageOrAttachment = false
2107
+ }
2108
+ }
2102
2109
  if (checkDescription.checkImage && !this.workOrderDestail.value.includes('img')) {
2103
2110
  imageFlag = false
2104
2111
  }
2105
- if (checkDescription.checkAttachment && this.attachments.length == 0) {
2112
+ if (checkDescription.checkAttachment && this.attachmentList.length == 0) {
2106
2113
  attachmentFlag = false
2107
2114
  }
2108
2115
  let text = this.isBaiLi ? '反馈描述' : '问题描述'
2109
2116
  if (!textFlag) {
2110
2117
  errorText = text + '必须要有文字'
2111
2118
  }
2119
+ if(!imageOrAttachment) {
2120
+ errorText = text + '必须要有图片或附件'
2121
+ }
2112
2122
  if (!imageFlag) {
2113
2123
  errorText = text + '必须要有图片'
2114
2124
  }
@@ -2130,7 +2140,7 @@ export default {
2130
2140
  } else {
2131
2141
  let d = document.createElement('div')
2132
2142
  d.innerHTML = this.workOrderDestail.value
2133
- if (checkDescription.required && !d.innerText && !this.workOrderDestail.value.includes('img') && this.attachments.length == 0) {
2143
+ if (checkDescription.required && !d.innerText && !this.workOrderDestail.value.includes('img') && this.attachmentList.length == 0) {
2134
2144
  let errorText = this.isBaiLi ? '反馈描述是必填的' : '问题描述是必填的'
2135
2145
  this.$message.error(errorText);
2136
2146
  return false
@@ -2230,7 +2240,6 @@ export default {
2230
2240
  }
2231
2241
  let extInfo = {
2232
2242
  extInfoFieldValue:this.extInfoFieldValue,
2233
- attachments:this.attachments,
2234
2243
  attachmentList:this.attachmentList
2235
2244
  }
2236
2245
  this.$set(this.formShow,'extInfo',extInfo)
@@ -2967,76 +2976,8 @@ export default {
2967
2976
  }
2968
2977
  return flag
2969
2978
  },
2970
- getAttach (newVal) {
2971
- let d = document.createElement('div')
2972
- d.innerHTML = newVal
2973
- let uploadList = d.getElementsByClassName('ask-component-placeholder-container')
2974
- if (uploadList) {
2975
- for (let index = 0; index < uploadList.length; index++) {
2976
- if(!uploadList[index].childNodes[0] || !uploadList[index].childNodes[0].getAttribute) {
2977
- break
2978
- }
2979
- if (uploadList[index].childNodes[0].getAttribute('type') == 'upload' || uploadList[index].childNodes[0].getAttribute('type') == 'undefined') {
2980
- this.uploadImgQueue = true
2981
- let text = uploadList[index].innerText.replace('正在上传...', '')
2982
- let i = uploadList[index].childNodes[0].getAttribute('data')
2983
- if (newVal.includes(text + i)) {
2984
- uploadList[index].setAttribute('type', 'upload')
2985
- let ht = '<span class="ask-component-placeholder-container">' + uploadList[index].innerHTML + '</span>'
2986
- newVal = newVal.replace(ht, '')
2987
- this.uploadImgQueue = false
2988
- let time = setTimeout(() => {
2989
- this.currentEditor.model.change(writer => {
2990
- writer.setSelection(writer.createPositionAt(this.currentEditor.model.document.getRoot(), 'end'));
2991
- })
2992
- this.currentEditor.editing.view.focus();
2993
- clearTimeout(time)
2994
- }, 500)
2995
- }
2996
- }
2997
- if (uploadList[index].childNodes[0].getAttribute('type') == 'MyFile' || uploadList[index].childNodes[0].getAttribute('type') == 'FileUpload') {
2998
- let span = uploadList[index].getElementsByClassName('ask-component-placeholder-span')[0]
2999
- const text = span.innerText
3000
- let value = ''
3001
- let id = ''
3002
- if (typeof span.getAttribute('data') == 'string' && !span.getAttribute('data').includes('default')) {
3003
- id = span.getAttribute('data')
3004
- this.attachmentList.push({
3005
- name: text,
3006
- id: id,
3007
- url: '',
3008
- })
3009
- } else {
3010
- value = JSON.parse(span.getAttribute('data')).default
3011
- id = JSON.parse(span.getAttribute('data')).id
3012
- this.attachments.push(value)
3013
- this.attachmentList = this.attachmentList.filter(attach => {
3014
- return attach.id != id
3015
- })
3016
- this.attachmentList.push({
3017
- name: text,
3018
- url: value,
3019
- })
3020
- let time = setTimeout(() => {
3021
- this.currentEditor.model.change(writer => {
3022
- writer.setSelection(writer.createPositionAt(this.currentEditor.model.document.getRoot(), 'end'));
3023
- })
3024
- this.currentEditor.editing.view.focus();
3025
- clearTimeout(time)
3026
- }, 500)
3027
- }
3028
- uploadList[index].setAttribute('type', 'MyFile')
3029
- let ht = '<span class="ask-component-placeholder-container">' + uploadList[index].innerHTML + '</span>'
3030
- newVal = newVal.replace(ht, '')
3031
- span = null
3032
- }
3033
- }
3034
- }
3035
- d = null
3036
- return newVal
3037
- },
3038
2979
  attachDeleteAttch (index) {
3039
- this.attachments.splice(index, 1)
2980
+ // this.attachments.splice(index, 1)
3040
2981
  this.attachmentList.splice(index, 1)
3041
2982
  },
3042
2983
  attachDeleteFile(index,fieldId){
@@ -3070,7 +3011,6 @@ export default {
3070
3011
  handler(val){
3071
3012
  let newVal = ''
3072
3013
  newVal = val.replace(/ style=".*?"/g, '');
3073
- // newVal = this.getAttach(newVal)
3074
3014
  if (this.currentEditor){
3075
3015
  if (this.workOrderDestail){
3076
3016
  this.$nextTick(() =>{