报告生成器代码提交

This commit is contained in:
zhaol 2025-02-24 15:40:35 +08:00
parent e031b05e85
commit da5c87484e
2 changed files with 77 additions and 76 deletions

View File

@ -46,26 +46,26 @@ var OutputReportWizard = {
};
// 在加载事件中直接配置
$("#create").on(
"click",
function() {
$("#reportName").val("");
OutputReportWizard.treeRelationNodeIds="";
OutputReportWizard.fileTreeNodeIds="";
OutputReportWizard.appProfileId ="";
$("input[name='reportNameIsItName']").val("");
$("input[name='reportNameNotItName']").val("%fileName%_%fileVersion%");
$("input[id='complete']").check();
$("input[id='complete']").check("option", "checked", true);
OutputReportWizard.isModify=false;
OutputReportWizard.taskId="";
$("#awsui-wizard1").wizard("destroy");
var wizard = $("#awsui-wizard1").wizard(options1);
$("#wizard-dig1").dialog();
var url = "./w?sid=" + sid
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_json_data&language="
+ $("#selectLanguage option:selected").val() + "&templateOperate=" + templateOperate;
$("#reportTree").attr("src", url);
});
"click",
function() {
$("#reportName").val("");
OutputReportWizard.treeRelationNodeIds="";
OutputReportWizard.fileTreeNodeIds="";
OutputReportWizard.appProfileId ="";
$("input[name='reportNameIsItName']").val("");
$("input[name='reportNameNotItName']").val("%fileName%_%fileVersion%");
$("input[id='complete']").check();
$("input[id='complete']").check("option", "checked", true);
OutputReportWizard.isModify=false;
OutputReportWizard.taskId="";
$("#awsui-wizard1").wizard("destroy");
var wizard = $("#awsui-wizard1").wizard(options1);
$("#wizard-dig1").dialog();
var url = "./w?sid=" + sid
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_json_data&language="
+ $("#selectLanguage option:selected").val() + "&templateOperate=" + templateOperate;
$("#reportTree").attr("src", url);
});
reportWizardOption = options1;
},
step1 : function(options) {
@ -87,7 +87,7 @@ var OutputReportWizard = {
return false;
}
if (OutputReportWizard.treeNodeObj == null
|| OutputReportWizard.treeNodeObj.pid == undefined) {
|| OutputReportWizard.treeNodeObj.pid == undefined) {
$.simpleAlert("请选择要生成报告的类型");
options.currentStep = 0;
return false;
@ -98,14 +98,14 @@ var OutputReportWizard = {
} else {
$("#reportNameIsItName").val("%fileName%_%fileVersion%");
}
}
if (raciDataType == 'platform' && (OutputReportWizard.treeNodeObj.generClass == 'com.actionsoft.apps.coe.pal.output.raci.report2.Report2Gener' || OutputReportWizard.treeNodeObj.generClass == 'com.actionsoft.apps.coe.pal.output.raci.report3.Report3Gener')) {
OutputReportWizard.selectPlatformRealOrg('department,user,role');// AWS平台组织架构(部门/人员/角色)
} else if (orDataType == 'platform' && (OutputReportWizard.treeNodeObj.generClass == 'com.actionsoft.apps.coe.pal.output.or.report1.Report1Gener' || OutputReportWizard.treeNodeObj.generClass == 'com.actionsoft.apps.coe.pal.output.or.report2.Report2Gener')) {
OutputReportWizard.selectPlatformRealOrg('role');// AWS平台组织架构(角色)
} else {
OutputReportWizard.selectVersion();// PAL模型
OutputReportWizard.selectVersion();// PAL模型
}
return true;
},
@ -114,15 +114,15 @@ var OutputReportWizard = {
// 筛选有效选项
var effectived = [];// 有效选择
var checked = reportPalFileTree.window.getCheckedNode();
// 判断当前是否关联的AWS平台的组织架构
var isAwsOrg = false;
if (checked.length > 0 && checked[0].isAwsOrg == true) {
isAwsOrg = true;
}
for (var i = 0; i < checked.length; i++) {
if(checked[i].effective) {
if(checked[i].plMethodId!='process.framework') {
effectived.push(checked[i]);
}
}
@ -172,7 +172,7 @@ var OutputReportWizard = {
return false;
}
}
var targetMethodType = OutputReportWizard.treeNodeObj.targetMethodType;
if (targetMethodType != "") {
OutputReportWizard.targetShapes = reportPalFileTree.window.getCheckedShape();
@ -247,13 +247,13 @@ var OutputReportWizard = {
return false;
}
$.simpleAlert("正在保存", "loading", 30000, {model: true});
var isExecute = "N";
if ($("#complete").is(":checked")) {
isExecute = "Y";
}
var url = "./jd?sid=" + encodeURIComponent(sid)
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_complete";
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_complete";
var targetFileId = "";
var tempArr = [];
@ -261,9 +261,9 @@ var OutputReportWizard = {
for (var index = 0; index < fileTreeArr.length; index++) {
if (fileTreeArr[index].isAwsOrg == true) {// 关联AWS组织的处理
var tempObj = {
id : fileTreeArr[index].uuid,
name : fileTreeArr[index].name,
type : fileTreeArr[index].type
id : fileTreeArr[index].uuid,
name : fileTreeArr[index].name,
type : fileTreeArr[index].type
}
tempArr.push(tempObj);
} else {
@ -307,6 +307,7 @@ var OutputReportWizard = {
data : params,
type : "post",
success : function(msg) {
debugger;
$.simpleAlert('close');
if (msg.result == "ok") {
OutputReportWizard.isModify = false;
@ -349,21 +350,21 @@ var OutputReportWizard = {
+ sid
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_pal_aws_org_page&methodType="
+ OutputReportWizard.treeNodeObj.targetMethodScope + "&wsid="
+ wsid + "&teamId="+teamId
+ wsid + "&teamId="+teamId
+ "&type=" + type
+ "&targetMethodType=" + OutputReportWizard.treeNodeObj.targetMethodType;
$("#reportPalFileTree").attr("src", url);
$("#reportPalFileTree").attr("src", url);
},
selectVersion : function() {
$('#reportPalFileTree').parent().height('380px');
$('#reportPalFileTree').height('380px');
var selectVal = "isUsed";
var url = "./w?sid="
+ sid
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_pal_file_json_data_root&methodType="
+ OutputReportWizard.treeNodeObj.targetMethodScope + "&wsid="
+ wsid + "&versionType=" + selectVal + "&teamId="+teamId
+ "&targetMethodType=" + OutputReportWizard.treeNodeObj.targetMethodType;
+ sid
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_pal_file_json_data_root&methodType="
+ OutputReportWizard.treeNodeObj.targetMethodScope + "&wsid="
+ wsid + "&versionType=" + selectVal + "&teamId="+teamId
+ "&targetMethodType=" + OutputReportWizard.treeNodeObj.targetMethodType;
$("#reportPalFileTree").attr("src", url);
},
selectProcessVersion : function() {
@ -407,7 +408,7 @@ var OutputReportWizard = {
}
isNotItReport += "'ignoreNumber':false,";
isNotItReport += "'reportNameNotItName':'"
+ $("input[name='reportNameNotItName']").val() + "'}";
+ $("input[name='reportNameNotItName']").val() + "'}";
return isNotItReport;
} else if ($("#tabReportIsIt").attr("data-current") == "1") {
var isItReport = "{'isItReport':true,";

View File

@ -73,12 +73,12 @@ var OutputReportWizard = {
return false;
}
if (OutputReportWizard.trimSpaces(reportName).length > 64) {
$.simpleAlert("[名称]长度不允许超过64个字");
options.currentStep = 0;
return false;
}
$.simpleAlert("[名称]长度不允许超过64个字");
options.currentStep = 0;
return false;
}
if (OutputReportWizard.treeNodeObj == null
|| OutputReportWizard.treeNodeObj.pid == undefined) {
|| OutputReportWizard.treeNodeObj.pid == undefined) {
$.simpleAlert("请选择要生成报告的类型");
options.currentStep = 0;
return false;
@ -89,7 +89,7 @@ var OutputReportWizard = {
} else {
$("#reportNameIsItName").val("%fileName%_%fileVersion%");
}
}
if (raciDataType == 'platform' && (OutputReportWizard.treeNodeObj.generClass == 'com.actionsoft.apps.coe.pal.output.raci.report2.Report2Gener' || OutputReportWizard.treeNodeObj.generClass == 'com.actionsoft.apps.coe.pal.output.raci.report3.Report3Gener')) {
OutputReportWizard.selectPlatformRealOrg('department,user,role');// AWS平台组织架构(部门/人员/角色)
@ -161,7 +161,7 @@ var OutputReportWizard = {
return false;
}
}
var targetMethodType = OutputReportWizard.treeNodeObj.targetMethodType;
if (targetMethodType != "") {
OutputReportWizard.targetShapes = reportPalFileTree.window.getCheckedShape();
@ -199,7 +199,7 @@ var OutputReportWizard = {
var relationMethodScope = OutputReportWizard.treeNodeObj.relationMethodScope;
if (relationMethodScope != "-") {
if (OutputReportWizard.treeRelationNodeObj == null
|| OutputReportWizard.treeRelationNodeObj.length == 0) {
|| OutputReportWizard.treeRelationNodeObj.length == 0) {
$.simpleAlert("请选择限定关联范围内的文件");
options.currentStep = 2;
return false;
@ -233,13 +233,13 @@ var OutputReportWizard = {
config = OutputReportWizard.getConfig();// 得到配置
$.simpleAlert("正在保存", "loading");
disableAll();
var isExecute = "N";
if ($("#complete").is(":checked")) {
isExecute = "Y";
}
var url = "./jd?sid=" + encodeURIComponent(sid)
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_complete";
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_complete";
var targetFileId = "";
var tempArr = [];
@ -247,13 +247,13 @@ var OutputReportWizard = {
for (var index = 0; index < fileTreeArr.length; index++) {
if (fileTreeArr[index].isAwsOrg == true) {// 关联AWS组织的处理
var tempObj = {
id : fileTreeArr[index].uuid,
name : fileTreeArr[index].name,
type : fileTreeArr[index].type
id : fileTreeArr[index].uuid,
name : fileTreeArr[index].name,
type : fileTreeArr[index].type
}
tempArr.push(tempObj);
} else {
targetFileId += "," + fileTreeArr[index].id;
targetFileId += "," + fileTreeArr[index].id;
}
}
if (tempArr.length > 0) {
@ -295,7 +295,7 @@ var OutputReportWizard = {
success : function(msg) {
if (msg.result == "ok") {
OutputReportWizard.isModify = false;
var tit;
var attributes = document.querySelector("#teamAppFrame").contentWindow.document.querySelector(".active").attributes;
for (var i = 0; i < attributes.length; i++) {
@ -311,15 +311,15 @@ var OutputReportWizard = {
$("#wizard-dig1 input[type='text']").val("");
OutputReportWizard.treeRelationNodeObj = null;
OutputReportWizard.fileTreeNode = null;
var obj = document.querySelector("#teamAppFrame").contentWindow.document.querySelector("#" + tit).contentDocument.getElementById(msg.data.taskId);
_iframeContent.OutputReport.refreshEvent = _iframeContent.window.setInterval(_iframeContent.OutputReport._refreshRowData(msg.data.taskId),1000);
$.simpleAlert('close');
$.simpleAlert("创建成功", "ok", 2000, {callback:function(){
$("#wizard-dig1").dialog("close");
}});
$("#wizard-dig1").dialog("close");
}});
} else {
$.simpleAlert('close');
$.simpleAlert("创建失败");
@ -345,21 +345,21 @@ var OutputReportWizard = {
+ sid
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_pal_aws_org_page&methodType="
+ OutputReportWizard.treeNodeObj.targetMethodScope + "&wsid="
+ coeWsid + "&teamId="+coeTeamId
+ coeWsid + "&teamId="+coeTeamId
+ "&type=" + type
+ "&targetMethodType=" + OutputReportWizard.treeNodeObj.targetMethodType;
$("#reportPalFileTree").attr("src", url);
$("#reportPalFileTree").attr("src", url);
},
selectVersion : function() {
$('#reportPalFileTree').parent().height('370px');
$('#reportPalFileTree').height('370px');
var selectVal = "isUsed";
var url = "./w?sid="
+ sid
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_pal_file_json_data_root&methodType="
+ OutputReportWizard.treeNodeObj.targetMethodScope + "&wsid="
+ coeWsid + "&versionType=" + selectVal + "&teamId="+coeTeamId
+ "&targetMethodType=" + OutputReportWizard.treeNodeObj.targetMethodType;
+ sid
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_pal_file_json_data_root&methodType="
+ OutputReportWizard.treeNodeObj.targetMethodScope + "&wsid="
+ coeWsid + "&versionType=" + selectVal + "&teamId="+coeTeamId
+ "&targetMethodType=" + OutputReportWizard.treeNodeObj.targetMethodType;
$("#reportPalFileTree").attr("src", url);
},
selectProcessVersion : function() {
@ -403,7 +403,7 @@ var OutputReportWizard = {
}
isNotItReport += "'ignoreNumber':false,";
isNotItReport += "'reportNameNotItName':'"
+ $("input[name='reportNameNotItName']").val() + "'}";
+ $("input[name='reportNameNotItName']").val() + "'}";
return isNotItReport;
} else if ($("#tabReportIsIt").attr("data-current") == "1") {
var isItReport = "{'isItReport':true,";
@ -430,7 +430,7 @@ var OutputReportWizard = {
OutputReportWizard.fileTreeNodeIds="";
OutputReportWizard.appProfileId ="";
$("input[name='reportNameIsItName']").val("");
$("input[name='reportNameNotItName']").val("%fileName%_%fileVersion%");
$("input[name='reportNameNotItName']").val("%fileName%_%fileVersion%");
$("input[id='complete']").check("option", "checked", true);
OutputReportWizard.isModify=false;
OutputReportWizard.taskId="";
@ -438,18 +438,18 @@ var OutputReportWizard = {
var wizard = $("#awsui-wizard1").wizard(reportWizardOption);
$("#wizard-dig1").dialog();
var url = "./w?sid=" + sid
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_json_data&language="
+ $("#selectLanguage option:selected").val() + "&templateOperate=" + templateOperate;
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_json_data&language="
+ $("#selectLanguage option:selected").val() + "&templateOperate=" + templateOperate;
$("#reportTree").attr("src", url);
},
modifyReport : function(id, wsid, teamId) {
coeWsid=wsid;
coeTeamId=teamId;
var url = "./jd?sid=" + encodeURIComponent(sid)
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_modify";
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_modify";
var params = {
id : id
};
id : id
};
$.ajax({
url : url,
async : false,
@ -473,8 +473,8 @@ var OutputReportWizard = {
var wizard = $("#awsui-wizard1").wizard(reportWizardOption);
$("#wizard-dig1").dialog();
var url = "./w?sid=" + sid
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_json_data&language="
+ $("#selectLanguage option:selected").val() + "&wsid=" + wsid + "&templateOperate=" + templateOperate;
+ "&cmd=com.actionsoft.apps.coe.pal_outputreport_json_data&language="
+ $("#selectLanguage option:selected").val() + "&wsid=" + wsid + "&templateOperate=" + templateOperate;
$("#reportTree").attr("src", url);
}
}