更改附件
This commit is contained in:
parent
7725b0f1fc
commit
248d4e6f00
@ -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>
|
||||
|
||||
@ -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({
|
||||
|
||||
Loading…
Reference in New Issue
Block a user