parent
f6557f1b63
commit
b94e93a6aa
|
|
@ -34,6 +34,42 @@ const ReportTable: FC = (props) => {
|
|||
return {
|
||||
...child, ellipsis: true,
|
||||
render: (text: string, record: any) => {
|
||||
if(child.dataIndex?.endsWith("increase")){
|
||||
let lowerLimitIndex = child.dataIndex.replace("increase", "lowerLimit");
|
||||
let upperLimitIndex = child.dataIndex.replace("increase", "upperLimit");
|
||||
let rowData = record[child.dataIndex].split(",").join("");
|
||||
if (isNaN(parseFloat(rowData))) {
|
||||
return record[child.dataIndex]
|
||||
}
|
||||
if (!isNaN(parseFloat(record[lowerLimitIndex])) && parseFloat(rowData) < parseFloat(record[lowerLimitIndex])) {
|
||||
return <Button type="link" block onClick={() => {
|
||||
window.parent.postMessage(
|
||||
{
|
||||
type: "turn",
|
||||
payload: { id: "PIVOTCHART", params: { record } }
|
||||
},
|
||||
"*"
|
||||
);
|
||||
}}>
|
||||
<Text type="success">{rowData}</Text>
|
||||
</Button>
|
||||
}
|
||||
if (!isNaN(parseFloat(record[upperLimitIndex])) && parseFloat(rowData) > parseFloat(record[upperLimitIndex])) {
|
||||
return <Button type="link" block onClick={() => {
|
||||
window.parent.postMessage(
|
||||
{
|
||||
type: "turn",
|
||||
payload: { id: "PIVOTCHART", params: { record } }
|
||||
},
|
||||
"*"
|
||||
);
|
||||
}}>
|
||||
<Text type="danger">{rowData}</Text>
|
||||
</Button>
|
||||
} else {
|
||||
return `${rowData}`
|
||||
}
|
||||
}
|
||||
return <Button type="link" block onClick={() => {
|
||||
window.parent.postMessage(
|
||||
{
|
||||
|
|
@ -75,7 +111,7 @@ const ReportTable: FC = (props) => {
|
|||
{
|
||||
_.map(totalColumns, (item, index) => {
|
||||
return <Table.Summary.Cell index={index} key={index} align="center">
|
||||
<Text type="danger">{!_.isNil(sumRow[item.dataIndex]) ? sumRow[item.dataIndex] : "-"}</Text>
|
||||
<Text>{!_.isNil(sumRow[item.dataIndex]) ? sumRow[item.dataIndex] : "-"}</Text>
|
||||
</Table.Summary.Cell>;
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue