泛微薪资核算iframe表格

custom-新弘农业/V2-薪资核算表格添加序号列
黎永顺 3 years ago
parent 0f21ec8e1c
commit 0223e54156

@ -1,7 +1,7 @@
import * as React from "react"; import * as React from "react";
import { useEffect } from "react"; import { useEffect } from "react";
import { ConfigProvider } from "antd"; import { ConfigProvider } from "antd";
import styles from "./index.less"; import styles from "../index.less";
export default ({ children, style = {} }: any) => { export default ({ children, style = {} }: any) => {
useEffect(() => { useEffect(() => {

@ -144,6 +144,7 @@ const AntdTable: FC<ITableProps> = (props) => {
result.dataIndex = item.column; result.dataIndex = item.column;
result.oldWidth = result.width; result.oldWidth = result.width;
result.width = "150px"; result.width = "150px";
result.ellipsis = true;
if (result.children) { if (result.children) {
result.width = (result.children.length * 150) + "px"; result.width = (result.children.length * 150) + "px";
result.children.map((child: any) => { result.children.map((child: any) => {
@ -195,6 +196,7 @@ const AntdTable: FC<ITableProps> = (props) => {
</span>; </span>;
child.dataIndex = child.column; child.dataIndex = child.column;
child.width = "150px"; child.width = "150px";
child.ellipsis = true;
child.render = (text: string) => { child.render = (text: string) => {
return <span className={styles.contentSpan}> return <span className={styles.contentSpan}>
<span>{text}</span> <span>{text}</span>
@ -238,7 +240,9 @@ const AntdTable: FC<ITableProps> = (props) => {
setDataSource([]); setDataSource([]);
const data: any = exceptStr(event.data); const data: any = exceptStr(event.data);
if (!_.isEmpty(data)) { if (!_.isEmpty(data)) {
getPCDataList({ ...data, ...pageParams }); const { selectedRowKeys, ...extraData } = data;
getPCDataList({ ...extraData, ...pageParams });
if (selectedRowKeys) setSelected(selectedRowKeys);
} }
}; };
@ -275,7 +279,8 @@ const AntdTable: FC<ITableProps> = (props) => {
dataSource={dataSource} dataSource={dataSource}
size="small" size="small"
bordered bordered
rowSelection={tab === "PC" && usertab === "SA" ? rowSelection : undefined} // rowSelection={tab === "PC" && usertab === "SA" ? rowSelection : undefined}
rowSelection={rowSelection}
pagination={{ pagination={{
...paginationFun(pageParams, sizeChange, onChange), ...paginationFun(pageParams, sizeChange, onChange),
size: "default" size: "default"
@ -298,7 +303,7 @@ const AntdTable: FC<ITableProps> = (props) => {
<Table.Summary fixed> <Table.Summary fixed>
<Table.Summary.Row> <Table.Summary.Row>
{ {
_.map(totalColumns, (item, index) => { _.map([{},...totalColumns], (item, index) => {
if (index === 0) { if (index === 0) {
return <Table.Summary.Cell index={0}><Text type="danger"></Text></Table.Summary.Cell>; return <Table.Summary.Cell index={0}><Text type="danger"></Text></Table.Summary.Cell>;
} }

Loading…
Cancel
Save