diff --git a/orion-ops-ui/src/assets/style/layout.less b/orion-ops-ui/src/assets/style/layout.less index 1cc3918c..50525289 100644 --- a/orion-ops-ui/src/assets/style/layout.less +++ b/orion-ops-ui/src/assets/style/layout.less @@ -7,18 +7,52 @@ .table-search-card { width: 100%; + padding-top: 16px; margin-bottom: 16px; + + .arco-form-item { + margin-bottom: 0; + } +} + +.table-bar-handle { + display: flex; + align-items: center; + justify-content: end } .table-card { width: 100%; + + .arco-card-header { + padding: 8px 16px 0 16px; + + .arco-card-header-title { + display: flex; + justify-content: space-between; + + .table-title { + display: flex; + align-items: center; + font-size: 16px; + font-weight: 600; + } + } + } + } .table-wrapper { - margin-top: 16px; + &-8 { + margin-top: 8px; + } + + &-16 { + margin-top: 16px; + } } -.table-option-wrapper { +.table-handle-wrapper { .arco-btn-text { padding: 0 8px; } diff --git a/orion-ops-ui/src/types/global.ts b/orion-ops-ui/src/types/global.ts index d28b5d4a..8095a246 100644 --- a/orion-ops-ui/src/types/global.ts +++ b/orion-ops-ui/src/types/global.ts @@ -26,9 +26,13 @@ export interface PostData { export interface Pagination { page?: number; limit?: number; - current?: number; - pageSize?: number; - total?: number; +} + +export interface DataGrid { + page: number; + limit: number; + total: number; + rows: T[]; } export type TimeRanger = [string, string]; diff --git a/orion-ops-ui/src/types/table.ts b/orion-ops-ui/src/types/table.ts new file mode 100644 index 00000000..840c20e4 --- /dev/null +++ b/orion-ops-ui/src/types/table.ts @@ -0,0 +1,25 @@ +import { PaginationProps, TableRowSelection } from '@arco-design/web-vue'; + +/** + * 默认分页 + */ +export const defaultPagination = (): PaginationProps => { + return { + current: 1, + pageSize: 10, + showTotal: true, + showPageSize: true, + pageSizeOptions: [10, 20, 30, 50, 100] + }; +}; + +/** + * 默认行选择器 + */ +export const defaultRowSelection = (): TableRowSelection => { + return { + type: 'checkbox', + showCheckedAll: true, + onlyCurrent: true, + }; +}; diff --git a/orion-ops-ui/src/utils/index.ts b/orion-ops-ui/src/utils/index.ts index 959ee36c..2ca87960 100644 --- a/orion-ops-ui/src/utils/index.ts +++ b/orion-ops-ui/src/utils/index.ts @@ -57,10 +57,12 @@ export function isEmptyStr(val: any) { return typeof (val) === 'undefined' || val == null || val === ''; } +export const YMD_HMS = 'yyyy-MM-dd HH:mm:ss'; + /** * 格式化时间 */ -export function dateFormat(date = new Date(), pattern = 'yyyy-MM-dd HH:mm:ss') { +export function dateFormat(date = new Date(), pattern = YMD_HMS) { const o = { 'M+': date.getMonth() + 1, 'd+': date.getDate(), diff --git a/orion-ops-ui/src/views/system/menu/components/menu-form-modal.vue b/orion-ops-ui/src/views/system/menu/components/menu-form-modal.vue index bc8ad0b6..37b578f9 100644 --- a/orion-ops-ui/src/views/system/menu/components/menu-form-modal.vue +++ b/orion-ops-ui/src/views/system/menu/components/menu-form-modal.vue @@ -107,16 +107,15 @@ diff --git a/orion-ops-ui/src/views/system/menu/index.vue b/orion-ops-ui/src/views/system/menu/index.vue index f871ca1c..2017294c 100644 --- a/orion-ops-ui/src/views/system/menu/index.vue +++ b/orion-ops-ui/src/views/system/menu/index.vue @@ -19,9 +19,10 @@