owl-cli 6.192.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
- titleList.forEach(function(title){
48
- var field = title.fieldKey|| title.field
49
- var value = modelService.getValue(title.field,row);
50
- if(title.type==="date"){
51
- if(value){
52
- var ts = new Date(value).getTime();
53
- value = ts /86400000+25569; //这是excel的特殊的格式,用小数点表示
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
- if(title.fullField && title.fullField.options && title.fullField.fieldType==='choice'){
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,31 +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
- if(title.type==="img"){
77
- if(value && value.length>0){
78
- var imgIdx = title.imgIdx || 0;
79
- if(value.length>imgIdx){
80
- value = value[imgIdx].url;
81
- if(title.spec && value.indexOf("?")===-1){
82
- value = value + title.spec;
83
- }
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");
84
75
  }
85
- else{
86
- value = "";
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
+ }
87
89
  }
88
90
  }
89
- }
90
- record[field] = value;
91
- });
91
+ record[field] = value;
92
+ });
93
+ }
94
+ catch(e){
95
+ $.log(e.toString());
96
+ }
97
+
92
98
  return record;
93
99
  });
94
100
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "owl-cli",
3
- "version": "6.192.0",
3
+ "version": "6.193.0",
4
4
  "main": "index.js",
5
5
  "preferGlobal": true,
6
6
  "bin": {