From 6ff9269fa8eee19f1b66715a1bbcbc7594653b4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=9D=E5=85=88=E7=91=9E?= <1490493387@qq.com> Date: Sun, 20 Feb 2022 23:56:31 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20element-plus=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E6=AD=A3=E5=BC=8F=E7=89=88=E6=9C=AC=E7=A7=BB=E9=99=A4size?= =?UTF-8?q?=E4=B8=BAmini=E7=9A=84=E5=80=BC=E5=90=8C=E6=AD=A5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Pagination/index.vue | 9 +- src/components/RightPanel/index.vue | 150 ++++++++++++++++++ src/components/SizeSelect/index.vue | 4 +- src/layout/components/Settings/index.vue | 2 - src/layout/index.vue | 12 +- src/utils/index.ts | 30 ++++ src/views/dashboard/components/Team/index.vue | 2 +- src/views/dashboard/index.vue | 47 ++++-- src/views/ums/member/index.vue | 7 +- 9 files changed, 228 insertions(+), 35 deletions(-) create mode 100644 src/components/RightPanel/index.vue create mode 100644 src/utils/index.ts diff --git a/src/components/Pagination/index.vue b/src/components/Pagination/index.vue index c1bd8d17..e0f85f21 100644 --- a/src/components/Pagination/index.vue +++ b/src/components/Pagination/index.vue @@ -17,7 +17,7 @@ import {computed} from "vue"; import {scrollTo} from '@/utils/scroll-to' -const props=defineProps({ +const props = defineProps({ total: { required: true, type: Number, @@ -70,18 +70,19 @@ const pageSize = computed({ get() { return props.limit }, - set(val){ + set(val) { emit('update:limit', val) } }) -function handleSizeChange(val){ +function handleSizeChange(val) { emit('pagination', {page: currentPage, limit: val}) if (props.autoScroll) { scrollTo(0, 800) } } -function handleCurrentChange(val){ + +function handleCurrentChange(val) { emit('pagination', {page: val, limit: props.pageSizes}) if (props.autoScroll) { scrollTo(0, 800) diff --git a/src/components/RightPanel/index.vue b/src/components/RightPanel/index.vue new file mode 100644 index 00000000..a90dece0 --- /dev/null +++ b/src/components/RightPanel/index.vue @@ -0,0 +1,150 @@ + + + + + + + diff --git a/src/components/SizeSelect/index.vue b/src/components/SizeSelect/index.vue index aaa643b0..91212f38 100644 --- a/src/components/SizeSelect/index.vue +++ b/src/components/SizeSelect/index.vue @@ -27,8 +27,6 @@ import {ElMessage} from 'element-plus' import {useAppStoreHook} from '@/store/modules/app' import SvgIcon from '@/components/SvgIcon/index.vue' -const route = useRoute() -const router = useRouter() const size = computed(() => useAppStoreHook().size) const sizeOptions = ref([ @@ -40,7 +38,7 @@ const sizeOptions = ref([ function handleSetSize(size: string) { useAppStoreHook().setSize(size) window.location.reload() - ElMessage.success('切换全局大小成功') + ElMessage.success('切换布局大小成功') } diff --git a/src/layout/components/Settings/index.vue b/src/layout/components/Settings/index.vue index 1b0575f2..2cc3539b 100644 --- a/src/layout/components/Settings/index.vue +++ b/src/layout/components/Settings/index.vue @@ -29,12 +29,10 @@