owl-cli 6.55.0 → 6.57.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.
|
@@ -18,7 +18,7 @@ function main(){
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
var params = JSON.parse($body);
|
|
21
|
-
var
|
|
21
|
+
var id = params.id;
|
|
22
22
|
var templateId = params.templateId;
|
|
23
23
|
|
|
24
24
|
var now = new Date().getTime();
|
|
@@ -29,16 +29,16 @@ function main(){
|
|
|
29
29
|
pageId:'tasks/exportWithTemplateTask.jsx',
|
|
30
30
|
state:'notstart',
|
|
31
31
|
params:JSON.stringify({
|
|
32
|
-
ids:
|
|
32
|
+
ids:id,
|
|
33
33
|
templateId:templateId
|
|
34
34
|
})
|
|
35
35
|
};
|
|
36
|
-
|
|
36
|
+
owl_task_infoService.add(taskInfo);
|
|
37
|
+
var taskInfoId = taskInfo.id;
|
|
37
38
|
var taskId = 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 = {
|
|
@@ -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
|
|
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
99
|
url:url,
|
|
94
|
-
fileId:fileId
|
|
100
|
+
fileId:fileId,
|
|
101
|
+
name:docName
|
|
95
102
|
}
|
|
96
103
|
@projectCodeService.update(doc);
|
|
97
104
|
}
|