日期预选,日期格式化
parent
22bff8d5f5
commit
7fe02588cd
@ -1,4 +1,26 @@
|
||||
import React from "react";
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
export const DATE_FORMAT = "YYYY-MM-DD";
|
||||
export const HT_HOST = process.env.NODE_ENV == "production" ? "https://p9axztuwd7x8a7.mycht.cn" : "http://202.103.68.100:890";
|
||||
export const DATE_PRESETS = [
|
||||
{
|
||||
label: "本周",
|
||||
value: [dayjs().startOf("w"), dayjs().endOf("w")],
|
||||
},
|
||||
{
|
||||
label: "上周",
|
||||
value: [dayjs().startOf("w").subtract(7, "days"), dayjs().endOf("w").subtract(7, "days")],
|
||||
},
|
||||
{
|
||||
label: "本月",
|
||||
value: [dayjs().startOf("M"), dayjs().endOf("M")],
|
||||
},
|
||||
// 本月: [dayjs().startOf("month"), moment().endOf("month")],
|
||||
// 上个月: [dayjs().subtract(1, "months").startOf("month"), moment(new Date()).subtract(1, "months").endOf("month")],
|
||||
// 近7天: [dayjs().add(-7, "days"), dayjs()],
|
||||
// 近30天: [dayjs().subtract(30, "days"), moment()],
|
||||
// 近三个月: [dayjs().subtract(2, "month").startOf("month"), moment().endOf("month")],
|
||||
// 今年: [dayjs().startOf("year"), moment().endOf("year")],
|
||||
// 去年: [dayjs().subtract(1, "year").startOf("year"), moment().subtract(1, "year").endOf("year")],
|
||||
];
|
||||
export const HT_HOST = process.env.NODE_ENV == "production" ? "https://p9axztuwd7x8a7.mycht.cn" : "http://202.103.68.100:890";
|
||||
|
@ -1,103 +1,105 @@
|
||||
import { useParams, useNavigate } from "react-router-dom";
|
||||
import { useEffect } from 'react';
|
||||
import { useEffect } from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
import moment from "moment";
|
||||
import { Row, Col, Space, Button, Table, Tag, Typography, DatePicker } from 'antd';
|
||||
import { useStore } from '../../stores/StoreContext.js';
|
||||
import { Row, Col, Space, Button, Table, Tag, Typography, DatePicker } from "antd";
|
||||
import { useStore } from "../../stores/StoreContext.js";
|
||||
|
||||
const { Title } = Typography;
|
||||
|
||||
const dataSource = [
|
||||
{
|
||||
key: '1',
|
||||
name: '2',
|
||||
age: '二',
|
||||
address: '5月2日',
|
||||
},
|
||||
{
|
||||
key: '2',
|
||||
name: '胡彦祖',
|
||||
age: 42,
|
||||
address: '西湖区湖底公园1号',
|
||||
},
|
||||
{
|
||||
key: "1",
|
||||
name: "2",
|
||||
age: "二",
|
||||
address: "5月2日",
|
||||
},
|
||||
{
|
||||
key: "2",
|
||||
name: "胡彦祖",
|
||||
age: 42,
|
||||
address: "西湖区湖底公园1号",
|
||||
},
|
||||
];
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '天数',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
},
|
||||
{
|
||||
title: '星期',
|
||||
dataIndex: 'age',
|
||||
key: 'age',
|
||||
},
|
||||
{
|
||||
title: '日期',
|
||||
dataIndex: 'address',
|
||||
key: 'address',
|
||||
},
|
||||
{
|
||||
title: '始发城市',
|
||||
dataIndex: 'address',
|
||||
key: 'address',
|
||||
},
|
||||
{
|
||||
title: '抵达城市',
|
||||
dataIndex: 'address',
|
||||
key: 'address',
|
||||
},
|
||||
{
|
||||
title: '交通',
|
||||
dataIndex: 'address',
|
||||
key: 'address',
|
||||
},
|
||||
{
|
||||
title: '酒店',
|
||||
dataIndex: 'address',
|
||||
key: 'address',
|
||||
},
|
||||
{
|
||||
title: '餐饮 [午、晚]',
|
||||
dataIndex: 'address',
|
||||
key: 'address',
|
||||
},
|
||||
{
|
||||
title: '景点及旅游服务安排',
|
||||
dataIndex: 'address',
|
||||
key: 'address',
|
||||
},
|
||||
{
|
||||
title: "天数",
|
||||
dataIndex: "name",
|
||||
key: "name",
|
||||
},
|
||||
{
|
||||
title: "星期",
|
||||
dataIndex: "age",
|
||||
key: "age",
|
||||
},
|
||||
{
|
||||
title: "日期",
|
||||
dataIndex: "address",
|
||||
key: "address",
|
||||
},
|
||||
{
|
||||
title: "始发城市",
|
||||
dataIndex: "address",
|
||||
key: "address",
|
||||
},
|
||||
{
|
||||
title: "抵达城市",
|
||||
dataIndex: "address",
|
||||
key: "address",
|
||||
},
|
||||
{
|
||||
title: "交通",
|
||||
dataIndex: "address",
|
||||
key: "address",
|
||||
},
|
||||
{
|
||||
title: "酒店",
|
||||
dataIndex: "address",
|
||||
key: "address",
|
||||
},
|
||||
{
|
||||
title: "餐饮 [午、晚]",
|
||||
dataIndex: "address",
|
||||
key: "address",
|
||||
},
|
||||
{
|
||||
title: "景点及旅游服务安排",
|
||||
dataIndex: "address",
|
||||
key: "address",
|
||||
},
|
||||
];
|
||||
|
||||
function Detail() {
|
||||
const navigate = useNavigate();
|
||||
const { reservationId } = useParams();
|
||||
const { reservationStore } = useStore();
|
||||
const { reservationList } = reservationStore;
|
||||
const navigate = useNavigate();
|
||||
const { reservationId } = useParams();
|
||||
const { reservationStore } = useStore();
|
||||
const { reservationList } = reservationStore;
|
||||
|
||||
useEffect(() => {
|
||||
console.info('Detail.useEffect: ' + reservationId);
|
||||
}, [reservationId]);
|
||||
useEffect(() => {
|
||||
console.info("Detail.useEffect: " + reservationId);
|
||||
}, [reservationId]);
|
||||
|
||||
return (
|
||||
<Space direction="vertical" style={{ width: '100%' }}>
|
||||
<Row gutter={{ md: 24 }}>
|
||||
<Col span={20}>
|
||||
<Title level={4}>Reservation Detail 中华游111029-N111025076</Title>
|
||||
</Col>
|
||||
<Col span={4}>
|
||||
<Button type="link" onClick={() => navigate('/reservation/newest')}>Return</Button>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row>
|
||||
<Col span={24}>
|
||||
<Table dataSource={dataSource} columns={columns} />
|
||||
</Col>
|
||||
</Row>
|
||||
</Space>
|
||||
);
|
||||
return (
|
||||
<Space direction="vertical" style={{ width: "100%" }}>
|
||||
<Row gutter={{ md: 24 }}>
|
||||
<Col span={20}>
|
||||
<Title level={4}>Reservation Detail 中华游111029-N111025076</Title>
|
||||
</Col>
|
||||
<Col span={4}>
|
||||
<Button type="link" onClick={() => navigate("/feedback")}>
|
||||
Return
|
||||
</Button>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row>
|
||||
<Col span={24}>
|
||||
<Table dataSource={dataSource} columns={columns} />
|
||||
</Col>
|
||||
</Row>
|
||||
</Space>
|
||||
);
|
||||
}
|
||||
|
||||
export default observer(Detail);
|
||||
export default observer(Detail);
|
||||
|
Loading…
Reference in New Issue