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
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
global-highlights-hub.oss-cn-hongkong.aliyuncs.com
反馈表测试链接
http://202.103.68.111:5173/feedback/330948

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

@ -4,7 +4,7 @@ import useAuthStore from '@/stores/Auth'
export default function RequireAuth({ children, ...props }) {
const isPermitted = useAuthStore((state) => state.isPermitted)
const [isPermitted, currentUser] = useAuthStore(state => [state.isPermitted, state.currentUser])
const { userId } = usingStorage()
if (isPermitted(props.subject)) {
@ -15,7 +15,7 @@ export default function RequireAuth({ children, ...props }) {
<Result
status='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 ProductsDetail from '@/views/products/Detail';
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'
const { createRoot } = ReactDOM
const initRouter = async () => {
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: "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/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()
ReactDOM.createRoot(document.getElementById('root')).render(
createRoot(document.getElementById('root')).render(
//<React.StrictMode>
<ThemeContext.Provider value={{ colorPrimary: '#00b96b', borderRadius: 4 }}>
<RouterProvider

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

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

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

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

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

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

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

@ -167,12 +167,12 @@ function Detail() {
<Row gutter={{ md: 24 }}>
<Col span={12} className='w-full'>
<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>
</Col>
<Col span={12} className='w-full'>
<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>
</Col>
</Row>

Loading…
Cancel
Save