feat(web): 增加装饰
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
import {ProLayout} from '@ant-design/pro-components'
|
import {type AppItemProps, ProLayout} from '@ant-design/pro-components'
|
||||||
import {ConfigProvider} from 'antd'
|
import {ConfigProvider} from 'antd'
|
||||||
import React from 'react'
|
import {dateFormat} from 'licia'
|
||||||
|
import React, {useMemo} from 'react'
|
||||||
import {Outlet, useLocation, useNavigate} from 'react-router'
|
import {Outlet, useLocation, useNavigate} from 'react-router'
|
||||||
import {menus} from '../route.tsx'
|
import {menus} from '../route.tsx'
|
||||||
|
|
||||||
const apps: { title: string, desc: string, url: string, icon?: string }[] = [
|
const apps: AppItemProps[] = [
|
||||||
{
|
{
|
||||||
icon: 'http://132.126.207.124:8686/udal-manager/static/favicon.ico',
|
icon: 'http://132.126.207.124:8686/udal-manager/static/favicon.ico',
|
||||||
title: 'CSV-HUDI处理平台',
|
title: 'CSV-HUDI处理平台',
|
||||||
@@ -16,8 +17,10 @@ const apps: { title: string, desc: string, url: string, icon?: string }[] = [
|
|||||||
const App: React.FC = () => {
|
const App: React.FC = () => {
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
|
const currentYear = useMemo(() => dateFormat(new Date(), 'yyyy'), [])
|
||||||
return (
|
return (
|
||||||
<ProLayout
|
<ProLayout
|
||||||
|
siderWidth={180}
|
||||||
token={{
|
token={{
|
||||||
colorTextAppListIcon: '#dfdfdf',
|
colorTextAppListIcon: '#dfdfdf',
|
||||||
colorTextAppListIconHover: '#ffffff',
|
colorTextAppListIconHover: '#ffffff',
|
||||||
@@ -31,8 +34,16 @@ const App: React.FC = () => {
|
|||||||
colorBgMenuItemSelected: '#22272b',
|
colorBgMenuItemSelected: '#22272b',
|
||||||
colorTextRightActionsItem: '#dfdfdf',
|
colorTextRightActionsItem: '#dfdfdf',
|
||||||
},
|
},
|
||||||
|
pageContainer: {
|
||||||
|
paddingBlockPageContainerContent: 0,
|
||||||
|
paddingInlinePageContainerContent: 0,
|
||||||
|
marginBlockPageContainerContent: 0,
|
||||||
|
marginInlinePageContainerContent: 0,
|
||||||
|
},
|
||||||
}}
|
}}
|
||||||
appList={apps}
|
appList={apps}
|
||||||
|
defaultCollapsed={false}
|
||||||
|
breakpoint={false}
|
||||||
disableMobile={true}
|
disableMobile={true}
|
||||||
logo={<img src="icon.png" alt="logo"/>}
|
logo={<img src="icon.png" alt="logo"/>}
|
||||||
title="Hudi 服务总台"
|
title="Hudi 服务总台"
|
||||||
@@ -47,6 +58,15 @@ const App: React.FC = () => {
|
|||||||
splitMenus={true}
|
splitMenus={true}
|
||||||
style={{minHeight: '100vh'}}
|
style={{minHeight: '100vh'}}
|
||||||
contentStyle={{backgroundColor: 'white', padding: '10px 10px 10px 20px'}}
|
contentStyle={{backgroundColor: 'white', padding: '10px 10px 10px 20px'}}
|
||||||
|
menuFooterRender={props => {
|
||||||
|
return (
|
||||||
|
<div className="text-sm text-center" style={{userSelect: 'none', msUserSelect: 'none'}}>
|
||||||
|
{props?.collapsed
|
||||||
|
? undefined
|
||||||
|
: <div>© 2023-{currentYear} 汇聚平台</div>}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<ConfigProvider
|
<ConfigProvider
|
||||||
theme={{
|
theme={{
|
||||||
|
|||||||
2
service-web/client/src/vite-env.d.ts
vendored
2
service-web/client/src/vite-env.d.ts
vendored
@@ -1 +1,3 @@
|
|||||||
/// <reference types="vite/client" />
|
/// <reference types="vite/client" />
|
||||||
|
|
||||||
|
declare const __APP_VERSION__: string
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
import react from '@vitejs/plugin-react-swc'
|
import react from '@vitejs/plugin-react-swc'
|
||||||
import {defineConfig, type UserConfig} from 'vite'
|
import {defineConfig, type UserConfig} from 'vite'
|
||||||
import obfuscatorPlugin from 'vite-plugin-javascript-obfuscator'
|
import obfuscatorPlugin from 'vite-plugin-javascript-obfuscator'
|
||||||
|
import packageJson from './package.json'
|
||||||
|
|
||||||
// https://vite.dev/config/
|
// https://vite.dev/config/
|
||||||
export default defineConfig(({mode}) => {
|
export default defineConfig(({mode}) => {
|
||||||
let config: UserConfig = {
|
let config: UserConfig = {
|
||||||
|
define: {
|
||||||
|
__APP_VERSION__: JSON.stringify(packageJson.version) ?? '0.0.0',
|
||||||
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
react(),
|
react(),
|
||||||
obfuscatorPlugin({
|
obfuscatorPlugin({
|
||||||
|
|||||||
Reference in New Issue
Block a user