askbot-dragon 0.8.24 → 0.8.25

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.8.24",
3
+ "version": "0.8.25",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -1310,7 +1310,14 @@ export default {
1310
1310
  else {
1311
1311
  let valueList=[]
1312
1312
  let bool=false
1313
- if(this.formList.form.formFieldRelation[i].value.length > 0) {
1313
+
1314
+ if (!Array.isArray(this.formList.form.formFieldRelation[i].value)){
1315
+ let obj = {
1316
+ url:this.formList.form.formFieldRelation[i].value
1317
+ }
1318
+ this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId] = [obj]
1319
+ }
1320
+ else if(this.formList.form.formFieldRelation[i].value.length > 0) {
1314
1321
  for (let file=0;file<this.formList.form.formFieldRelation[i].value.length;file++) {
1315
1322
  let type = typeof (this.formList.form.formFieldRelation[i].value[file])
1316
1323
  if (type === "string") {
@@ -12,7 +12,11 @@ export default class ImageCommand extends Command {
12
12
  refresh() {
13
13
  this.isEnabled = true;
14
14
  }
15
- execute() {
15
+ execute(file) {
16
+ if (file){
17
+ this.forEachFiles(file.file)
18
+ return
19
+ }
16
20
  var inputObj = document.createElement('input')
17
21
  inputObj.setAttribute('id', '_ef');
18
22
  inputObj.setAttribute('type', 'file');
@@ -39,7 +43,22 @@ export default class ImageCommand extends Command {
39
43
  }
40
44
  }
41
45
  }
42
-
46
+ forEachFiles(files){
47
+ for (let index = 0; index < files.length; index++) {
48
+ const filed = files[index];
49
+ this.upload(filed).then(res =>{
50
+ let command = this.editor.commands.get("insertAskComponent");
51
+ command.execute({
52
+ tag: "img",
53
+ options: {
54
+ width:'100%',
55
+ name: res.default,
56
+ src: res.default
57
+ },
58
+ });
59
+ })
60
+ }
61
+ }
43
62
  upload(file) {
44
63
  return new Promise((resolve) => {
45
64
  /* this._initRequest();