Skip to content

Commit

Permalink
🐛 fix(ims-view-pc): export excel Null judgment use ?? replace ternary…
Browse files Browse the repository at this point in the history
… expression
  • Loading branch information
eternallycyf committed Mar 27, 2024
1 parent 8557acc commit 90ef8e8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
19 changes: 19 additions & 0 deletions packages/ims-view-pc/src/components/ExportButton/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,26 @@ export interface IExportButtonProps<DataType = AnyData, Params = RequestParams>
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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 90ef8e8

Please sign in to comment.