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

release
YCC 2 years ago
parent 9ba37b94bc
commit be9efb8e60

@ -6,3 +6,16 @@ Global Highlights Hub 海外供应商平台
1. 安装组件npm install 1. 安装组件npm install
2. 运行开发环境npm run dev 或者 start.bat 2. 运行开发环境npm run dev 或者 start.bat
3. 打包代码npm run build 或者 build.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,13 +1,11 @@
import { Outlet, Link, useHref, useLocation } from "react-router-dom"; import { Outlet, Link, useHref, useLocation } from "react-router-dom";
import { useEffect } from 'react'; import { useEffect } from "react";
import { observer } from "mobx-react"; import { observer } from "mobx-react";
import { Layout, Menu, ConfigProvider, theme, Dropdown, Space, Row, Col, App as AntApp } from 'antd'; import { Layout, Menu, ConfigProvider, theme, Dropdown, Space, Row, Col, Alert, App as AntApp } from "antd";
import { import { DownOutlined } from "@ant-design/icons";
DownOutlined import "antd/dist/reset.css";
} from '@ant-design/icons'; import AppLogo from "@/assets/logo-gh.png";
import 'antd/dist/reset.css'; import { useStore } from "@/stores/StoreContext.js";
import AppLogo from '@/assets/logo-gh.png'
import { useStore } from '@/stores/StoreContext.js';
const { Header, Content, Footer } = Layout; const { Header, Content, Footer } = Layout;
const items = [ const items = [
@ -17,7 +15,7 @@ const items = [
Profile Profile
</a> </a>
), ),
key: '0', key: "0",
}, },
{ {
label: ( label: (
@ -25,10 +23,10 @@ const items = [
Privacy Privacy
</a> </a>
), ),
key: '1', key: "1",
}, },
{ {
type: 'divider', type: "divider",
}, },
{ {
label: ( label: (
@ -36,11 +34,10 @@ const items = [
Logout Logout
</a> </a>
), ),
key: '3', key: "3",
}, },
] ];
function App() { function App() {
const { authStore } = useStore(); const { authStore } = useStore();
const href = useHref(); const href = useHref();
@ -48,7 +45,7 @@ function App() {
let location = useLocation(); let location = useLocation();
useEffect(() => { useEffect(() => {
// Check location // Check location
console.info('location.pathname: ' + location.pathname) console.info("location.pathname: " + location.pathname);
}, [location]); }, [location]);
const { const {
@ -59,35 +56,36 @@ function App() {
<ConfigProvider <ConfigProvider
theme={{ theme={{
token: { token: {
colorPrimary: '#00b96b', colorPrimary: "#00b96b",
}, },
algorithm: theme.defaultAlgorithm, algorithm: theme.defaultAlgorithm,
}} }}>
>
<AntApp> <AntApp>
<Layout <Layout
style={{ style={{
minHeight: "100vh", minHeight: "100vh",
}}> }}>
<Header className="header" style={{ position: 'sticky', top: 0, zIndex: 1, width: '100%' }}> <Header className="header" style={{ position: "sticky", top: 0, zIndex: 1, width: "100%" }}>
<Row gutter={{ md: 24 }} justify="end"> <Row gutter={{ md: 24 }} justify="end">
<Col span={20}> <Col span={20}>
<img src={AppLogo} className="logo" alt="App logo" /> <img src={AppLogo} className="logo" alt="App logo" />
<Menu theme="dark" mode="horizontal" defaultSelectedKeys={[href]} items={ <Menu
[ theme="dark"
{ key: '/reservation/newest', label: <Link to="/reservation/newest">Reservation</Link> }, mode="horizontal"
{ key: '/feedback', label: <Link to="/feedback">Feedback</Link> }, defaultSelectedKeys={[href]}
{ key: '/invoice/list', label: <Link to="/invoice/list">Invoice</Link> } 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>
<Col span={4}> <Col span={4}>
<Dropdown <Dropdown
menu={{ menu={{
items items,
}} }}>
> <a onClick={e => e.preventDefault()}>
<a onClick={(e) => e.preventDefault()}>
<Space> <Space>
{authStore.login.username} {authStore.login.username}
<DownOutlined /> <DownOutlined />
@ -97,6 +95,9 @@ function App() {
</Col> </Col>
</Row> </Row>
</Header> </Header>
<Alert message="公告 查看后不再显示,或者一直显示,或者放到页面底部" description="" type="info" banner closable />
<Content <Content
style={{ style={{
padding: 24, padding: 24,
@ -106,8 +107,7 @@ function App() {
}}> }}>
<Outlet /> <Outlet />
</Content> </Content>
<Footer> <Footer></Footer>
</Footer>
</Layout> </Layout>
</AntApp> </AntApp>
</ConfigProvider> </ConfigProvider>

@ -5,8 +5,9 @@ import { toJS } from "mobx";
import moment from "moment"; import moment from "moment";
import { Row, Col, Space, Button, Divider, Form, Typography, Rate, Radio, Modal, Upload, Input } from "antd"; import { Row, Col, Space, Button, Divider, Form, Typography, Rate, Radio, Modal, Upload, Input } from "antd";
import { useStore } from "../../stores/StoreContext.js"; import { useStore } from "../../stores/StoreContext.js";
import { UploadOutlined } from "@ant-design/icons"; import { PlusOutlined } from "@ant-design/icons";
const { Title, Text, Paragraph } = Typography; const { Title, Text, Paragraph } = Typography;
import * as config from "@/config";
function Detail() { function Detail() {
const navigate = useNavigate(); const navigate = useNavigate();
@ -54,20 +55,26 @@ function Detail() {
status: "done", status: "done",
url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png", 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 ( return (
<Space direction="vertical" style={{ width: "100%" }}> <Space direction="vertical" style={{ width: "100%" }}>
<Row gutter={16}> <Row gutter={16}>
@ -153,11 +160,19 @@ function Detail() {
<Form.Item> <Form.Item>
<Input.TextArea rows={6}></Input.TextArea> <Input.TextArea rows={6}></Input.TextArea>
</Form.Item> </Form.Item>
<Divider orientation="left">上传照片</Divider> <Divider orientation="left">上传照片</Divider>
<Form.Item label="Tour Guide Service"> <Form.Item>
<Space>上传照片</Space> <Upload name="ghhfile" accept="image/*" action={"http://202.103.68.157:890/service-fileServer/FileTransfer?filename=test11111.jpg"}>
<Upload name="filename" action="https://p9axztuwd7x8a7.mycht.cn/service-fileServer/FileTransfer" headers={{ authorization: "authorization-text" }}> <Button type="primary">上传</Button>
<Button>Click to Upload</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> </Upload>
</Form.Item> </Form.Item>
</Form> </Form>

Loading…
Cancel
Save