Merge branch 'main' of github.com:hainatravel/GHHub

perf/export-docx
黄文强@HWQ-PC 1 year ago
commit 8bfb9defdc

@ -7,8 +7,15 @@ Global Highlights Hub 海外供应商平台
2. 运行开发环境npm run dev 或者 start.bat 2. 运行开发环境npm run dev 或者 start.bat
3. 打包代码npm run build 或者 build.bat 3. 打包代码npm run build 或者 build.bat
// "push:tag": "npm version patch && git.exe push --progress "origin" main:main" ## 版本设置
// "push:tag": "npm version patch && git push origin master" npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git]
npm version premajor --no-git-tag-version
npm version prerelease --no-git-tag-version
npm version patch --no-git-tag-version
"push:tag": "npm version patch && git.exe push --progress "origin" main:main"
"push:tag": "npm version patch && git push origin master"
## 相关文档 ## 相关文档
@ -27,8 +34,6 @@ Bucket 名称global-highlights-hub
Endpointoss-cn-hongkong.aliyuncs.com Endpointoss-cn-hongkong.aliyuncs.com
global-highlights-hub.oss-cn-hongkong.aliyuncs.com global-highlights-hub.oss-cn-hongkong.aliyuncs.com
反馈表测试链接 反馈表测试链接
http://202.103.68.111:5173/feedback/330948 http://202.103.68.111:5173/feedback/330948

@ -1,7 +1,7 @@
{ {
"name": "global.highlights.hub", "name": "global-highlights-hub",
"private": true, "private": true,
"version": "2.0.0", "version": "2.0.0-0",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

@ -4,7 +4,7 @@ import useAuthStore from '@/stores/Auth'
export default function RequireAuth({ children, ...props }) { export default function RequireAuth({ children, ...props }) {
const isPermitted = useAuthStore((state) => state.isPermitted) const [isPermitted, currentUser] = useAuthStore(state => [state.isPermitted, state.currentUser])
const { userId } = usingStorage() const { userId } = usingStorage()
if (isPermitted(props.subject)) { if (isPermitted(props.subject)) {
@ -15,7 +15,7 @@ export default function RequireAuth({ children, ...props }) {
<Result <Result
status='403' status='403'
title='403' title='403'
subTitle={`抱歉,你(${userId})没有权限使用该功能`} subTitle={`抱歉,你(${currentUser.username})没有权限使用该功能(${props.subject})`}
/> />
) )
} }

@ -37,10 +37,12 @@ import { isNotEmpty } from '@/utils/commons'
import ProductsManage from '@/views/products/Manage'; import ProductsManage from '@/views/products/Manage';
import ProductsDetail from '@/views/products/Detail'; import ProductsDetail from '@/views/products/Detail';
import ProductsAudit from '@/views/products/Audit'; import ProductsAudit from '@/views/products/Audit';
import { PERM_ACCOUNT_MANAGEMENT, PERM_ROLE_NEW, PERM_OVERSEA, PERM_AIR_TICKET, PERM_PRODUCTS_MANAGEMENT } from '@/config' import { PERM_ACCOUNT_MANAGEMENT, PERM_ROLE_NEW, PERM_OVERSEA, PERM_AIR_TICKET, PERM_PRODUCTS_MANAGEMENT, PERM_PRODUCTS_OFFER_PUT } from '@/config'
import './i18n' import './i18n'
const { createRoot } = ReactDOM
const initRouter = async () => { const initRouter = async () => {
return createBrowserRouter([ return createBrowserRouter([
{ {
@ -69,7 +71,7 @@ const initRouter = async () => {
{ path: 'airticket/plan/:coli_sn',element:<RequireAuth subject={PERM_AIR_TICKET} result={true}><AirticketPlan /></RequireAuth>}, { path: 'airticket/plan/:coli_sn',element:<RequireAuth subject={PERM_AIR_TICKET} result={true}><AirticketPlan /></RequireAuth>},
{ path: "products",element: <RequireAuth subject={PERM_PRODUCTS_MANAGEMENT} result={true}><ProductsManage /></RequireAuth>}, { path: "products",element: <RequireAuth subject={PERM_PRODUCTS_MANAGEMENT} result={true}><ProductsManage /></RequireAuth>},
{ path: "products/:travel_agency_id/:use_year/:audit_state/audit",element:<RequireAuth subject={PERM_PRODUCTS_MANAGEMENT} result={true}><ProductsAudit /></RequireAuth>}, { path: "products/:travel_agency_id/:use_year/:audit_state/audit",element:<RequireAuth subject={PERM_PRODUCTS_MANAGEMENT} result={true}><ProductsAudit /></RequireAuth>},
{ path: "products/:travel_agency_id/:use_year/:audit_state/edit",element:<ProductsDetail />}, { path: "products/:travel_agency_id/:use_year/:audit_state/edit",element:<RequireAuth subject={PERM_PRODUCTS_OFFER_PUT} result={true}><ProductsDetail /></RequireAuth>},
] ]
}, },
{ {
@ -92,7 +94,7 @@ const initAppliction = async () => {
const router = await initRouter() const router = await initRouter()
ReactDOM.createRoot(document.getElementById('root')).render( createRoot(document.getElementById('root')).render(
//<React.StrictMode> //<React.StrictMode>
<ThemeContext.Provider value={{ colorPrimary: '#00b96b', borderRadius: 4 }}> <ThemeContext.Provider value={{ colorPrimary: '#00b96b', borderRadius: 4 }}>
<RouterProvider <RouterProvider

@ -126,11 +126,16 @@ const useAuthStore = create((set, get) => ({
}, },
logout: () => { logout: () => {
const { tokenInterval } = get() const { tokenInterval, currentUser } = get()
const { clearStorage } = usingStorage() const { clearStorage } = usingStorage()
clearStorage() clearStorage()
clearInterval(tokenInterval) clearInterval(tokenInterval)
set(initialState) set(() => ({
...initialState,
currentUser: {
username: currentUser.username
}
}))
}, },
startTokenInterval: () => { startTokenInterval: () => {

@ -101,8 +101,7 @@ function App() {
>{t('Submit')}</Button></Space> >{t('Submit')}</Button></Space>
</Modal> </Modal>
<Layout <Layout className='min-h-screen'>
className='min-h-screen'>
<Header className='sticky top-0 z-10 w-full'> <Header className='sticky top-0 z-10 w-full'>
<Row gutter={{ md: 24 }} justify='end' align='middle'> <Row gutter={{ md: 24 }} justify='end' align='middle'>
<Col span={16}> <Col span={16}>

@ -38,7 +38,7 @@ function Login() {
} }
return ( return (
<Row justify='center' align='middle' style={{ minHeight: 500 }}> <Row justify='center' align='middle' className='min-h-96'>
<Form <Form
name='basic' name='basic'
form={form} form={form}
@ -49,9 +49,7 @@ function Login() {
wrapperCol={{ wrapperCol={{
span: 16, span: 16,
}} }}
style={{ className='max-w-xl'
maxWidth: 600,
}}
initialValues={{ initialValues={{
remember: true, remember: true,
}} }}
@ -89,7 +87,7 @@ function Login() {
span: 16, span: 16,
}} }}
> >
<Button type='primary' htmlType='submit' style={{width: '100%'}}> <Button type='primary' htmlType='submit' className='w-full'>
{t('Login')} {t('Login')}
</Button> </Button>
</Form.Item> </Form.Item>

@ -25,28 +25,19 @@ function Standlone() {
algorithm: theme.defaultAlgorithm, algorithm: theme.defaultAlgorithm,
}}> }}>
<AntApp> <AntApp>
<Layout <Layout className='min-h-screen'>
style={{
minHeight: '100vh',
}}>
<Header className='sticky top-0 z-10 w-full'> <Header className='sticky top-0 z-10 w-full'>
<Row gutter={{ md: 24 }} justify='center'> <Row gutter={{ md: 24 }} justify='center'>
<Col span={4}> <Col span={4}>
<img src={AppLogo} className='float-left h-9 my-4 mr-6 ml-0 bg-white/30' alt='App logo' /> <img src={AppLogo} className='float-left h-9 my-4 mr-6 ml-0 bg-white/30' alt='App logo' />
</Col> </Col>
<Col span={18}><Title style={{ color: 'white', marginTop: '3.5px' }}>Global Highlights Hub</Title></Col> <Col span={18}><h1 className='text-white'>Global Highlights Hub</h1></Col>
<Col span={2}> <Col span={2}>
<Language /> <Language />
</Col> </Col>
</Row> </Row>
</Header> </Header>
<Content <Content className='p-6 m-0 min-h-72 bg-white'>
style={{
padding: 24,
margin: 0,
minHeight: 280,
background: colorBgContainer,
}}>
<Outlet /> <Outlet />
</Content> </Content>
<Footer></Footer> <Footer></Footer>

@ -41,15 +41,13 @@ function ChangePassword() {
return ( return (
<> <>
<Row justify="center" align="middle" style={{ minHeight: 500 }}> <Row justify="center" align="middle" className='min-h-96'>
<Form <Form
name="basic" name="basic"
form={form} form={form}
layout="vertical" layout="vertical"
size="large" size="large"
style={{ className='max-w-xl'
maxWidth: 600,
}}
onFinish={onFinish} onFinish={onFinish}
onFinishFailed={onFinishFailed} onFinishFailed={onFinishFailed}
autoComplete="off" autoComplete="off"

@ -224,17 +224,15 @@ function Management() {
}} }}
title={t('account:detail')} title={t('account:detail')}
open={isAccountModalOpen} onOk={() => setAccountModalOpen(false)} onCancel={() => setAccountModalOpen(false)} open={isAccountModalOpen} onOk={() => setAccountModalOpen(false)} onCancel={() => setAccountModalOpen(false)}
destroyOnClose={true} destroyOnClose
clearOnDestroy={true} forceRender
modalRender={(dom) => ( modalRender={(dom) => (
<Form <Form
name='AccountForm' name='AccountForm'
form={accountForm} form={accountForm}
layout='vertical' layout='vertical'
size='large' size='large'
style={{ className='max-w-2xl'
maxWidth: 600,
}}
onFinish={onAccountFinish} onFinish={onAccountFinish}
onFinishFailed={onAccountFailed} onFinishFailed={onAccountFailed}
autoComplete='off' autoComplete='off'
@ -322,7 +320,7 @@ function Management() {
</Select> </Select>
</Form.Item> </Form.Item>
</Modal> </Modal>
<Space direction='vertical' style={{ width: '100%' }}> <Space direction='vertical' className='w-full'>
<Title level={3}>{t('account:accountList')}</Title> <Title level={3}>{t('account:accountList')}</Title>
<SearchForm <SearchForm
fieldsConfig={{ fieldsConfig={{
@ -331,7 +329,7 @@ function Management() {
username: { label: t('account:username') }, username: { label: t('account:username') },
realname: { label: t('account:realname') }, realname: { label: t('account:realname') },
}, },
sort: { username: 1, realname: 2, dates: 3}, sort: { username: 1, realname: 2},
}} }}
onSubmit={() => { onSubmit={() => {
handelAccountSearch() handelAccountSearch()

@ -161,17 +161,15 @@ function RoleList() {
}} }}
title={t('account:detail')} title={t('account:detail')}
open={isRoleModalOpen} onOk={() => setRoleModalOpen(false)} onCancel={() => setRoleModalOpen(false)} open={isRoleModalOpen} onOk={() => setRoleModalOpen(false)} onCancel={() => setRoleModalOpen(false)}
destroyOnClose={true} destroyOnClose
clearOnDestroy={true} forceRender
modalRender={(dom) => ( modalRender={(dom) => (
<Form <Form
name='RoleForm' name='RoleForm'
form={roleForm} form={roleForm}
layout='vertical' layout='vertical'
size='large' size='large'
style={{ className='max-w-xl'
maxWidth: 600,
}}
onFinish={onRoleFinish} onFinish={onRoleFinish}
onFinishFailed={onRoleFailed} onFinishFailed={onRoleFailed}
autoComplete='off' autoComplete='off'
@ -198,10 +196,7 @@ function RoleList() {
name='res_array' name='res_array'
> >
<TreeSelect treeData={permissionTreeData} value={permissionValue} <TreeSelect treeData={permissionTreeData} value={permissionValue}
dropdownStyle={{ popupClassName='max-w-xl overflow-auto'
maxHeight: 600,
overflow: 'auto',
}}
placement='bottomLeft' placement='bottomLeft'
showSearch showSearch
allowClear allowClear
@ -212,12 +207,10 @@ function RoleList() {
treeCheckable={true} treeCheckable={true}
showCheckedStrategy={TreeSelect.SHOW_CHILD} showCheckedStrategy={TreeSelect.SHOW_CHILD}
placeholder={'Please select'} placeholder={'Please select'}
style={{ className='w-full' />
width: '100%',
}} />
</Form.Item> </Form.Item>
</Modal> </Modal>
<Space direction='vertical' style={{ width: '100%' }}> <Space direction='vertical' className='w-full'>
<Title level={3}>{t('account:roleList')}</Title> <Title level={3}>{t('account:roleList')}</Title>
<Row> <Row>
<Col span={24}> <Col span={24}>

@ -167,12 +167,12 @@ function Detail() {
<Row gutter={{ md: 24 }}> <Row gutter={{ md: 24 }}>
<Col span={12} className='w-full'> <Col span={12} className='w-full'>
<iframe id='msdoc-iframe-reservation' title='msdoc-iframe-reservation' <iframe id='msdoc-iframe-reservation' title='msdoc-iframe-reservation'
src={reservationPreviewUrl} frameBorder='0' style={{height: '600px'}} className='w-full'></iframe> src={reservationPreviewUrl} frameBorder='0' className='w-full h-[600px]'></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} className='w-full'> <Col span={12} className='w-full'>
<iframe id='msdoc-iframe-name-card' title='msdoc-iframe-name-card' <iframe id='msdoc-iframe-name-card' title='msdoc-iframe-name-card'
src={nameCardPreviewUrl} frameBorder='0' style={{height: '600px'}} className='w-full'></iframe> src={nameCardPreviewUrl} frameBorder='0' className='w-full h-[600px]'></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>

Loading…
Cancel
Save