|
|
|
@ -11,7 +11,7 @@ const { Text } = Typography;
|
|
|
|
|
interface ITableProps {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const AntdTable: FC<ITableProps> = (props) => {
|
|
|
|
|
const AntdTableColumns2: FC<ITableProps> = (props) => {
|
|
|
|
|
const [selected, setSelected] = useState<Array<string>>([]); //列表选中的数据
|
|
|
|
|
const [tab, setTab] = useState<string>(""); //顶部TAB变量
|
|
|
|
|
const [usertab, setUsertab] = useState<string>(""); //底部TAB变量
|
|
|
|
@ -58,9 +58,9 @@ const AntdTable: FC<ITableProps> = (props) => {
|
|
|
|
|
setPageParams({ ...pageParams, total, size, pageNum });
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
const { columns = [], pageInfo = {} } = dataCopy;
|
|
|
|
|
const { columns = [], columns2 = [], pageInfo = {} } = dataCopy;
|
|
|
|
|
const { list = [], total, pageSize: size, pageNum } = pageInfo;
|
|
|
|
|
setColumns(getColumns(columns, hasOperate));
|
|
|
|
|
setColumns(getColumns(columns2, hasOperate));
|
|
|
|
|
setDataSource(list);
|
|
|
|
|
setPageParams({ ...pageParams, total, size, pageNum });
|
|
|
|
|
const confCode: any = await API.CalculateService.getSysconfcode({ code: "OPEN_ACCT_RESULT_SUM" });
|
|
|
|
@ -260,6 +260,67 @@ const AntdTable: FC<ITableProps> = (props) => {
|
|
|
|
|
}
|
|
|
|
|
</span>;
|
|
|
|
|
};
|
|
|
|
|
if (child.children) {
|
|
|
|
|
child.children.map((grandSon: any) => {
|
|
|
|
|
grandSon.title = <span className={styles.titleWrapper}>
|
|
|
|
|
<span title={grandSon.text} onClick={() => {
|
|
|
|
|
window.parent.postMessage(
|
|
|
|
|
{
|
|
|
|
|
type: "PR",
|
|
|
|
|
data: { id: "COLUMNINDEX", data: grandSon.column }
|
|
|
|
|
},
|
|
|
|
|
"*"
|
|
|
|
|
);
|
|
|
|
|
}}>{grandSon.text}</span>
|
|
|
|
|
{
|
|
|
|
|
grandSon.lockStatus &&
|
|
|
|
|
<span className={styles.titleIcon}>
|
|
|
|
|
{
|
|
|
|
|
grandSon.lockStatus === "UNLOCK" &&
|
|
|
|
|
<LockOutlined
|
|
|
|
|
title="点击锁定所有解锁的项目值"
|
|
|
|
|
onClick={() => {
|
|
|
|
|
window.parent.postMessage(
|
|
|
|
|
{
|
|
|
|
|
type: "PR",
|
|
|
|
|
data: { id: "COLUMNINDEX", data: grandSon.column, extraId: "LOCK" }
|
|
|
|
|
},
|
|
|
|
|
"*"
|
|
|
|
|
);
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
grandSon.lockStatus !== "UNLOCK" &&
|
|
|
|
|
<UnlockOutlined
|
|
|
|
|
title="点击解锁所有锁定的项目值"
|
|
|
|
|
onClick={() => {
|
|
|
|
|
window.parent.postMessage(
|
|
|
|
|
{
|
|
|
|
|
type: "PR",
|
|
|
|
|
data: { id: "COLUMNINDEX", data: grandSon.column, extraId: "UNLOCK" }
|
|
|
|
|
},
|
|
|
|
|
"*"
|
|
|
|
|
);
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
}
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
</span>;
|
|
|
|
|
grandSon.dataIndex = grandSon.column;
|
|
|
|
|
grandSon.width = "150px";
|
|
|
|
|
grandSon.ellipsis = true;
|
|
|
|
|
grandSon.render = (text: string) => {
|
|
|
|
|
return <span className={styles.contentSpan}>
|
|
|
|
|
<span title={text} className={styles.contentTitle}>{text}</span>
|
|
|
|
|
{
|
|
|
|
|
child.lockStatus === "LOCK" ? <LockOutlined title="锁定的项目值"/> : null
|
|
|
|
|
}
|
|
|
|
|
</span>;
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -348,10 +409,16 @@ const AntdTable: FC<ITableProps> = (props) => {
|
|
|
|
|
if (tab !== "PR" || !showSumrow) return;
|
|
|
|
|
let totalColumns: any[] = [];
|
|
|
|
|
_.forEach(columns, it => {
|
|
|
|
|
if (!it.children) {
|
|
|
|
|
if (_.isEmpty(it.children)) {
|
|
|
|
|
totalColumns.push(it);
|
|
|
|
|
} else {
|
|
|
|
|
totalColumns = [...totalColumns, ...it.children];
|
|
|
|
|
_.forEach(it.children, gt => {
|
|
|
|
|
if (_.isEmpty(gt.children)) {
|
|
|
|
|
totalColumns.push(gt);
|
|
|
|
|
} else {
|
|
|
|
|
totalColumns = [...totalColumns, ...gt.children];
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return (
|
|
|
|
@ -361,7 +428,8 @@ const AntdTable: FC<ITableProps> = (props) => {
|
|
|
|
|
_.isEmpty(sumRow) ? <Spin tip="加载中"/> :
|
|
|
|
|
_.map([{}, ...totalColumns], (item, index) => {
|
|
|
|
|
if (index === 0) {
|
|
|
|
|
return <Table.Summary.Cell index={0} align="center"><Text type="danger">总计</Text></Table.Summary.Cell>;
|
|
|
|
|
return <Table.Summary.Cell index={0} align="center"><Text
|
|
|
|
|
type="danger">总计</Text></Table.Summary.Cell>;
|
|
|
|
|
}
|
|
|
|
|
return <Table.Summary.Cell index={index} key={index}>
|
|
|
|
|
<Text type="danger">{sumRow[item.dataIndex] || "-"}</Text>
|
|
|
|
@ -375,4 +443,4 @@ const AntdTable: FC<ITableProps> = (props) => {
|
|
|
|
|
/>;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default AntdTable;
|
|
|
|
|
export default AntdTableColumns2;
|