Merge branch 'master' into feature/2.9.42310.01-薪资项目拓扑图
# Conflicts: # src/pages/calcTable/customTableTitle.tsx
This commit is contained in:
commit
783ab813cb
|
|
@ -279,6 +279,11 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ant-typography {
|
||||
margin-bottom: 0 !important;
|
||||
font-size: 12px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,10 +41,16 @@ const customTableTitle: FunctionComponent<Props> = (props) => {
|
|||
{
|
||||
!!lockStatus && !calcDetail &&
|
||||
<div className={styles["toogle-lock-tool"]}>
|
||||
<Icon type="icon-piliangsuoding" title={i18n["点击锁定所有解锁的项目值"]}
|
||||
onClick={() => handleToggleSalaryItemVal(dataIndex as string, "LOCK")}/>
|
||||
<Icon type="icon-piliangjiesuo" title={i18n["点击解锁所有锁定的项目值"]}
|
||||
onClick={() => handleToggleSalaryItemVal(dataIndex as string, "UNLOCK")}/>
|
||||
{
|
||||
lockStatus === "UNLOCK" &&
|
||||
<Icon type="icon-piliangsuoding" title={i18n["点击锁定所有解锁的项目值"]}
|
||||
onClick={() => handleToggleSalaryItemVal(dataIndex as string, "LOCK")}/>
|
||||
}
|
||||
{
|
||||
lockStatus === "LOCK" &&
|
||||
<Icon type="icon-piliangjiesuo" title={i18n["点击解锁所有锁定的项目值"]}
|
||||
onClick={() => handleToggleSalaryItemVal(dataIndex as string, "UNLOCK")}/>
|
||||
}
|
||||
<Icon type="icon-piliangfenpei" title={i18n["查看拓扑图"]}
|
||||
onClick={() => handleToggleSalaryItemVal(dataIndex as string, "DIAGRAM")}/>
|
||||
<Icon type="icon-pilianggengxin" title={i18n["批量更新"]}
|
||||
|
|
|
|||
|
|
@ -3,12 +3,13 @@ import { Button, Table, Typography } from "antd";
|
|||
import { exceptStr } from "@/utils/common";
|
||||
import styles from "@/pages/atdTable/components/index.less";
|
||||
|
||||
const { Text } = Typography;
|
||||
const { Text, Paragraph } = Typography;
|
||||
const ReportTable: FC = (props) => {
|
||||
const [columns, setColumns] = useState<Array<any>>([]);
|
||||
const [sumRow, setSumRow] = useState<Partial<{}>>({});
|
||||
const [dataSource, setDataSource] = useState<Array<any>>([]);
|
||||
const [showSumrow, setShowSumrow] = useState<boolean>(false);
|
||||
const [SSHeaderInfo, setSSHeaderInfo] = useState<string>("");
|
||||
|
||||
useEffect(() => {
|
||||
window.parent.postMessage({ type: "init" }, "*");
|
||||
|
|
@ -20,10 +21,11 @@ const ReportTable: FC = (props) => {
|
|||
const receiveMessageFromIndex = (event: any) => {
|
||||
const data: any = exceptStr(event.data);
|
||||
if (!_.isEmpty(data)) {
|
||||
const { columns, dataSource, countResult, showSum } = data;
|
||||
const { columns, dataSource, countResult, showSum, SSHeaderInfo = "" } = data;
|
||||
setDataSource(dataSource);
|
||||
setShowSumrow(showSum);
|
||||
setSumRow(countResult);
|
||||
setSSHeaderInfo(SSHeaderInfo);
|
||||
setColumns(_.map(columns, (item, index: number) => {
|
||||
if (index === 0) {
|
||||
return { ...item, fixed: "left", ellipsis: true };
|
||||
|
|
@ -34,12 +36,12 @@ const ReportTable: FC = (props) => {
|
|||
return {
|
||||
...child, ellipsis: true,
|
||||
render: (text: string, record: any) => {
|
||||
if(child.dataIndex?.endsWith("increase")){
|
||||
if (child.dataIndex?.endsWith("increase")) {
|
||||
let lowerLimitIndex = child.dataIndex.replace("increase", "lowerLimit");
|
||||
let upperLimitIndex = child.dataIndex.replace("increase", "upperLimit");
|
||||
let rowData = record[child.dataIndex].split(",").join("");
|
||||
let rowData = !_.isEmpty(record[child.dataIndex]) ? record[child.dataIndex].split(",").join("") : "";
|
||||
if (isNaN(parseFloat(rowData))) {
|
||||
return record[child.dataIndex]
|
||||
return record[child.dataIndex];
|
||||
}
|
||||
if (!isNaN(parseFloat(record[lowerLimitIndex])) && parseFloat(rowData) < parseFloat(record[lowerLimitIndex])) {
|
||||
return <Button type="link" block onClick={() => {
|
||||
|
|
@ -52,7 +54,7 @@ const ReportTable: FC = (props) => {
|
|||
);
|
||||
}}>
|
||||
<Text type="success">{rowData}</Text>
|
||||
</Button>
|
||||
</Button>;
|
||||
}
|
||||
if (!isNaN(parseFloat(record[upperLimitIndex])) && parseFloat(rowData) > parseFloat(record[upperLimitIndex])) {
|
||||
return <Button type="link" block onClick={() => {
|
||||
|
|
@ -65,9 +67,9 @@ const ReportTable: FC = (props) => {
|
|||
);
|
||||
}}>
|
||||
<Text type="danger">{rowData}</Text>
|
||||
</Button>
|
||||
</Button>;
|
||||
} else {
|
||||
return `${rowData}`
|
||||
return `${rowData}`;
|
||||
}
|
||||
}
|
||||
return <Button type="link" block onClick={() => {
|
||||
|
|
@ -94,7 +96,8 @@ const ReportTable: FC = (props) => {
|
|||
pagination={false}
|
||||
bordered
|
||||
size="small"
|
||||
scroll={{ x: 1200, y: `calc(100vh - 109px)` }}
|
||||
scroll={{ x: 1200, y: `calc(100vh - 148px)` }}
|
||||
title={() => <Paragraph ellipsis={true}>{SSHeaderInfo}</Paragraph>}
|
||||
summary={() => {
|
||||
if (!showSumrow) return;
|
||||
let totalColumns: any[] = [];
|
||||
|
|
|
|||
Loading…
Reference in New Issue