|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import React, { FC, useEffect, useState } from "react";
|
|
|
|
|
import { Table, Typography } from "antd";
|
|
|
|
|
import { Button, Table, Typography } from "antd";
|
|
|
|
|
import { exceptStr } from "@/utils/common";
|
|
|
|
|
import styles from "@/pages/atdTable/components/index.less";
|
|
|
|
|
|
|
|
|
@ -22,9 +22,29 @@ const ReportTable: FC = (props) => {
|
|
|
|
|
if (!_.isEmpty(data)) {
|
|
|
|
|
const { columns, dataSource, countResult, showSum } = data;
|
|
|
|
|
setDataSource(dataSource);
|
|
|
|
|
setColumns(columns);
|
|
|
|
|
setShowSumrow(showSum);
|
|
|
|
|
setSumRow(countResult);
|
|
|
|
|
setColumns(_.map(columns, item => {
|
|
|
|
|
return {
|
|
|
|
|
...item,
|
|
|
|
|
children: _.map(item.children, child => {
|
|
|
|
|
return {
|
|
|
|
|
...child,
|
|
|
|
|
render: (text: string, record: any) => {
|
|
|
|
|
return <Button type="link" onClick={() => {
|
|
|
|
|
window.parent.postMessage(
|
|
|
|
|
{
|
|
|
|
|
type: "turn",
|
|
|
|
|
payload: { id: "PIVOTCHART", params: { record } }
|
|
|
|
|
},
|
|
|
|
|
"*"
|
|
|
|
|
);
|
|
|
|
|
}}>{text}</Button>;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return <Table
|
|
|
|
|