4.1 同步发版内容到天梯

This commit is contained in:
jl-zhoujl2
2022-04-01 20:06:34 +08:00
parent a3b939d154
commit 7b3efe00dd
128 changed files with 929 additions and 5029 deletions

View File

@ -20,6 +20,7 @@ import { getEditStatus, selectAnnoById, selectDocumentsById } from './service';
import '@/utils/lq.style.less';
import moment from "moment";
import ApprovalAttachment from '../ApprovalAttachment/ApprovalAttachment';
import { downloadFileObjectId } from '@/utils/DownloadUtils';
const { Panel } = Collapse;
/**
@ -95,29 +96,6 @@ const ProcurementRequirementsArePublicized: React.FC = () => {
window.parent.postMessage("{'height':" + document.documentElement.scrollHeight + "}", '*');
}, []);
//weboffice变更文件名称下载方法
const getFileList = (bid: any, fileName: any) => {
window.fetch(`/api/core-service-ebtp-updownload/v1/attachment/download/bid/${bid}`, {
method: "GET",
headers: {
// JwtToken: getSessionUserData() == null ? null : getSessionUserData().userId,
Authorization: getUserToken(),
currentRoleCode: getSessionRoleData()?.roleCode,
},
credentials: 'include',
}).then((response) => {
// 这里才是下载附件逻辑处理的地方
response.blob().then(blob => {
const blobUrl = window.URL.createObjectURL(blob);
const aElement = document.createElement("a");
aElement.href = blobUrl; // 设置a标签路径
aElement.download = fileName;
aElement.click();
window.URL.revokeObjectURL(blobUrl);
});
});
}
return (
<Card bordered={false} bodyStyle={{ padding: '0 200px', borderRadius: 6 }}>
<h2 style={{ textAlign: 'center', marginTop: 10 }}></h2>
@ -222,7 +200,7 @@ const ProcurementRequirementsArePublicized: React.FC = () => {
label="正文"
labelStyle={{ textAlign: 'center' }}
>
<a style={{ color: "#b30000" }} key="zhengwen" onClick={() => getFileList(item?.contentFileId, `${item?.documentName}(正文).doc`)}>{item?.documentName}().doc</a>
<a style={{ color: "#b30000" }} key="zhengwen" onClick={() => downloadFileObjectId(item?.contentFileId)}>{item?.documentName}().doc</a>
</Descriptions.Item>
</Descriptions>
})}

View File

@ -2,11 +2,13 @@ import React, { useEffect, useState } from 'react';
import { Upload, Button, message, Modal, Spin } from "antd";
import { UploadOutlined, CloseSquareOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
import { createNewFileBid, removeFileByOid, getFileListByBid, saveAttachment } from "./service"
import { saveAttachment } from "./service"
import { getSessionRoleData, getUserToken } from '@/utils/session';
import { UploadProps } from 'antd/lib/upload/interface';
import { downloadFile, getFileListByBid, uploadAttachmentPath } from '@/utils/DownloadUtils';
import { createNewFileBid, removeFileByOid } from '@/services/download_';
interface ApprovalAttachmentProps {
primaryKey?: string,
@ -149,50 +151,29 @@ const ApprovalAttachment: React.FC<ApprovalAttachmentProps> = (props) => {
return promise;
}
const fileDownLoad = (file: any) => {
window.fetch(file.url, {
method: "GET",
headers: {
// JwtToken: getSessionUserData() == null ? null : getSessionUserData().userId,
Authorization: getUserToken(),
currentRoleCode: getSessionRoleData()?.roleCode,
},
credentials: 'include',
}).then((response) => {
// 这里才是下载附件逻辑处理的地方
response.blob().then(blob => {
const blobUrl = window.URL.createObjectURL(blob);
const aElement = document.createElement("a");
const filename = file.name; // 设置文件名称
aElement.href = blobUrl; // 设置a标签路径
aElement.download = filename;
aElement.click();
window.URL.revokeObjectURL(blobUrl);
});
});
}
return (
<>
<Spin spinning={spin}>
<Upload
{...uploadProps}
key={"file" + returnValue}
action="/api/core-service-ebtp-updownload/v1/attachment/upload/"
data={{ businessId: returnValue }}
action={uploadAttachmentPath}
data={{
appCode: 'ebtp-cloud-frontend',
objectId: returnValue,
}}
headers={{
// JwtToken: getSessionUserData() == null ? null : getSessionUserData().userId,
Authorization: getUserToken(),
currentRoleCode: getSessionRoleData()?.roleCode,
}}
name="file"
name="multipartFiles"
beforeUpload={fileBeforeUpload}
onChange={fileChange}
onRemove={fileRemove}
showUploadList={{
removeIcon: <CloseSquareOutlined />,
}}
onPreview={fileDownLoad}
onPreview={downloadFile}
fileList={fileList}
>
{!uploadProps?.disabled ?

View File

@ -1,48 +1,5 @@
import request from '@/utils/request';
//获取项目所有公告信息
//params项目id项目类别id
//projectId
//roomType
export async function createNewFileBid() {
return request('/api/core-service-ebtp-updownload/v1/business/id', {
method: 'get',
});
}
//按照oid删除文件
export async function removeFileByOid(oid?: string) {
return request('/api/core-service-ebtp-updownload/v1/attachment/item/' + oid, {
method: 'delete',
});
}
//根据bid获取文件列表返回给ExtendUpload组件
export async function getFileListByBid(Bid: string) {
let result: { uid: any; name: any; status: string; url: string }[] = [];
if (Bid == null || Bid == '' || Bid == undefined) {
return [];
}
return request('/api/core-service-ebtp-updownload/v1/attachment/find', {
method: 'post',
data: {
bidList: [Bid],
},
}).then((res) => {
if (res?.[Bid]?.length > 0) {
for (let i = 0; i < res[Bid].length; i++) {
result.push({
uid: res[Bid][i].id,
name: res[Bid][i].filename,
status: 'done',
url: '/api/core-service-ebtp-updownload/v1/attachment/download/oid/' + res[Bid][i].id,
});
}
return result;
}
return [];
});
}
/**
* 保存并修改审批单附件id
* @param id

View File

@ -21,6 +21,7 @@ import '@/utils/lq.style.less';
import moment from "moment";
import ApprovalAttachment from '../ApprovalAttachment/ApprovalAttachment';
import { getEditStatus } from '../Announcement/service';
import { downloadFileObjectId } from '@/utils/DownloadUtils';
const { Panel } = Collapse;
/**
@ -96,29 +97,6 @@ const ProcurementRequirementsArePublicized: React.FC = () => {
window.parent.postMessage("{'height':" + document.documentElement.scrollHeight + "}", '*');
}, []);
//weboffice变更文件名称下载方法
const getFileList = (bid: any, fileName: any) => {
window.fetch(`/api/core-service-ebtp-updownload/v1/attachment/download/bid/${bid}`, {
method: "GET",
headers: {
// JwtToken: getSessionUserData() == null ? null : getSessionUserData().userId,
Authorization: getUserToken(),
currentRoleCode: getSessionRoleData()?.roleCode,
},
credentials: 'include',
}).then((response) => {
// 这里才是下载附件逻辑处理的地方
response.blob().then(blob => {
const blobUrl = window.URL.createObjectURL(blob);
const aElement = document.createElement("a");
aElement.href = blobUrl; // 设置a标签路径
aElement.download = fileName;
aElement.click();
window.URL.revokeObjectURL(blobUrl);
});
});
}
return (
<Card bordered={false} bodyStyle={{ padding: '0 200px', borderRadius: 6 }}>
<h2 style={{ textAlign: 'center', marginTop: 10 }}></h2>
@ -223,7 +201,7 @@ const ProcurementRequirementsArePublicized: React.FC = () => {
label="正文"
labelStyle={{ textAlign: 'center' }}
>
<a style={{ color: "#b30000" }} key="zhengwen" onClick={() => getFileList(item?.contentFileId, `${item?.documentName}(正文).doc`)}>{item?.documentName}().doc</a>
<a style={{ color: "#b30000" }} key="zhengwen" onClick={() => downloadFileObjectId(item?.contentFileId)}>{item?.documentName}().doc</a>
</Descriptions.Item>
</Descriptions>
})}

View File

@ -1,10 +1,10 @@
import React, { useEffect, useState } from 'react';
import { Card, Collapse, Descriptions } from 'antd';
import { getFileListByBid, getViewData } from './service';
import { getUserToken } from '@/utils/session';
import { getViewData } from './service';
import { getURLInformation } from '@/utils/CommonUtils';
import BasicInformation from '../BasicInformation/BasicInformation';
import moment from "moment";
import ExtendUpload from '@/utils/ExtendUpload';
const ExternalReference: React.FC<{}> = (props) => {
//显示的数据
@ -17,45 +17,16 @@ const ExternalReference: React.FC<{}> = (props) => {
evaluationStartTime: '',
isAgreement: '',
});
//上传文件列表
const [fileListData, setFileListData] = useState<any[]>([]);
//说明文件fileId
const [fileId, setFileId] = useState<string>('');
//审批单id
const [processInstanceId, setProcessInstanceId] = useState<string>('');
//标段采购包包件
const [sectionName, setSectionName] = useState<any>('采购包');
//评审评标谈判
const [sectionType, setSectionType] = useState<any>('评审');
const token = getUserToken();
const { Panel } = Collapse;
//根据bid获取到oid列表
const getOidList = async (param: any) => {
if (param == undefined || param == '' || param == null) {
} else {
let list: any[] = [];
list.push(param);
await getFileListByBid({ bidList: list }).then((res) => {
let data = res[param];
let list: any[] = [];
if (data.length == 0) {
setFileListData([]);
} else {
data.forEach((ele: any) => {
list.push({
uid: ele.id,
name: ele.filename,
status: 'done',
oid: ele.id,
businessId: ele.bid,
url: `/api/core-service-ebtp-updownload/v1/attachment/download/oid/${ele.id}?Authorization=${token}`,
});
});
setFileListData(list);
}
});
}
};
useEffect(() => {
const param = {
// id: '1367283840111869952',
@ -74,7 +45,7 @@ const ExternalReference: React.FC<{}> = (props) => {
} else if (MethodDict == 'procurement_mode_4') {
setSectionName('包件');
}
getOidList(data?.uploadFileId);
setFileId(data?.uploadFileId)
setProcessInstanceId(data?.instanceId);
setDesData({
projectName: data?.projectName,
@ -87,7 +58,7 @@ const ExternalReference: React.FC<{}> = (props) => {
});
}
});
window.parent.postMessage("{'height':"+document.documentElement.scrollHeight+"}",'*'  );
window.parent.postMessage("{'height':" + document.documentElement.scrollHeight + "}", '*');
}, []);
return (
<Card bordered={false} bodyStyle={{ padding: '0 200px', borderRadius: 6 }}>
@ -144,15 +115,7 @@ const ExternalReference: React.FC<{}> = (props) => {
label="说明文件"
labelStyle={{ textAlign: 'center' }}
>
{fileListData.length == 0
? '-'
: fileListData.map((e) => (
<a
href={`/api/core-service-ebtp-updownload/v1/attachment/download/oid/${e.oid}?Authorization=${token}`}
>
{e.name}
</a>
))}
<ExtendUpload bid={fileId} uploadProps={{ disabled: true }} />
</Descriptions.Item>
</Descriptions>
</Panel>

View File

@ -1,15 +1,4 @@
import request from '@/utils/request';
/**
* 根据bid获取文件列表
* @param params
*/
export async function getFileListByBid(params: any) {
return request('/api/core-service-ebtp-updownload/v1/attachment/find', {
method: 'POST',
data: {...params}
});
}
/**
* 查看审批流程内嵌-查看重新评审查询

View File

@ -1,16 +1,5 @@
import request from '@/utils/request';
/**
* 根据bid获取文件列表
* @param params
*/
export async function getFileListByBid(params: any) {
return request('/api/core-service-ebtp-updownload/v1/attachment/find', {
method: 'POST',
data: {...params}
});
}
/**
* 查询失败公告信息
* @param params

View File

@ -12,9 +12,10 @@ import React, { useEffect, useState } from 'react';
import BasicInformation from '../BasicInformation/BasicInformation';
import { selectDefaultNameByBidMethodDict, selectNameByBidMethodDict } from '../utils';
import { selectAnnoById, selectDocumentsById } from '../Announcement/service';
import '@/utils/lq.style.less';
import '@/utils/lq.style.less';
import { getSessionRoleData, getUserToken } from '@/utils/session';
import moment from "moment";
import { downloadFileObjectId } from '@/utils/DownloadUtils';
const { Panel } = Collapse;
/**
@ -47,7 +48,7 @@ const ProcurementRequirementsArePublicized: React.FC = () => {
if (res.code === 200) {
let data = res?.data;
selectDocumentsById(annoId).then(response => {
if(res?.code == 200) {
if (res?.code == 200) {
setListDisplayInfo({
annoTitle: data?.annoTitle,
docStartTime: moment(data?.docStartTime).format('YYYY-MM-DD HH:mm'),
@ -65,42 +66,19 @@ const ProcurementRequirementsArePublicized: React.FC = () => {
setProcessInstanceId(data?.approvalInstanceId);
}
});
window.parent.postMessage("{'height':"+document.documentElement.scrollHeight+"}",'*'  );
window.parent.postMessage("{'height':" + document.documentElement.scrollHeight + "}", '*');
}, []);
//weboffice变更文件名称下载方法
const getFileList = (bid: any,fileName: any) => {
window.fetch(`/api/core-service-ebtp-updownload/v1/attachment/download/bid/${bid}`, {
method: "GET",
headers: {
// JwtToken: getSessionUserData() == null ? null : getSessionUserData().userId,
Authorization:getUserToken(),
currentRoleCode: getSessionRoleData()?.roleCode,
},
credentials: 'include',
}).then((response) => {
// 这里才是下载附件逻辑处理的地方
response.blob().then(blob => {
const blobUrl = window.URL.createObjectURL(blob);
const aElement = document.createElement("a");
aElement.href = blobUrl; // 设置a标签路径
aElement.download = fileName;
aElement.click();
window.URL.revokeObjectURL(blobUrl);
});
});
}
return (
<Card bordered={false} bodyStyle={{ padding: '0 200px', borderRadius: 6 }}>
<h2 style={{ textAlign: 'center', marginTop: 10 }}></h2>
<Collapse defaultActiveKey={['1','2','3']} style={{ marginTop: 30 }}>
<Collapse defaultActiveKey={['1', '2', '3']} style={{ marginTop: 30 }}>
<Panel header="基本信息" key="1">
<BasicInformation processInstanceId={processInstanceId} />
</Panel>
<Panel header="邀请函信息" key="2">
<Descriptions bordered column={1}>
<Descriptions.Item label="邀请函名称" labelStyle={{ textAlign: 'center',width: '40%' }}>
<Descriptions.Item label="邀请函名称" labelStyle={{ textAlign: 'center', width: '40%' }}>
{listDisplayInfo.annoTitle}
</Descriptions.Item>
<Descriptions.Item
@ -145,37 +123,37 @@ const ProcurementRequirementsArePublicized: React.FC = () => {
<p className="table-border" dangerouslySetInnerHTML={{ __html: contentWithStyle }}></p>
</Panel>
<Panel header="文件信息" key="3">
{listDisplayInfo.documentsList.map((item: any,index: any) => {
return <Descriptions bordered column={1} key={index} style={{marginBottom: 8}}>
<Descriptions.Item
label={processName.name1 + '文件名称'}
labelStyle={{ textAlign: 'center' ,width: '40%' }}
>
{item?.documentName}
</Descriptions.Item>
<Descriptions.Item
label={'关联' + processName.name4}
labelStyle={{ textAlign: 'center' }}
>
{item?.sections?.map((e: any) => e.bsName).join(",")}
</Descriptions.Item>
<Descriptions.Item
label="附件"
labelStyle={{ textAlign: 'center' }}
>
<ExtendUpload
bid={item?.documentSetId}
btnName="附件"
uploadProps={{ disabled: true }}
/>
</Descriptions.Item>
<Descriptions.Item
label="正文"
labelStyle={{ textAlign: 'center' }}
>
<a style={{color:"#b30000"}} key="zhengwen" onClick={() => getFileList(item?.contentFileId,`${item?.documentName}(正文).doc`)}>{item?.documentName}().doc</a>
</Descriptions.Item>
</Descriptions>
{listDisplayInfo.documentsList.map((item: any, index: any) => {
return <Descriptions bordered column={1} key={index} style={{ marginBottom: 8 }}>
<Descriptions.Item
label={processName.name1 + '文件名称'}
labelStyle={{ textAlign: 'center', width: '40%' }}
>
{item?.documentName}
</Descriptions.Item>
<Descriptions.Item
label={'关联' + processName.name4}
labelStyle={{ textAlign: 'center' }}
>
{item?.sections?.map((e: any) => e.bsName).join(",")}
</Descriptions.Item>
<Descriptions.Item
label="附件"
labelStyle={{ textAlign: 'center' }}
>
<ExtendUpload
bid={item?.documentSetId}
btnName="附件"
uploadProps={{ disabled: true }}
/>
</Descriptions.Item>
<Descriptions.Item
label="正文"
labelStyle={{ textAlign: 'center' }}
>
<a style={{ color: "#b30000" }} key="zhengwen" onClick={() => downloadFileObjectId(item?.contentFileId)}>{item?.documentName}().doc</a>
</Descriptions.Item>
</Descriptions>
})}
</Panel>
</Collapse>