owl-cli 6.56.0 → 6.58.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.
@@ -29,21 +29,21 @@ function main(){
29
29
  pageId:'tasks/exportWithTemplateTask.jsx',
30
30
  state:'notstart',
31
31
  params:JSON.stringify({
32
- ids:id,
32
+ id:id,
33
33
  templateId:templateId
34
34
  })
35
35
  };
36
- var taskInfoId = owl_task_infoService.add(taskInfo);
37
- var taskId = JobsService.submitExportTask('@projectCode', 'tasks/exportWithTemplateTask.jsx',{
36
+ owl_task_infoService.add(taskInfo);
37
+ var taskInfoId = taskInfo.id;
38
+ JobsService.submitExportTask('@projectCode', 'tasks/exportWithTemplateTask.jsx',{
38
39
  id:id,
39
40
  templateId:templateId,
40
- taskInfoId:taskInfoId,
41
- taskId:taskId
41
+ taskInfoId:"" + taskInfoId
42
42
  },now);
43
43
 
44
44
  var ret = {
45
45
  state:'ok',
46
- taskInfoId : taskId
46
+ taskInfoId : taskInfoId
47
47
  }
48
48
 
49
49
  out.print(JSON.stringify(ret));
@@ -72,14 +72,13 @@ function getExportDoc(obj){
72
72
 
73
73
  (function(){
74
74
  var template = owl_excel_templatesService.get(templateId);
75
- if(!template || template.template && template.template.length>0){
76
- $.log("没有配置模版")
75
+ if(!template || !template.template){
76
+ $.log("没有配置模版,templateId=" + templateId);
77
77
  return null;
78
78
  }
79
79
  var taskInfo = owl_task_infoService.get(taskInfoId);
80
80
  taskInfo.state = "running";
81
81
  taskInfo.beginDate = new Date().getTime();
82
- taskInfo.taskId = taskId;
83
82
  owl_task_infoService.update(taskInfo);
84
83
  var doc = @projectCodeService.get(id);
85
84
  var exportDoc = getExportDoc(doc);
@@ -89,9 +88,17 @@ function getExportDoc(obj){
89
88
  if(template.toField){
90
89
  var doc = @projectCodeService.get(id);
91
90
  var url = FileService.getFullPath(fileId);
91
+ var docName = null;
92
+ if(typeof pname === 'undefined'){
93
+ docName = template.name + "_" +fileId;
94
+ }
95
+ else{
96
+ docName = pname;
97
+ }
92
98
  doc[template.toField] = {
93
- url:url,
94
- fileId:fileId
99
+ url: "" + url,
100
+ fileId: "" + fileId,
101
+ name:"" + docName
95
102
  }
96
103
  @projectCodeService.update(doc);
97
104
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "owl-cli",
3
- "version": "6.56.0",
3
+ "version": "6.58.0",
4
4
  "main": "index.js",
5
5
  "preferGlobal": true,
6
6
  "bin": {