泛微薪资核算iframe表格

custom-新弘农业/V2-薪资核算表格添加序号列
黎永顺 2 years ago
parent d1135f1be0
commit 81c648f5ab

@ -1,7 +1,7 @@
import React, { FC, useEffect, useState } from "react";
import { Button, Dropdown, Menu, Space, Spin, Table, Typography } from "antd";
import { DownOutlined } from "@ant-design/icons";
import { exceptStr, paginationFun } from "@/utils/common";
import { convertColumns, exceptStr, paginationFun } from "@/utils/common";
import styles from "@/pages/atdTable/components/index.less";
import { defaultPage, IPage } from "@/common/types";
import cs from "classnames";
@ -158,7 +158,7 @@ const payrollFilesTable: FC = (props) => {
}
};
}
return { ...item };
return _.omitBy({ ...item }, item => !item);
}));
setShowSumrow(showSum);
setSumRow(_.isEmpty(countResult) ? { [new Date().getTime()]: new Date().getTime() } : countResult);
@ -202,13 +202,14 @@ const payrollFilesTable: FC = (props) => {
);
}
};
return <Table
rowKey="id"
className={cs({
[styles.tableWrapper]: true,
[styles.tableTotalWrapper]: true
})}
columns={columns}
columns={!_.isEmpty(columns) && convertColumns(columns, _.findIndex(columns, ["dataIndex", "operate"]), Object.keys(columns).length)}
dataSource={dataSource}
size="small"
rowSelection={rowSelection}

@ -49,6 +49,15 @@ export const getPicSuffix = () => {
return config.get("picSuffix");
};
/**
* 数组中某项移至数组末尾
* @returns {array}
*/
export const convertColumns = (array, fromIndex, toIndex) => {
array.splice(toIndex, 1, array.splice(fromIndex, 1)[0]);
return array;
};
/**
* 判断是否为JSON字符串
* @returns {string}
@ -76,8 +85,8 @@ export const paginationFun = (tableListPageObj, sizeChange, onChange) => {
onChange({
pageNum: page,
size,
total,
total
});
},
}
};
};

Loading…
Cancel
Save