import React, { Fragment, useRef, useMemo,useEffect,useState } from 'react'; import { useSelector } from 'react-redux'; import BasicCrudModal from '../../../../components/crud/BasicCrudModal'; import { Table, Card, Row, Col, Divider,Image,Modal } from 'antd'; import { DeleteOutlined,FileWordOutlined,FilePdfOutlined,FileZipOutlined,FileExcelOutlined } from '@ant-design/icons'; import ToolBar from './toolbar'; import ModalForm from './form'; import apiurl from '../../../../service/apiurl'; import { getDictService } from '../../../../service/SelectValue' import usePageTable from '../../../../components/crud/usePageTable'; import { createCrudService } from '../../../../components/crud/_'; import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender'; import { dealValue } from '../../../../utils/tools'; import ListSelect from "../../../../components/Form/ListSelect"; import Form from './form' import moment from 'moment'; const Page = ({data,fileList,isMeetData=false}) => { const url = "http://223.75.53.141:9100/gs-tsg" const [iframeSrc, setIframeSrc] = useState('') const [pdfViewOPen, setPdfViewOPen] = useState(false) /** * @description pdf文件预览 * @param {String} params 文件预览url */ const viewPdf = (params) => { console.log(params); setIframeSrc(params) setPdfViewOPen(true) } /** * @description 文件下载 * @param {String} params 文件fileId */ const download = (params) => { let downloadLink = document.createElement("a"); downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/xfflood/xfIdeoFcB/file/download/${params}`; downloadLink.download = `${params.fileName}`; downloadLink.style.display = "none"; // 将链接添加到页面中 document.body.appendChild(downloadLink); // 模拟点击事件,开始下载 downloadLink.click(); } return ( <>
会议主题:
{data.theme}
主办单位:
{data.organiser}
会议时间:
{ !isMeetData ?data.meetDate:data.startDate}
会议地点:
{data.loc}
局内参加人员:
{data.participant}
会议类型:
{ data.meetType === "0" ? "视频会议" : data.meetType === "1" ? "现场会议" : data.meetType === "2" ? "电话会议" : "网络会议" }
会议主要内容:
附件:
{ fileList.length > 0 && fileList.map(file => { return ( <>
{file.name.indexOf('.docx') > -1 ?
{ download(file.response?.data?.fileId) }} style={{ cursor: 'pointer' }} >
: file.name.indexOf('.pdf') > -1 ?
{ viewPdf(file.response?.data?.fileId) }} style={{ cursor: 'pointer' }} >
: file.name.indexOf('.zip') > -1 ?
{ download(file.response?.data?.fileId) }} style={{ cursor: 'pointer' }} >
: file.name.indexOf('.xlsx') > -1 ?
{ download(file.response?.data?.fileId) }} style={{ cursor: 'pointer' }} >
: }
{file.name} {((file.response?.data?.fileLength)/1024).toFixed(2) }KB
{ setPdfViewOPen(false) }} >