diff --git a/packages/ims-view-pc/src/components/ExportButton/interface.ts b/packages/ims-view-pc/src/components/ExportButton/interface.ts index 0e3eb98..f8c0202 100644 --- a/packages/ims-view-pc/src/components/ExportButton/interface.ts +++ b/packages/ims-view-pc/src/components/ExportButton/interface.ts @@ -46,7 +46,26 @@ export interface IExportButtonProps setImageStyle?: any; setWorkSheet?: any; setColumnStyle?: (...args: RenderCellParams[]) => React.CSSProperties; + /** + * + * @example + * ```tsx + * setRowStyle={(data, type, row, rowIndex) => { + * if(type == 'header') return { font: {bold:true},height:44 } + * if(type == 'main') return { height:30 } + * }} + * ``` + */ setRowStyle?: (...args: RenderCellParams[]) => React.CSSProperties; + /** + * + * @example + * ```tsx + * setCellStyle={(data, type, row, rowIndex) => { + * if(type == 'main') return {style:{alignment:{vertical:'middle',horizontal:'left',wrapText:true}}} + * }} + * ``` + */ setCellStyle?: (...args: RenderCellParams[]) => React.CSSProperties; setCellFormat?: (...args: RenderCellParams[]) => React.CSSProperties; diff --git a/packages/ims-view-pc/src/components/ExportButton/utils/table-helpers/map-table.js b/packages/ims-view-pc/src/components/ExportButton/utils/table-helpers/map-table.js index e12be04..6fdef6e 100755 --- a/packages/ims-view-pc/src/components/ExportButton/utils/table-helpers/map-table.js +++ b/packages/ims-view-pc/src/components/ExportButton/utils/table-helpers/map-table.js @@ -230,7 +230,7 @@ export class MapCreateMergeHeaderTable extends MapTable { if (isObject(excel)) { const text = excel.text; const format = excel.format; - cell.text = text ? text : ''; + cell.text = text ?? ''; if (!isEmptyObj(format)) { cell.format = format; } @@ -364,7 +364,7 @@ export class MapCreateNoMergeTable extends MapTable { if (isObject(excel)) { const text = excel.text; const format = excel.format; - cell.text = text ? text : ''; + cell.text = text ?? ''; if (!isEmptyObj(format)) { cell.format = format; } @@ -561,7 +561,7 @@ export class MapCreateCombinMainTable extends MapTable { if (isObject(excel)) { const text = excel.text; const format = excel.format; - cell.text = text ? text : ''; + cell.text = text ?? ''; if (!isEmptyObj(format)) { cell.format = format; }