From 7ddcb4cfa664ec1d4a55af37bd3e46a137383dcf Mon Sep 17 00:00:00 2001 From: mizhexiaoxiao <1157861072@qq.com> Date: Mon, 4 Sep 2023 18:13:20 +0800 Subject: [PATCH] =?UTF-8?q?Update:=20=E7=A7=BB=E5=8A=A8=E7=AB=AF=E9=80=82?= =?UTF-8?q?=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/query-bar/QueryBar.vue | 9 +++-- web/src/components/query-bar/QueryBarItem.vue | 2 +- web/src/components/table/CrudTable.vue | 4 +-- .../header/components/FullScreen.vue | 4 ++- web/src/layout/index.vue | 33 +++++++++++++++++++ web/src/store/modules/app/index.js | 22 +++++++------ web/src/views/system/api/index.vue | 11 +++++-- web/src/views/system/menu/index.vue | 14 ++++---- web/src/views/system/role/index.vue | 6 ++-- web/src/views/system/user/index.vue | 14 ++++---- web/src/views/workbench/index.vue | 27 +++++++-------- 11 files changed, 90 insertions(+), 56 deletions(-) diff --git a/web/src/components/query-bar/QueryBar.vue b/web/src/components/query-bar/QueryBar.vue index 5a70132..9880767 100644 --- a/web/src/components/query-bar/QueryBar.vue +++ b/web/src/components/query-bar/QueryBar.vue @@ -13,12 +13,11 @@ > +
+ 重置 + 搜索 +
- -
- 重置 - 搜索 -
diff --git a/web/src/components/query-bar/QueryBarItem.vue b/web/src/components/query-bar/QueryBarItem.vue index 7434ed5..eb9bb8a 100644 --- a/web/src/components/query-bar/QueryBarItem.vue +++ b/web/src/components/query-bar/QueryBarItem.vue @@ -8,7 +8,7 @@ > {{ label }} -
+
diff --git a/web/src/components/table/CrudTable.vue b/web/src/components/table/CrudTable.vue index f4e73b7..b89fabf 100644 --- a/web/src/components/table/CrudTable.vue +++ b/web/src/components/table/CrudTable.vue @@ -8,6 +8,7 @@ :loading="loading" :columns="columns" :data="tableData" + :scroll-x="scrollX" :row-key="(row) => row[rowKey]" :pagination="isPagination ? pagination : false" @update:checked-row-keys="onChecked" @@ -16,7 +17,6 @@ diff --git a/web/src/layout/index.vue b/web/src/layout/index.vue index 7f44efb..2f3c2b3 100644 --- a/web/src/layout/index.vue +++ b/web/src/layout/index.vue @@ -37,5 +37,38 @@ import AppTags from './components/tags/index.vue' import { useAppStore } from '@/store' import { header, tags } from '~/settings' +// 移动端适配 +import { useBreakpoints } from '@vueuse/core' + const appStore = useAppStore() +const breakpointsEnum = { + xl: 1600, + lg: 1199, + md: 991, + sm: 666, + xs: 575, +} +const breakpoints = reactive(useBreakpoints(breakpointsEnum)) +const isMobile = breakpoints.smaller('sm') +const isPad = breakpoints.between('sm', 'md') +const isPC = breakpoints.greater('md') +watchEffect(() => { + if (isMobile.value) { + // Mobile + appStore.setCollapsed(true) + appStore.setFullScreen(false) + } + + if (isPad.value) { + // IPad + appStore.setCollapsed(true) + appStore.setFullScreen(false) + } + + if (isPC.value) { + // PC + appStore.setCollapsed(false) + appStore.setFullScreen(true) + } +}) diff --git a/web/src/store/modules/app/index.js b/web/src/store/modules/app/index.js index 27353d2..dfdfd8e 100644 --- a/web/src/store/modules/app/index.js +++ b/web/src/store/modules/app/index.js @@ -7,6 +7,7 @@ export const useAppStore = defineStore('app', { return { reloadFlag: true, collapsed: false, + fullScreen: true, /** keepAlive路由的key,重新赋值可重置keepAlive */ aliveKeys: {}, isDark, @@ -30,18 +31,19 @@ export const useAppStore = defineStore('app', { setCollapsed(collapsed) { this.collapsed = collapsed }, + setFullScreen(fullScreen) { + this.fullScreen = fullScreen + }, setAliveKeys(key, val) { this.aliveKeys[key] = val }, - /** 设置暗黑模式 */ - setDark(isDark) { - this.isDark = isDark - }, - /** 切换/关闭 暗黑模式 */ - toggleDark() { - this.isDark = !this.isDark - }, + /** 设置暗黑模式 */ + setDark(isDark) { + this.isDark = isDark + }, + /** 切换/关闭 暗黑模式 */ + toggleDark() { + this.isDark = !this.isDark + }, }, }) - - diff --git a/web/src/views/system/api/index.vue b/web/src/views/system/api/index.vue index f702248..b0de06d 100644 --- a/web/src/views/system/api/index.vue +++ b/web/src/views/system/api/index.vue @@ -132,6 +132,7 @@ const columns = [ { size: 'small', type: 'primary', + style: 'margin-right: 8px;', onClick: () => { handleEdit(row) modalForm.value.roles = row.roles.map((e) => (e = e.id)) @@ -158,7 +159,6 @@ const columns = [ { size: 'small', type: 'error', - style: 'margin-left: 8px;', }, { default: () => '删除', @@ -181,13 +181,18 @@ const columns = [