This commit is contained in:
何美荣 2026-06-09 16:43:35 +08:00
commit 0aca6273b1
3 changed files with 224 additions and 85 deletions

View File

@ -345,8 +345,7 @@ class SE018EditPage extends React.Component {
<td colSpan={4} className={styles.fontBold}>审阅意见</td> <td colSpan={4} className={styles.fontBold}>审阅意见</td>
{ {
data && data.STATUS > 2 && data.DT_APPROVE ? <td colSpan={20}> data && data.STATUS > 2 && data.DT_APPROVE ? <td colSpan={20}>
<p>审阅人{showUserSign(data.Nav_UserApro, config.picServerHost)}</p> <p>{showUserSign(data.Nav_UserApro, config.picServerHost)} {data.DT_APPROVE}</p>
<p>审阅时间{data.DT_APPROVE}</p>
</td> : <td colSpan={20} ></td> </td> : <td colSpan={20} ></td>
} }
</tr> </tr>

View File

@ -46,7 +46,7 @@ class RiskControl extends React.Component {
this.echartsInstances.stackBarChart = echarts.init(chartDom); this.echartsInstances.stackBarChart = echarts.init(chartDom);
const { riskSubData } = this.props; const { riskSubData } = this.props;
const riskList = riskSubData?.riskList || []; const riskList = riskSubData?.riskList?.filter((item) => item.companyName !== '小计') || [];
if (riskList.length === 0) { if (riskList.length === 0) {
this.echartsInstances.stackBarChart.setOption({ this.echartsInstances.stackBarChart.setOption({
@ -324,6 +324,8 @@ class RiskControl extends React.Component {
this.setupResizeHandler('typeBarChart', this.renderTypeBarChart); this.setupResizeHandler('typeBarChart', this.renderTypeBarChart);
}; };
// 表格: 各公司风险统计明细表
// 表格: 各公司风险统计明细表
// 表格: 各公司风险统计明细表 // 表格: 各公司风险统计明细表
renderRiskTable = () => { renderRiskTable = () => {
const { riskSubData } = this.props; const { riskSubData } = this.props;
@ -333,100 +335,238 @@ class RiskControl extends React.Component {
return <div style={{ textAlign: 'center', padding: '50px', color: '#999' }}>暂无风险数据</div>; return <div style={{ textAlign: 'center', padding: '50px', color: '#999' }}>暂无风险数据</div>;
} }
// 表格列配置(与 trainingContent 样式保持一致) const filteredRiskList = riskList.filter((item) => item.companyName !== '小计');
const columns = [
{
title: '公司名称',
dataIndex: 'companyName',
key: 'companyName',
align: 'center',
width: 120,
render: (text) => <strong>{text}</strong>,
},
{
title: '重大风险',
dataIndex: 'majorCount',
key: 'majorCount',
align: 'center',
width: 100,
render: (text) => <span style={{ color: '#c92a2a', fontWeight: 'bold' }}>{text}</span>,
},
{
title: '较大风险',
dataIndex: 'largerCount',
key: 'largerCount',
align: 'center',
width: 100,
render: (text) => <span style={{ color: '#ffa94d', fontWeight: 'bold' }}>{text}</span>,
},
{
title: '一般风险',
dataIndex: 'generalCount',
key: 'generalCount',
align: 'center',
width: 100,
render: (text) => <span style={{ color: '#ffe066', fontWeight: 'bold' }}>{text}</span>,
},
{
title: '低风险',
dataIndex: 'lowCount',
key: 'lowCount',
align: 'center',
width: 100,
render: (text) => <span style={{ color: '#4285F4', fontWeight: 'bold' }}>{text}</span>,
},
{
title: '小计',
dataIndex: 'totalCount',
key: 'totalCount',
align: 'center',
width: 100,
render: (text) => <strong style={{ color: '#000', fontSize: '14px' }}>{text}</strong>,
},
];
const tableData = riskList.map((item, index) => ({
key: index,
companyName: item.companyName,
majorCount: item.majorCount,
largerCount: item.largerCount,
generalCount: item.generalCount,
lowCount: item.lowCount,
totalCount: item.totalCount,
}));
// 合计行
const summary = { const summary = {
majorTotal: riskList.reduce((sum, item) => sum + (item.majorCount || 0), 0), majorTotal: filteredRiskList.reduce((sum, item) => sum + (item.majorCount || 0), 0),
largerTotal: riskList.reduce((sum, item) => sum + (item.largerCount || 0), 0), largerTotal: filteredRiskList.reduce((sum, item) => sum + (item.largerCount || 0), 0),
generalTotal: riskList.reduce((sum, item) => sum + (item.generalCount || 0), 0), generalTotal: filteredRiskList.reduce((sum, item) => sum + (item.generalCount || 0), 0),
lowTotal: riskList.reduce((sum, item) => sum + (item.lowCount || 0), 0), lowTotal: filteredRiskList.reduce((sum, item) => sum + (item.lowCount || 0), 0),
totalAll: riskList.reduce((sum, item) => sum + (item.totalCount || 0), 0), totalAll: filteredRiskList.reduce((sum, item) => sum + (item.totalCount || 0), 0),
}; };
const scrollConfig = columns.length > 10 ? { x: columns.length * 100, y: 360 } : { y: 360 };
const totalWidth = 620;
return ( return (
<div style={{ height: '100%', display: 'flex', flexDirection: 'column' }}> <div
style={{
height: '100%',
display: 'flex',
flexDirection: 'column',
overflow: 'hidden',
}}
>
<div <div
style={{ style={{
textAlign: 'center', textAlign: 'center',
padding: '20px 0 0 0', padding: '16px 0',
fontWeight: 'bold', fontWeight: 'bold',
fontSize: '17px', fontSize: '16px',
color: '#000', color: '#000',
flexShrink: 0,
borderBottom: '1px solid #f0f0f0',
}} }}
> >
各家公司的风险统计情况 各家公司的风险统计情况
</div> </div>
<div style={{ flex: 1, padding: '10px' }}>
<Table {/* 表格滚动区域 */}
columns={columns} <div
dataSource={tableData} style={{
pagination={false} flex: 1,
scroll={scrollConfig} overflow: 'auto',
size="small" minHeight: 0,
bordered position: 'relative',
className={styles.certificateTable} marginLeft: '20px',
/> }}
>
<table
style={{
width: '100%',
borderCollapse: 'collapse',
fontSize: '14px',
minWidth: totalWidth,
}}
>
{/* 表头 - 使用 sticky 固定 */}
<thead>
<tr style={{ backgroundColor: '#4285f4', position: 'sticky', top: 0, zIndex: 20 }}>
<th
style={{
padding: '10px 8px',
textAlign: 'center',
border: '1px solid #e8e8e8',
color: '#fff',
fontWeight: 'bold',
width: 120,
}}
>
公司名称
</th>
<th
style={{
padding: '10px 8px',
textAlign: 'center',
border: '1px solid #e8e8e8',
color: '#fff',
fontWeight: 'bold',
width: 100,
}}
>
重大风险
</th>
<th
style={{
padding: '10px 8px',
textAlign: 'center',
border: '1px solid #e8e8e8',
color: '#fff',
fontWeight: 'bold',
width: 100,
}}
>
较大风险
</th>
<th
style={{
padding: '10px 8px',
textAlign: 'center',
border: '1px solid #e8e8e8',
color: '#fff',
fontWeight: 'bold',
width: 100,
}}
>
一般风险
</th>
<th
style={{
padding: '10px 8px',
textAlign: 'center',
border: '1px solid #e8e8e8',
color: '#fff',
fontWeight: 'bold',
width: 100,
}}
>
低风险
</th>
<th
style={{
padding: '10px 8px',
textAlign: 'center',
border: '1px solid #e8e8e8',
color: '#fff',
fontWeight: 'bold',
width: 100,
}}
>
小计
</th>
</tr>
</thead>
<tbody>
{filteredRiskList.map((item, index) => (
<tr key={index} style={{ backgroundColor: '#fff' }}>
<td style={{ padding: '8px', textAlign: 'center', border: '1px solid #f0f0f0' }}>
<strong>{item.companyName}</strong>
</td>
<td style={{ padding: '8px', textAlign: 'center', border: '1px solid #f0f0f0' }}>
<span style={{ color: '#c92a2a', fontWeight: 'bold' }}>{item.majorCount}</span>
</td>
<td style={{ padding: '8px', textAlign: 'center', border: '1px solid #f0f0f0' }}>
<span style={{ color: '#ffa94d', fontWeight: 'bold' }}>{item.largerCount}</span>
</td>
<td style={{ padding: '8px', textAlign: 'center', border: '1px solid #f0f0f0' }}>
<span style={{ color: '#ffe066', fontWeight: 'bold' }}>{item.generalCount}</span>
</td>
<td style={{ padding: '8px', textAlign: 'center', border: '1px solid #f0f0f0' }}>
<span style={{ color: '#4285F4', fontWeight: 'bold' }}>{item.lowCount}</span>
</td>
<td style={{ padding: '8px', textAlign: 'center', border: '1px solid #f0f0f0' }}>
<strong>{item.totalCount}</strong>
</td>
</tr>
))}
</tbody>
{/* 合计行 - 使用 sticky 固定在底部 */}
<tfoot>
<tr style={{ backgroundColor: '#fafafa', position: 'sticky', bottom: 0, zIndex: 10 }}>
<td
style={{
padding: '10px 8px',
textAlign: 'center',
border: '1px solid #f0f0f0',
fontWeight: 'bold',
backgroundColor: '#fafafa',
}}
>
合计
</td>
<td
style={{
padding: '10px 8px',
textAlign: 'center',
border: '1px solid #f0f0f0',
color: '#c92a2a',
fontWeight: 'bold',
backgroundColor: '#fafafa',
}}
>
{summary.majorTotal}
</td>
<td
style={{
padding: '10px 8px',
textAlign: 'center',
border: '1px solid #f0f0f0',
color: '#ffa94d',
fontWeight: 'bold',
backgroundColor: '#fafafa',
}}
>
{summary.largerTotal}
</td>
<td
style={{
padding: '10px 8px',
textAlign: 'center',
border: '1px solid #f0f0f0',
color: '#ffe066',
fontWeight: 'bold',
backgroundColor: '#fafafa',
}}
>
{summary.generalTotal}
</td>
<td
style={{
padding: '10px 8px',
textAlign: 'center',
border: '1px solid #f0f0f0',
color: '#4285F4',
fontWeight: 'bold',
backgroundColor: '#fafafa',
}}
>
{summary.lowTotal}
</td>
<td
style={{
padding: '10px 8px',
textAlign: 'center',
border: '1px solid #f0f0f0',
fontWeight: 'bold',
backgroundColor: '#fafafa',
}}
>
{summary.totalAll}
</td>
</tr>
</tfoot>
</table>
</div> </div>
</div> </div>
); );

View File

@ -448,7 +448,7 @@ class Home extends React.Component {
}); });
this.getTeam(); this.getTeam();
this.getHomeTitle(); this.getHomeTitle();
//定时器功能,暂时不开启 //定时器功能,暂时不开启2分钟刷一次
this.timerID = setInterval(() => { this.timerID = setInterval(() => {
if (this._isMounted) { if (this._isMounted) {
this.getBaseInfoData(1, this.state.tableKey, 5); this.getBaseInfoData(1, this.state.tableKey, 5);