master
This commit is contained in:
parent
c8dabd2918
commit
ccdd0b8818
|
|
@ -54,6 +54,24 @@
|
|||
<div class="content unicode" style="display: block;">
|
||||
<ul class="icon_lists dib-box">
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">export</div>
|
||||
<div class="code-name">&#xe61e;</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">对比</div>
|
||||
<div class="code-name">&#xe617;</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">import</div>
|
||||
<div class="code-name">&#xe73a;</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">error</div>
|
||||
|
|
@ -186,9 +204,9 @@
|
|||
<pre><code class="language-css"
|
||||
>@font-face {
|
||||
font-family: 'iconfont';
|
||||
src: url('iconfont.woff2?t=1723796605504') format('woff2'),
|
||||
url('iconfont.woff?t=1723796605504') format('woff'),
|
||||
url('iconfont.ttf?t=1723796605504') format('truetype');
|
||||
src: url('iconfont.woff2?t=1741245710478') format('woff2'),
|
||||
url('iconfont.woff?t=1741245710478') format('woff'),
|
||||
url('iconfont.ttf?t=1741245710478') format('truetype');
|
||||
}
|
||||
</code></pre>
|
||||
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
|
||||
|
|
@ -214,6 +232,33 @@
|
|||
<div class="content font-class">
|
||||
<ul class="icon_lists dib-box">
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont icon-export"></span>
|
||||
<div class="name">
|
||||
export
|
||||
</div>
|
||||
<div class="code-name">.icon-export
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont icon-duibi"></span>
|
||||
<div class="name">
|
||||
对比
|
||||
</div>
|
||||
<div class="code-name">.icon-duibi
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont icon-import"></span>
|
||||
<div class="name">
|
||||
import
|
||||
</div>
|
||||
<div class="code-name">.icon-import
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont icon-error"></span>
|
||||
<div class="name">
|
||||
|
|
@ -412,6 +457,30 @@
|
|||
<div class="content symbol">
|
||||
<ul class="icon_lists dib-box">
|
||||
|
||||
<li class="dib">
|
||||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-export"></use>
|
||||
</svg>
|
||||
<div class="name">export</div>
|
||||
<div class="code-name">#icon-export</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-duibi"></use>
|
||||
</svg>
|
||||
<div class="name">对比</div>
|
||||
<div class="code-name">#icon-duibi</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-import"></use>
|
||||
</svg>
|
||||
<div class="name">import</div>
|
||||
<div class="code-name">#icon-import</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-error"></use>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
@font-face {
|
||||
font-family: "iconfont"; /* Project id 4257468 */
|
||||
src: url('iconfont.woff2?t=1723796605504') format('woff2'),
|
||||
url('iconfont.woff?t=1723796605504') format('woff'),
|
||||
url('iconfont.ttf?t=1723796605504') format('truetype');
|
||||
src: url('iconfont.woff2?t=1741245710478') format('woff2'),
|
||||
url('iconfont.woff?t=1741245710478') format('woff'),
|
||||
url('iconfont.ttf?t=1741245710478') format('truetype');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
|
|
@ -13,6 +13,18 @@
|
|||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-export:before {
|
||||
content: "\e61e";
|
||||
}
|
||||
|
||||
.icon-duibi:before {
|
||||
content: "\e617";
|
||||
}
|
||||
|
||||
.icon-import:before {
|
||||
content: "\e73a";
|
||||
}
|
||||
|
||||
.icon-error:before {
|
||||
content: "\e6c6";
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -5,6 +5,27 @@
|
|||
"css_prefix_text": "icon-",
|
||||
"description": "",
|
||||
"glyphs": [
|
||||
{
|
||||
"icon_id": "10124054",
|
||||
"name": "export",
|
||||
"font_class": "export",
|
||||
"unicode": "e61e",
|
||||
"unicode_decimal": 58910
|
||||
},
|
||||
{
|
||||
"icon_id": "18272183",
|
||||
"name": "对比",
|
||||
"font_class": "duibi",
|
||||
"unicode": "e617",
|
||||
"unicode_decimal": 58903
|
||||
},
|
||||
{
|
||||
"icon_id": "19300598",
|
||||
"name": "import",
|
||||
"font_class": "import",
|
||||
"unicode": "e73a",
|
||||
"unicode_decimal": 59194
|
||||
},
|
||||
{
|
||||
"icon_id": "6652504",
|
||||
"name": "error",
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,9 +1,8 @@
|
|||
import React, { FC, useEffect, useState } from "react";
|
||||
import { Button, Spin, Table, Typography } from "antd";
|
||||
import { Button, Table, Typography } from "antd";
|
||||
import { exceptStr, paginationFun } from "@/utils/common";
|
||||
import { defaultPage, IPage } from "@/common/types";
|
||||
import styles from "@/pages/atdTable/components/index.less";
|
||||
import API from "@/api";
|
||||
|
||||
const { Text } = Typography;
|
||||
const StandingbookTable: FC = (props) => {
|
||||
|
|
@ -12,7 +11,6 @@ const StandingbookTable: FC = (props) => {
|
|||
const [dataSource, setDataSource] = useState<Array<any>>([]);
|
||||
const [pageInfo, setPageInfo] = useState<IPage>(defaultPage);
|
||||
const [sumRow, setSumRow] = useState<Partial<{}>>({});
|
||||
const [showSumrow, setShowSumrow] = useState<boolean>(false);
|
||||
|
||||
useEffect(() => {
|
||||
window.parent.postMessage({ type: "init" }, "*");
|
||||
|
|
@ -24,134 +22,108 @@ const StandingbookTable: FC = (props) => {
|
|||
const receiveMessageFromIndex = async (event: any) => {
|
||||
const data: any = exceptStr(event.data);
|
||||
if (!_.isEmpty(data)) {
|
||||
const {
|
||||
columns, dataSource, pageInfo, showOperates, selectedRowKeys,
|
||||
sumpayload, selectedKey
|
||||
} = data;
|
||||
const { columns, dataSource, pageInfo, showOperates, selectedRowKeys, sumRow } = data;
|
||||
const { current: pageNum, pageSize: size, total } = pageInfo;
|
||||
const conventColumns = _.map(_.filter(columns, it => it.dataIndex !== "id"), item => {
|
||||
const { dataIndex } = item;
|
||||
if (dataIndex === "employeeId") {
|
||||
const conventColumns = _.map(
|
||||
_.filter(columns, (it) => it.dataIndex !== "id"),
|
||||
(item) => {
|
||||
const { dataIndex } = item;
|
||||
if (dataIndex === "employeeId") {
|
||||
return {
|
||||
title: "姓名",
|
||||
dataIndex,
|
||||
fixed: "left",
|
||||
width: 150,
|
||||
render: (_: any, record: Partial<any>) => <span>{record?.userName}</span>
|
||||
};
|
||||
}
|
||||
return {
|
||||
title: "姓名", dataIndex, fixed: "left", width: 150,
|
||||
render: (_: any, record: Partial<any>) => (
|
||||
<span>{record?.userName}</span>
|
||||
)
|
||||
dataIndex,
|
||||
width: 150,
|
||||
title: <span dangerouslySetInnerHTML={{ __html: item.title }} />
|
||||
};
|
||||
}
|
||||
return {
|
||||
dataIndex, width: 150,
|
||||
title: <span dangerouslySetInnerHTML={{ __html: item.title }}/>
|
||||
};
|
||||
});
|
||||
);
|
||||
setDataSource(dataSource);
|
||||
setColumns(
|
||||
!showOperates ? conventColumns :
|
||||
[
|
||||
...conventColumns,
|
||||
{
|
||||
title: "操作",
|
||||
dataIndex: "operate",
|
||||
fixed: "right",
|
||||
width: 120,
|
||||
render: (_: any, record: any) => {
|
||||
return (
|
||||
<Button type="link" onClick={() => handleEdit(record)}>编辑</Button>
|
||||
);
|
||||
!showOperates
|
||||
? conventColumns
|
||||
: [
|
||||
...conventColumns,
|
||||
{
|
||||
title: "操作",
|
||||
dataIndex: "operate",
|
||||
fixed: "right",
|
||||
width: 120,
|
||||
render: (_: any, record: any) => {
|
||||
return (
|
||||
<Button type="link" onClick={() => handleEdit(record)}>
|
||||
编辑
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
);
|
||||
setPageInfo({ pageNum, size, total });
|
||||
setSelected(selectedRowKeys);
|
||||
const confCode: any = await API.CalculateService.getSysconfcode({ code: "OPEN_ACCT_RESULT_SUM" });
|
||||
setShowSumrow(confCode.data.status && confCode.data.data === "1");
|
||||
if (confCode.data.status && confCode.data.data === "1") {
|
||||
const sumRowlist: any = selectedKey === "1" ? await API.CalculateService.siaccountDetailCommonListSum(sumpayload) :
|
||||
selectedKey === "3" ? await API.CalculateService.siaccountDetailSupplementaryListSum(sumpayload) :
|
||||
selectedKey === "regression" ? await API.CalculateService.siaccountDetailRecessionListSum(sumpayload) :
|
||||
selectedKey === "difference" ? await API.CalculateService.siaccountDetailBalanceListSum(sumpayload) : {
|
||||
data: {
|
||||
status: false,
|
||||
data: { sumRow: {} }
|
||||
}
|
||||
};
|
||||
if (sumRowlist.data.status) {
|
||||
if (!_.isEmpty(sumRowlist.data.data.sumRow)) {
|
||||
setSumRow(sumRowlist.data.data.sumRow);
|
||||
} else {
|
||||
setSumRow({ [new Date().getTime()]: new Date().getTime() });
|
||||
}
|
||||
}
|
||||
if (sumRowlist.data.status && _.isNil(sumRowlist.data.data.sumRow)) {
|
||||
setSumRow({ [new Date().getTime()]: new Date().getTime() });
|
||||
}
|
||||
}
|
||||
setSumRow(sumRow);
|
||||
}
|
||||
};
|
||||
const handleEdit = (record: any) => {
|
||||
window.parent.postMessage({ type: "turn", payload: { id: "EDIT", params: { ...record } } }, "*");
|
||||
};
|
||||
const sizeChange = (pageobj: IPage) => {
|
||||
};
|
||||
const sizeChange = (pageobj: IPage) => {};
|
||||
const onChange = (pageobj: IPage) => {
|
||||
setPageInfo({ ...pageInfo, ...pageobj });
|
||||
window.parent.postMessage(
|
||||
{
|
||||
type: "turn",
|
||||
payload: { id: "PAGEINFO", params: { ...pageInfo, ...pageobj } }
|
||||
},
|
||||
"*"
|
||||
);
|
||||
window.parent.postMessage({ type: "turn", payload: { id: "PAGEINFO", params: { ...pageInfo, ...pageobj } } }, "*");
|
||||
};
|
||||
const rowSelection = {
|
||||
selectedRowKeys: selected,
|
||||
columnWidth: 80,
|
||||
columnWidth: 60,
|
||||
onChange: (selectedRowKeys: Array<any>) => {
|
||||
setSelected(selectedRowKeys);
|
||||
window.parent.postMessage(
|
||||
{
|
||||
type: "turn",
|
||||
payload: { id: "ROWSELECT", params: { selectedRowKeys } }
|
||||
},
|
||||
"*"
|
||||
);
|
||||
window.parent.postMessage({ type: "turn", payload: { id: "ROWSELECT", params: { selectedRowKeys } } }, "*");
|
||||
}
|
||||
};
|
||||
return <Table
|
||||
rowKey="id"
|
||||
className={styles.tableWrapper}
|
||||
columns={columns}
|
||||
dataSource={dataSource}
|
||||
size="small"
|
||||
rowSelection={rowSelection}
|
||||
pagination={{
|
||||
...paginationFun(pageInfo, sizeChange, onChange),
|
||||
size: "default"
|
||||
}}
|
||||
scroll={{ x: 1200, y: `calc(100vh - 172px)` }}
|
||||
summary={() => {
|
||||
if (_.isEmpty(columns) || !showSumrow) return;
|
||||
return (
|
||||
<Table.Summary fixed>
|
||||
<Table.Summary.Row>
|
||||
{
|
||||
_.isEmpty(sumRow) ? <Spin tip="加载中"/> :
|
||||
_.map([{}, ...columns], (item, index) => {
|
||||
if (index === 0) {
|
||||
return <Table.Summary.Cell index={0} key={index} align="center"><Text
|
||||
type="danger">总计</Text></Table.Summary.Cell>;
|
||||
}
|
||||
return <Table.Summary.Cell index={index} key={index}>
|
||||
return (
|
||||
<Table
|
||||
rowKey="id"
|
||||
className={styles.tableWrapper}
|
||||
columns={columns}
|
||||
dataSource={dataSource}
|
||||
size="small"
|
||||
rowSelection={rowSelection}
|
||||
pagination={{
|
||||
...paginationFun(pageInfo, sizeChange, onChange),
|
||||
size: "default"
|
||||
}}
|
||||
scroll={{ x: 1200, y: `calc(100vh - 172px)` }}
|
||||
summary={() => {
|
||||
if (_.isEmpty(sumRow)) return;
|
||||
return (
|
||||
<Table.Summary fixed>
|
||||
<Table.Summary.Row>
|
||||
{_.map([{}, ...columns], (item, index) => {
|
||||
if (index === 0) {
|
||||
return (
|
||||
<Table.Summary.Cell index={0} key={index} align="center">
|
||||
<Text type="danger">总计</Text>
|
||||
</Table.Summary.Cell>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Table.Summary.Cell index={index} key={index}>
|
||||
<Text type="danger">{!_.isNil(sumRow[item.dataIndex]) ? sumRow[item.dataIndex] : "-"}</Text>
|
||||
</Table.Summary.Cell>;
|
||||
})
|
||||
}
|
||||
</Table.Summary.Row>
|
||||
</Table.Summary>
|
||||
);
|
||||
}}
|
||||
/>;
|
||||
</Table.Summary.Cell>
|
||||
);
|
||||
})}
|
||||
</Table.Summary.Row>
|
||||
</Table.Summary>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default StandingbookTable;
|
||||
|
|
|
|||
Loading…
Reference in New Issue