owl-cli 6.191.0 → 6.193.0
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.
|
@@ -44,17 +44,18 @@ function main(modelService,spec){
|
|
|
44
44
|
});
|
|
45
45
|
var recordList = ret.rows.map(function(row){
|
|
46
46
|
var record = {};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
47
|
+
try{
|
|
48
|
+
titleList.forEach(function(title){
|
|
49
|
+
var field = title.fieldKey|| title.field
|
|
50
|
+
var value = modelService.getValue(title.field,row);
|
|
51
|
+
if(title.type==="date"){
|
|
52
|
+
if(value){
|
|
53
|
+
var ts = new Date(value).getTime();
|
|
54
|
+
value = ts /86400000+25569; //这是excel的特殊的格式,用小数点表示
|
|
55
|
+
}
|
|
55
56
|
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
}
|
|
58
|
+
if(title.fullField && title.fullField.options && title.fullField.fieldType==='choice'){
|
|
58
59
|
var options = title.fullField.options;
|
|
59
60
|
for(var i=0;i<options.length;i++){
|
|
60
61
|
var option = options[i];
|
|
@@ -64,28 +65,36 @@ function main(modelService,spec){
|
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
67
|
|
|
67
|
-
}
|
|
68
|
-
if(title.type==="imgUrls"){
|
|
69
|
-
if(value && value.length>0){
|
|
70
|
-
var urls = value.map(function(imgObj){
|
|
71
|
-
return imgObj.url;
|
|
72
|
-
});
|
|
73
|
-
value = urls.join("\n");
|
|
74
68
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
value =
|
|
69
|
+
if(title.type==="imgUrls"){
|
|
70
|
+
if(value && value.length>0){
|
|
71
|
+
var urls = value.map(function(imgObj){
|
|
72
|
+
return imgObj.url;
|
|
73
|
+
});
|
|
74
|
+
value = urls.join("\n");
|
|
81
75
|
}
|
|
82
|
-
|
|
83
|
-
|
|
76
|
+
}
|
|
77
|
+
if(title.type==="img"){
|
|
78
|
+
if(value && value.length>0){
|
|
79
|
+
var imgIdx = title.imgIdx || 0;
|
|
80
|
+
if(value.length>imgIdx && value[imgIdx] && value[imgIdx].url){
|
|
81
|
+
value = value[imgIdx].url;
|
|
82
|
+
if(title.spec && value.indexOf("?")===-1){
|
|
83
|
+
value = value + title.spec;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else{
|
|
87
|
+
value = "";
|
|
88
|
+
}
|
|
84
89
|
}
|
|
85
90
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
91
|
+
record[field] = value;
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
catch(e){
|
|
95
|
+
$.log(e.toString());
|
|
96
|
+
}
|
|
97
|
+
|
|
89
98
|
return record;
|
|
90
99
|
});
|
|
91
100
|
|