3.10 工程代码同步master

This commit is contained in:
jl-zhoujl2
2022-03-10 14:24:13 +08:00
parent 41ab55a4ac
commit 62f6b07ee2
914 changed files with 143121 additions and 29110 deletions

View File

@ -1,96 +1,144 @@
import React, { useEffect,useRef, useState, } from 'react';
import React, { useRef } from 'react';
import ProTable, { ActionType } from '@ant-design/pro-table';
import { getPage,downLord} from '../service';
import FileManageDownLordModal from "./fileManageDownLordModal"
import request from '@/utils/request';
import { Space,Button, Card, Divider, Drawer, message, Modal, Spin, Table} from 'antd';
import { getPage, addDownList } from '../service';
import { Button, Card, message } from 'antd';
import { getSessionUserData } from '@/utils/session';
import FileDown from '@/utils/Download';
var columns: any = [];
const FilesList: React.FC<{}> = () => {
//操作数据后刷新列表
const checkRelationRef = useRef<ActionType>();
//预览窗口显示
const [previewJgtzsFormVisible, setPreviewJgtzsFormVisible] = useState<any>(false);
const [fileId, setFileId] = useState<any>("");
const [downLoadFileName, setDownLoadFileName] = useState<any>("");
const checkRelationRef = useRef<ActionType>(); //操作数据后刷新列表
const columns: any = [
{
title: '序号',
valueType: 'index',
width:80
},
{
title: '文档名称',
dataIndex: 'sharedName',
width:220
},
{
title: '使用角色',
dataIndex: 'sharedRole',
width:220
},
{
title: '上传日期',
dataIndex: 'createDate',
width:220
},
{
title: '操作',
valueType: 'option',
width:100,
render: (record: any) => (
<Space size="middle">
<a key="downLord" onClick={() => filedownLord(record)}>
</a>
</Space>
),
}
]
/**
* 下载
* @param data
*/
const filedownLord = async(data: any) => {
await clickJgtzs(data.props.text.sharedFile,data.props.text.sharedName);
await downLord(data);
checkRelationRef.current?.reload();
}
const clickJgtzs=(sharedFile:any,sharedName:any)=>{
setFileId(sharedFile);
setDownLoadFileName(sharedName);
// setFileId("8d40d4ec-cacb-4917-b5e2-80e38b3d4803");
setPreviewJgtzsFormVisible(true);
if(getSessionUserData().roleIds == 'ebtp-system-admin'){
columns = [
{
title: '序号',
valueType: 'index',
width: 80
},
{
title: '文档名称',
dataIndex: 'sharedName',
width: 220,
},
{
title: '使用角色',
dataIndex: 'sharedRole',
width: 220
},
{
title: '上传日期',
dataIndex: 'createDate',
valueType: 'date',
width: 220
},
{
title: '操作',
valueType: 'option',
width: 100,
render: (record: any) => {
if (record.props.text.sharedFile && record.props.text.allowDownload) {
return (
<Button type="link" danger onClick={() => downList(record)}></Button>
)
} else if (!record.props.text.allowDownload) {
return (
<Button type="link" danger disabled></Button>
)
} else {
return (
<Button type="link" danger key="downLord" onClick={() => message.error('未上传文档,所以暂时无法下载!')}></Button>
)
}
}
}
]
} else {
columns = [
{
title: '序号',
valueType: 'index',
width: 80
},
{
title: '文档名称',
dataIndex: 'sharedName',
width: 220,
},
{
title: '上传日期',
dataIndex: 'createDate',
valueType: 'date',
width: 220
},
{
title: '操作',
valueType: 'option',
width: 100,
render: (record: any) => {
if (record.props.text.sharedFile && record.props.text.allowDownload) {
return (
<Button type="link" danger onClick={() => downList(record)}></Button>
)
} else if (!record.props.text.allowDownload) {
return (
<Button type="link" danger disabled></Button>
)
} else {
return (
<Button type="link" danger key="downLord" onClick={() => message.error('未上传文档,所以暂时无法下载!')}></Button>
)
}
}
}
]
}
return (
<>
<ProTable
actionRef={checkRelationRef}
columns={columns}
request={params => getPage(params)}
rowKey="id"
/>
{previewJgtzsFormVisible?
<FileManageDownLordModal
fileId={fileId}
downLoadFileName={downLoadFileName}
modalVisible={previewJgtzsFormVisible}
onCancel={() => {
setFileId("");
setPreviewJgtzsFormVisible(!previewJgtzsFormVisible);
}}
>
</FileManageDownLordModal>
:null}
</>
);
const downList = async (val: any) => {
let data = {
id: val.props.text.id
}
await addDownList(data).then((res) => {
if (res.code == 200) {
window.location.href = '/api/core-service-ebtp-updownload/v1/attachment/download/bid/' + val.props.text.sharedFile
}
})
}
return (
<>
<Card title="共享文档下载">
<ProTable
actionRef={checkRelationRef}
columns={columns}
size='small'
className="searchH"
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>
</>
);
}
export default FilesList;
export default FilesList;

View File

@ -1,86 +0,0 @@
import React , { useEffect,useState } from 'react';
import { Modal,Button } from 'antd';
import ProCard from '@ant-design/pro-card';
import FileDown from '@/utils/Download';
import {checkFileExist} from "../service"
interface fileManageDownLordModal {
fileId:string,
downLoadFileName:string,
modalVisible:boolean,
onCancel:any
}
const fileManageDownLordModal: React.FC<fileManageDownLordModal> = (props) => {
const {fileId,downLoadFileName,modalVisible,onCancel}=props
const [page, setPage] = useState<number>(1);
const [pages, setPages] = useState<number>(0);
const [fileExist, setFileExist] = useState<boolean>(false);
useEffect(() => {
checkFileExist(fileId).then(res => {
if (res !== undefined&&res.length>0){
setFileExist(true);
}else{
setFileExist(false);
}
})
},[fileId])
const onDocumentComplete = (pages:any) => {
setPage(1);
setPages(pages);
}
const handlePrevious = () => {
setPage(page-1);
}
const handleNext = () => {
setPage(page+1);
}
const downLoadFile =(fileId:string)=>{
const returnUrl = "/api/core-service-ebtp-updownload/v1/attachment/download/bid/"+fileId;
return returnUrl;
}
return (
<Modal
destroyOnClose
title={"预览"}
visible={modalVisible}
onCancel={() => onCancel()}
width={800}
footer={[
<>
<FileDown
key="downLoadFile"
type="zip"
apiUrl={downLoadFile(fileId)}
style={{"float":"left"}}
fileName={downLoadFileName}
btnName="下载"
method="GET"
form={null}
/>,
<Button disabled={page===1} key="preBtn" onClick={() => handlePrevious()}> </Button>
<Button disabled={page===pages} key="nextBtn" onClick={() => handleNext()}> </Button>
<Button key="close" onClick={() => onCancel()}></Button>
</>
]}
>
<ProCard
layout="center"
direction="column"
ghost
>
{fileExist?
"您所查看的文件可以下载!"
:"对不起,您所查看的文件不存在,请与系统管理员联系!"}
</ProCard>
</Modal>
);
};
export default fileManageDownLordModal;

View File

@ -3,11 +3,17 @@ import request from '@/utils/request';
* 查询数据并分页
* @param params
*/
export async function getPage(params?: any) {
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/bizbidshared/list',{
method: 'POST',
data:params,
data: {
...data,
pageNo: data?.current,
pageSize: data?.pageSize
},
});
}
@ -28,4 +34,12 @@ export async function checkFileExist(fileId?:any) {
return request('/api/core-service-ebtp-updownload/v1/attachment/find/bid/'+fileId,{
method:'GET' ,
})
}
// 下载之前记录下载
export async function addDownList(data?: any) {
return request('/api/biz-service-ebtp-extend/v1/bizbidsharedrecord/add', {
method: 'POST',
data: data,
})
}

View File

@ -1,86 +0,0 @@
import React , { useEffect,useState } from 'react';
import { Modal,Button } from 'antd';
import ProCard from '@ant-design/pro-card';
import FileDown from '@/utils/Download';
import {checkFileExist} from "../service"
interface fileManageDownLordModal {
fileId:string,
downLoadFileName:string,
modalVisible:boolean,
onCancel:any
}
const fileManageDownLordModal: React.FC<fileManageDownLordModal> = (props) => {
const {fileId,downLoadFileName,modalVisible,onCancel}=props
const [page, setPage] = useState<number>(1);
const [pages, setPages] = useState<number>(0);
const [fileExist, setFileExist] = useState<boolean>(false);
useEffect(() => {
checkFileExist(fileId).then(res => {
if (res !== undefined&&res.length>0){
setFileExist(true);
}else{
setFileExist(false);
}
})
},[fileId])
const onDocumentComplete = (pages:any) => {
setPage(1);
setPages(pages);
}
const handlePrevious = () => {
setPage(page-1);
}
const handleNext = () => {
setPage(page+1);
}
const downLoadFile =(fileId:string)=>{
const returnUrl = "/api/core-service-ebtp-updownload/v1/attachment/download/bid/"+fileId;
return returnUrl;
}
return (
<Modal
destroyOnClose
title={"预览"}
visible={modalVisible}
onCancel={() => onCancel()}
width={800}
footer={[
<>
<FileDown
key="downLoadFile"
type="zip"
apiUrl={downLoadFile(fileId)}
style={{"float":"left"}}
fileName={downLoadFileName}
btnName="下载"
method="GET"
form={null}
/>,
<Button disabled={page===1} key="preBtn" onClick={() => handlePrevious()}> </Button>
<Button disabled={page===pages} key="nextBtn" onClick={() => handleNext()}> </Button>
<Button key="close" onClick={() => onCancel()}></Button>
</>
]}
>
<ProCard
layout="center"
direction="column"
ghost
>
{fileExist?
"您所查看的文件可以下载!"
:"对不起,您所查看的文件不存在,请与系统管理员联系!"}
</ProCard>
</Modal>
);
};
export default fileManageDownLordModal;

View File

@ -1,31 +1,7 @@
import {BarsOutlined, UploadOutlined} from "@ant-design/icons"
import {
Button,
Card,
Checkbox,
Col,
Collapse,
DatePicker, Drawer,
Form, Image,
Input, List,
message,
Modal, Popover,
Radio,
Row,
Spin,
Upload
} from "antd"
import { Button, Collapse, Form, message, Modal, } from "antd"
import ProTable, { ActionType } from '@ant-design/pro-table';
import React, {useEffect, useRef, useState} from "react"
import style from './style.less'
import { DownLordList,addNotice,getPageInfo} from '../service'
import moment from "moment";
import Weboffice from "@/pages/webOffice/weboffice";
import request from '@/utils/request';
import FileDown from '@/utils/Download';
import {existingProblem} from "@/pages/Evaluation/expert/ReviewResults/Jury/service";
import {commonMessage} from "@/utils/MessageUtils";
import React, { useEffect, useRef, useState } from "react"
import { DownLordList, addNotice, getPageInfo } from '../service'
interface filesDownComponents {
modalVisible: boolean;
@ -35,237 +11,101 @@ interface filesDownComponents {
tpId: string;
pkId: string;
SX: () => void;
noticeTitle:String;
noticeContent:String;
noticeFile:String;
noticeTitle: String;
noticeContent: String;
noticeFile: String;
}
const layout = {
labelCol: {span: 7},
wrapperCol: {span: 10},
labelCol: { span: 7 },
wrapperCol: { span: 10 },
};
const filesDownComponents: React.FC<filesDownComponents> = (props) => {
const {Panel} = Collapse;
const {titleName, modalVisible, onCancel, type, tpId, pkId, SX} = props;
const [form] = Form.useForm();
const [spinning, setSping] = useState<boolean>();//加载遮罩
const [TpPackageId, setTpPackageId] = useState<any[]>([]); //标包信息
const [editInformation, setEditInformation] = useState<boolean>(false);//是否可编
const [editInformation4Change, setEditInformation4Change] = useState<boolean>(false);//是否可编
const [annoNature, setAnnoNature] = useState<number>(1);
const [TpPackageName, setTpPackageName] = useState<string>("招标");
const [choiceHallType, setChoiceHallType] = useState<boolean>(false);//选择开标大厅窗口状态
const [choiceHallData, setChoiceHallData] = useState<any>([]);//选择开标大厅窗口状态
const [docFileCode, setDocFileCode] = useState<string>("");//文档id
const [docBtnName, setDocBtnName] = useState<any>();//文档按钮文字
const [docReadOnly, setDocReadOnly] = useState<string>("false");//是否可编辑
const [docSaveBtn, setDocSaveBtn] = useState<string>("compact");//保存按钮是否展示
//操作数据后刷新列表
const checkRelationRef = useRef<ActionType>();
const { titleName, modalVisible, onCancel, type, tpId, pkId, SX } = props;
//操作数据后刷新列表
const checkRelationRef = useRef<ActionType>();
const columns: any = [
{
title: '序号',
valueType: 'index',
width:80
title: '序号',
valueType: 'index',
},
{
title: '使用角色',
dataIndex: 'recordRole',
width:220
},
{
title: '机构名称',
dataIndex: 'recordName',
width:220
title: '机构名称',
dataIndex: 'recordOrgName',
},
{
title: '下载人',
dataIndex: 'recordStaff',
width:220
},
{
title: '下载账号',
dataIndex: 'recordAccount',
width:220
},
dataIndex: 'recordName',
},
{
title: '上传日期',
dataIndex: 'createDate',
width:220
title: '下载账号',
dataIndex: 'recordAccount',
},
{
title: '下载日期',
dataIndex: 'createDate',
valueType: 'dateTime',
width: 220
}
]
/*weboffice 相关*/
const WebofficeRef = useRef<Weboffice>(null);
const onRef = (ref) => {
/* this.child= ref;*/
}
/*拉取数据 beg*/
useEffect(() => {
Int();
form.resetFields();//清除form中数据
}, [pkId, type]);
const Int = () => {
setSping(true);
if (type == "cease") {
return;
} else if (type == "new") {//==========================================================新建
setSping(false);
setDocBtnName("新建");
setAnnoNature(1);//公告类型
setEditInformation(false);//可编辑
} else if (type == "read") {//=========================================================查看
return;
} else if (type == "edit" || type == "change") {//==========================================================编辑
getPageInfo(pkId).then(res => {
if (res != null && res.message == "success") {
const data = res.data
form.setFieldsValue({
"id":pkId,
"sharedName": data.sharedName,
"sharedRole": data.sharedRole,
"sharedFile": data.sharedFile,
"sharedRemarks": data.sharedRemarks,
});
setDocBtnName("编辑");
//setDocFileCode(data.contentFileId);
setSping(false);
} else {
onCancel();
message.error('程序出错,请您稍后再试');
}
}
);
setAnnoNature(1);//公告类型
setEditInformation(false);//可编辑
}
};
/*拉取数据 end*/
/*提交数据*/
const onFinish = async (data: any) => {
form.validateFields().then(res => {
const fromData = {
"sharedName": form.getFieldValue("sharedName"),
"sharedRole": form.getFieldValue("sharedRole"),
"sharedFile": form.getFieldValue("sharedFile"),
"sharedRemarks": form.getFieldValue("sharedRemarks"),
"id": pkId,
}
addNotice(fromData).then(res => {
if (res != null && res.message == "success") {
message.success("成功");
setSping(true);
onCancel();
SX();
} else {
message.error("失败");
setSping(true);
onCancel();
}
});
}).catch(res => {
message.warn("您有未填写的选项!")
});
}
/*提交数据*/
const onSave = async (data: any) => {
form.validateFields().then(res => {
const fromData = {
"sharedName": form.getFieldValue("sharedName"),
"sharedRole": form.getFieldValue("sharedRole"),
"sharedFile": form.getFieldValue("sharedFile"),
"sharedRemarks": form.getFieldValue("sharedRemarks"),
}
addNotice(fromData).then(res => {
if (res != null && res.message == "success") {
message.success("成功");
setSping(true);
onCancel();
SX();
} else {
message.error("失败");
setSping(true);
onCancel();
}
});
}).catch(res => {
message.warn("您有未填写的选项!")
});
}
]
const renderFooter = () => {
if (type == "read") {
return (
<>
<Button onClick={onCancel}></Button>
</>
);
} else if(type == "edit"){
return (
<>
<Button onClick={onFinish}></Button>
<Button onClick={onCancel}></Button>
</>
);
}else if(type == "new"){
return (
<>
<Button onClick={onSave}></Button>
<Button onClick={onCancel}></Button>
<Button onClick={onCancel}></Button>
</>
);
}
}
return (
<>
<Modal
destroyOnClose={true}
getContainer={false}
title={titleName}
visible={modalVisible}
className="返回"
onCancel={() => onCancel()}
width={1000}
bodyStyle={{padding: '32px 40px 48px', height: "600px", overflowY: 'auto'}}
footer={renderFooter()}
>
<ProTable
actionRef={checkRelationRef}
columns={columns}
request={params => DownLordList(pkId,params)}
rowKey="id"
/>
</Modal>
<Modal
destroyOnClose={true}
getContainer={false}
title={titleName}
visible={modalVisible}
onCancel={() => onCancel()}
width={1000}
footer={renderFooter()}
>
<ProTable
actionRef={checkRelationRef}
columns={columns}
size='small'
className="searchH"
request={async (params) =>
await DownLordList(pkId, 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}
/>
</Modal>
</>
)
}
export default filesDownComponents

View File

@ -1,176 +1,114 @@
import React, { useEffect,useRef, useState, } from 'react';
import React, { useEffect, useRef, useState, } from 'react';
import ProTable, { ActionType } from '@ant-design/pro-table';
import FilesManageComponents from "./filesManageComponents"
import FilesDownComponents from "./filesDownComponents"
import FileManageDownLordModal from "./fileManageDownLordModal"
import request from '@/utils/request';
import { getPage,deleteById,downLord,DownLordList,topById,qxtopById } from '../service';
import { Space,Button, Card, Divider, Drawer, message, Modal, Spin, Table} from 'antd';
//import {getProId} from "@/utils/session";
//删除确认弹窗
import { getPage, deleteById, addDownList } from '../service';
import { Button, Card, message, Modal } from 'antd';
import FileDown from '@/utils/Download';
import { btnAuthority } from '@/utils/authority';
const filesManage: React.FC<{}> = () => {
const [deletetcid, handledeletetcid] = useState<any>();
const [deletetc, handledeletetc] = useState<boolean>(false); //删除数据弹窗
const checkRelationRef = useRef<ActionType>(); //操作数据后刷新列表
const [Refresh, setRefresh] = useState<any>(Math.random);
//删除数据弹窗
const [deletetcid, handledeletetcid] = useState<any>();
//删除数据弹窗
const [deletetc, handledeletetc] = useState<boolean>(false);
//操作数据后刷新列表
const checkRelationRef = useRef<ActionType>();
const [updateVisible, setUpdateVisible] = useState<boolean>(false)
const [DownLord, setDownLord] = useState<boolean>(false)
const [updateChange, setUpdateChange] = useState<string>('');//弹窗名
const [type, setType] = useState<any>('cease');//弹窗类型
const [pkId, setPkId] = useState<string>();//公告id
const [tpId, setTpId] = useState<any>();//项目id
const columns: any = [
{
title: '序号',
valueType: 'index',
},
{
title: '文档名称',
dataIndex: 'sharedName',
},
{
title: '使用角色',
dataIndex: 'sharedRole',
},
{
title: '上传日期',
dataIndex: 'createDate',
valueType: 'date',
},
{
title: '操作',
valueType: 'option',
width: 300,
render: (record: any) => {
if (record.props.text.sharedFile) {
return (
<>
<Button hidden={btnAuthority(['ebtp-system-admin'])} type="link" danger onClick={() => downList(record)}></Button>
<Button hidden={btnAuthority(['ebtp-system-admin'])} type="link" danger key="updateInfo" onClick={() => updateInfo(record)}></Button>
<Button hidden={btnAuthority(['ebtp-system-admin'])} type="link" danger key="deleteInfo" onClick={() => { handledeletetc(true); handledeletetcid(record) }}></Button>
<Button hidden={btnAuthority(['ebtp-system-admin'])} type="link" danger key="selectDownLord" onClick={() => selectDownLord(record)}></Button>
</>
)
} else {
return (
<>
<Button hidden={btnAuthority(['ebtp-system-admin'])} type="link" danger key="downLord" onClick={() => message.error('未上传文档,所以暂时无法下载!')}></Button>
<Button hidden={btnAuthority(['ebtp-system-admin'])} type="link" danger key="updateInfo" onClick={() => updateInfo(record)}></Button>
<Button hidden={btnAuthority(['ebtp-system-admin'])} type="link" danger key="deleteInfo" onClick={() => { handledeletetc(true); handledeletetcid(record) }}></Button>
<Button hidden={btnAuthority(['ebtp-system-admin'])} type="link" danger key="selectDownLord" onClick={() => selectDownLord(record)}></Button>
</>
)
}
},
}
]
const [updateVisible, setUpdateVisible] = useState<boolean>(false)
const [DownLord, setDownLord] = useState<boolean>(false)
const [updateChange, setUpdateChange] = useState<string>('');//弹窗名
const [type, setType] = useState<any>('cease');//弹窗类型
const [pkId, setPkId] = useState<string>();//公告id
const [tpId, setTpId] = useState<any>();//项目id
const [dataSource, setdataSource] = useState<any[]>([]); //公告列表数据
const [dataSourcePage, setDataSourcePage] = useState<any>(1);//当前页数
const [dataSourceAllNum, setDataSourceAllNum] = useState<any>();//总行数
const [dataSourceNum, setDataSourceNum] = useState<any>(20);//当前每页行数
const [ChangeNoticeListVisible, setChangeNoticeListVisible] = useState<boolean>(false); //变更公告列表窗状态
const [ChangeNoticeListdataSource, setChangeNoticeListdataSource] = useState<any[]>([]); //变更公告列表数据
const [pageloading, setPageloading] = useState<boolean>(false);//加载遮罩
//预览窗口显示
const [previewJgtzsFormVisible, setPreviewJgtzsFormVisible] = useState<any>(false);
const [fileId, setFileId] = useState<any>("");
const [downLoadFileName, setDownLoadFileName] = useState<any>("");
const clickJgtzs=(sharedFile:any,sharedName:any)=>{
setFileId(sharedFile);
setDownLoadFileName(sharedName);
// setFileId("8d40d4ec-cacb-4917-b5e2-80e38b3d4803");
setPreviewJgtzsFormVisible(true);
const downList = async (val: any) => {
let data = {
id: val.props.text.id
}
await addDownList(data).then((res) => {
if (res.code == 200) {
window.location.href = '/api/core-service-ebtp-updownload/v1/attachment/download/bid/'+val.props.text.sharedFile
}
})
}
const columns: any = [
{
title: '序号',
valueType: 'index',
width:80
},
{
title: '文档名称',
dataIndex: 'sharedName',
width:220
},
{
title: '使用角色',
dataIndex: 'sharedRole',
width:220
},
{
title: '上传日期',
dataIndex: 'createDate',
width:220
},
{
title: '操作',
valueType: 'option',
width:100,
render: (record: any) => (
<Space size="middle">
{/* <>
<Button size='small' type="primary" onClick={() => clickJgtzs(record.noticePdfFileId,record.sharedName)}>下载</Button>
</> */}
<a key="downLord" onClick={() => filedownLord(record)}>
</a>
<a key="updateInfo" onClick={() => updateInfo(record)}>
</a>
<a key="deleteInfo" onClick={() =>{handledeletetc(true);handledeletetcid(record)}}>
</a>
<a key="selectDownLord" onClick={() => selectDownLord(record)}>
</a>
</Space>
),
}
]
/**
* 刷新
* @param data
*/
const sx = async () => {
checkRelationRef.current?.reload();
}
/**
* 刷新
* @param data
*/
const sx = async() => {
checkRelationRef.current?.reload();
}
/**
* 删除
* @param data
*/
const deleteInfo = async (data: any) => {
await deleteById(data.props.text.id)
checkRelationRef.current?.reload();
}
/**
* 修改
* @param data
*/
const updateInfo = async(data: any) => {
setUpdateVisible(true);
setPkId(data.props.text.id);
setUpdateChange('修改共享文档')
setType("edit");
/**
* 下载记录
* @param data
*/
const selectDownLord = async (data: any) => {
setType("read");
setDownLord(true);
setPkId(data.props.text.id);
setUpdateChange('查询下载记录')
}
}
/**
* 删除
* @param data
*/
const deleteInfo = async(data:any) => {
await deleteById(data.props.text.id)
checkRelationRef.current?.reload();
}
/**
* 下载
* @param data
*/
const filedownLord = async(data: any) => {
await clickJgtzs(data.props.text.sharedFile,data.props.text.sharedName)
await downLord(data);
checkRelationRef.current?.reload();
}
/**
* 下载记录
* @param data
*/
const selectDownLord = async(data:any) => {
setType("read");
setDownLord(true);
setPkId(data.props.text.id);
setUpdateChange('查询下载记录')
//await DownLordList(data)
// checkRelationRef.current?.reload();
}
/**
* 置顶
* @param data
*/
const zhiding = async(data: any) => {
await topById(data.props.text.id)
checkRelationRef.current?.reload();
}
/**
* 取消置顶
* @param data
*/
const closezhiding = async(data:any) => {
await qxtopById(data.props.text.id)
checkRelationRef.current?.reload();
}
/**
* 删除数据
* @param fields
*/
const recall = async (data: any) => {
/**
* 删除数据
* @param fields
*/
const recall = async (data: any) => {
const hide = message.loading('正在删除');
await deleteInfo(data);
try {
@ -184,103 +122,111 @@ const recall = async (data: any) => {
}
};
/*拉取数据 beg*/
// useEffect(() => {
// GetList("page")
// }, [])
const GetList = (props: any) => {
setPageloading(true);
if (props == "page") {//初始化页面
getPage({}).then(res => {
if (res != null && res.message == "success") {
setdataSource(res.data.records)
setDataSourceAllNum(res.total)
} else {
message.error('程序出错,请您稍后再试');
}
setPageloading(false);
})
} else {
getPage({ }).then(res => {
if (res.message == "success" && res.data != null) {
setChangeNoticeListdataSource(res.data.records);
setPageloading(false);
} else {
message.error('程序出错,请您稍后再试');
setChangeNoticeListVisible(false);
setPageloading(false);
}
})
}
}
/*新增通知公告*/
const toEditAdd = (props: any) => {
setUpdateVisible(true);
setUpdateChange('新建共享文档')
setType("new");
}
return (
<>
<ProTable
actionRef={checkRelationRef}
/**
* 修改
* @param data
*/
const updateInfo = async (data: any) => {
setUpdateVisible(true);
setPkId(data.props.text.id);
setUpdateChange('修改共享文档')
setType("edit");
}
toolBarRender={() => [
<Button type="primary" onClick={() => toEditAdd([])}></Button>,
]}
columns={columns}
request={params => getPage(params)}
rowKey="id"
/>
<Modal
getContainer={false}
width={200}
centered
visible={deletetc}
onCancel={() => handledeletetc(false)}
onOk={async () => {
const success = await recall(deletetcid);
if (success) {
handledeletetc(false);
if (checkRelationRef.current) {
checkRelationRef.current.reload();
}
}
}}
>
</Modal>
{previewJgtzsFormVisible?
<FileManageDownLordModal
fileId={fileId}
downLoadFileName={downLoadFileName}
modalVisible={previewJgtzsFormVisible}
onCancel={() => {
setFileId("");
setPreviewJgtzsFormVisible(!previewJgtzsFormVisible);
useEffect(() => {
}, []);
return (
<>
<Card title="共享文档管理">
<ProTable
actionRef={checkRelationRef}
columns={columns}
size='small'
className="searchH"
search={{
labelWidth: 'auto',
span: 6,
optionRender: (searchConfig: any, { form }) => {
return [
<Button
key="searchText"
type="primary"
onClick={() => {
form?.submit();
}}
>
{searchConfig?.searchText}
</Button>,
<Button
key="resetText"
onClick={() => {
form?.resetFields();
searchConfig?.onReset();
}}
>
{searchConfig?.resetText}
</Button>,
<Button hidden={btnAuthority(['ebtp-system-admin'])} type="primary" onClick={() => toEditAdd([])}></Button>
];
},
}}
>
</FileManageDownLordModal>
:null}
<FilesManageComponents key={Math.random()} SX={()=>sx()} titleName={updateChange} pkId={pkId} type={type} tpId={tpId}
onCancel={() => setUpdateVisible(false)} modalVisible={updateVisible}/>
<FilesDownComponents key={Math.random()} SX={()=>sx()} titleName={updateChange} pkId={pkId} type={type} tpId={tpId}
onCancel={() => setDownLord(false)} modalVisible={DownLord}/>
</>
);
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>
<Modal
getContainer={false}
width={200}
centered
visible={deletetc}
onCancel={() => handledeletetc(false)}
onOk={async () => {
const success = await recall(deletetcid);
if (success) {
handledeletetc(false);
if (checkRelationRef.current) {
checkRelationRef.current.reload();
}
}
}}
>
</Modal>
<FilesManageComponents key={Math.random()} SX={() => sx()} titleName={updateChange} pkId={pkId} type={type}
onCancel={() => setUpdateVisible(false)} modalVisible={updateVisible} />
<FilesDownComponents key={Math.random()} SX={() => sx()} titleName={updateChange} pkId={pkId} type={type}
onCancel={() => setDownLord(false)} modalVisible={DownLord} />
</>
)
}
export default filesManage;

View File

@ -1,309 +1,229 @@
import {BarsOutlined, UploadOutlined} from "@ant-design/icons"
import {
Button,
Card,
Checkbox,
Col,
Collapse,
DatePicker, Drawer,
Form, Image,
Input, List,
message,
Modal, Popover,
Radio,
Row,
Spin,
Upload
} from "antd"
import ProTable, { ActionType } from '@ant-design/pro-table';
import React, {useEffect, useRef, useState} from "react"
import style from './style.less'
import { DownLordList,addNotice,getPageInfo} from '../service'
import moment from "moment";
import Weboffice from "@/pages/webOffice/weboffice";
import request from '@/utils/request';
import FileDown from '@/utils/Download';
import {existingProblem} from "@/pages/Evaluation/expert/ReviewResults/Jury/service";
import {commonMessage} from "@/utils/MessageUtils";
import { Button, Checkbox, Form, Input, message, Modal, Spin } from "antd"
import React, { useEffect, useState } from "react"
import { addNotice, getPageInfo, scopePage } from '../service'
import ExtendUpload from "@/utils/ExtendUpload";
const { TextArea } = Input;
interface filesManageComponents {
modalVisible: boolean;
titleName: string;
onCancel: () => void;
type: string;
tpId: string;
pkId: string;
SX: () => void;
noticeTitle:String;
noticeContent:String;
noticeFile:String;
noticeTitle: String;
noticeContent: String;
noticeFile: String;
}
const layout = {
labelCol: {span: 7},
wrapperCol: {span: 10},
labelCol: { span: 7 },
wrapperCol: { span: 10 },
};
const filesManageComponents: React.FC<filesManageComponents> = (props) => {
const {Panel} = Collapse;
const {titleName, modalVisible, onCancel, type, tpId, pkId, SX} = props;
const { titleName, modalVisible, onCancel, type, pkId, SX } = props;
const [form] = Form.useForm();
const [spinning, setSping] = useState<boolean>();//加载遮罩
const [editInformation, setEditInformation] = useState<boolean>(false);//是否可编
const [editInformation4Change, setEditInformation4Change] = useState<boolean>(false);//是否可编
const [annoNature, setAnnoNature] = useState<number>(1);
const [docBtnName, setDocBtnName] = useState<any>();//文档按钮文字
const [filePath, setFilePath] = useState<any>(); // 文件回显
const [spinning, setSping] = useState<boolean>(false);//加载遮罩
const [roles, seRoles] = useState<any>([]); // 角色
/*20210112 新增 发布媒体限制*/
const [mediaType,setmediaType] =useState<any>(false);
/*weboffice 相关*/
const WebofficeRef = useRef<Weboffice>(null);
const onRef = (ref) => {
/* this.child= ref;*/
}
/*拉取数据 beg*/
useEffect(() => {
Int();
rolesList();
form.resetFields();//清除form中数据
}, [pkId, type]);
const Int = () => {
setSping(true);
if (type == "cease") {
return;
} else if (type == "new") {//==========================================================新建
setSping(false);
setDocBtnName("新建");
setAnnoNature(1);//公告类型
setEditInformation(false);//可编辑
} else if (type == "read") {//=========================================================查看
return;
} else if (type == "edit" || type == "change") {//==========================================================编辑
if (type == "edit") {// 编辑
getPageInfo(pkId).then(res => {
if (res != null && res.message == "success") {
const data = res.data
form.setFieldsValue({
"id":pkId,
"id": pkId,
"sharedName": data.sharedName,
"sharedRole": data.sharedRole,
"sharedRoles": data.sharedRoles.split(","),
"sharedFile": data.sharedFile,
"sharedRemarks": data.sharedRemarks,
});
setDocBtnName("编辑");
//setDocFileCode(data.contentFileId);
setSping(false);
setFilePath(data.sharedFile)
} else {
onCancel();
message.error('程序出错,请您稍后再试');
}
}
);
setAnnoNature(1);//公告类型
setEditInformation(false);//可编辑
}
};
/*拉取数据 end*/
});
}
};
const rolesList = () => {
if (type == "edit" || type == "new") {
let data = {
roleScope: "EBTP"
}
scopePage(data).then(res => {
if (res.success) {
let options: any = []
res.data.records.map((item: any, index: any) => {
options.push({ label: item.roleName, value: item.roleCode })
})
seRoles(options)
Int()
} else {
message.error(res.message)
}
});
}
};
/*提交数据*/
const onFinish = async (data: any) => {
form.validateFields().then(res => {
setSping(true);
const fromData = {
"sharedName": form.getFieldValue("sharedName"),
"sharedRoles": form.getFieldValue("sharedRoles"),
"roles": form.getFieldValue("sharedRoles"),
"sharedFile": form.getFieldValue("sharedFile"),
"sharedRemarks": form.getFieldValue("sharedRemarks"),
"id": pkId,
}
addNotice(fromData).then(res => {
if (res != null && res.message == "success") {
message.success("成功");
setSping(true);
message.success("修改成功");
setSping(false);
onCancel();
SX();
} else {
message.error("失败");
setSping(true);
message.error("修改失败");
setSping(false);
onCancel();
}
}).finally(() => {
setSping(false)
});
}).catch(res => {
message.warn("您有未填写的选项!")
});
}
/*提交数据*/
const onSave = async (data: any) => {
form.validateFields().then(res => {
setSping(true);
const fromData = {
"sharedName": form.getFieldValue("sharedName"),
"sharedRoles": form.getFieldValue("sharedRoles"),
"roles": form.getFieldValue("sharedRoles"),
"sharedFile": form.getFieldValue("sharedFile"),
"sharedRemarks": form.getFieldValue("sharedRemarks"),
}
addNotice(fromData).then(res => {
if (res != null && res.message == "success") {
message.success("成功");
setSping(true);
message.success("新增成功");
setSping(false);
onCancel();
SX();
} else {
message.error("失败");
setSping(true);
message.error("新增失败");
setSping(false);
onCancel();
}
}).finally(() => {
setSping(false)
});
}).catch(res => {
message.warn("您有未填写的选项!")
});
}
const renderFooter = () => {
if (type == "read") {
if (type == "edit") {
return (
<>
<Button onClick={onCancel}></Button>
</>
);
} else if(type == "edit"){
return (
<>
<Button onClick={onFinish}></Button>
<Button onClick={onFinish} loading={spinning}></Button>
<Button onClick={onCancel}></Button>
</>
);
}else if(type == "new"){
} else if (type == "new") {
return (
<>
<Button onClick={onSave}></Button>
<Button onClick={onSave} loading={spinning}></Button>
<Button onClick={onCancel}></Button>
</>
);
}
}
const onChangeCheckBox = (checkedList:any) =>{
console.log(checkedList);
const onChangeCheckBox = (checkedList: any) => {
}
return (
<>
<Modal
destroyOnClose={true}
getContainer={false}
title={titleName}
visible={modalVisible}
className="返回"
onCancel={() => onCancel()}
width={1000}
bodyStyle={{padding: '32px 40px 48px', height: "600px", overflowY: 'auto'}}
footer={renderFooter()}
>
<Spin spinning={spinning}>
<Card>
<Form
{...layout}
name="basic"
form={form}
>
<Form.Item
label="文档名称"
name="sharedName"
validateStatus="error"
rules={[
{
required: true,
message: '当前项不可为空',
},
]}
<Modal
destroyOnClose={true}
getContainer={false}
title={titleName}
visible={modalVisible}
className="返回"
onCancel={() => onCancel()}
width={1000}
footer={renderFooter()}
>
<Spin spinning={spinning}>
<Form
{...layout}
name="basic"
form={form}
>
<Input readOnly={editInformation || editInformation4Change}/>
</Form.Item>
<Form.Item
label="使用角色"
name="sharedRoles"
validateStatus="error"
rules={[
{
required: true,
message: '当前项不可为空',
},
]}
>
<Checkbox.Group style={{width: '100%'}}
disabled={editInformation || editInformation4Change}
onChange={onChangeCheckBox}
<Form.Item
label="文档名称"
name="sharedName"
rules={[
{
required: true,
message: '当前项不可为空',
},
]}
>
<Input maxLength={255} />
</Form.Item>
<Form.Item
label="使用角色"
name="sharedRoles"
// rules={[
// {
// required: true,
// message: '当前项不可为空',
// },
// ]}
>
<Checkbox.Group style={{ width: '100%' }}
onChange={onChangeCheckBox}
options={roles}
>
<Row style={{width: '100%'}} >
<Col span={24}>
<Checkbox disabled={mediaType} key={"1"} value="招标人"></Checkbox>
</Col>
<Col span={24}>
<Checkbox disabled={mediaType} key={"2"} value="招标代理机构"></Checkbox>
</Col>
<Col span={24}>
<Checkbox disabled={mediaType} key={"3"} value="投标人"></Checkbox>
</Col>
<Col span={24}>
<Checkbox disabled={mediaType} key={"5"} value="监督人员"></Checkbox>
</Col>
<Col span={24}>
<Checkbox disabled={mediaType} key={"6"} value="平台运维"></Checkbox>
</Col>
<Col span={24}>
<Checkbox disabled={mediaType} key={"7"} value="专家"></Checkbox>
</Col>
</Row>
</Checkbox.Group>
</Form.Item>
<Form.Item
label="备注"
name="sharedRemarks"
>
<Input readOnly={editInformation || editInformation4Change}/>
</Form.Item>
<Form.Item
label="共享文档"
name="sharedFile"
>
<div className={style.bidding}>
<div className="uploadTotal">
<Upload>
<Button type="primary" disabled={editInformation || editInformation4Change}
className="upload"><UploadOutlined/></Button>
</Upload>
<p className="uploadLabel">10M文件</p>
</div>
</div>
</Form.Item>
</Form>
</Card>
</Spin>
</Modal>
</Checkbox.Group>
</Form.Item>
<Form.Item
label="备注"
name="sharedRemarks"
>
<TextArea maxLength={255} rows={3} />
</Form.Item>
<Form.Item
label="共享文档"
name="sharedFile"
extra="最多上传一个文件每个最大200MB"
>
<ExtendUpload btnName="上传" bid={filePath} maxSize={200} maxCount={1} uploadProps={{ disabled: false }}>
</ExtendUpload>
</Form.Item>
</Form>
</Spin>
</Modal>
</>
)
}
export default filesManageComponents

View File

@ -1,69 +0,0 @@
//新增招标公告
.bidding {
margin-bottom: 8px;
:global {
.biddingLabel {
width: 30%;
display: inline-block;
text-align: right;
// padding-left: 20px;
padding-right: 10px;
}
.biddingIndex {
width: 40%;
display: inline-block;
justify-content: right;
}
.biddingDatePicker {
width: 40%;
}
.biddingRadio {
// display: inline-block;
width: 40%;
margin-top:24px;
}
.ant-row .ant-col {
margin: 6px 0px;
}
.uploadTotal {
display: inline-block;
width: 40%;
.upload {
--antd-wave-shadow-color:#1c84c6;
background: #1c84c6;
color:#fff;
border-color: #1c84c6;
}
.uploadLabel {
// display: inline;
font-size: 13px;
color: #c8ced1;
margin-top: 5px;
}
}
}
}
.announcementFootButton {
:global{
display: flex;
justify-content: center;
margin-top: 15px;
.save{
--antd-wave-shadow-color:#f7ab59;
background: #f7ab59;
color:#fff;
border-color: #f7ab59;
}
}
}
//招标公告
.label {
:global {
color:#f62a2b;
}
}
.ant-pro-table-toolbar {
:global {
margin: -12px 0px;
}
}

View File

@ -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/bizbidshared/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/bizbidshared/list', {
method: 'POST',
data:params,
data: {
...data,
pageNo: data?.current,
pageSize: data?.pageSize
},
});
}
@ -16,7 +22,7 @@ export async function getPage(params?: any) {
* @param params
*/
export async function getPageInfo(params: String) {
return request('/api/biz-service-ebtp-extend/v1/bizbidshared/'+params,{
return request('/api/biz-service-ebtp-extend/v1/bizbidshared/' + params, {
method: 'GET',
});
}
@ -26,10 +32,10 @@ export async function getPageInfo(params: String) {
* @param params
*/
export async function addNotice(params?: any) {
return request('/api/biz-service-ebtp-extend/v1/bizbidshared/add',{
return request('/api/biz-service-ebtp-extend/v1/bizbidshared/add', {
method: 'POST',
data:params,
data: params,
});
}
@ -38,7 +44,7 @@ export async function addNotice(params?: any) {
* @param params
*/
export async function deleteById(id: any) {
return request('/api/biz-service-ebtp-extend/v1/bizbidshared/delete/' + id,{
return request('/api/biz-service-ebtp-extend/v1/bizbidshared/delete/' + id, {
method: 'POST',
});
}
@ -49,9 +55,9 @@ export async function deleteById(id: any) {
* @param params
*/
export async function downLord(params?: any) {
return request('/api/biz-service-ebtp-extend/v1/bizbidsharedrecord/add',{
return request('/api/biz-service-ebtp-extend/v1/bizbidsharedrecord/add', {
method: 'POST',
data:params.props.text,
data: params.props.text,
});
}
@ -59,38 +65,37 @@ export async function downLord(params?: any) {
* 下载记录
* @param params
*/
export async function DownLordList(id:String,params?: any) {
return request('/api/biz-service-ebtp-extend/v1/bizbidsharedrecord/list/'+id,{
method: 'POST',
data:params,
});
}
export async function DownLordList(id: String, data?: any) {
/**
* 置顶
* @param params
*/
export async function topById(id: any) {
return request('/api/biz-service-ebtp-extend/v1/bizbidnotice/top/' + id,{
method: 'POST',
});
}
/**
* 取消置顶
* @param params
*/
export async function qxtopById(id: any) {
return request('/api/biz-service-ebtp-extend/v1/bizbidnotice/qxtop/' + id,{
return request('/api/biz-service-ebtp-extend/v1/bizbidsharedrecord/list/' + id, {
method: 'POST',
data: {
...data,
pageNo: data?.current,
pageSize: data?.pageSize
},
});
}
//检验文档中心是否存在该文档
export async function checkFileExist(fileId?:any) {
return request('/api/core-service-ebtp-updownload/v1/attachment/find/bid/'+fileId,{
method:'GET' ,
export async function checkFileExist(fileId?: any) {
return request('/api/core-service-ebtp-updownload/v1/attachment/find/bid/' + fileId, {
method: 'GET',
})
}
// 下载之前记录下载
export async function addDownList(data?: any) {
return request('/api/biz-service-ebtp-extend/v1/bizbidsharedrecord/add', {
method: 'POST',
data: data,
})
}
//新增角色列表
export async function scopePage(data: any) {
return request('/api/core-service-usercenter-public/v1.0/role/scopePage', {
method: 'POST',
data: data,
})
}