增加方案图、工程制度标准手册导出

This commit is contained in:
zhal 2024-06-13 16:26:44 +08:00
parent 4c6181dd8b
commit 67df3f954e
6 changed files with 34 additions and 11 deletions

View File

@ -2573,7 +2573,8 @@ public class CoEPALController {
String methodId = model.getMethodId(); String methodId = model.getMethodId();
if ("data.form".equals(methodId)) { if ("data.form".equals(methodId)) {
return PALRepositoryQueryAPIManager.getInstance().createOutputReportBd(wsId, me.getUID(), teamId, fileId); return PALRepositoryQueryAPIManager.getInstance().createOutputReportBd(wsId, me.getUID(), teamId, fileId);
} else if ("control.policy".equals(methodId)) { //方案手册走制度手册逻辑
} else if ("control.policy".equals(methodId) ||"process.scheme".equals(methodId)) {
return PALRepositoryQueryAPIManager.getInstance().createOutputReportZd(wsId, me.getUID(), teamId, fileId); return PALRepositoryQueryAPIManager.getInstance().createOutputReportZd(wsId, me.getUID(), teamId, fileId);
} }
return PALRepositoryQueryAPIManager.getInstance().createOutputReportPr(wsId, me.getUID(), teamId, fileId); return PALRepositoryQueryAPIManager.getInstance().createOutputReportPr(wsId, me.getUID(), teamId, fileId);

View File

@ -468,7 +468,7 @@ public class OutputWordUtil {
//设置固定列宽 //设置固定列宽
if(i==0){ if(i==0){
row.getCells().get(0).setWidth(35); row.getCells().get(0).setWidth(45);
}else if(i==1){ }else if(i==1){
row.getCells().get(1).setWidth(45); row.getCells().get(1).setWidth(45);
}else if(i==2){ }else if(i==2){
@ -803,6 +803,7 @@ public class OutputWordUtil {
table.autoFit(AutoFitBehaviorType.Auto_Fit_To_Window); table.autoFit(AutoFitBehaviorType.Auto_Fit_To_Window);
TableRow row = table.getRows().get(0); TableRow row = table.getRows().get(0);
row.isHeader(true); row.isHeader(true);
row.setHeight(20); row.setHeight(20);
@ -813,15 +814,23 @@ public class OutputWordUtil {
//row.getCells().get(0).setWidth(50); //row.getCells().get(0).setWidth(50);
//row.getCells().get(1).setWidth(150); //row.getCells().get(1).setWidth(150);
Paragraph p = row.getCells().get(i).addParagraph(); Paragraph p = row.getCells().get(i).addParagraph();
p.getFormat().setHorizontalAlignment(Center); //p.getFormat().setHorizontalAlignment(Center);
p.getFormat().setHorizontalAlignment(HorizontalAlignment.Center);
TextRange txtRange = p.appendText(header[i]); TextRange txtRange = p.appendText(header[i]);
txtRange.getCharacterFormat().setBold(true); txtRange.getCharacterFormat().setBold(true);
txtRange.getCharacterFormat().setFontName("宋体"); txtRange.getCharacterFormat().setFontName("宋体");
txtRange.getCharacterFormat().setFontSize(10.5f); txtRange.getCharacterFormat().setFontSize(10.5f);
} }
//将数据添加到其余行 //将数据添加到其余行
for (int r = 0; r < data.length; r++) { for (int r = 0; r < data.length; r++) {
TableRow dataRow = table.getRows().get(r + 1); TableRow dataRow = table.getRows().get(r + 1);
@ -838,6 +847,12 @@ public class OutputWordUtil {
TextRange text =dataRow.getCells().get(c).addParagraph().appendText(data[r][c]); TextRange text =dataRow.getCells().get(c).addParagraph().appendText(data[r][c]);
text.getCharacterFormat().setFontName("宋体"); text.getCharacterFormat().setFontName("宋体");
text.getCharacterFormat().setFontSize(10.5f); text.getCharacterFormat().setFontSize(10.5f);
//dataRow.getRowFormat().setHorizontalAlignment();
//tableRow.setGravity(Gravity.CENTER);
dataRow.getRowFormat().setHorizontalAlignment(RowAlignment.Center);
dataRow.getCells().get(c).getCellFormat();
} }
} }
@ -924,13 +939,18 @@ public class OutputWordUtil {
row.isHeader(true); row.isHeader(true);
row.setHeight(20); row.setHeight(20);
row.setHeightType(TableRowHeightType.Exactly); row.setHeightType(TableRowHeightType.Exactly);
for (int i = 0; i < header.length; i++) { for (int i = 0; i < header.length; i++) {
row.getCells().get(i).getCellFormat().setVerticalAlignment(VerticalAlignment.Middle); row.getCells().get(i).getCellFormat().setVerticalAlignment(VerticalAlignment.Middle);
//设置固定列宽 //设置固定列宽
//row.getCells().get(0).setWidth(150); //row.getCells().get(0).setWidth(150);
//row.getCells().get(1).setWidth(500); //row.getCells().get(1).setWidth(500);
Paragraph p = row.getCells().get(i).addParagraph(); Paragraph p = row.getCells().get(i).addParagraph();
p.getFormat().setHorizontalAlignment(Center); //p.getFormat().setHorizontalAlignment(Center);
p.getFormat().setHorizontalAlignment(HorizontalAlignment.Center);
TextRange txtRange = p.appendText(header[i]); TextRange txtRange = p.appendText(header[i]);
txtRange.getCharacterFormat().setBold(true); txtRange.getCharacterFormat().setBold(true);
txtRange.getCharacterFormat().setFontName("宋体"); txtRange.getCharacterFormat().setFontName("宋体");
@ -1374,7 +1394,7 @@ public class OutputWordUtil {
tr4.getCharacterFormat().setBold(true); tr4.getCharacterFormat().setBold(true);
tr4.getCharacterFormat().setFontName("宋体"); tr4.getCharacterFormat().setFontName("宋体");
//paragraph.applyStyle(BuiltinStyle.Heading_2); //应用标题1样式 paragraph.applyStyle(BuiltinStyle.Heading_2); //应用标题1样式
//doc.saveToFile(outFile.getPath(), FileFormat.Docx_2013); //doc.saveToFile(outFile.getPath(), FileFormat.Docx_2013);
@ -2299,8 +2319,7 @@ public class OutputWordUtil {
String plver = ""; String plver = "";
if (!"".equals(plvers)) { if (!"".equals(plvers)) {
if (plvers.length() > 1) { if (plvers.length() > 1) {
plver = plvers.substring(0, 1) + "." plver = plvers.substring(0,plvers.indexOf(".")) + "." + plvers.substring(plvers.length() - 1, plvers.length());
+ plvers.substring(plvers.length() - 1, plvers.length());
} else { } else {
plver = plvers.substring(0, 1) + ".0"; plver = plvers.substring(0, 1) + ".0";
} }

View File

@ -616,7 +616,7 @@ public class CoeDesignerWeb extends ActionWeb {
macroLibraries.put("importShapeStyle", "display:block"); macroLibraries.put("importShapeStyle", "display:block");
} }
boolean flag1 = "data.form".equals(plModel.getMethodId()) && SDK.getAppAPI().isActive("com.awspaas.user.apps.coe.pal.output.bd"); boolean flag1 = "data.form".equals(plModel.getMethodId()) && SDK.getAppAPI().isActive("com.awspaas.user.apps.coe.pal.output.bd");
boolean flag2 = "control.policy".equals(plModel.getMethodId()) && SDK.getAppAPI().isActive("com.awspaas.user.apps.coe.pal.output.zd"); boolean flag2 = ("control.policy".equals(plModel.getMethodId()) && SDK.getAppAPI().isActive("com.awspaas.user.apps.coe.pal.output.zd")||"engineering.standard".equals(plModel.getMethodId()) && SDK.getAppAPI().isActive("com.awspaas.user.apps.coe.pal.output.zd") );
boolean flag3 = "process".equals(plModel.getMethodCategory()) && !"process.evc".equals(plModel.getMethodId()) && SDK.getAppAPI().isActive("com.actionsoft.apps.coe.pal.output.pr"); boolean flag3 = "process".equals(plModel.getMethodCategory()) && !"process.evc".equals(plModel.getMethodId()) && SDK.getAppAPI().isActive("com.actionsoft.apps.coe.pal.output.pr");
if (outputPerm && (flag1 || flag2 || flag3) && SDK.getAppAPI().isActive("com.actionsoft.apps.addons.onlinedoc")) { if (outputPerm && (flag1 || flag2 || flag3) && SDK.getAppAPI().isActive("com.actionsoft.apps.addons.onlinedoc")) {
macroLibraries.put("processOutput", true); macroLibraries.put("processOutput", true);

View File

@ -496,6 +496,10 @@
$('#export_report').text('导出表单手册'); $('#export_report').text('导出表单手册');
} else if (methodId == 'control.policy') { } else if (methodId == 'control.policy') {
$('#export_report').text('导出制度手册'); $('#export_report').text('导出制度手册');
} else if (methodId == 'process.scheme') {
$('#export_report').text('导出方案手册');
}else if (methodId == 'engineering.standard') {
$('#export_report').text('导出工程技术标准手册');
} }
outputProcess(); outputProcess();
} }

View File

@ -79,7 +79,6 @@ $(function() {
//事件回调函数 //事件回调函数
}, },
add: function(e, data) { //附件被添加到上传列表时触发当返回false时可阻止上传 add: function(e, data) { //附件被添加到上传列表时触发当返回false时可阻止上传
debugger;
if (data.files.length == 0) { if (data.files.length == 0) {
return false; return false;
} }
@ -116,7 +115,7 @@ $(function() {
} }
//阻止非支持类型文件的上传 //阻止非支持类型文件的上传
var suffix = data.files[0].name.substring(data.files[0].name.lastIndexOf(".") + 1); var suffix = data.files[0].name.substring(data.files[0].name.lastIndexOf(".") + 1);
var fileTypes = "jpg,jpeg,gif,png,bmp,pdf,doc,docx,ppt,pptx,xls,xlsx,txt,mp3,mp4,avi,mpeg,flv,swf,wmv,xml,rtf,zip,rar"; var fileTypes = "jpg,jpeg,gif,png,bmp,pdf,doc,docx,ppt,pptx,xls,xlsx,txt,mp3,mp4,avi,mpeg,flv,swf,wmv,xml,rtf,zip,rar,dwg";
if (fileTypes.indexOf(suffix) < 0) { if (fileTypes.indexOf(suffix) < 0) {
upfileAccessoryTmpObj[data.files[0].name] = { upfileAccessoryTmpObj[data.files[0].name] = {
status: 'error', status: 'error',