엑셀다운 수정

main
이범준 11 months ago
parent da10b3a8e4
commit 5ff4076acd

@ -9,7 +9,7 @@ public class CmmnQuery extends QueryRequest {
private String mainOption; private String mainOption;
private String subOption; private String subOption;
private String colDefs; private String cellDefs;
private String[] excelTitle; private String[] excelTitle;
private int[] excelTitleWidth; private int[] excelTitleWidth;
@ -51,12 +51,12 @@ public class CmmnQuery extends QueryRequest {
return self(); return self();
} }
public String getColDefs() { public String getCellDefs() {
return ifEmpty(colDefs, () -> null); return ifEmpty(cellDefs, () -> null);
} }
public <T extends CmmnQuery> T setColDefs(String colDefs) { public <T extends CmmnQuery> T setCellDefs(String cellDefs) {
this.colDefs = colDefs; this.cellDefs = cellDefs;
return self(); return self();
} }

@ -982,9 +982,9 @@ $(document).ready(function(){
$P.photoInspectionControl.query.excelTitle = headerInfo.excelTitle; $P.photoInspectionControl.query.excelTitle = headerInfo.excelTitle;
$P.photoInspectionControl.query.excelTitleWidth = headerInfo.excelTitleWidth; $P.photoInspectionControl.query.excelTitleWidth = headerInfo.excelTitleWidth;
var colDefs = getColDefs($("#photoInspection_Table_0--${pageName} thead th").not(".dummy-th").not(":eq(0)"), var cellDefs = getCellDefs($("#photoInspection_Table_0--${pageName} thead th").not(".dummy-th").not(":eq(0)"),
$($("#photoInspectionRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)")); $($("#photoInspectionRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
$P.photoInspectionControl.query.colDefs = colDefs; $P.photoInspectionControl.query.cellDefs = cellDefs;
$P.photoInspectionControl.download(); $P.photoInspectionControl.download();
@ -1000,9 +1000,9 @@ $(document).ready(function(){
$P.sameVehicleControl.main.query.excelTitle = headerInfo.excelTitle; $P.sameVehicleControl.main.query.excelTitle = headerInfo.excelTitle;
$P.sameVehicleControl.main.query.excelTitleWidth = headerInfo.excelTitleWidth; $P.sameVehicleControl.main.query.excelTitleWidth = headerInfo.excelTitleWidth;
var colDefs = getColDefs($("#sameVehicleInspectionMain_Table_0--${pageName} thead th").not(".dummy-th"), var cellDefs = getCellDefs($("#sameVehicleInspectionMain_Table_0--${pageName} thead th").not(".dummy-th"),
$($("#sameVehicleInspectionMainRow--${pageName}")[0].content).find("td").not(".dummy-td")); $($("#sameVehicleInspectionMainRow--${pageName}")[0].content).find("td").not(".dummy-td"));
$P.sameVehicleControl.main.query.colDefs = colDefs; $P.sameVehicleControl.main.query.cellDefs = cellDefs;
$P.sameVehicleControl.main.download(); $P.sameVehicleControl.main.download();
} else { } else {
@ -1010,9 +1010,9 @@ $(document).ready(function(){
$P.sameVehicleControl.sub.query.excelTitle = headerInfo.excelTitle; $P.sameVehicleControl.sub.query.excelTitle = headerInfo.excelTitle;
$P.sameVehicleControl.sub.query.excelTitleWidth = headerInfo.excelTitleWidth; $P.sameVehicleControl.sub.query.excelTitleWidth = headerInfo.excelTitleWidth;
var colDefs = getColDefs($("#sameVehicleInspectionSub_Table_0--${pageName} thead th").not(".dummy-th").not(":hidden"), var cellDefs = getCellDefs($("#sameVehicleInspectionSub_Table_0--${pageName} thead th").not(".dummy-th").not(":hidden"),
$($("#sameVehicleInspectionSubRow--${pageName}")[0].content).find("td").not(".dummy-td").not(".privacy-mask")); $($("#sameVehicleInspectionSubRow--${pageName}")[0].content).find("td").not(".dummy-td").not(".privacy-mask"));
$P.sameVehicleControl.sub.query.colDefs = colDefs; $P.sameVehicleControl.sub.query.cellDefs = cellDefs;
$P.sameVehicleControl.sub.download(); $P.sameVehicleControl.sub.download();
} }

@ -311,9 +311,9 @@ $(document).ready(function(){
$P.crdnControl.query.excelTitle = headerInfo.excelTitle; $P.crdnControl.query.excelTitle = headerInfo.excelTitle;
$P.crdnControl.query.excelTitleWidth = headerInfo.excelTitleWidth; $P.crdnControl.query.excelTitleWidth = headerInfo.excelTitleWidth;
var colDefs = getColDefs($("#crdnTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)"), var cellDefs = getCellDefs($("#crdnTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)"),
$($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)")); $($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
$P.crdnControl.query.colDefs = colDefs; $P.crdnControl.query.cellDefs = cellDefs;
$P.crdnControl.download(); $P.crdnControl.download();
}); });

@ -480,9 +480,9 @@ $(document).ready(function(){
$P.crdnControl.query.excelTitle = headerInfo.excelTitle; $P.crdnControl.query.excelTitle = headerInfo.excelTitle;
$P.crdnControl.query.excelTitleWidth = headerInfo.excelTitleWidth; $P.crdnControl.query.excelTitleWidth = headerInfo.excelTitleWidth;
var colDefs = getColDefs($("#crdnThead--${pageName} th").not(".dummy-th").not(":eq(0)"), var cellDefs = getCellDefs($("#crdnThead--${pageName} th").not(".dummy-th").not(":eq(0)"),
$($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)")); $($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
$P.crdnControl.query.colDefs = colDefs; $P.crdnControl.query.cellDefs = cellDefs;
$P.crdnControl.download(); $P.crdnControl.download();
}); });

@ -449,9 +449,9 @@ $(document).ready(function(){
$P.exmptnVhclControl.query.excelTitle = headerInfo.excelTitle; $P.exmptnVhclControl.query.excelTitle = headerInfo.excelTitle;
$P.exmptnVhclControl.query.excelTitleWidth = headerInfo.excelTitleWidth; $P.exmptnVhclControl.query.excelTitleWidth = headerInfo.excelTitleWidth;
var colDefs = getColDefs($("#exmptnVhclTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)"), var cellDefs = getCellDefs($("#exmptnVhclTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)"),
$($("#exmptnVhclRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)")); $($("#exmptnVhclRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
$P.exmptnVhclControl.query.colDefs = colDefs; $P.exmptnVhclControl.query.cellDefs = cellDefs;
$P.exmptnVhclControl.download(); $P.exmptnVhclControl.download();
}); });

@ -642,9 +642,9 @@ $(document).ready(function(){
$P.crdnControl.query.excelTitle = headerInfo.excelTitle; $P.crdnControl.query.excelTitle = headerInfo.excelTitle;
$P.crdnControl.query.excelTitleWidth = headerInfo.excelTitleWidth; $P.crdnControl.query.excelTitleWidth = headerInfo.excelTitleWidth;
var colDefs = getColDefs($("#crdnThead--${pageName} th").not(".dummy-th").not(":eq(0)"), var cellDefs = getCellDefs($("#crdnThead--${pageName} th").not(".dummy-th").not(":eq(0)"),
$($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)")); $($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
$P.crdnControl.query.colDefs = colDefs; $P.crdnControl.query.cellDefs = cellDefs;
$P.crdnControl.download(); $P.crdnControl.download();
}); });

@ -672,9 +672,9 @@ $(document).ready(function(){
$P.crdnControl.query.excelTitle = headerInfo.excelTitle; $P.crdnControl.query.excelTitle = headerInfo.excelTitle;
$P.crdnControl.query.excelTitleWidth = headerInfo.excelTitleWidth; $P.crdnControl.query.excelTitleWidth = headerInfo.excelTitleWidth;
var colDefs = getColDefs($("#crdnThead--${pageName} th").not(".dummy-th").not(":eq(0)").not(":eq(0)"), var cellDefs = getCellDefs($("#crdnThead--${pageName} th").not(".dummy-th").not(":eq(0)").not(":eq(0)"),
$($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)").not(":eq(0)")); $($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)").not(":eq(0)"));
$P.crdnControl.query.colDefs = colDefs; $P.crdnControl.query.cellDefs = cellDefs;
$P.crdnControl.download(); $P.crdnControl.download();
}); });

@ -536,9 +536,9 @@ $(document).ready(function(){
$P.crdnControl.query.excelTitle = headerInfo.excelTitle; $P.crdnControl.query.excelTitle = headerInfo.excelTitle;
$P.crdnControl.query.excelTitleWidth = headerInfo.excelTitleWidth; $P.crdnControl.query.excelTitleWidth = headerInfo.excelTitleWidth;
var colDefs = getColDefs($("#crdnThead--${pageName} th").not(".dummy-th").not(":eq(0)"), var cellDefs = getCellDefs($("#crdnThead--${pageName} th").not(".dummy-th").not(":eq(0)"),
$($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)")); $($("#crdnRow--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
$P.crdnControl.query.colDefs = colDefs; $P.crdnControl.query.cellDefs = cellDefs;
$P.crdnControl.download(); $P.crdnControl.download();
}); });

@ -574,9 +574,9 @@
${pageName}Control.query.excelTitleWidth = headerInfo.excelTitleWidth; ${pageName}Control.query.excelTitleWidth = headerInfo.excelTitleWidth;
// DataTables(그리드) 데이터 // DataTables(그리드) 데이터
let colDefs = getColDefs($("#theadTr--${pageName} th").not(".dummy-th").not(":eq(0)") let cellDefs = getCellDefs($("#theadTr--${pageName} th").not(".dummy-th").not(":eq(0)")
, $($("#${infoPrefix}Row--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)")); , $($("#${infoPrefix}Row--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
${pageName}Control.query.colDefs = colDefs; ${pageName}Control.query.cellDefs = cellDefs;
${pageName}Control.download(); ${pageName}Control.download();
} }

@ -610,9 +610,9 @@
${pageName}Control.query.excelTitleWidth = headerInfo.excelTitleWidth; ${pageName}Control.query.excelTitleWidth = headerInfo.excelTitleWidth;
// DataTables(그리드) 데이터 // DataTables(그리드) 데이터
let colDefs = getColDefs($("#theadTr--${pageName} th").not(".dummy-th").not(":eq(0)") let cellDefs = getCellDefs($("#theadTr--${pageName} th").not(".dummy-th").not(":eq(0)")
, $($("#${infoPrefix}Row--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)")); , $($("#${infoPrefix}Row--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
${pageName}Control.query.colDefs = colDefs; ${pageName}Control.query.cellDefs = cellDefs;
${pageName}Control.download(); ${pageName}Control.download();
} }

@ -522,9 +522,9 @@
${pageName}Control.query.excelTitleWidth = headerInfo.excelTitleWidth; ${pageName}Control.query.excelTitleWidth = headerInfo.excelTitleWidth;
// DataTables(그리드) 데이터 // DataTables(그리드) 데이터
let colDefs = getColDefs($("#theadTr--${pageName} th").not(".dummy-th").not(":eq(0)") let cellDefs = getCellDefs($("#theadTr--${pageName} th").not(".dummy-th").not(":eq(0)")
, $($("#${infoPrefix}Row--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)")); , $($("#${infoPrefix}Row--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)"));
${pageName}Control.query.colDefs = colDefs; ${pageName}Control.query.cellDefs = cellDefs;
${pageName}Control.download(); ${pageName}Control.download();
} }

@ -341,7 +341,7 @@ integrationSearch.setTotalData = (updown, list) => {
// 엑셀 // 엑셀
integrationSearch.fnExcel = (updown) => { integrationSearch.fnExcel = (updown) => {
var headerInfo; var headerInfo;
var colDefs; var cellDefs;
if(updown == "up"){ if(updown == "up"){
if(integrationSearchControl.updataset.empty){ if(integrationSearchControl.updataset.empty){
@ -351,7 +351,7 @@ integrationSearch.fnExcel = (updown) => {
headerInfo = $("#upTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)").not(":hidden").getHeaderInfo(); headerInfo = $("#upTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)").not(":hidden").getHeaderInfo();
colDefs = getColDefs($("#upTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)").not(":hidden"), cellDefs = getCellDefs($("#upTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)").not(":hidden"),
$($("#row--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)").not(".privacy-mask")); $($("#row--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)").not(".privacy-mask"));
integrationSearchControl.query.gridType = "up"; integrationSearchControl.query.gridType = "up";
@ -363,7 +363,7 @@ integrationSearch.fnExcel = (updown) => {
headerInfo = $("#downTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)").not(":hidden").getHeaderInfo(); headerInfo = $("#downTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)").not(":hidden").getHeaderInfo();
colDefs = getColDefs($("#downTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)").not(":hidden"), cellDefs = getCellDefs($("#downTheadTr--${pageName} th").not(".dummy-th").not(":eq(0)").not(":hidden"),
$($("#row--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)").not(".privacy-mask")); $($("#row--${pageName}")[0].content).find("td").not(".dummy-td").not(":eq(0)").not(".privacy-mask"));
integrationSearchControl.query.gridType = "down"; integrationSearchControl.query.gridType = "down";
@ -372,7 +372,7 @@ integrationSearch.fnExcel = (updown) => {
integrationSearchControl.query.excelTitle = headerInfo.excelTitle; integrationSearchControl.query.excelTitle = headerInfo.excelTitle;
integrationSearchControl.query.excelTitleWidth = headerInfo.excelTitleWidth; integrationSearchControl.query.excelTitleWidth = headerInfo.excelTitleWidth;
integrationSearchControl.query.colDefs = colDefs; integrationSearchControl.query.cellDefs = cellDefs;
integrationSearchControl.download(); integrationSearchControl.download();

@ -149,9 +149,9 @@ $(document).ready(function(){
query.excelTitle = headerInfo.excelTitle; query.excelTitle = headerInfo.excelTitle;
query.excelTitleWidth = headerInfo.excelTitleWidth; query.excelTitleWidth = headerInfo.excelTitleWidth;
var colDefs = getColDefs($("#theadTr--${pageName} th").not(".dummy-th"), var cellDefs = getCellDefs($("#theadTr--${pageName} th").not(".dummy-th"),
$($("#found--${pageName}")[0].content).find("td").not(".dummy-td")); $($("#found--${pageName}")[0].content).find("td").not(".dummy-td"));
query.colDefs = colDefs; query.cellDefs = cellDefs;
query.download = "xls"; query.download = "xls";
query.crdnIDs = $P.crdnIds.join(","); query.crdnIDs = $P.crdnIds.join(",");

@ -1,6 +1,6 @@
//엑셀 파일 생성 정보 //엑셀 파일 생성 정보
function getColDefs($th, $td){ function getCellDefs($th, $td){
var colDefs = []; var cellDefs = [];
for(var i=0; i < $th.length; i++){ for(var i=0; i < $th.length; i++){
@ -14,18 +14,18 @@ function getColDefs($th, $td){
field = field.replace("{", ""); field = field.replace("{", "");
field = field.replace("}", ""); field = field.replace("}", "");
var colDef = { var cellDef = {
label : label, label : label,
width : width, width : width,
field : field field : field
}; };
colDefs.push(colDef); cellDefs.push(cellDef);
} }
} }
return JSON.stringify(colDefs); return JSON.stringify(cellDefs);
} }
/************************************************************************** /**************************************************************************

Loading…
Cancel
Save