import React, { useState, useEffect } from 'react'; import type { ReactText } from 'react'; import { Row, Col, Tag } from 'antd'; import { getPackages } from './service'; import '@/assets/ld_style.less'; import { getProId, getSessionProjectData } from '@/utils/session'; import ProList from '@ant-design/pro-list'; import TableLook from './TableLook'; import { getStatusByProId } from '@/services/downLoad'; import { ExclamationCircleOutlined } from '@ant-design/icons'; import SupplierCommitment from '@/pages/Tender/UploadResponse/components/SupplierCommitment'; const Index: React.FC<{}> = () => { let projectId = getProId() const [expandedRowKeys, setExpandedRowKeys] = useState([0]); //供应商资质库显示状态 const [supplierStatus, setSupplierStatus] = useState(false); // 提示信息显隐 const [tip, setTip] = useState(true); //是否初始化列表-供应商承诺书用 const [isInit, setIsInit] = useState(false); /** * 根据项目id获取供应商资质库信息引用状态 * @param id 项目id * @returns true-有供应商资质库信息 false-无供应商资质库信息 */ const getSupplierStatus = async (id: string) => { await getStatusByProId({ id: id }).then(res => { setTip(false) if (res?.code == 200) { setSupplierStatus(res?.data) } }) } let listRender = (list: any[]) => list?.map((item: any, index: any) => ({ title: item.packageName + '—第' + item.roomSort + '轮', description: (
{/* {expandedRowKeys.includes(item.sectionVO.bsId) ? : null} */}
) })); const changeList = (expanded: any, record: any) => { // 列表展开 } useEffect(() => { getSupplierStatus(projectId) }, []); return ( <>
分包分段信息
{isInit && ( await getPackages(params).then((res) => { if (res.code == 200) { let data = res.data; // setDateList(res.data.records) return Promise.resolve({ data: listRender(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: true, }} expandable={{ expandedRowKeys, onExpandedRowsChange: setExpandedRowKeys, onExpand: changeList }} // dataSource={listDate} metas={{ title: {}, content: {}, description: {} }} /> )} { setIsInit(true) }} />
) } export default Index