askbot-dragon 0.9.1 → 0.9.2

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": "0.9.01",
3
+ "version": "0.9.2",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -63,6 +63,7 @@
63
63
  v-model="item.value"
64
64
  :config="{...ckeditor.editorConfig,placeholder:item.formField.extInfo && item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请输入'}"
65
65
  v-else-if="item.fieldId==='workorder_description'"
66
+ @ready="(editor)=>currentEditor=editor"
66
67
  ></ckeditor>
67
68
  <el-date-picker
68
69
  v-model=item.value
@@ -862,7 +863,8 @@ export default {
862
863
  refDefaultValue:{},
863
864
  selectOptionWidth:null,
864
865
  fieldValue:{},
865
- optionsList:{}
866
+ optionsList:{},
867
+ currentEditor:null
866
868
  }
867
869
  },
868
870
  props: {
@@ -1368,6 +1370,29 @@ export default {
1368
1370
  this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId] = name
1369
1371
  }
1370
1372
  }
1373
+ /*如何工单描述中只有一个链接地址,则将链接地址替换成图片*/
1374
+ if (this.formList.form.formFieldRelation[i].fieldId === 'workorder_description' &&
1375
+ this.formList.form.formFieldRelation[i].value.search(/<img /i) < 0 &&
1376
+ this.formList.form.formFieldRelation[i].value.indexOf('https://guoranopen-zjk')!==-1){
1377
+ let value = this.formList.form.formFieldRelation[i].value
1378
+ this.formList.form.formFieldRelation[i].value = ""
1379
+ let blob = null
1380
+ let file = null
1381
+ let xhr = new XMLHttpRequest()
1382
+ xhr.open('GET', value)
1383
+ xhr.responseType = 'blob'
1384
+ // 加载时处理(异步)
1385
+ xhr.onload = (res) => {
1386
+ // 获取返回结果
1387
+ blob = xhr.response
1388
+ file = new File([blob],'图片')
1389
+ let obj = {
1390
+ file:[file]
1391
+ }
1392
+ this.currentEditor.commands.get("imageUpload").execute(obj)
1393
+ }
1394
+ xhr.send()
1395
+ }
1371
1396
  }
1372
1397
  for (let i = 0; i < this.formList.form.formFieldRelation.length; i++) {
1373
1398
  let type = this.formList.form.formFieldRelation[i].formField.type