diff --git a/src/components/ImageUploader.jsx b/src/components/ImageUploader.jsx index a1d8611..d405148 100644 --- a/src/components/ImageUploader.jsx +++ b/src/components/ImageUploader.jsx @@ -1,6 +1,6 @@ import { useEffect, useState } from "react"; -import { Upload, List, Button, Popconfirm, Col, Row } from "antd"; -import { UploadOutlined, FileTextOutlined, DeleteOutlined } from "@ant-design/icons"; +import { Upload, List, Button, Tooltip, Popconfirm, Col, Row } from "antd"; +import { UploadOutlined, FileTextOutlined, DeleteOutlined, StopOutlined } from "@ant-design/icons"; import { Image } from "antd"; import { fetchJSON } from "@/utils/request"; import { HT3_HOST } from "@/config"; @@ -94,7 +94,7 @@ export const ImageUploader = props => { const [previewOpen, setPreviewOpen] = useState(false); const [previewImage, setPreviewImage] = useState(""); const key = simple_encrypt(props.osskey); - const ignore_case = props.ignore_case || true; + const ignore_case = props.ignore_case; // 组件挂载时获取图片列表 useEffect(() => { @@ -175,7 +175,6 @@ export const ImageUploader = props => { const handleRemove = () => { return false; }; - return ( <> { onChange={handleChange} showUploadList={{ showDownloadIcon: true, - showRemoveIcon: true, - removeIcon: file => { - return ( - { - handleDelete(file); - }} - onCancel={() => setFileList([...fileList])} - okText="Yes" - cancelText="No"> - - - ); - }, + showRemoveIcon: props.deletable, + removeIcon: file => { + return ( + { + handleDelete(file); + }} + onCancel={() => setFileList([...fileList])} + okText="Yes" + cancelText="No"> + + + ) + }, }}>
@@ -229,8 +228,8 @@ export const ImageUploader = props => { export const ImageViewer = props => { const [fileList, setFileList] = useState([]); const key = props.osskey; - const overlist = props.overlist || false; - const ignore_case = props.ignore_case || true; + const overlist = props.overlist; + const ignore_case = props.ignore_case; // 组件挂载时获取图片列表 useEffect(() => { diff --git a/src/views/reservation/Detail.jsx b/src/views/reservation/Detail.jsx index e344063..52f7f1c 100644 --- a/src/views/reservation/Detail.jsx +++ b/src/views/reservation/Detail.jsx @@ -7,6 +7,7 @@ import { import { usingStorage } from '@/hooks/usingStorage' import useReservationStore from '@/stores/Reservation' import { useTranslation } from 'react-i18next' +import {ImageUploader} from '@/components/ImageUploader' const { Title, Paragraph } = Typography const { TextArea } = Input @@ -51,15 +52,10 @@ function Detail() { } function attachmentRender(_, confirm) { + const attachmentKey = `GHH/${travelAgencyId}/${reservationId}/PCISN${confirm.key}`; return ( <> - {confirm.attachmentList.map(attch => { - return ( - }> - {attch.file_name} - - )} - )} + ); } @@ -133,7 +129,7 @@ function Detail() { .finally(() => { setDataLoading(false); }); - }, [reservationId, getReservationDetail, notification]); + }, [reservationId]); return ( <> @@ -161,7 +157,7 @@ function Detail() { /> -