diff --git a/src/components/GiLeftRightPane/index.vue b/src/components/GiLeftRightPane/index.vue
new file mode 100644
index 0000000..20ae6cd
--- /dev/null
+++ b/src/components/GiLeftRightPane/index.vue
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/GiSpace/index.vue b/src/components/GiSpace/index.vue
new file mode 100644
index 0000000..f51b30c
--- /dev/null
+++ b/src/components/GiSpace/index.vue
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/components/GiSplitButton/index.vue b/src/components/GiSplitButton/index.vue
new file mode 100644
index 0000000..4dcb01e
--- /dev/null
+++ b/src/components/GiSplitButton/index.vue
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/GiSplitPane/components/GiSplitPaneFlexibleBox.vue b/src/components/GiSplitPane/components/GiSplitPaneFlexibleBox.vue
new file mode 100644
index 0000000..9d052a4
--- /dev/null
+++ b/src/components/GiSplitPane/components/GiSplitPaneFlexibleBox.vue
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/components/GiSplitPane/index.vue b/src/components/GiSplitPane/index.vue
new file mode 100644
index 0000000..b47507f
--- /dev/null
+++ b/src/components/GiSplitPane/index.vue
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
diff --git a/src/hooks/modules/useTable.ts b/src/hooks/modules/useTable.ts
index f6e7013..3f73176 100644
--- a/src/hooks/modules/useTable.ts
+++ b/src/hooks/modules/useTable.ts
@@ -1,7 +1,7 @@
import type { TableData, TableInstance } from '@arco-design/web-vue'
import { Message, Modal } from '@arco-design/web-vue'
import type { Options as paginationOptions } from './usePagination'
-import { usePagination } from '@/hooks'
+import { useBreakpoint, usePagination } from '@/hooks'
interface Options {
formatResult?: (data: T[]) => U[]
@@ -94,5 +94,32 @@ export function useTable(api: Api, options?: Options !['xs', 'sm'].includes(breakpoint.value) ? 'right' : undefined)
+
+ return {
+ /** 表格加载状态 */
+ loading,
+ /** 表格数据 */
+ tableData,
+ /** 获取表格数据 */
+ getTableData,
+ /** 搜索,页码会重置为1 */
+ search,
+ /** 分页的传参 */
+ pagination,
+ /** 选择的行keys */
+ selectedKeys,
+ /** 选择行 */
+ select,
+ /** 全选行 */
+ selectAll,
+ /** 处理删除、批量删除 */
+ handleDelete,
+ /** 刷新表格数据,页码会缓存 */
+ refresh,
+ /** 操作列在小屏场景下不固定在右侧 */
+ fixed,
+ }
}
diff --git a/src/layout/components/HeaderRightBar/index.vue b/src/layout/components/HeaderRightBar/index.vue
index 4ca4b59..2b8636c 100644
--- a/src/layout/components/HeaderRightBar/index.vue
+++ b/src/layout/components/HeaderRightBar/index.vue
@@ -30,7 +30,7 @@
-
+
@@ -76,10 +76,12 @@ import Message from './Message.vue'
import SettingDrawer from './SettingDrawer.vue'
import { getUnreadMessageCount } from '@/apis'
import { useUserStore } from '@/stores'
-import { isMobile } from '@/utils'
import { getToken } from '@/utils/auth'
+import { useBreakpoint } from '@/hooks'
defineOptions({ name: 'HeaderRight' })
+
+const { breakpoint } = useBreakpoint()
let socket: WebSocket
onBeforeUnmount(() => {
if (socket) {
diff --git a/src/layout/components/Main.vue b/src/layout/components/Main.vue
index 6376755..2c908a0 100644
--- a/src/layout/components/Main.vue
+++ b/src/layout/components/Main.vue
@@ -3,7 +3,7 @@
-
+
diff --git a/src/styles/base.scss b/src/styles/base.scss
index b7afc13..c80b245 100644
--- a/src/styles/base.scss
+++ b/src/styles/base.scss
@@ -57,15 +57,3 @@ a:hover {
color: inherit;
text-decoration: none;
}
-
-.w-full {
- width: 100%;
-}
-
-.h-full {
- height: 100%;
-}
-
-.ov-hidden {
- overflow: hidden;
-}
diff --git a/src/styles/global.scss b/src/styles/global.scss
index 4b377da..7830433 100644
--- a/src/styles/global.scss
+++ b/src/styles/global.scss
@@ -1,5 +1,22 @@
/* 全局样式 */
@import './var.scss';
+
+.w-full {
+ width: 100%;
+}
+
+.h-full {
+ height: 100%;
+}
+
+.overflow-hidden {
+ overflow: hidden;
+}
+
+.flex-1 {
+ flex: 1;
+}
+
// 通用外边距
.gi_margin {
margin: $margin;
@@ -223,10 +240,12 @@
}
}
-.gi_table_box {
- max-height: 100%;
+// 表格类名 高度自适应
+.gi_table {
+ flex: 1;
overflow: hidden;
}
+
.detail{
height: 100%;
display: flex;
diff --git a/src/types/components.d.ts b/src/types/components.d.ts
index 604dfd6..f481476 100644
--- a/src/types/components.d.ts
+++ b/src/types/components.d.ts
@@ -29,9 +29,14 @@ declare module 'vue' {
GiForm: typeof import('./../components/GiForm/src/GiForm.vue')['default']
GiIconSelector: typeof import('./../components/GiIconSelector/index.vue')['default']
GiIframe: typeof import('./../components/GiIframe/index.vue')['default']
+ GiLeftRightPane: typeof import('./../components/GiLeftRightPane/index.vue')['default']
GiOption: typeof import('./../components/GiOption/index.vue')['default']
GiOptionItem: typeof import('./../components/GiOptionItem/index.vue')['default']
GiOverFlowTags: typeof import('./../components/GiOverFlowTags/index.vue')['default']
+ GiSpace: typeof import('./../components/GiSpace/index.vue')['default']
+ GiSplitButton: typeof import('./../components/GiSplitButton/index.vue')['default']
+ GiSplitPane: typeof import('./../components/GiSplitPane/index.vue')['default']
+ GiSplitPaneFlexibleBox: typeof import('./../components/GiSplitPane/components/GiSplitPaneFlexibleBox.vue')['default']
GiSvgIcon: typeof import('./../components/GiSvgIcon/index.vue')['default']
GiTable: typeof import('./../components/GiTable/index.vue')['default']
GiTag: typeof import('./../components/GiTag/index.tsx')['default']
diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue
index 9350293..b5d5c24 100644
--- a/src/views/system/dict/index.vue
+++ b/src/views/system/dict/index.vue
@@ -11,7 +11,7 @@
-
+
-
+
-
+
diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue
index c5dabc4..ccb74a3 100644
--- a/src/views/system/user/index.vue
+++ b/src/views/system/user/index.vue
@@ -11,7 +11,7 @@
-
+