askbot-dragon 0.8.24 → 0.8.26
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
|
@@ -860,6 +860,7 @@ export default {
|
|
|
860
860
|
selectDetail:{},
|
|
861
861
|
refDefaultValue:{},
|
|
862
862
|
selectOptionWidth:null,
|
|
863
|
+
fieldValue:{}
|
|
863
864
|
}
|
|
864
865
|
},
|
|
865
866
|
props: {
|
|
@@ -911,6 +912,9 @@ export default {
|
|
|
911
912
|
}
|
|
912
913
|
})
|
|
913
914
|
arr.forEach(item=>{
|
|
915
|
+
if (item.value && item.value.length){
|
|
916
|
+
this.$set(this.fieldValue,item.fieldId,item.value)
|
|
917
|
+
}
|
|
914
918
|
this.$set(item,'relationDisplay',this.relationSet(item.formField,'dependentFieldId'))
|
|
915
919
|
if(item.formField.type === 'CHECKBOX'){
|
|
916
920
|
if(!item.value){
|
|
@@ -920,6 +924,10 @@ export default {
|
|
|
920
924
|
item.value = item.formField.defaultValue
|
|
921
925
|
}
|
|
922
926
|
}
|
|
927
|
+
if (item.relationDisplay && this.fieldValue[item.fieldId]){
|
|
928
|
+
item.value = this.fieldValue[item.fieldId];
|
|
929
|
+
this.extInfoFieldValue[item.fieldId] = this.fieldValue[item.fieldId];
|
|
930
|
+
}
|
|
923
931
|
if (!item.relationDisplay){
|
|
924
932
|
item.value = []
|
|
925
933
|
this.extInfoFieldValue[item.fieldId] = []
|
|
@@ -1310,7 +1318,14 @@ export default {
|
|
|
1310
1318
|
else {
|
|
1311
1319
|
let valueList=[]
|
|
1312
1320
|
let bool=false
|
|
1313
|
-
|
|
1321
|
+
|
|
1322
|
+
if (!Array.isArray(this.formList.form.formFieldRelation[i].value)){
|
|
1323
|
+
let obj = {
|
|
1324
|
+
url:this.formList.form.formFieldRelation[i].value
|
|
1325
|
+
}
|
|
1326
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId] = [obj]
|
|
1327
|
+
}
|
|
1328
|
+
else if(this.formList.form.formFieldRelation[i].value.length > 0) {
|
|
1314
1329
|
for (let file=0;file<this.formList.form.formFieldRelation[i].value.length;file++) {
|
|
1315
1330
|
let type = typeof (this.formList.form.formFieldRelation[i].value[file])
|
|
1316
1331
|
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();
|