owl-cli 6.188.0 → 6.190.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.
@@ -328,6 +328,15 @@ var @projectCodeService = (function (pigeon) {
328
328
  }
329
329
  },
330
330
 
331
+ getField:function(fullKey){
332
+ var matchedField=null;
333
+ f.tranverseFields(formSpecs,function(field,ctx){
334
+ if(field.key===fullKey){
335
+ matchedField = field;
336
+ }
337
+ });
338
+ return matchedField;
339
+ },
331
340
  tranverseFields: function (formSpec, callback, ctx) {
332
341
  formSpec.fields.forEach(function (field) {
333
342
  if (field['_ft'] == 'field') {
@@ -36,6 +36,12 @@ function main(modelService,spec){
36
36
  if(!titleList){
37
37
  return;
38
38
  }
39
+ titleList.forEach(function(title){
40
+ var fullKey = title.field;
41
+ var fullField = modelService.getField(fullKey);
42
+ title.fullField = fullField;
43
+
44
+ });
39
45
  var recordList = ret.rows.map(function(row){
40
46
  var record = {};
41
47
  titleList.forEach(function(title){
@@ -48,6 +54,36 @@ function main(modelService,spec){
48
54
  }
49
55
 
50
56
  }
57
+ if(title.fullField && title.fullField.options && title.fullField.fieldType==='choice'){
58
+ var options = title.fullField.options;
59
+ for(var i=0;i<options.length;i++){
60
+ var option = options[i];
61
+ if(option[0] === value){
62
+ value = option[1];
63
+ break;
64
+ }
65
+ }
66
+
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
+ }
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
+ }
82
+ else{
83
+ value = "";
84
+ }
85
+ }
86
+ }
51
87
  record[field] = value;
52
88
  });
53
89
  return record;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "owl-cli",
3
- "version": "6.188.0",
3
+ "version": "6.190.0",
4
4
  "main": "index.js",
5
5
  "preferGlobal": true,
6
6
  "bin": {