|
@@ -11,7 +11,7 @@ let visualJumbo = {
|
|
|
me.tplWorkBook.destroy();
|
|
|
me.tplWorkBook = null;
|
|
|
}
|
|
|
- me.tplWorkBook = new GC.Spread.Sheets.Workbook($('#ele_visual_div_main3')[0], {sheetCount: 1});
|
|
|
+ me.tplWorkBook = new GC.Spread.Sheets.Workbook($('#ele_visual_div_main3')[0], { sheetCount: 1 });
|
|
|
me.tplWorkBook.options.tabStripVisible = false;
|
|
|
me.tplWorkBook.options.allowCopyPasteExcelStyle = false;
|
|
|
me.tplWorkBook.options.allowUserDragDrop = false;
|
|
@@ -23,20 +23,20 @@ let visualJumbo = {
|
|
|
},
|
|
|
setupTpl: function () {
|
|
|
let me = this;
|
|
|
- let rptTpl = (zTreeOprObj.currentNode)?zTreeOprObj.currentNode.rptTpl:null;
|
|
|
+ let rptTpl = (zTreeOprObj.currentNode) ? zTreeOprObj.currentNode.rptTpl : null;
|
|
|
if (rptTpl && me.tplWorkBook) {
|
|
|
- let sheet = me.tplWorkBook.getActiveSheet();
|
|
|
+ let sheet = me.tplWorkBook.getActiveSheet();
|
|
|
let border = new GC.Spread.Sheets.LineBorder;
|
|
|
border.color = "Black";
|
|
|
border.style = GC.Spread.Sheets.LineStyle.thin;
|
|
|
let pageH, pageW;
|
|
|
let pIdx = JV.PAGES_SIZE_STR.indexOf(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_PAGE_SIZE]);
|
|
|
- pageW = Math.round(JV.PAGES_SIZE[pIdx][0] * 96 - (parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_LEFT]) + parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_RIGHT])) /2.54*96 );
|
|
|
- pageH = Math.round(JV.PAGES_SIZE[pIdx][1] * 96 - (parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_TOP]) + parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_BOTTOM])) /2.54*96 );
|
|
|
+ pageW = Math.round(JV.PAGES_SIZE[pIdx][0] * 96 - (parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_LEFT]) + parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_RIGHT])) / 2.54 * 96);
|
|
|
+ pageH = Math.round(JV.PAGES_SIZE[pIdx][1] * 96 - (parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_TOP]) + parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_BOTTOM])) / 2.54 * 96);
|
|
|
if (rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_ORIENTATION] === JV.ORIENTATION_LANDSCAPE ||
|
|
|
rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_ORIENTATION] === JV.ORIENTATION_LANDSCAPE_CHN) {
|
|
|
- pageW = Math.round(JV.PAGES_SIZE[pIdx][1] * 96 - (parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_LEFT]) + parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_RIGHT])) /2.54*96 );
|
|
|
- pageH = Math.round(JV.PAGES_SIZE[pIdx][0] * 96 - (parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_TOP]) + parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_BOTTOM])) /2.54*96 );
|
|
|
+ pageW = Math.round(JV.PAGES_SIZE[pIdx][1] * 96 - (parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_LEFT]) + parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_RIGHT])) / 2.54 * 96);
|
|
|
+ pageH = Math.round(JV.PAGES_SIZE[pIdx][0] * 96 - (parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_TOP]) + parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_BOTTOM])) / 2.54 * 96);
|
|
|
}
|
|
|
sheet.suspendPaint();
|
|
|
sheet.setRowCount(0);
|
|
@@ -64,8 +64,8 @@ let visualJumbo = {
|
|
|
visualCommonOprObj.addBandPos(rptTpl, pageW, pageH, xPos, yPos, bandMappingObj);
|
|
|
visualCommonOprObj.addTplTxtFldPos(rptTpl, dataInfoMapTreeOprObj.treeObj, xPos, yPos, bandMappingObj);
|
|
|
//2. 设置spreadjs
|
|
|
- xPos.sort(function(x1, x2){ return (x1 - x2); });
|
|
|
- yPos.sort(function(y1, y2){ return (y1 - y2); });
|
|
|
+ xPos.sort(function (x1, x2) { return (x1 - x2); });
|
|
|
+ yPos.sort(function (y1, y2) { return (y1 - y2); });
|
|
|
sheet.setRowCount(yPos.length - 1);
|
|
|
sheet.setColumnCount(xPos.length - 1);
|
|
|
for (let idx = 1; idx < xPos.length; idx++) {
|
|
@@ -176,7 +176,7 @@ let visualJumbo = {
|
|
|
$(`#vis_outter_border`)[0].className = "btn btn-sm btn-outline-secondary active";
|
|
|
$(`#vis_bottom_border`)[0].className = "btn btn-sm btn-outline-secondary";
|
|
|
$(`#vis_no_border`)[0].className = "btn btn-sm btn-outline-secondary";
|
|
|
- } else if (bottomBorder && bottomBorder.style === GC.Spread.Sheets.LineStyle.thin){
|
|
|
+ } else if (bottomBorder && bottomBorder.style === GC.Spread.Sheets.LineStyle.thin) {
|
|
|
$(`#vis_outter_border`)[0].className = "btn btn-sm btn-outline-secondary";
|
|
|
$(`#vis_bottom_border`)[0].className = "btn btn-sm btn-outline-secondary active";
|
|
|
$(`#vis_no_border`)[0].className = "btn btn-sm btn-outline-secondary";
|
|
@@ -208,12 +208,12 @@ let visualJumbo = {
|
|
|
me.private_disable_pre_suff();
|
|
|
}
|
|
|
} else {
|
|
|
- $("#visElementFonts")[0].disabled = "disabled" ;
|
|
|
- $("#elementBordersVis")[0].disabled = "disabled" ;
|
|
|
- $("#elementControlsVis")[0].disabled = "disabled" ;
|
|
|
- $("#visRdIsText")[0].disabled = "disabled" ;
|
|
|
- $("#visRdIsField")[0].disabled = "disabled" ;
|
|
|
- $("#eleIsAutoHeightVis")[0].disabled = "disabled" ;
|
|
|
+ $("#visElementFonts")[0].disabled = "disabled";
|
|
|
+ $("#elementBordersVis")[0].disabled = "disabled";
|
|
|
+ $("#elementControlsVis")[0].disabled = "disabled";
|
|
|
+ $("#visRdIsText")[0].disabled = "disabled";
|
|
|
+ $("#visRdIsField")[0].disabled = "disabled";
|
|
|
+ $("#eleIsAutoHeightVis")[0].disabled = "disabled";
|
|
|
$("#id_vis_setup_lbl")[0].innerHTML = '...';
|
|
|
me.private_disable_pre_suff();
|
|
|
}
|
|
@@ -222,11 +222,11 @@ let visualJumbo = {
|
|
|
let ele1 = $(`#elePrefix_Vis`)[0];
|
|
|
let ele2 = $(`#eleFormat_Vis`)[0];
|
|
|
let ele3 = $(`#eleDftValue_Vis`)[0];
|
|
|
- let ele4 =$(`#eleSuffix_Vis`)[0];
|
|
|
- ele1.disabled = "disabled" ;
|
|
|
- ele2.disabled = "disabled" ;
|
|
|
- ele3.disabled = "disabled" ;
|
|
|
- ele4.disabled = "disabled" ;
|
|
|
+ let ele4 = $(`#eleSuffix_Vis`)[0];
|
|
|
+ ele1.disabled = "disabled";
|
|
|
+ ele2.disabled = "disabled";
|
|
|
+ ele3.disabled = "disabled";
|
|
|
+ ele4.disabled = "disabled";
|
|
|
ele1.value = ``;
|
|
|
ele2.value = ``;
|
|
|
ele3.value = ``;
|
|
@@ -243,13 +243,13 @@ let visualJumbo = {
|
|
|
let ele1 = $(`#elePrefix_Vis`)[0];
|
|
|
let ele2 = $(`#eleFormat_Vis`)[0];
|
|
|
let ele3 = $(`#eleDftValue_Vis`)[0];
|
|
|
- let ele4 =$(`#eleSuffix_Vis`)[0];
|
|
|
+ let ele4 = $(`#eleSuffix_Vis`)[0];
|
|
|
let fps = me.bandMappingObj.fieldPreSufAttr[cell.row + "_" + cell.col + "_fieldPreSuf"];
|
|
|
if (fps) {
|
|
|
- ele1.value = (stringUtil.isEmptyString(fps[JV.PROP_PREFIX]))?``:fps[JV.PROP_PREFIX];
|
|
|
- ele2.value = (stringUtil.isEmptyString(fps[JV.PROP_FORMAT]))?``:fps[JV.PROP_FORMAT];
|
|
|
- ele3.value = (stringUtil.isEmptyString(fps[JV.PROP_DFT_VALUE]))?``:fps[JV.PROP_DFT_VALUE];
|
|
|
- ele4.value = (stringUtil.isEmptyString(fps[JV.PROP_SUFFIX]))?``:fps[JV.PROP_SUFFIX];
|
|
|
+ ele1.value = (stringUtil.isEmptyString(fps[JV.PROP_PREFIX])) ? `` : fps[JV.PROP_PREFIX];
|
|
|
+ ele2.value = (stringUtil.isEmptyString(fps[JV.PROP_FORMAT])) ? `` : fps[JV.PROP_FORMAT];
|
|
|
+ ele3.value = (stringUtil.isEmptyString(fps[JV.PROP_DFT_VALUE])) ? `` : fps[JV.PROP_DFT_VALUE];
|
|
|
+ ele4.value = (stringUtil.isEmptyString(fps[JV.PROP_SUFFIX])) ? `` : fps[JV.PROP_SUFFIX];
|
|
|
} else {
|
|
|
ele1.value = ``;
|
|
|
ele2.value = ``;
|
|
@@ -429,14 +429,14 @@ let visualJumbo = {
|
|
|
}
|
|
|
},
|
|
|
fitTheWidth: function (factor) {
|
|
|
- let me = this, rptTpl = (zTreeOprObj.currentNode)?zTreeOprObj.currentNode.rptTpl:null;
|
|
|
+ let me = this, rptTpl = (zTreeOprObj.currentNode) ? zTreeOprObj.currentNode.rptTpl : null;
|
|
|
let pIdx = JV.PAGES_SIZE_STR.indexOf(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_PAGE_SIZE]);
|
|
|
let bandW = 700;
|
|
|
if (pIdx >= 0) {
|
|
|
- bandW = Math.round(JV.PAGES_SIZE[pIdx][0] * 96 - (parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_LEFT]) + parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_RIGHT])) /2.54*96 );
|
|
|
+ bandW = Math.round(JV.PAGES_SIZE[pIdx][0] * 96 - (parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_LEFT]) + parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_RIGHT])) / 2.54 * 96);
|
|
|
if (rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_ORIENTATION] === JV.ORIENTATION_LANDSCAPE ||
|
|
|
rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_ORIENTATION] === JV.ORIENTATION_LANDSCAPE_CHN) {
|
|
|
- bandW = Math.round(JV.PAGES_SIZE[pIdx][1] * 96 - (parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_LEFT]) + parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_RIGHT])) /2.54*96 );
|
|
|
+ bandW = Math.round(JV.PAGES_SIZE[pIdx][1] * 96 - (parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_LEFT]) + parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_RIGHT])) / 2.54 * 96);
|
|
|
}
|
|
|
}
|
|
|
bandW *= factor;
|
|
@@ -480,8 +480,7 @@ let visualJumbo = {
|
|
|
let spans = sheet.getSpans();
|
|
|
if (selectedRanges.length > 0 && spans.length > 0) {
|
|
|
let selectedSpans = [];
|
|
|
- for(let i = 0; i < spans.length; i++)
|
|
|
- {
|
|
|
+ for (let i = 0; i < spans.length; i++) {
|
|
|
for (let j = 0; j < selectedRanges.length; j++) {
|
|
|
if (spans[i].row >= selectedRanges[j].row && spans[i].col >= selectedRanges[j].col &&
|
|
|
spans[i].row < selectedRanges[j].row + selectedRanges[j].rowCount && spans[i].col < selectedRanges[j].col + selectedRanges[j].colCount) {
|
|
@@ -552,9 +551,9 @@ let visualJumbo = {
|
|
|
fontAttr = {};
|
|
|
fontAttr[JV.FONT_PROPS[JV.FONT_PROP_IDX_NAME]] = $(`#visElementFontNames`)[0].value;
|
|
|
fontAttr[JV.FONT_PROPS[JV.FONT_PROP_IDX_HEIGHT]] = $(`#visEleFontSize`)[0].value;
|
|
|
- fontAttr[JV.FONT_PROPS[JV.FONT_PROP_IDX_BOLD]] = ($("#vis_font_bold")[0].className === "btn btn-sm btn-outline-secondary")?'F':'T'; //bold
|
|
|
- fontAttr[JV.FONT_PROPS[JV.FONT_PROP_IDX_ITALIC]] = ($("#vis_font_italic")[0].className === "btn btn-sm btn-outline-secondary")?'F':'T'; //italic
|
|
|
- fontAttr[JV.FONT_PROPS[JV.FONT_PROP_IDX_UNDERLINE]] = ($("#vis_font_underline")[0].className === "btn btn-sm btn-outline-secondary")?'F':'T'; //underline
|
|
|
+ fontAttr[JV.FONT_PROPS[JV.FONT_PROP_IDX_BOLD]] = ($("#vis_font_bold")[0].className === "btn btn-sm btn-outline-secondary") ? 'F' : 'T'; //bold
|
|
|
+ fontAttr[JV.FONT_PROPS[JV.FONT_PROP_IDX_ITALIC]] = ($("#vis_font_italic")[0].className === "btn btn-sm btn-outline-secondary") ? 'F' : 'T'; //italic
|
|
|
+ fontAttr[JV.FONT_PROPS[JV.FONT_PROP_IDX_UNDERLINE]] = ($("#vis_font_underline")[0].className === "btn btn-sm btn-outline-secondary") ? 'F' : 'T'; //underline
|
|
|
fontAttr[JV.FONT_PROPS[JV.FONT_PROP_IDX_STRIKEOUT]] = "F"; //strikeout
|
|
|
fontAttr[JV.FONT_PROPS[JV.FONT_PROP_IDX_COLOR]] = "BLACK";
|
|
|
fontAttr[JV.FONT_PROPS[JV.FONT_PROP_IDX_ANGLE]] = 0; //angle
|
|
@@ -739,16 +738,16 @@ let visualJumbo = {
|
|
|
for (let borderLine of borderObj[JV.PROP_BORDER_STYLE]) {
|
|
|
switch (borderLine[JV.PROP_POSITION]) {
|
|
|
case JV.PROP_LEFT:
|
|
|
- _setCB(parseInt(borderLine[JV.PROP_LINE_WEIGHT]), {left: true}, cellRange);
|
|
|
+ _setCB(parseInt(borderLine[JV.PROP_LINE_WEIGHT]), { left: true }, cellRange);
|
|
|
break;
|
|
|
case JV.PROP_RIGHT:
|
|
|
- _setCB(parseInt(borderLine[JV.PROP_LINE_WEIGHT]), {right: true}, cellRange);
|
|
|
+ _setCB(parseInt(borderLine[JV.PROP_LINE_WEIGHT]), { right: true }, cellRange);
|
|
|
break;
|
|
|
case JV.PROP_TOP:
|
|
|
- _setCB(parseInt(borderLine[JV.PROP_LINE_WEIGHT]), {top: true}, cellRange);
|
|
|
+ _setCB(parseInt(borderLine[JV.PROP_LINE_WEIGHT]), { top: true }, cellRange);
|
|
|
break;
|
|
|
case JV.PROP_BOTTOM:
|
|
|
- _setCB(parseInt(borderLine[JV.PROP_LINE_WEIGHT]), {bottom: true}, cellRange);
|
|
|
+ _setCB(parseInt(borderLine[JV.PROP_LINE_WEIGHT]), { bottom: true }, cellRange);
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
@@ -778,10 +777,10 @@ let visualJumbo = {
|
|
|
let bottomBorder = new GC.Spread.Sheets.LineBorder;
|
|
|
bottomBorder.color = "Black";
|
|
|
bottomBorder.style = GC.Spread.Sheets.LineStyle.empty;
|
|
|
- cellRange.setBorder(bottomBorder, {all: true});
|
|
|
- cellRange.setBorder(border, {bottom: true});
|
|
|
+ cellRange.setBorder(bottomBorder, { all: true });
|
|
|
+ cellRange.setBorder(border, { bottom: true });
|
|
|
} else {
|
|
|
- cellRange.setBorder(border, {all: true});
|
|
|
+ cellRange.setBorder(border, { all: true });
|
|
|
}
|
|
|
sheet.resumePaint();
|
|
|
}
|
|
@@ -802,10 +801,10 @@ let visualJumbo = {
|
|
|
}
|
|
|
cell.font(fontStr);
|
|
|
},
|
|
|
- _setupFont: function(fontAttr) {
|
|
|
+ _setupFont: function (fontAttr) {
|
|
|
if (typeof fontAttr === "string" && fontAttr !== "自定义") {
|
|
|
- $("#visElementFontNames")[0].disabled = "disabled" ;
|
|
|
- $("#visEleFontSize")[0].disabled = "disabled" ;
|
|
|
+ $("#visElementFontNames")[0].disabled = "disabled";
|
|
|
+ $("#visEleFontSize")[0].disabled = "disabled";
|
|
|
let idx = rpt_tpl_cfg_helper.reportCfg.fontArr.indexOf(fontAttr);
|
|
|
let font = rpt_tpl_cfg_helper.reportCfg.fonts[idx];
|
|
|
$("#visElementFonts")[0].selectedIndex = idx;
|
|
@@ -873,7 +872,7 @@ let visualJumbo = {
|
|
|
}
|
|
|
} else {
|
|
|
if (val.indexOf(`{`) === 0) {
|
|
|
- cell.value(val.replace('{', '').replace('}',''));
|
|
|
+ cell.value(val.replace('{', '').replace('}', ''));
|
|
|
}
|
|
|
}
|
|
|
sheet.resumePaint();
|
|
@@ -1003,26 +1002,57 @@ let visualJumbo = {
|
|
|
}
|
|
|
},
|
|
|
changeCellType: function (newType) {
|
|
|
+ // let me = visualJumbo, sheet = me.tplWorkBook.getActiveSheet();
|
|
|
+ // let selectedRanges = sheet.getSelections();
|
|
|
+ // if (selectedRanges.length > 0) {
|
|
|
+ // let cell = sheet.getCell(selectedRanges[0].row, selectedRanges[0].col);
|
|
|
+ // switch (newType) {
|
|
|
+ // case `field`:
|
|
|
+ // let rptTpl = (zTreeOprObj.currentNode) ? zTreeOprObj.currentNode.rptTpl : null;
|
|
|
+ // let cellType = new GC.Spread.Sheets.CellTypes.ComboBox();
|
|
|
+ // // let selectableFields = me.getSelectedFields(rptTpl);
|
|
|
+ // let selectableFields = visualCommonOprObj.getAllSelectedFields();
|
|
|
+ // cellType.items(selectableFields);
|
|
|
+ // cell.cellType(cellType);
|
|
|
+ // break;
|
|
|
+ // case `text`:
|
|
|
+ // default:
|
|
|
+ // cell.cellType(new GC.Spread.Sheets.CellTypes.Text());
|
|
|
+ // cell.value(``);
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // 单个操作实现多个操作(参考计量)
|
|
|
let me = visualJumbo, sheet = me.tplWorkBook.getActiveSheet();
|
|
|
let selectedRanges = sheet.getSelections();
|
|
|
if (selectedRanges.length > 0) {
|
|
|
- let cell = sheet.getCell(selectedRanges[0].row, selectedRanges[0].col);
|
|
|
- switch (newType) {
|
|
|
- case `field`:
|
|
|
- let rptTpl = (zTreeOprObj.currentNode)?zTreeOprObj.currentNode.rptTpl:null;
|
|
|
- let cellType = new GC.Spread.Sheets.CellTypes.ComboBox();
|
|
|
- // let selectableFields = me.getSelectedFields(rptTpl);
|
|
|
- let selectableFields = visualCommonOprObj.getAllSelectedFields();
|
|
|
- cellType.items(selectableFields);
|
|
|
- cell.cellType(cellType);
|
|
|
- break;
|
|
|
- case `text`:
|
|
|
- default:
|
|
|
- cell.cellType(new GC.Spread.Sheets.CellTypes.Text());
|
|
|
- cell.value(``);
|
|
|
- break;
|
|
|
+ for (let selIdx = 0; selIdx < selectedRanges.length; selIdx++) {
|
|
|
+ let startRow = selectedRanges[selIdx].row;
|
|
|
+ for (let rowIdx = 0; rowIdx < selectedRanges[selIdx].rowCount; rowIdx++) {
|
|
|
+ let startCol = selectedRanges[selIdx].col;
|
|
|
+ for (let colIdx = 0; colIdx < selectedRanges[selIdx].colCount; colIdx++) {
|
|
|
+ let cell = sheet.getCell(rowIdx + startRow, colIdx + startCol);
|
|
|
+ switch (newType) {
|
|
|
+ case `field`:
|
|
|
+ let rptTpl = (zTreeOprObj.currentNode) ? zTreeOprObj.currentNode.rptTpl : null;
|
|
|
+ let cellType = new GC.Spread.Sheets.CellTypes.ComboBox();
|
|
|
+ // let selectableFields = me.getSelectedFields(rptTpl);
|
|
|
+ let selectableFields = visualCommonOprObj.getAllSelectedFields();
|
|
|
+ cellType.items(selectableFields);
|
|
|
+ cell.cellType(cellType);
|
|
|
+ break;
|
|
|
+ case `text`:
|
|
|
+ default:
|
|
|
+ cell.cellType(new GC.Spread.Sheets.CellTypes.Text());
|
|
|
+ cell.value(``);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+ // me._setupCellCtrlEx(ctrlAttr);
|
|
|
}
|
|
|
+
|
|
|
},
|
|
|
changePreSuf: function (typeStr, dom) {
|
|
|
let me = visualJumbo, sheet = me.tplWorkBook.getActiveSheet();
|
|
@@ -1039,7 +1069,7 @@ let visualJumbo = {
|
|
|
},
|
|
|
applyBack: function () {
|
|
|
let me = visualJumbo, sheet = me.tplWorkBook.getActiveSheet();
|
|
|
- let rptTpl = (zTreeOprObj.currentNode)?zTreeOprObj.currentNode.rptTpl:null;
|
|
|
+ let rptTpl = (zTreeOprObj.currentNode) ? zTreeOprObj.currentNode.rptTpl : null;
|
|
|
let xPos = [0], yPos = [0];
|
|
|
for (let iRow = 0; iRow < sheet.getRowCount(); iRow++) {
|
|
|
xPos.push(sheet.getRowHeight(iRow) + xPos[xPos.length - 1]);
|
|
@@ -1071,13 +1101,13 @@ let visualJumbo = {
|
|
|
let columnBand = visualCommonOprObj.getBandEx(rptTpl[JV.NODE_FLOW_INFO][JV.NODE_FLOW_COLUMN][JV.PROP_BAND_NAME], rptTpl);
|
|
|
handledBands.push(columnBand[JV.PROP_NAME]);
|
|
|
me.private_setup_bandHeight(columnBand[JV.PROP_NAME], columnBand, sheet);
|
|
|
- startRow = me.collectSheetTxtFldByArea(sheet, me.bandMappingObj[columnBand[JV.PROP_NAME]][JV.PROP_COLOR] , textFldArr, colWidthArr, rowHeightArr);
|
|
|
+ startRow = me.collectSheetTxtFldByArea(sheet, me.bandMappingObj[columnBand[JV.PROP_NAME]][JV.PROP_COLOR], textFldArr, colWidthArr, rowHeightArr);
|
|
|
let columnNodes = [];
|
|
|
let columnDisFieldArr = null;
|
|
|
for (let txtFld of textFldArr) {
|
|
|
if (txtFld.isField) {
|
|
|
if (columnDisFieldArr === null) {
|
|
|
- columnDisFieldArr = {Name: "子项", BandName: columnBand[JV.PROP_NAME], items: [[],[]], isParent: true};
|
|
|
+ columnDisFieldArr = { Name: "子项", BandName: columnBand[JV.PROP_NAME], items: [[], []], isParent: true };
|
|
|
discreteNodesArr.push(columnDisFieldArr);
|
|
|
}
|
|
|
let fldNode = me.private_create_field_param_node(sheet, txtFld, startRow, colWidthArr, rowHeightArr, rptTpl);
|
|
@@ -1094,7 +1124,7 @@ let visualJumbo = {
|
|
|
textFldArr = [];
|
|
|
colWidthArr = [];
|
|
|
rowHeightArr = [];
|
|
|
- startRow = me.collectSheetTxtFldByArea(sheet, me.bandMappingObj[cotentBand[JV.PROP_NAME]][JV.PROP_COLOR] , textFldArr, colWidthArr, rowHeightArr);
|
|
|
+ startRow = me.collectSheetTxtFldByArea(sheet, me.bandMappingObj[cotentBand[JV.PROP_NAME]][JV.PROP_COLOR], textFldArr, colWidthArr, rowHeightArr);
|
|
|
let contentNodes = [];
|
|
|
for (let field of textFldArr) {
|
|
|
if (field.isField) {
|
|
@@ -1123,7 +1153,7 @@ let visualJumbo = {
|
|
|
if (me.bandMappingObj && me.bandMappingObj.items && me.bandMappingObj.items.length > 0) {
|
|
|
for (let sBandMap of me.bandMappingObj.items) {
|
|
|
if (handledBands.indexOf(sBandMap[JV.PROP_BAND_NAME]) < 0 && sBandMap[JV.PROP_COLOR] !== 'White') {
|
|
|
- let sArr = {Name: "子项", BandName: sBandMap[JV.PROP_BAND_NAME], items: [[],[]], isParent: true};
|
|
|
+ let sArr = { Name: "子项", BandName: sBandMap[JV.PROP_BAND_NAME], items: [[], []], isParent: true };
|
|
|
let sBand = visualCommonOprObj.getBandEx(sBandMap[JV.PROP_BAND_NAME], rptTpl);
|
|
|
if (sBand) {
|
|
|
me.private_setup_bandHeight(sBand[JV.PROP_NAME], sBand, sheet);
|
|
@@ -1143,7 +1173,7 @@ let visualJumbo = {
|
|
|
let me = this;
|
|
|
me.private_setup_bandHeight(band[JV.PROP_NAME], band, sheet);
|
|
|
let textFldArr = [], colWidthArr = [], rowHeightArr = [];
|
|
|
- let startRow = me.collectSheetTxtFldByArea(sheet, me.bandMappingObj[band[JV.PROP_NAME]][JV.PROP_COLOR] , textFldArr, colWidthArr, rowHeightArr);
|
|
|
+ let startRow = me.collectSheetTxtFldByArea(sheet, me.bandMappingObj[band[JV.PROP_NAME]][JV.PROP_COLOR], textFldArr, colWidthArr, rowHeightArr);
|
|
|
for (let txtFld of textFldArr) {
|
|
|
if (txtFld.isField) {
|
|
|
let fldNode = me.private_create_field_param_node(sheet, txtFld, startRow, colWidthArr, rowHeightArr, rptTpl);
|
|
@@ -1188,7 +1218,7 @@ let visualJumbo = {
|
|
|
//离散信息
|
|
|
if (discreteNodesArr) {
|
|
|
for (let dNode of discreteNodesArr) {
|
|
|
- let discreteNode = {"Name": "子项", "BandName": dNode[JV.PROP_BAND_NAME], "items": [{"Name": "离散字段集", "items": [], "isParent": true},{"Name": "离散文本集", "items": [], "isParent": true}], "isParent": true};
|
|
|
+ let discreteNode = { "Name": "子项", "BandName": dNode[JV.PROP_BAND_NAME], "items": [{ "Name": "离散字段集", "items": [], "isParent": true }, { "Name": "离散文本集", "items": [], "isParent": true }], "isParent": true };
|
|
|
if (dNode.items[0].length > 0) {
|
|
|
// dataInfoMapTreeOprObj.treeObj.addNodes(node.items[0], -1, segSummaryNodes[0], true);
|
|
|
discreteNode.items[0].items = dNode.items[0];
|
|
@@ -1209,10 +1239,11 @@ let visualJumbo = {
|
|
|
let isAutoHeight = false;
|
|
|
if (field.text && field.text.indexOf(`{`) === 0) {
|
|
|
isAutoHeight = true;
|
|
|
- field.text = field.text.replace('{', '').replace('}','');
|
|
|
+ field.text = field.text.replace('{', '').replace('}', '');
|
|
|
}
|
|
|
- let rst = {"Name": field.text, "Title": '', "FieldID": -1, "font": "Content", "control": "Column", "style" : "Default_Normal", "isAutoHeight" : false,
|
|
|
- "area" : {"Left" : 0, "Right" : 100, "Top" : 0, "Bottom" : 100, "H_CalculationType" : "percentage", "V_CalculationType" : "percentage"}
|
|
|
+ let rst = {
|
|
|
+ "Name": field.text, "Title": '', "FieldID": -1, "font": "Content", "control": "Column", "style": "Default_Normal", "isAutoHeight": false,
|
|
|
+ "area": { "Left": 0, "Right": 100, "Top": 0, "Bottom": 100, "H_CalculationType": "percentage", "V_CalculationType": "percentage" }
|
|
|
};
|
|
|
//1. 设置FieldID
|
|
|
let hasChkField = false;
|
|
@@ -1325,7 +1356,7 @@ let visualJumbo = {
|
|
|
//1. 锚定content
|
|
|
let cotentBand = visualCommonOprObj.getBandEx(rptTpl[JV.NODE_BILL_INFO][JV.NODE_BILL_CONTENT][JV.PROP_BAND_NAME], rptTpl);
|
|
|
let textFldArr = [], colWidthArr = [], rowHeightArr = [];
|
|
|
- let startRow = me.collectSheetTxtFldByArea(sheet, me.bandMappingObj[cotentBand[JV.PROP_NAME]][JV.PROP_COLOR] , textFldArr, colWidthArr, rowHeightArr);
|
|
|
+ let startRow = me.collectSheetTxtFldByArea(sheet, me.bandMappingObj[cotentBand[JV.PROP_NAME]][JV.PROP_COLOR], textFldArr, colWidthArr, rowHeightArr);
|
|
|
let contentNodes = [];
|
|
|
for (let field of textFldArr) {
|
|
|
if (field.isField) {
|
|
@@ -1337,7 +1368,7 @@ let visualJumbo = {
|
|
|
let discreteNodesArr = [];
|
|
|
if (me.bandMappingObj && me.bandMappingObj.items && me.bandMappingObj.items.length > 0) {
|
|
|
for (let sBandMap of me.bandMappingObj.items) {
|
|
|
- let sArr = {Name: "子项", BandName: sBandMap[JV.PROP_BAND_NAME], items: [[],[]], isParent: true};
|
|
|
+ let sArr = { Name: "子项", BandName: sBandMap[JV.PROP_BAND_NAME], items: [[], []], isParent: true };
|
|
|
let sBand = visualCommonOprObj.getBandEx(sBandMap[JV.PROP_BAND_NAME], rptTpl);
|
|
|
if (sBand) {
|
|
|
me.private_setup_bandHeight(sBand[JV.PROP_NAME], sBand, sheet);
|
|
@@ -1372,7 +1403,7 @@ let visualJumbo = {
|
|
|
//离散信息
|
|
|
if (discreteNodesArr) {
|
|
|
for (let dNode of discreteNodesArr) {
|
|
|
- let discreteNode = {"Name": "子项", "BandName": dNode[JV.PROP_BAND_NAME], "items": [{"Name": "离散字段集", "items": [], "isParent": true},{"Name": "离散文本集", "items": [], "isParent": true}], "isParent": true};
|
|
|
+ let discreteNode = { "Name": "子项", "BandName": dNode[JV.PROP_BAND_NAME], "items": [{ "Name": "离散字段集", "items": [], "isParent": true }, { "Name": "离散文本集", "items": [], "isParent": true }], "isParent": true };
|
|
|
if (dNode.items[0].length > 0) {
|
|
|
// dataInfoMapTreeOprObj.treeObj.addNodes(node.items[0], -1, segSummaryNodes[0], true);
|
|
|
discreteNode.items[0].items = dNode.items[0];
|
|
@@ -1494,7 +1525,7 @@ let visualJumbo = {
|
|
|
}
|
|
|
}
|
|
|
if (!isBlank) {
|
|
|
- textArr.push({"row": row, "col": col, "rowCount": rowCount, "colCount": colCount, "text": textValue, "isField": isField});
|
|
|
+ textArr.push({ "row": row, "col": col, "rowCount": rowCount, "colCount": colCount, "text": textValue, "isField": isField });
|
|
|
}
|
|
|
},
|
|
|
createTxtNode: function (text, sheet, startRow, colWidthArr, rowHeightArr) {
|