泛微薪资核算iframe表格
parent
7c57f726a1
commit
59497e306b
@ -1,25 +1,26 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
name: '统一软件开发平台',
|
name: "统一软件开发平台",
|
||||||
layoutConfig: {
|
layoutConfig: {
|
||||||
'/home': 'blank',
|
"/home": "blank",
|
||||||
'/manage/design/.*': 'blank',
|
"/manage/design/.*": "blank",
|
||||||
'/manage/editor': 'blank',
|
"/manage/editor": "blank",
|
||||||
'/calculateDetail.*': 'blank',
|
"/calculateDetail.*": "blank",
|
||||||
'/atdTable.*': 'blank',
|
"/atdTable.*": "blank",
|
||||||
'/previewTable.*': 'blank',
|
"/previewTable.*": "blank",
|
||||||
'/standingbookTable.*': 'blank',
|
"/standingbookTable.*": "blank",
|
||||||
'/fileTable.*': 'blank',
|
"/fileTable.*": "blank",
|
||||||
'/rankMapTable.*': 'blank',
|
"/rankMapTable.*": "blank",
|
||||||
'/manage.*': 'manage',
|
"/reportTable.*": "blank",
|
||||||
'/portal.*': 'template',
|
"/manage.*": "manage",
|
||||||
'/passport/oauth-in': 'blank',
|
"/portal.*": "template",
|
||||||
'/passport/openid-in': 'blank',
|
"/passport/oauth-in": "blank",
|
||||||
'/passport/sign-in': 'user',
|
"/passport/openid-in": "blank",
|
||||||
'/passport/chose-portal': 'user',
|
"/passport/sign-in": "user",
|
||||||
'/passport/RegisterResult': 'user',
|
"/passport/chose-portal": "user",
|
||||||
'/403': 'blank',
|
"/passport/RegisterResult": "user",
|
||||||
'/404': 'blank',
|
"/403": "blank",
|
||||||
'/500': 'blank',
|
"/404": "blank",
|
||||||
'/': 'template',
|
"/500": "blank",
|
||||||
},
|
"/": "template"
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
@ -0,0 +1,59 @@
|
|||||||
|
import React, { FC, useEffect, useState } from "react";
|
||||||
|
import { Table, Typography } from "antd";
|
||||||
|
import { exceptStr } from "@/utils/common";
|
||||||
|
import styles from "@/pages/atdTable/components/index.less";
|
||||||
|
|
||||||
|
const { Text } = Typography;
|
||||||
|
const PreviewTable: FC = (props) => {
|
||||||
|
const [columns, setColumns] = useState<Array<any>>([]);
|
||||||
|
const [sumRow, setSumRow] = useState<Partial<{}>>({});
|
||||||
|
const [dataSource, setDataSource] = useState<Array<any>>([]);
|
||||||
|
const [showSumrow, setShowSumrow] = useState<boolean>(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
window.parent.postMessage({ type: "init" }, "*");
|
||||||
|
window.addEventListener("message", receiveMessageFromIndex, false);
|
||||||
|
return () => {
|
||||||
|
window.removeEventListener("message", receiveMessageFromIndex, false);
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
const receiveMessageFromIndex = (event: any) => {
|
||||||
|
const data: any = exceptStr(event.data);
|
||||||
|
if (!_.isEmpty(data)) {
|
||||||
|
const { columns, dataSource, countResult, showSum } = data;
|
||||||
|
setDataSource(dataSource);
|
||||||
|
setColumns(columns);
|
||||||
|
setShowSumrow(showSum);
|
||||||
|
setSumRow(countResult);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return <Table
|
||||||
|
rowKey="id"
|
||||||
|
className={styles.tableWrapper}
|
||||||
|
columns={columns}
|
||||||
|
dataSource={dataSource}
|
||||||
|
bordered
|
||||||
|
size="small"
|
||||||
|
summary={() => {
|
||||||
|
if (!showSumrow) return;
|
||||||
|
return (
|
||||||
|
<Table.Summary fixed>
|
||||||
|
<Table.Summary.Row>
|
||||||
|
{
|
||||||
|
_.map(columns, (item, index) => {
|
||||||
|
if (index === 0) {
|
||||||
|
return <Table.Summary.Cell index={0} key={index}><Text type="danger">总计</Text></Table.Summary.Cell>;
|
||||||
|
}
|
||||||
|
return <Table.Summary.Cell index={index} key={index}>
|
||||||
|
<Text type="danger">{!_.isNil(sumRow[item.dataIndex]) ? sumRow[item.dataIndex] : "-"}</Text>
|
||||||
|
</Table.Summary.Cell>;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</Table.Summary.Row>
|
||||||
|
</Table.Summary>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default PreviewTable;
|
Loading…
Reference in New Issue