feat: 增加返回顶部按钮

fix: 合同保存成功后关闭对话框
perf: 优化 main.jsx
main
Jimmy Liow 10 months ago
parent a7954e1114
commit ad81a60d55

@ -1,5 +1,4 @@
import React from 'react' import { createRoot } from 'react-dom/client'
import ReactDOM from 'react-dom/client'
import { import {
createBrowserRouter, createBrowserRouter,
RouterProvider, RouterProvider,
@ -42,8 +41,6 @@ import { PERM_ACCOUNT_MANAGEMENT, PERM_ROLE_NEW, PERM_OVERSEA, PERM_AIR_TICKET,
import './i18n' import './i18n'
const { createRoot } = ReactDOM
const initRouter = async () => { const initRouter = async () => {
return createBrowserRouter([ return createBrowserRouter([
{ {
@ -100,8 +97,11 @@ const initAppliction = async () => {
} }
const router = await initRouter() const router = await initRouter()
const root = document.getElementById('root')
if (!root) throw new Error('No root element found')
createRoot(document.getElementById('root')).render( createRoot(root).render(
//<React.StrictMode> //<React.StrictMode>
<ThemeContext.Provider value={{ colorPrimary: '#00b96b', borderRadius: 4 }}> <ThemeContext.Provider value={{ colorPrimary: '#00b96b', borderRadius: 4 }}>
<RouterProvider <RouterProvider

@ -82,7 +82,15 @@ function App() {
algorithm: theme.defaultAlgorithm, algorithm: theme.defaultAlgorithm,
}}> }}>
<AntApp> <AntApp>
<FloatButton icon={<BugOutlined />} onClick={() => uploadLog()} /> <FloatButton.Group
shape='square'
style={{
insetInlineEnd: 94,
}}
>
<FloatButton icon={<BugOutlined />} onClick={() => uploadLog()} />
<FloatButton.BackTop />
</FloatButton.Group>
{contextHolder} {contextHolder}
<ErrorBoundary> <ErrorBoundary>
<Layout className='min-h-screen'> <Layout className='min-h-screen'>

@ -22,6 +22,7 @@ export const ContractRemarksModal = () => {
const remarkList = remarksForm.getFieldsValue().remarkList const remarkList = remarksForm.getFieldsValue().remarkList
saveOrUpdateRemark(remarkList) saveOrUpdateRemark(remarkList)
.then(() => { .then(() => {
setRemarksModalOpen(false)
notification.info({ notification.info({
message: 'Notification', message: 'Notification',
description: '合同备注保存成功', description: '合同备注保存成功',

Loading…
Cancel
Save