This commit is contained in:
wyw 2026-05-11 17:23:32 +08:00
commit 281eaab5c8
2 changed files with 12 additions and 42 deletions

View File

@ -7,7 +7,8 @@ import echarts from 'echarts';
import configc from '../../config';
import 'slick-carousel/slick/slick.css';
import 'slick-carousel/slick/slick-theme.css';
import { extendRule } from '../../utils/common';
import { extendRule, showFileModal, showFiles, GetFileModel } from '../../utils/common';
import FormPage from '../../components/FormPage';
class HomeContent extends React.Component {
constructor(props) {
@ -22,6 +23,12 @@ class HomeContent extends React.Component {
this.chartResizeHandlers = {};
this.isUnmounted = false;
this.autoplayTimer = null;
this.state = {
fileForm: {
title: '',
visible: false,
},
};
}
waitForElement = (elementId, maxRetries = 10) => {
@ -753,46 +760,9 @@ class HomeContent extends React.Component {
<div style={{ fontWeight: 'bold', marginBottom: '12px', fontSize: '14px', color: '#333' }}>
附件 ({Nav_Files.length})
</div>
<div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
{Nav_Files.map((file, index) => (
<div
key={file.ID || index}
style={{
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
padding: '8px 12px',
backgroundColor: '#f5f5f5',
borderRadius: '4px',
}}
>
<span style={{ fontSize: '14px', color: '#333', flex: 1 }}>
<Icon type="paper-clip" style={{ marginRight: '8px', color: '#1890ff' }} />
{file.Nav_ImgFile?.FILE_NAME || '未知文件'}
</span>
<div>
<Button
type="link"
size="small"
onClick={() => this.handlePreview(file)}
style={{ padding: '0 8px' }}
>
<Icon type="eye" />
预览
</Button>
<Button
type="link"
size="small"
onClick={() => this.handleDownload(file)}
style={{ padding: '0 8px' }}
>
<Icon type="download" />
下载
</Button>
</div>
</div>
))}
</div>
{showFiles(Nav_Files, configc.picServerHost, this)}
{GetFileModel(Modal, FormPage, this, this.state.fileForm.visible)}
<FormPage {...this.state.tmpData} />
</div>
)}
</div>

View File

@ -170,7 +170,7 @@ class FullScreen extends React.Component {
this.props.dispatch({
type: 'app/getDataByPost',
payload: json,
url: 'PF/Annourcement/Get',
url: 'PF/PFAnnourcement/Get',
onComplete: (ret) => {
if (ret && !this.isUnmounted) {
this.setState({