Merge branch 'master' into feature/2.9.42310.01-薪资项目拓扑图
# Conflicts: # public/css/iconfont/demo_index.html # public/css/iconfont/iconfont.css # public/css/iconfont/iconfont.js # public/css/iconfont/iconfont.json # public/css/iconfont/iconfont.ttf # public/css/iconfont/iconfont.woff # public/css/iconfont/iconfont.woff2 # src/pages/atdTable/components/index.less # src/pages/calcTable/calcExplainFooter.tsx # src/pages/calcTable/customTableTitle.tsxrelease/2.19.1.2503.01-业务线个税
commit
03d0e23191
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 个税申报表-详情表格
|
||||
* Description:
|
||||
* Date: 2023/12/27
|
||||
*/
|
||||
import React, { FC, useEffect, useState } from "react";
|
||||
import { Button, Space, Table } from "antd";
|
||||
import { exceptStr, paginationAction } from "@/utils/common";
|
||||
import styles from "@/pages/atdTable/components/index.less";
|
||||
import { PaginationData } from "rc-pagination";
|
||||
|
||||
const TaxDeclareTable: FC = (props) => {
|
||||
const [pageInfo, setPageInfo] = useState<Partial<PaginationData>>({});
|
||||
const [columns, setColumns] = useState<Array<any>>([]);
|
||||
const [dataSource, setDataSource] = useState<Array<any>>([]);
|
||||
const [i18n, setI18n] = useState<Partial<{}>>({});
|
||||
|
||||
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, pageInfo, i18n, declareStatus } = data;
|
||||
setDataSource(dataSource);
|
||||
setI18n(i18n);
|
||||
setPageInfo(pageInfo);
|
||||
setColumns(["NOT_DECLARE", "DECLARE_FAIL"].includes(declareStatus) ? [
|
||||
...columns,
|
||||
{
|
||||
title: i18n["操作"],
|
||||
dataIndex: "operate",
|
||||
fixed: "right",
|
||||
width: 120,
|
||||
render: (_: any, record: any) => (
|
||||
<Space>
|
||||
<Button type="link" onClick={() => handleEdit(record)}>{i18n["编辑"]}</Button>
|
||||
{/*<Button type="link" onClick={() => handleDelete(record)}>{i18n["删除"]}</Button>*/}
|
||||
</Space>
|
||||
)
|
||||
}
|
||||
] : columns);
|
||||
}
|
||||
};
|
||||
const handleEdit = (record: any) => {
|
||||
window.parent.postMessage({ type: "turn", payload: { id: "EDIT", params: { ...record } } }, "*");
|
||||
};
|
||||
const handleDelete = (record: any) => {
|
||||
window.parent.postMessage({ type: "turn", payload: { id: "DELETE", params: { ...record } } }, "*");
|
||||
};
|
||||
const onChange = (current: number, pageSize: number) => {
|
||||
setPageInfo((prevState) => {
|
||||
const { pageSize: size } = prevState;
|
||||
window.parent.postMessage(
|
||||
{
|
||||
type: "turn",
|
||||
payload: { id: "PAGEINFO", params: { ...pageInfo, current: size === pageSize ? current : 1, pageSize } }
|
||||
},
|
||||
"*"
|
||||
);
|
||||
return { ...pageInfo, current: size === pageSize ? current : 1, pageSize };
|
||||
});
|
||||
};
|
||||
return <Table
|
||||
rowKey="id" className={styles.tableWrapper} size="small"
|
||||
columns={columns} dataSource={dataSource} bordered
|
||||
scroll={{ x: 1200, y: `calc(100vh - 100px)` }}
|
||||
pagination={{
|
||||
...paginationAction(pageInfo, i18n, onChange),
|
||||
size: "default"
|
||||
}}
|
||||
/>;
|
||||
};
|
||||
|
||||
export default TaxDeclareTable;
|
Loading…
Reference in New Issue