diff --git a/src/components/common/data-table.vue b/src/components/common/data-table.vue new file mode 100644 index 00000000..cc5ce083 --- /dev/null +++ b/src/components/common/data-table.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/src/constants/app.ts b/src/constants/app.ts index 4767c479..cc249c10 100644 --- a/src/constants/app.ts +++ b/src/constants/app.ts @@ -63,3 +63,11 @@ export const resetCacheStrategyRecord: Record = { + small: 'theme.table.size.small', + medium: 'theme.table.size.medium', + large: 'theme.table.size.large' +}; + +export const themeTableSizeOptions = transformRecordToOption(themeTableSizeRecord); diff --git a/src/layouts/modules/theme-drawer/index.vue b/src/layouts/modules/theme-drawer/index.vue index aa937d5a..1cb11390 100644 --- a/src/layouts/modules/theme-drawer/index.vue +++ b/src/layouts/modules/theme-drawer/index.vue @@ -6,6 +6,7 @@ import LayoutMode from './modules/layout-mode.vue'; import ThemeColor from './modules/theme-color.vue'; import PageFun from './modules/page-fun.vue'; import ConfigOperation from './modules/config-operation.vue'; +import TableProps from './modules/table-props.vue'; defineOptions({ name: 'ThemeDrawer' @@ -21,6 +22,7 @@ const appStore = useAppStore(); + diff --git a/src/layouts/modules/theme-drawer/modules/table-props.vue b/src/layouts/modules/theme-drawer/modules/table-props.vue new file mode 100644 index 00000000..ac84e5ce --- /dev/null +++ b/src/layouts/modules/theme-drawer/modules/table-props.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index ba006b8e..7ae7dc29 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -165,6 +165,20 @@ const local: App.I18n.Schema = { visible: 'Watermark Full Screen Visible', text: 'Watermark Text' }, + tablePropsTitle: 'Table Props', + table: { + size: { + title: 'Table Size', + small: 'Small', + medium: 'Medium', + large: 'Large' + }, + bordered: 'Bordered', + bottomBordered: 'Bottom Bordered', + singleColumn: 'Single Column', + singleLine: 'Single Line', + striped: 'Striped' + }, themeDrawerTitle: 'Theme Configuration', pageFunTitle: 'Page Function', resetCacheStrategy: { diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index 3290c0db..4fbe3686 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -165,6 +165,20 @@ const local: App.I18n.Schema = { visible: '显示全屏水印', text: '水印文本' }, + tablePropsTitle: '表格配置', + table: { + size: { + title: '表格大小', + small: '小', + medium: '中', + large: '大' + }, + bordered: '边框', + bottomBordered: '底部边框', + singleColumn: '设定行的分割线', + singleLine: '设定列的分割线', + striped: '斑马线条纹' + }, themeDrawerTitle: '主题配置', pageFunTitle: '页面功能', resetCacheStrategy: { diff --git a/src/theme/settings.ts b/src/theme/settings.ts index 57bc26d3..5d521d52 100644 --- a/src/theme/settings.ts +++ b/src/theme/settings.ts @@ -57,6 +57,14 @@ export const themeSettings: App.Theme.ThemeSetting = { visible: import.meta.env.VITE_WATERMARK === 'Y', text: 'RuoYi-Vue-Plus' }, + table: { + bordered: true, + bottomBordered: true, + singleColumn: false, + singleLine: true, + size: 'small', + striped: false + }, tokens: { light: { colors: { diff --git a/src/typings/app.d.ts b/src/typings/app.d.ts index b37b9083..d2273547 100644 --- a/src/typings/app.d.ts +++ b/src/typings/app.d.ts @@ -109,6 +109,20 @@ declare namespace App { /** Watermark text */ text: string; }; + table: { + /** Whether to show the table border */ + bordered: boolean; + /** Whether to show the table bottom border */ + bottomBordered: boolean; + /** Whether to show the table single column */ + singleColumn: boolean; + /** Whether to show the table single line */ + singleLine: boolean; + /** Whether to show the table size */ + size: UnionKey.ThemeTableSize; + /** Whether to show the table striped */ + striped: boolean; + }; /** define some theme settings tokens, will transform to css variables */ tokens: { light: ThemeSettingToken; @@ -426,6 +440,15 @@ declare namespace App { visible: string; text: string; }; + tablePropsTitle: string; + table: { + size: { title: string } & Record; + bordered: string; + bottomBordered: string; + singleColumn: string; + singleLine: string; + striped: string; + }; themeDrawerTitle: string; pageFunTitle: string; resetCacheStrategy: { title: string } & Record; diff --git a/src/typings/components.d.ts b/src/typings/components.d.ts index f735fc70..8be6129d 100644 --- a/src/typings/components.d.ts +++ b/src/typings/components.d.ts @@ -14,6 +14,7 @@ declare module 'vue' { ButtonIcon: typeof import('./../components/custom/button-icon.vue')['default'] CountTo: typeof import('./../components/custom/count-to.vue')['default'] DarkModeContainer: typeof import('./../components/common/dark-mode-container.vue')['default'] + DataTable: typeof import('./../components/common/data-table.vue')['default'] DeptTree: typeof import('./../components/custom/dept-tree.vue')['default'] DeptTreeSelect: typeof import('./../components/custom/dept-tree-select.vue')['default'] DictRadio: typeof import('./../components/custom/dict-radio.vue')['default'] diff --git a/src/typings/union-key.d.ts b/src/typings/union-key.d.ts index a783294b..dc27a701 100644 --- a/src/typings/union-key.d.ts +++ b/src/typings/union-key.d.ts @@ -51,6 +51,15 @@ declare namespace UnionKey { */ type ThemeTabMode = import('@sa/materials').PageTabMode; + /** + * The table size + * + * - small: small size + * - medium: medium size + * - large: large size + */ + type ThemeTableSize = 'small' | 'medium' | 'large'; + /** Unocss animate key */ type UnoCssAnimateKey = | 'pulse' diff --git a/src/views/demo/demo/index.vue b/src/views/demo/demo/index.vue index fcc883fc..b9818f03 100644 --- a/src/views/demo/demo/index.vue +++ b/src/views/demo/demo/index.vue @@ -184,11 +184,10 @@ async function handleExport() { @refresh="getData" /> - -