添加文档引用,图片上传测试,显示公告

release
YCC 2 years ago
parent 9ba37b94bc
commit be9efb8e60

@ -6,3 +6,16 @@ Global Highlights Hub 海外供应商平台
1. 安装组件npm install
2. 运行开发环境npm run dev 或者 start.bat
3. 打包代码npm run build 或者 build.bat
## 相关文档
需求文档 https://www.kdocs.cn/l/csZrIZlpuF2i
dayjs https://dayjs.gitee.io/docs/zh-CN/manipulate/start-of
antd https://ant-design.antgroup.com/components/upload-cn#uploadfile
反馈表案例 https://www.chinahighlights.com/customerservice/feedback/PostTourSurveyFormToWLGH.asp?LGC=1&COLI_SN=988185&MEI_SN=954295&Email=jennroth18@hotmail.com&ToC=0&ShowType=&page_class=4&dei_sn=28&country=30,490
国内供应商平台 http://p.mycht.cn/index.aspx
## 阿里云OSS
Bucket 名称global-highlights-hub
Endpointoss-cn-hongkong.aliyuncs.com
global-highlights-hub.oss-cn-hongkong.aliyuncs.com

@ -1,117 +1,117 @@
import { Outlet, Link, useHref, useLocation } from "react-router-dom";
import { useEffect } from 'react';
import { useEffect } from "react";
import { observer } from "mobx-react";
import { Layout, Menu, ConfigProvider, theme, Dropdown, Space, Row, Col, App as AntApp } from 'antd';
import {
DownOutlined
} from '@ant-design/icons';
import 'antd/dist/reset.css';
import AppLogo from '@/assets/logo-gh.png'
import { useStore } from '@/stores/StoreContext.js';
import { Layout, Menu, ConfigProvider, theme, Dropdown, Space, Row, Col, Alert, App as AntApp } from "antd";
import { DownOutlined } from "@ant-design/icons";
import "antd/dist/reset.css";
import AppLogo from "@/assets/logo-gh.png";
import { useStore } from "@/stores/StoreContext.js";
const { Header, Content, Footer } = Layout;
const items = [
{
label: (
<a target="_blank" rel="noopener noreferrer" href="#">
Profile
</a>
),
key: '0',
},
{
label: (
<a target="_blank" rel="noopener noreferrer" href="#">
Privacy
</a>
),
key: '1',
},
{
type: 'divider',
},
{
label: (
<a target="_blank" rel="noopener noreferrer" href="#">
Logout
</a>
),
key: '3',
},
]
{
label: (
<a target="_blank" rel="noopener noreferrer" href="#">
Profile
</a>
),
key: "0",
},
{
label: (
<a target="_blank" rel="noopener noreferrer" href="#">
Privacy
</a>
),
key: "1",
},
{
type: "divider",
},
{
label: (
<a target="_blank" rel="noopener noreferrer" href="#">
Logout
</a>
),
key: "3",
},
];
function App() {
const { authStore } = useStore();
const { authStore } = useStore();
const href = useHref();
const href = useHref();
let location = useLocation();
useEffect(() => {
// Check location
console.info("location.pathname: " + location.pathname);
}, [location]);
let location = useLocation();
useEffect(() => {
// Check location
console.info('location.pathname: ' + location.pathname)
}, [location]);
const {
token: { colorBgContainer },
} = theme.useToken();
const {
token: { colorBgContainer },
} = theme.useToken();
return (
<ConfigProvider
theme={{
token: {
colorPrimary: "#00b96b",
},
algorithm: theme.defaultAlgorithm,
}}>
<AntApp>
<Layout
style={{
minHeight: "100vh",
}}>
<Header className="header" style={{ position: "sticky", top: 0, zIndex: 1, width: "100%" }}>
<Row gutter={{ md: 24 }} justify="end">
<Col span={20}>
<img src={AppLogo} className="logo" alt="App logo" />
<Menu
theme="dark"
mode="horizontal"
defaultSelectedKeys={[href]}
items={[
{ key: "/reservation/newest", label: <Link to="/reservation/newest">Reservation</Link> },
{ key: "/feedback", label: <Link to="/feedback">Feedback</Link> },
{ key: "/invoice/list", label: <Link to="/invoice/list">Invoice</Link> },
]}
/>
</Col>
<Col span={4}>
<Dropdown
menu={{
items,
}}>
<a onClick={e => e.preventDefault()}>
<Space>
{authStore.login.username}
<DownOutlined />
</Space>
</a>
</Dropdown>
</Col>
</Row>
</Header>
return (
<ConfigProvider
theme={{
token: {
colorPrimary: '#00b96b',
},
algorithm: theme.defaultAlgorithm,
}}
>
<AntApp>
<Layout
style={{
minHeight: "100vh",
}}>
<Header className="header" style={{ position: 'sticky', top: 0, zIndex: 1, width: '100%' }}>
<Row gutter={{ md: 24 }} justify="end">
<Col span={20}>
<img src={AppLogo} className="logo" alt="App logo" />
<Menu theme="dark" mode="horizontal" defaultSelectedKeys={[href]} items={
[
{ key: '/reservation/newest', label: <Link to="/reservation/newest">Reservation</Link> },
{ key: '/feedback', label: <Link to="/feedback">Feedback</Link> },
{ key: '/invoice/list', label: <Link to="/invoice/list">Invoice</Link> }
]
} />
</Col>
<Col span={4}>
<Dropdown
menu={{
items
}}
>
<a onClick={(e) => e.preventDefault()}>
<Space>
{authStore.login.username}
<DownOutlined />
</Space>
</a>
</Dropdown>
</Col>
</Row>
</Header>
<Content
style={{
padding: 24,
margin: 0,
minHeight: 280,
background: colorBgContainer,
}}>
<Outlet />
</Content>
<Footer>
</Footer>
</Layout>
</AntApp>
</ConfigProvider>
);
<Alert message="公告 查看后不再显示,或者一直显示,或者放到页面底部" description="" type="info" banner closable />
<Content
style={{
padding: 24,
margin: 0,
minHeight: 280,
background: colorBgContainer,
}}>
<Outlet />
</Content>
<Footer></Footer>
</Layout>
</AntApp>
</ConfigProvider>
);
}
export default observer(App);

@ -5,8 +5,9 @@ import { toJS } from "mobx";
import moment from "moment";
import { Row, Col, Space, Button, Divider, Form, Typography, Rate, Radio, Modal, Upload, Input } from "antd";
import { useStore } from "../../stores/StoreContext.js";
import { UploadOutlined } from "@ant-design/icons";
import { PlusOutlined } from "@ant-design/icons";
const { Title, Text, Paragraph } = Typography;
import * as config from "@/config";
function Detail() {
const navigate = useNavigate();
@ -54,20 +55,26 @@ function Detail() {
status: "done",
url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png",
},
{
uid: "-xxx",
percent: 50,
name: "image.png",
status: "uploading",
url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png",
},
{
uid: "-5",
name: "image.png",
status: "error",
},
]);
const handleChange = info => {
console.log(info);
// ({ fileList: newFileList }) => setFileList(newFileList)
let newFileList = [...info.fileList];
newFileList = newFileList.map(file => {
if (file.response) {
file.url = file.response.url;
}
return file;
});
setFileList(newFileList);
};
const handRemove=info=>{
console.log(info);
return true
}
return (
<Space direction="vertical" style={{ width: "100%" }}>
<Row gutter={16}>
@ -153,11 +160,19 @@ function Detail() {
<Form.Item>
<Input.TextArea rows={6}></Input.TextArea>
</Form.Item>
<Divider orientation="left">上传照片</Divider>
<Form.Item label="Tour Guide Service">
<Space>上传照片</Space>
<Upload name="filename" action="https://p9axztuwd7x8a7.mycht.cn/service-fileServer/FileTransfer" headers={{ authorization: "authorization-text" }}>
<Button>Click to Upload</Button>
<Form.Item>
<Upload name="ghhfile" accept="image/*" action={"http://202.103.68.157:890/service-fileServer/FileTransfer?filename=test11111.jpg"}>
<Button type="primary">上传</Button>
</Upload>
</Form.Item>
<Form.Item>
<Upload name="ghhfile-111" accept="image/*" action={config.HT_HOST + "/service-fileServer/FileTransfer?filename=test11111.jpg"} fileList={fileList} listType="picture-card" onChange={handleChange} onRemove={handRemove}>
<div>
<PlusOutlined />
<div style={{ marginTop: 8 }}>Click to Upload</div>
</div>
</Upload>
</Form.Item>
</Form>

Loading…
Cancel
Save