Merge remote-tracking branch 'origin/main'

main
Lei OT 3 weeks ago
commit bbb5909988

@ -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 (
<>
<Upload
@ -188,22 +187,22 @@ export const ImageUploader = props => {
onChange={handleChange}
showUploadList={{
showDownloadIcon: true,
showRemoveIcon: true,
removeIcon: file => {
return (
<Popconfirm
title="Delete"
description="Are you sure you want to delete the file?"
onConfirm={() => {
handleDelete(file);
}}
onCancel={() => setFileList([...fileList])}
okText="Yes"
cancelText="No">
<DeleteOutlined />
</Popconfirm>
);
},
showRemoveIcon: props.deletable,
removeIcon: file => {
return (
<Popconfirm
title="Delete"
description="Are you sure you want to delete the file?"
onConfirm={() => {
handleDelete(file);
}}
onCancel={() => setFileList([...fileList])}
okText="Yes"
cancelText="No">
<DeleteOutlined />
</Popconfirm>
)
},
}}>
<div>
<UploadOutlined />
@ -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(() => {

@ -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 (
<Tag key={attch.file_name} bordered={false} icon={<FileOutlined />}>
<a href={attch.file_url} target='_blank' rel='noreferrer'>{attch.file_name}</a>
</Tag>
)}
)}
<ImageUploader osskey={attachmentKey} ignore_case={false} deletable={false} />
</>
);
}
@ -133,7 +129,7 @@ function Detail() {
.finally(() => {
setDataLoading(false);
});
}, [reservationId, getReservationDetail, notification]);
}, [reservationId]);
return (
<>
@ -161,7 +157,7 @@ function Detail() {
/>
</Modal>
<Space direction='vertical' className='w-full'>
<Flex horizontal align="flex-start" gap="middle"><Button type="text" icon={<ArrowLeftOutlined />} onClick={() => navigate(-1)} /><Title level={4}> {t('group:RefNo')}: {reservationDetail.referenceNumber}; {t('group:ArrivalDate')}: {reservationDetail.arrivalDate};</Title></Flex>
<Flex horizontal="true" align="flex-start" gap="middle"><Button type="text" icon={<ArrowLeftOutlined />} onClick={() => navigate(-1)} /><Title level={4}> {t('group:RefNo')}: {reservationDetail.referenceNumber}; {t('group:ArrivalDate')}: {reservationDetail.arrivalDate};</Title></Flex>
<Row gutter={{ md: 24 }}>
<Col span={12} className='w-full'>
<iframe id='msdoc-iframe-reservation' title='msdoc-iframe-reservation'

Loading…
Cancel
Save