feat: 团计划使用 Tailwind CSS

perf/export-docx
Jimmy Liow 1 year ago
parent 52fcb20dbf
commit e68e0ddd7d

@ -23,6 +23,7 @@
"detail": "详细信息", "detail": "详细信息",
"username": "用户名", "username": "用户名",
"realname": "姓名", "realname": "姓名",
"travelAgency": "供应商",
"travelAgencyName": "供应商名称", "travelAgencyName": "供应商名称",
"email": "邮箱地址", "email": "邮箱地址",
"lastLogin": "最后登陆时间", "lastLogin": "最后登陆时间",

@ -23,14 +23,14 @@ function Management() {
title: t('account:realname'), title: t('account:realname'),
dataIndex: 'realname', dataIndex: 'realname',
}, },
{
title: t('account:travelAgencyName'),
dataIndex: 'travelAgencyName',
},
{ {
title: t('account:email'), title: t('account:email'),
dataIndex: 'email', dataIndex: 'email',
}, },
{
title: t('account:travelAgency'),
dataIndex: 'travelAgencyName',
},
{ {
title: t('account:roleName'), title: t('account:roleName'),
dataIndex: 'role' dataIndex: 'role'
@ -283,7 +283,7 @@ function Management() {
<Input /> <Input />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label={t('account:travelAgencyName')} label={t('account:travelAgency')}
name='travelAgencyId' name='travelAgencyId'
rules={[ rules={[
{ {

@ -1,19 +1,19 @@
import { useParams } from "react-router-dom" import { useParams } from 'react-router-dom'
import { useEffect, useState } from 'react' import { useEffect, useState } from 'react'
import { Row, Col, Space, Button, Table, Input, Typography, Modal, Tag, App } from 'antd' import { Row, Col, Space, Button, Table, Input, Typography, Modal, Tag, App } from 'antd'
import { import {
FileOutlined FileOutlined
} from '@ant-design/icons'; } from '@ant-design/icons'
import { usingStorage } from '@/hooks/usingStorage' import { usingStorage } from '@/hooks/usingStorage'
import useReservationStore from '@/stores/Reservation' import useReservationStore from '@/stores/Reservation'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import BackBtn from '@/components/BackBtn' import BackBtn from '@/components/BackBtn'
const { Title, Paragraph } = Typography; const { Title, Paragraph } = Typography
const { TextArea } = Input; const { TextArea } = Input
function Detail() { function Detail() {
const { t } = useTranslation(); const { t } = useTranslation()
const confirmationListColumns = [ const confirmationListColumns = [
{ {
@ -43,9 +43,9 @@ function Detail() {
]; ];
function detailTextRender(text, confirm) { function detailTextRender(text, confirm) {
const formattedText = confirm.PCI_ConfirmText;//.replace(/\;/g, "\n\n"); const formattedText = confirm.PCI_ConfirmText;//.replace(/\;/g, '\n\n');
return ( return (
<div style={{whiteSpace: 'pre-line'}}> <div className='whitespace-pre-line'>
{formattedText} {formattedText}
</div> </div>
); );
@ -56,7 +56,7 @@ function Detail() {
<> <>
{confirm.attachmentList.map(attch => { {confirm.attachmentList.map(attch => {
return ( return (
<Tag bordered={false} icon={<FileOutlined />}><a href={attch.file_url} target="_blank">{attch.file_name}</a></Tag> <Tag bordered={false} icon={<FileOutlined />}><a href={attch.file_url} target='_blank'>{attch.file_name}</a></Tag>
)} )}
)} )}
</> </>
@ -65,7 +65,7 @@ function Detail() {
function confirmRender(text, confirm) { function confirmRender(text, confirm) {
return ( return (
<Button type="link" onClick={() => showConfirmModal(confirm)}>{t('Confirm')}</Button> <Button type='link' onClick={() => showConfirmModal(confirm)}>{t('Confirm')}</Button>
); );
} }
@ -96,7 +96,7 @@ function Detail() {
const showConfirmModal = (confirm) => { const showConfirmModal = (confirm) => {
setIsModalOpen(true); setIsModalOpen(true);
const formattedText = confirm.PCI_ConfirmText;//.replace(/\;/g, "\n\n"); const formattedText = confirm.PCI_ConfirmText;//.replace(/\;/g, '\n\n');
setConfirmText(formattedText); setConfirmText(formattedText);
selectConfirmation(confirm); selectConfirmation(confirm);
}; };
@ -140,7 +140,7 @@ function Detail() {
<Title level={4}>{t('group:ConfirmationDetails')}</Title> <Title level={4}>{t('group:ConfirmationDetails')}</Title>
<Paragraph> <Paragraph>
<blockquote> <blockquote>
<div style={{whiteSpace: 'pre-line'}}> <div className='whitespace-pre-line'>
{confirmText} {confirmText}
</div> </div>
</blockquote> </blockquote>
@ -155,7 +155,7 @@ function Detail() {
}} }}
/> />
</Modal> </Modal>
<Space direction="vertical" style={{ width: '100%' }}> <Space direction='vertical' className='w-full'>
<Row gutter={{ md: 24 }}> <Row gutter={{ md: 24 }}>
<Col span={20}> <Col span={20}>
<Title level={4}>{t('group:RefNo')}: {reservationDetail.referenceNumber}; {t('group:ArrivalDate')}: {reservationDetail.arrivalDate};</Title> <Title level={4}>{t('group:RefNo')}: {reservationDetail.referenceNumber}; {t('group:ArrivalDate')}: {reservationDetail.arrivalDate};</Title>
@ -165,17 +165,19 @@ function Detail() {
</Col> </Col>
</Row> </Row>
<Row gutter={{ md: 24 }}> <Row gutter={{ md: 24 }}>
<Col span={12} style={{height: '100%'}} > <Col span={12} className='w-full'>
<iframe id="msdoc-iframe-reservation" title="msdoc-iframe-reservation" src={reservationPreviewUrl} frameBorder="0" style={{ width: '100%', height: '600px' }}></iframe> <iframe id='msdoc-iframe-reservation' title='msdoc-iframe-reservation'
src={reservationPreviewUrl} frameBorder='0' style={{height: '600px'}} className='w-full'></iframe>
<Button type='link' target='_blank' href={reservationUrl}>{t('Download')} Itinerary</Button> <Button type='link' target='_blank' href={reservationUrl}>{t('Download')} Itinerary</Button>
</Col> </Col>
<Col span={12} style={{height: '100%'}} > <Col span={12} className='w-full'>
<iframe id="msdoc-iframe-name-card" title="msdoc-iframe-name-card" src={nameCardPreviewUrl} frameBorder="0" style={{ width: '100%', height: '600px' }}></iframe> <iframe id='msdoc-iframe-name-card' title='msdoc-iframe-name-card'
src={nameCardPreviewUrl} frameBorder='0' style={{height: '600px'}} className='w-full'></iframe>
<Button type='link' target='_blank' href={nameCardUrl}>{t('Download')} Name Card</Button> <Button type='link' target='_blank' href={nameCardUrl}>{t('Download')} Name Card</Button>
</Col> </Col>
</Row> </Row>
<Row> <Row>
<Col span={24}><Space direction="vertical" style={{ width: '100%' }}> <Col span={24}><Space direction='vertical' className='w-full'>
<Table <Table
bordered bordered
loading={dataLoading} loading={dataLoading}

@ -30,7 +30,7 @@ function Newest() {
{ {
title: t('group:ArrivalDate'), title: t('group:ArrivalDate'),
dataIndex: 'arrivalDate', dataIndex: 'arrivalDate',
render: (text, record) => (isEmpty(text) ? '' : dayjs(text).format('YYYY-MM-DD')), render: (text) => (isEmpty(text) ? '' : dayjs(text).format('YYYY-MM-DD')),
}, },
{ {
title: t('group:Pax'), title: t('group:Pax'),
@ -43,7 +43,7 @@ function Newest() {
{ {
title: t('group:ResSendingDate'), title: t('group:ResSendingDate'),
dataIndex: 'reservationDate', dataIndex: 'reservationDate',
render: (text, record) => (isEmpty(text) ? '' : dayjs(text).format('YYYY-MM-DD')), render: (text) => (isEmpty(text) ? '' : dayjs(text).format('YYYY-MM-DD')),
}, },
{ {
title: t('group:Guide'), title: t('group:Guide'),
@ -52,7 +52,7 @@ function Newest() {
}, },
]; ];
function guideRender(text, reservation) { function guideRender(_, reservation) {
if (reservation.guide === '') { if (reservation.guide === '') {
return ( return (
<Space size='middle'> <Space size='middle'>
@ -69,13 +69,11 @@ function Newest() {
} }
} }
function cityGuideRender(text, city) { function cityGuideRender(_, city) {
return ( return (
<Select <Select
showSearch showSearch
style={{ className='w-72'
width: 280,
}}
variant='borderless' variant='borderless'
allowClear allowClear
placeholder='Select a guide' placeholder='Select a guide'
@ -84,9 +82,6 @@ function Newest() {
onChange={(guideId) => { onChange={(guideId) => {
setupCityGuide(city.cityId, guideId); setupCityGuide(city.cityId, guideId);
}} }}
onSearch={(value) => {
// console.log('search:', value);
}}
filterOption={(input, option) => filterOption={(input, option) =>
(option?.label ?? '').toLowerCase().includes(input.toLowerCase()) (option?.label ?? '').toLowerCase().includes(input.toLowerCase())
} }
@ -177,7 +172,7 @@ function Newest() {
centered centered
open={isModalOpen} onOk={handleOk} onCancel={handleCancel} open={isModalOpen} onOk={handleOk} onCancel={handleCancel}
> >
<Space direction='vertical' style={{ width: '100%' }}> <Space direction='vertical' className='w-full'>
<Row> <Row>
<Col span={24}> <Col span={24}>
<Table <Table
@ -203,7 +198,7 @@ function Newest() {
</Row> </Row>
</Space> </Space>
</Modal> </Modal>
<Space direction='vertical' style={{ width: '100%' }}> <Space direction='vertical' className='w-full'>
<Title level={3}></Title> <Title level={3}></Title>
<SearchForm <SearchForm
fieldsConfig={{ fieldsConfig={{

Loading…
Cancel
Save