Parcourir la source

解决单元格框自定义失败的BUG

master
jacky6024 il y a 7 ans
Parent
révision
c4915ca5d1
  1. 40
      ureport2-console/src/main/resources/asserts/js/designer.bundle.js
  2. 4
      ureport2-console/src/main/resources/asserts/js/preview.bundle.js
  3. 8
      ureport2-js/src/Utils.js
  4. 8
      ureport2-js/src/table/CellRenderer.js
  5. 21
      ureport2-js/src/tools/BorderTool.js

40
ureport2-console/src/main/resources/asserts/js/designer.bundle.js

File diff suppressed because one or more lines are too long

4
ureport2-console/src/main/resources/asserts/js/preview.bundle.js

File diff suppressed because one or more lines are too long

8
ureport2-js/src/Utils.js

@ -514,19 +514,19 @@ function buildCellStyle(cellStyle,condition){
}
cellXml+='>';
let leftBorder=cellStyle.leftBorder;
if(leftBorder){
if(leftBorder && leftBorder.style!=="none"){
cellXml+=`<left-border width="${leftBorder.width}" style="${leftBorder.style}" color="${leftBorder.color}"/>`;
}
let rightBorder=cellStyle.rightBorder;
if(rightBorder){
if(rightBorder && rightBorder.style!=="none"){
cellXml+=`<right-border width="${rightBorder.width}" style="${rightBorder.style}" color="${rightBorder.color}"/>`;
}
let topBorder=cellStyle.topBorder;
if(topBorder){
if(topBorder && topBorder.style!=="none"){
cellXml+=`<top-border width="${topBorder.width}" style="${topBorder.style}" color="${topBorder.color}"/>`;
}
let bottomBorder=cellStyle.bottomBorder;
if(bottomBorder){
if(bottomBorder && bottomBorder.style!=="none"){
cellXml+=`<bottom-border width="${bottomBorder.width}" style="${bottomBorder.style}" color="${bottomBorder.color}"/>`;
}
cellXml+='</cell-style>';

8
ureport2-js/src/table/CellRenderer.js

@ -106,7 +106,7 @@ export function afterRenderer(td,row,col,prop,value,cellProperties){
const leftBorder=cellStyle.leftBorder;
if(leftBorder){
if(leftBorder===''){
if(leftBorder==='' || leftBorder.style==="none"){
$td.css({
'border-left':''
});
@ -131,7 +131,7 @@ export function afterRenderer(td,row,col,prop,value,cellProperties){
const rightBorder=cellStyle.rightBorder;
if(rightBorder){
if(rightBorder===''){
if(rightBorder==='' || rightBorder.style==="none"){
$td.css({
'border-right':''
});
@ -144,7 +144,7 @@ export function afterRenderer(td,row,col,prop,value,cellProperties){
}
const topBorder=cellStyle.topBorder;
if(topBorder){
if(topBorder===''){
if(topBorder==='' || topBorder.style==="none"){
$td.css({
'border-top':''
});
@ -168,7 +168,7 @@ export function afterRenderer(td,row,col,prop,value,cellProperties){
}
const bottomBorder=cellStyle.bottomBorder;
if(bottomBorder){
if(bottomBorder===''){
if(bottomBorder==='' || bottomBorder.style==="none"){
$td.css({
'border-bottom':''
});

21
ureport2-js/src/tools/BorderTool.js

@ -376,16 +376,26 @@ function updateCustomBorderStyle(context,startRow,startCol,endRow,endCol,leftBor
topBorder:cellStyle.topBorder,
bottomBorder:cellStyle.bottomBorder
};
cellStyle.leftBorder=left;
cellStyle.rightBorder=right;
cellStyle.topBorder=top;
cellStyle.bottomBorder=bottom;
cellStyle.leftBorder=cloneBorder(left);
cellStyle.rightBorder=cloneBorder(right);
cellStyle.topBorder=cloneBorder(top);
cellStyle.bottomBorder=cloneBorder(bottom);
}
}
hot.render();
return oldBorderStyle;
}
function cloneBorder(border){
if(border && border!==""){
const text=JSON.stringify(border);
const newJson=JSON.parse(text);
return newJson;
}else{
return border;
}
}
function buildBorderStyleContent(borderConfig,borderStyle){
const borderLineContainer=$(`<div style="margin: 20px 0 10px 0;"><span>线型:</span></div>`);
borderConfig.append(borderLineContainer);
@ -398,7 +408,8 @@ function buildBorderStyleContent(borderConfig,borderStyle){
`);
borderLineContainer.append(borderLineList);
borderLineList.change(function(){
borderStyle.style=$(this).val();
const value=$(this).val();
borderStyle.style=value;
});
const borderSizeContainer=$(`<div style="margin: 20px 0 10px 0;"><span>尺寸:</span></div>`);

Chargement…
Annuler
Enregistrer