diff --git a/admin/src/app/app.tsx b/admin/src/app/app.tsx index 663501e4..2d4ed2d8 100644 --- a/admin/src/app/app.tsx +++ b/admin/src/app/app.tsx @@ -36,8 +36,8 @@ export async function create(elementID: string, o: Options) { } /** -* 项目的根组件 -*/ + * 项目的根组件 + */ function App(props: {opt: Required, f: API}) { const { Provider } = buildContext(props.opt, props.f); // buildContext 必须在组件内使用! diff --git a/admin/src/components/form/checkbox/checkbox.tsx b/admin/src/components/form/checkbox/checkbox.tsx index 670c9ab6..a132896d 100644 --- a/admin/src/components/form/checkbox/checkbox.tsx +++ b/admin/src/components/form/checkbox/checkbox.tsx @@ -13,7 +13,7 @@ export interface Props extends FieldBaseProps { icon?: boolean; /** - * 复选框的默认状态,undefined 表示未确定的状态,true 为选中,false 为未选中。 + * 复选框的初始状态,undefined 表示未确定的状态,true 为选中,false 为未选中。 */ checked?: boolean; diff --git a/admin/src/components/page/page.tsx b/admin/src/components/page/page.tsx index 7b827dfd..f30dd8ee 100644 --- a/admin/src/components/page/page.tsx +++ b/admin/src/components/page/page.tsx @@ -12,19 +12,23 @@ export interface Props extends BaseProps, ParentProps { * 指定页面标题,可以是翻译 ID */ title: string; + + class?: string; } /** * 页面组件 + * + * 默认是 flex-col 布局。如果有需要,可自行指定 class 进行修改。 */ -export default function(props: Props) { +export default function (props: Props) { const ctx = useApp(); createEffect(() => { ctx.title = ctx.t(props.title as any); }); - return
+ return
{props.children}
; } diff --git a/admin/src/components/page/style.css b/admin/src/components/page/style.css new file mode 100644 index 00000000..51d4f977 --- /dev/null +++ b/admin/src/components/page/style.css @@ -0,0 +1,11 @@ +/* + * SPDX-FileCopyrightText: 2024 caixw + * + * SPDX-License-Identifier: MIT + */ + +@layer components { + .c--page { + @apply p-4 pt-6 flex flex-col gap-4 mx-auto; + } +} diff --git a/admin/src/components/style.css b/admin/src/components/style.css index e71e6da0..e9a5cffa 100644 --- a/admin/src/components/style.css +++ b/admin/src/components/style.css @@ -18,3 +18,4 @@ @import './pagination/style.css'; @import './table/style.css'; @import './spin/style.css'; +@import './page/style.css'; diff --git a/admin/src/pages/roles/roles.tsx b/admin/src/pages/roles/roles.tsx index e77ece3d..7c2c653b 100644 --- a/admin/src/pages/roles/roles.tsx +++ b/admin/src/pages/roles/roles.tsx @@ -71,7 +71,7 @@ export default function Roles(props: Props): JSX.Element { dialogRef.showModal(); }; - return + return dialogRef=el} header={currentID.getValue() ? ctx.t('_i.page.editItem') : ctx.t('_i.page.newItem')} actions={dialogRef!.DefaultActions(save)} diff --git a/admin/src/pages/system/info.tsx b/admin/src/pages/system/info.tsx index b9faae6f..eb7573c3 100644 --- a/admin/src/pages/system/info.tsx +++ b/admin/src/pages/system/info.tsx @@ -44,7 +44,7 @@ export default function(): JSX.Element { return ret.body; }); - return + return
TODO @@ -152,4 +152,4 @@ export default function(): JSX.Element {
; -} \ No newline at end of file +} diff --git a/admin/src/pages/system/services.tsx b/admin/src/pages/system/services.tsx index 13710a5e..05eeacb7 100644 --- a/admin/src/pages/system/services.tsx +++ b/admin/src/pages/system/services.tsx @@ -4,10 +4,10 @@ import { JSX, createMemo } from 'solid-js'; -import { LoaderTable, Column, Page, translateEnum } from '@/components'; -import { MessageKey } from '@/locales'; import { useApp } from '@/app'; +import { Column, LoaderTable, Page, translateEnum } from '@/components'; import { Query } from '@/core'; +import { MessageKey } from '@/locales'; interface Service { jobs: Array; @@ -47,7 +47,7 @@ export default function(): JSX.Element { return ret.body; }); - return + return
{ctx.t('_i.page.system.services')} (await items())?.services} queries={{}} columns={[ @@ -74,4 +74,4 @@ export default function(): JSX.Element { ]} />
; -} \ No newline at end of file +}