12-23-上传master
This commit is contained in:
@ -0,0 +1,146 @@
|
||||
import React, {useEffect, useState} from "react";
|
||||
import {Button, Col, List, message, Row, Tree} from "antd";
|
||||
import PDF from 'react-pdf-js'
|
||||
import {getFieleTree, getFileNode} from '../service'
|
||||
import {TreeNode} from "antd/es/tree-select";
|
||||
import ProTable from "@ant-design/pro-table";
|
||||
import {DownloadOutlined} from "@ant-design/icons/lib";
|
||||
|
||||
const viewOfTenderDocuments: React.FC<{}> = () => {
|
||||
const [treeData, setTreeData] = useState<any>();
|
||||
const [zipListTable, setZipListTable] = useState<any>();
|
||||
|
||||
|
||||
/*获取参数*/
|
||||
const getQueryString = (name: any) => {
|
||||
let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
||||
let r = window.location.search.substr(1).match(reg);
|
||||
return r !== null ? unescape(r[2]) : null;
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
let tdocid = getQueryString("tdocid");
|
||||
getFieleTree(tdocid).then((res) => {
|
||||
if(res!=null&&res.message=="success"){
|
||||
console.log(res);
|
||||
let data: any = [];
|
||||
if (res.data != undefined) {
|
||||
res.data.map((item: any, index: any) => {
|
||||
const title1 = item.name;
|
||||
const key1 = item.id;
|
||||
const structureType1 = item.structureType;
|
||||
|
||||
let children1: any = [];
|
||||
if (item.children != undefined) {
|
||||
const children = item.children.map((item: any, index: any) => {
|
||||
const title2 = item.name;
|
||||
const structureType2 = item.structureType;
|
||||
const key2 = item.id;
|
||||
let children2: any = [];
|
||||
if (item.children != undefined) {
|
||||
const children = item.children.map((item: any, index: any) => {
|
||||
const title3 = item.name;
|
||||
const structureType3 = item.structureType;
|
||||
const key3 = item.id;
|
||||
return {title: title3, key: key3, structureType: structureType3}
|
||||
});
|
||||
children2 = children;
|
||||
}
|
||||
return {title: title2, key: key2, children: children2, structureType: structureType2}
|
||||
});
|
||||
children1 = children;
|
||||
}
|
||||
const first = {title: title1, key: key1, children: children1, structureType: structureType1}
|
||||
data.push(first);
|
||||
});
|
||||
}
|
||||
console.log(data);
|
||||
setTreeData(data);
|
||||
}
|
||||
})
|
||||
}, [])
|
||||
|
||||
const onSelect = (selectedKeys, info) => {
|
||||
console.log('info.node.structureType', info.node.structureType);
|
||||
console.log('onCheck', selectedKeys, info);
|
||||
let tendererId = getQueryString("tendererId");//供应商id
|
||||
|
||||
|
||||
getFileNode({tdocCatalogId: info.node.key, tendererId: tendererId}).then(res => {
|
||||
if(res!=null&&res.message=="success"){
|
||||
console.log(res);
|
||||
setZipListTable(res.data.tfileContentList);
|
||||
}
|
||||
})
|
||||
if (info.node.structureType == 0) {//pdf
|
||||
// res.
|
||||
} else if (info.node.structureType == 1) { //zip
|
||||
|
||||
|
||||
} else if (info.node.structureType == 2) { //数据结构
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* message.error('程序出错,亲您稍后在世');*/
|
||||
};
|
||||
const downloadZip=(render:any)=>{
|
||||
message.warn('暂时下载不了,下载路径:'+render.content);
|
||||
}
|
||||
return (
|
||||
<>
|
||||
|
||||
<Row>
|
||||
<Col span={6}>
|
||||
<Tree
|
||||
/* defaultExpandedKeys={['0-0-0', '0-0-1']}
|
||||
defaultSelectedKeys={['0-0-0', '0-0-1']}
|
||||
defaultCheckedKeys={['0-0-0', '0-0-1']}*/
|
||||
onSelect={onSelect}
|
||||
treeData={treeData}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={18}>
|
||||
<ProTable
|
||||
style={{display:""}}
|
||||
search={false}
|
||||
options={false}
|
||||
columns={[
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'index',
|
||||
valueType: 'index',
|
||||
},
|
||||
{
|
||||
title: '供应商名称',
|
||||
dataIndex: 'tendererName',
|
||||
valueType: 'text'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
// valueType: 'option',
|
||||
render: (text: any, record: any) => {
|
||||
return (
|
||||
<>
|
||||
<Button type="primary" onClick={()=>downloadZip(record)} shape="round" icon={<DownloadOutlined/>}>下载</Button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
]}
|
||||
dataSource={zipListTable}
|
||||
// request={params => }
|
||||
// rowKey={"id"}
|
||||
/>
|
||||
|
||||
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
|
||||
</>
|
||||
)
|
||||
}
|
||||
export default viewOfTenderDocuments
|
56
src/pages/Evaluation/BiddingDocumentsDecrypt/index.less
Normal file
56
src/pages/Evaluation/BiddingDocumentsDecrypt/index.less
Normal file
@ -0,0 +1,56 @@
|
||||
@import '~antd/lib/style/themes/default.less';
|
||||
|
||||
.header {
|
||||
background-color: rgb(170, 0, 0);
|
||||
color: white;
|
||||
font-size: 40px;
|
||||
height: 70px;
|
||||
font-weight: 800;
|
||||
display: flex;
|
||||
.headerAlign {
|
||||
align-self: center;
|
||||
margin-left: 20px;
|
||||
}
|
||||
.proName {
|
||||
font-size: 30px;
|
||||
font-weight: 300;
|
||||
}
|
||||
.closeButton{
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
}
|
||||
}
|
||||
.titleTop {
|
||||
font-size: 30px;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
background-color: aliceblue;
|
||||
}
|
||||
.desStyle{
|
||||
background-color: white;
|
||||
.ant-descriptions-item-label{
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
min-width: 200px;
|
||||
}
|
||||
.ant-descriptions-item-content{
|
||||
font-size: 20px;
|
||||
min-width: 300px;
|
||||
max-width: 750px;
|
||||
}
|
||||
}
|
||||
|
||||
:global {
|
||||
.drawerStyle {
|
||||
.ant-drawer-content-wrapper {
|
||||
.ant-drawer-content {
|
||||
height: 100%;
|
||||
.ant-drawer-wrapper-body {
|
||||
.ant-drawer-body {
|
||||
padding: 0px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
149
src/pages/Evaluation/BiddingDocumentsDecrypt/index.tsx
Normal file
149
src/pages/Evaluation/BiddingDocumentsDecrypt/index.tsx
Normal file
@ -0,0 +1,149 @@
|
||||
import React, {useEffect, useState} from 'react';
|
||||
import {Button, Card, Divider, List, message, Modal, Progress} from "antd";
|
||||
import style from "@/pages/BiddingAnnouncement/components/style.less";
|
||||
import ProTable from "@ant-design/pro-table";
|
||||
import {DownloadOutlined, UnorderedListOutlined} from "@ant-design/icons/lib";
|
||||
import {getBiddingDocumentsDecryptList, DownFile, decryptFile} from "./service"
|
||||
import './index.less';
|
||||
|
||||
interface BiddingDocumentsDecryptProps {
|
||||
assessRoomId: "1331563848498413568";
|
||||
}
|
||||
|
||||
const BiddingDocumentsDecrypt: React.FC<BiddingDocumentsDecryptProps> = (props) => {
|
||||
// /*投标文件查看*/
|
||||
const [pageloading, setPageloading] = useState<boolean>(false);
|
||||
const [spin, spinSet] = useState<any>(false);
|
||||
|
||||
const [rateVis, handleRateVis] = useState<boolean>(false); //进度显隐
|
||||
const [rateCount, rateCountSet] = useState<number>(0); //查询进度启动器
|
||||
const [jmComplete, jmCompleteSet] = useState<number>(0);//已解密成功
|
||||
const [jmFail, jmFailSet] = useState<number>(0);//解密失败
|
||||
const [jmWait, jmWaitSet] = useState<number>(0);//未解密
|
||||
const [jmFileCount, jmFileCountSet] = useState<number>(0);//文件总数
|
||||
|
||||
|
||||
|
||||
|
||||
const [ListData, setListData] = useState<any>();
|
||||
useEffect(() => {
|
||||
getBiddingDocumentsDecryptList("1331563848498413568").then(res => {
|
||||
if (res.message != null && res.message == "success") {
|
||||
setListData(res.data)
|
||||
}
|
||||
|
||||
})
|
||||
}, [props.assessRoomId])
|
||||
|
||||
/*查看*/
|
||||
const OpenWindow = (record: any, docid: any) => {
|
||||
// window.open(`/room/index?aa=${record.assessRoomId}&bb=${record.turnSort}`)
|
||||
window.open("/viewOfTenderDocuments?tdocid=" + docid + "&tendererId=" + record.id);
|
||||
}
|
||||
|
||||
/*下载*/
|
||||
const download = (record: any, docid: any) => {
|
||||
message.warn('暂时下载不了');
|
||||
/* DownFile({tdocId: docid, tendererName: record.companyName}).then(res => {
|
||||
|
||||
})*/
|
||||
}
|
||||
const downloadPak = (docid: any) => {
|
||||
message.warn('暂时下载不了');
|
||||
/* DownFile({tdocId: docid}).then(res => {
|
||||
|
||||
})*/
|
||||
}
|
||||
/*解密*/
|
||||
const decrypt =(record:any)=>{
|
||||
handleRateVis(true);
|
||||
decryptFile({turnId:record}).then(res=>{
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/*===========================*/
|
||||
/*===========================*/
|
||||
return (
|
||||
<Card>
|
||||
<Divider style={{margin: "8px 0px"}}/>
|
||||
<div className={style.label}>
|
||||
<UnorderedListOutlined style={{marginRight: "8px"}}/>投标文件查看
|
||||
</div>
|
||||
<List
|
||||
itemLayout="vertical"
|
||||
dataSource={ListData}
|
||||
renderItem={item => (
|
||||
<List.Item>
|
||||
<ProTable
|
||||
loading={pageloading}
|
||||
toolBarRender={() => [
|
||||
<Button onClick={() => decrypt(item.id)}> 解密</Button>,,
|
||||
<Button onClick={() => downloadPak(item.id)}> 打包下载</Button>,
|
||||
// <Button> 下载说明</Button>,
|
||||
]}
|
||||
search={false}
|
||||
options={false}
|
||||
columns={[
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'index',
|
||||
valueType: 'index'
|
||||
},
|
||||
{
|
||||
title: '供应商名称',
|
||||
dataIndex: 'companyName',
|
||||
valueType: 'text'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
// valueType: 'option',
|
||||
render: (text: any, record: any) => {
|
||||
return (
|
||||
<>
|
||||
<Button type="primary" onClick={() => download(record, item.id)} shape="round"
|
||||
icon={<DownloadOutlined/>}>下载</Button>
|
||||
<Button type="primary" onClick={() => OpenWindow(record, item.id)} shape="round"
|
||||
icon={<DownloadOutlined/>}>查看</Button>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
]}
|
||||
dataSource={item.registerInfoVOList}
|
||||
// request={params => }
|
||||
// rowKey={"id"}
|
||||
/>
|
||||
</List.Item>
|
||||
)}
|
||||
/>
|
||||
<Modal
|
||||
title="解密进度"
|
||||
width={'800px'}
|
||||
destroyOnClose
|
||||
centered
|
||||
bodyStyle={{ padding: '32px 40px 48px', overflowY: 'auto' }}
|
||||
visible={rateVis}
|
||||
footer={false}
|
||||
onCancel={()=>handleRateVis(false)}
|
||||
|
||||
>
|
||||
<Progress percent={(jmComplete + jmFail) * 100 / jmFileCount} status="active" />
|
||||
|
||||
<div style={{ textAlign: "center" }}>
|
||||
文件总数:<span style={{ fontSize: 30, color: 'rgb(0,144,255)' }}>{jmFileCount}</span> 个
|
||||
</div>
|
||||
<div style={{ textAlign: "center" }}>
|
||||
解密成功:<span style={{ fontSize: 30, color: 'rgb(61,169,92)' }}>{jmComplete}</span> 个,
|
||||
{/* 排队解密中:<span style={{ fontSize: 30, color: 'red' }}>{100 - rate}</span> 个, */}
|
||||
正在解密:<span style={{ fontSize: 30, color: 'rgb(0,144,255)' }}>{jmWait}</span> 个,
|
||||
解密失败:<span style={{ fontSize: 30, color: 'red' }}>{jmFail}</span> 个
|
||||
</div>
|
||||
</Modal>
|
||||
|
||||
</Card>
|
||||
)
|
||||
}
|
||||
export default BiddingDocumentsDecrypt
|
44
src/pages/Evaluation/BiddingDocumentsDecrypt/service.ts
Normal file
44
src/pages/Evaluation/BiddingDocumentsDecrypt/service.ts
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request';
|
||||
import ex from "umi/dist";
|
||||
|
||||
// import {demo} from './data.d';
|
||||
|
||||
export async function getBiddingDocumentsDecryptList(params: any) {
|
||||
return request('/api/biz-service-ebtp-tender/v1/supplier_register/select_supplier_by_roomid_and_turnsort?assessRoomId=' + params, {method: 'get'})
|
||||
}
|
||||
|
||||
export async function getFieleTree(param: any) {
|
||||
return request('/api/biz-service-ebtp-resps/v1/tdoccatalog/treelistByUser',
|
||||
{
|
||||
method: 'post',
|
||||
data: {"tdocId": param}
|
||||
}
|
||||
)
|
||||
}
|
||||
export async function getFileNode(params: any){
|
||||
return request('/api/biz-service-ebtp-resps/v1/tfile/getCatalogContentById',
|
||||
{
|
||||
method: 'post',
|
||||
data: {...params}
|
||||
}
|
||||
);
|
||||
}
|
||||
export async function DownFile(params: any){
|
||||
return request('/api/biz-service-ebtp-resps/v1/tfile/downloadTfileBy',
|
||||
{
|
||||
method: 'post',
|
||||
data: {...params}
|
||||
}
|
||||
);
|
||||
}
|
||||
export async function decryptFile(params: any) {
|
||||
return request('/api/biz-service-ebtp-resps/v1/tfile/executeDecrypt',
|
||||
{
|
||||
method: 'post',
|
||||
data: {...params}
|
||||
}
|
||||
);
|
||||
}
|
||||
export async function decryptFileType(params: any){
|
||||
/**/
|
||||
}
|
Reference in New Issue
Block a user