feature/2.9.42310.01-薪资项目拓扑图
This commit is contained in:
parent
607f62b89e
commit
042a962a2f
|
|
@ -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;
|
||||
|
|
@ -58,9 +58,9 @@ const AntdTable: FC<ITableProps> = (props) => {
|
|||
setPageParams({ ...pageParams, total, size, pageNum });
|
||||
}
|
||||
} else {
|
||||
const { columns = [], columns2 = [], pageInfo = {} } = dataCopy;
|
||||
const { columns = [], pageInfo = {} } = dataCopy;
|
||||
const { list = [], total, pageSize: size, pageNum } = pageInfo;
|
||||
setColumns(getColumns(columns2, hasOperate));
|
||||
setColumns(getColumns(columns, hasOperate));
|
||||
setDataSource(list);
|
||||
setPageParams({ ...pageParams, total, size, pageNum });
|
||||
const confCode: any = await API.CalculateService.getSysconfcode({ code: "OPEN_ACCT_RESULT_SUM" });
|
||||
|
|
@ -260,67 +260,6 @@ 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>;
|
||||
};
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -409,16 +348,10 @@ const AntdTable: FC<ITableProps> = (props) => {
|
|||
if (tab !== "PR" || !showSumrow) return;
|
||||
let totalColumns: any[] = [];
|
||||
_.forEach(columns, it => {
|
||||
if (_.isEmpty(it.children)) {
|
||||
if (!it.children) {
|
||||
totalColumns.push(it);
|
||||
} else {
|
||||
_.forEach(it.children, gt => {
|
||||
if (_.isEmpty(gt.children)) {
|
||||
totalColumns.push(gt);
|
||||
} else {
|
||||
totalColumns = [...totalColumns, ...gt.children];
|
||||
}
|
||||
});
|
||||
totalColumns = [...totalColumns, ...it.children];
|
||||
}
|
||||
});
|
||||
return (
|
||||
|
|
@ -428,8 +361,7 @@ 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>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import React, { FC } from 'react';
|
||||
import AntdTable from './components/antdTable';
|
||||
import AntdTableColumns2 from './components/antdTable';
|
||||
|
||||
const AtdTable: FC = (props) => {
|
||||
|
||||
return <AntdTable />
|
||||
return <AntdTableColumns2 />
|
||||
};
|
||||
|
||||
export default AtdTable;
|
||||
|
|
|
|||
Loading…
Reference in New Issue