3.10 工程代码同步master
This commit is contained in:
65
src/pages/notice/noticeList/components/NoticeDetail.tsx
Normal file
65
src/pages/notice/noticeList/components/NoticeDetail.tsx
Normal file
@ -0,0 +1,65 @@
|
||||
import ExtendUpload from "@/utils/ExtendUpload";
|
||||
import { Button, Modal, Skeleton } from "antd"
|
||||
import React, { useEffect, useState } from "react"
|
||||
import { getPageInfo } from '../service'
|
||||
|
||||
interface filesManageComponents {
|
||||
modalVisible: boolean;
|
||||
detailId: string;
|
||||
onCancel: () => void;
|
||||
}
|
||||
|
||||
const modalHeight = window.innerHeight * 96 / 100;
|
||||
|
||||
const filesManageComponents: React.FC<filesManageComponents> = (props) => {
|
||||
const { modalVisible, detailId, onCancel } = props;
|
||||
const [detailData, setDetailData] = useState<any>({})
|
||||
const [loading, setLoading] = useState<boolean>(false) //loading
|
||||
useEffect(() => {
|
||||
Int();
|
||||
}, [detailId]);
|
||||
const Int = () => {
|
||||
setLoading(true);
|
||||
getPageInfo(detailId).then(res => {
|
||||
if (res?.code == 200) {
|
||||
const data = res?.data
|
||||
setDetailData(data)
|
||||
}
|
||||
}).finally(() => {
|
||||
setLoading(false);
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal
|
||||
destroyOnClose={true}
|
||||
getContainer={false}
|
||||
title='公告详情'
|
||||
visible={modalVisible}
|
||||
onCancel={() => onCancel()}
|
||||
width={'50%'}
|
||||
style={{ maxHeight: modalHeight }}
|
||||
bodyStyle={{ maxHeight: modalHeight - 107, overflowY: 'auto', padding: '20px 8.5%' }}
|
||||
centered
|
||||
footer={[<Button onClick={onCancel}>关闭</Button>]}
|
||||
>
|
||||
<Skeleton loading={loading}>
|
||||
<div>
|
||||
<div style={{ textAlign: 'center' }}>
|
||||
<h1 style={{ fontWeight: 'bold' }} >{detailData?.noticeTitle}</h1>
|
||||
</div>
|
||||
<div dangerouslySetInnerHTML={{ __html: detailData?.noticeContent }} className="notice-detail-html"></div>
|
||||
<div className="notice-detail-noticefile">
|
||||
<span className="notice-detail-file">公告文档:</span>
|
||||
<ExtendUpload bid={detailData?.noticeFile} uploadProps={{ name: "file", disabled: true }}>
|
||||
</ExtendUpload>
|
||||
</div>
|
||||
</div>
|
||||
</Skeleton>
|
||||
</Modal>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default filesManageComponents
|
@ -1,44 +1,84 @@
|
||||
import React, { useState } from 'react';
|
||||
import ProTable from '@ant-design/pro-table';
|
||||
import { getPage} from '../service';
|
||||
import { getPage } from '../service';
|
||||
import { Button, Card } from 'antd';
|
||||
import NoticeDetail from "./NoticeDetail"
|
||||
|
||||
|
||||
const NoticeList: React.FC<{}> = () => {
|
||||
const [detailId, setDetailId] = useState<string>('');// 详情id
|
||||
const [noticeDetail, setNoticeDetail] = useState<boolean>(false);
|
||||
|
||||
|
||||
|
||||
const columns: any = [
|
||||
{
|
||||
title: '序号',
|
||||
valueType: 'index',
|
||||
width:80
|
||||
},
|
||||
{
|
||||
title: '标题',
|
||||
dataIndex: 'noticeTitle',
|
||||
width:220
|
||||
},
|
||||
{
|
||||
title: '发布人',
|
||||
dataIndex: 'noticeName',
|
||||
width:220
|
||||
},
|
||||
{
|
||||
title: '发布时间',
|
||||
dataIndex: 'createDate',
|
||||
width:220
|
||||
},
|
||||
]
|
||||
|
||||
return (
|
||||
const columns: any = [
|
||||
{
|
||||
title: '序号',
|
||||
valueType: 'index',
|
||||
width: 80
|
||||
},
|
||||
{
|
||||
title: '标题',
|
||||
dataIndex: 'noticeTitle',
|
||||
},
|
||||
// {
|
||||
// title: '发布人',
|
||||
// dataIndex: 'noticeName',
|
||||
// width: 220
|
||||
// },
|
||||
{
|
||||
title: '发布时间',
|
||||
dataIndex: 'createDate',
|
||||
valueType: 'date',
|
||||
width: 220
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
valueType: 'option',
|
||||
render: (record: any) => (
|
||||
<>
|
||||
<ProTable
|
||||
columns={columns}
|
||||
request={params => getPage(params)}
|
||||
rowKey="id"
|
||||
/>
|
||||
<Button type="link" danger key="lookInfo" onClick={() => lookInfo(record.props.text.id)}>查看</Button>
|
||||
</>
|
||||
);
|
||||
)
|
||||
}
|
||||
]
|
||||
|
||||
const lookInfo = (id: any) => { // 查看
|
||||
setDetailId(id)
|
||||
setNoticeDetail(true)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card title="通知公告查看">
|
||||
<ProTable
|
||||
className="proSearch"
|
||||
columns={columns}
|
||||
size='small'
|
||||
request={async (params) =>
|
||||
await getPage(params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
let data = res.data;
|
||||
return Promise.resolve({
|
||||
data: data.records,
|
||||
success: res.success,
|
||||
total: res.data.total,
|
||||
current: res.data.current,
|
||||
});
|
||||
}
|
||||
return Promise.resolve({
|
||||
data: [],
|
||||
success: false,
|
||||
total: 0,
|
||||
current: 1,
|
||||
});
|
||||
})
|
||||
}
|
||||
pagination={{ defaultPageSize: 10, showSizeChanger: false }}//默认显示条数
|
||||
toolBarRender={false}
|
||||
/>
|
||||
</Card>
|
||||
{noticeDetail && <NoticeDetail detailId={detailId} onCancel={() => setNoticeDetail(false)} modalVisible={noticeDetail} />}
|
||||
</>
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
@ -3,11 +3,17 @@ import request from '@/utils/request';
|
||||
* 查询数据并分页
|
||||
* @param params
|
||||
*/
|
||||
export async function getPage(params?: any) {
|
||||
return request('/api/biz-service-ebtp-extend/v1/bizbidnotice/list',{
|
||||
export async function getPage(data?: any) {
|
||||
if(data.createDate != undefined){
|
||||
data.createDate = data.createDate.split(' ')[0] + ' 00:00:00'
|
||||
}
|
||||
return request('/api/biz-service-ebtp-extend/v1/bizbidnotice/list', {
|
||||
method: 'POST',
|
||||
data:params,
|
||||
|
||||
data: {
|
||||
...data,
|
||||
pageNo: data?.current,
|
||||
pageSize: data?.pageSize
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@ -15,6 +21,16 @@ export async function getPage(params?: any) {
|
||||
* 根据id查询项目信息
|
||||
* @param id
|
||||
*/
|
||||
export function getProjectById(id:any){
|
||||
export function getProjectById(id: any) {
|
||||
return request('/api/biz-service-ebtp-project/v1/projectRecord/' + id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询数据详细信息
|
||||
* @param params
|
||||
*/
|
||||
export async function getPageInfo(params: String) {
|
||||
return request('/api/biz-service-ebtp-extend/v1/bizbidnotice/select/' + params, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user