From 00b3a8bee23dec9a05940a3d66664e4712dace60 Mon Sep 17 00:00:00 2001 From: zs <710916479@qq.com> Date: Sun, 21 Jan 2024 12:47:08 +0800 Subject: [PATCH] =?UTF-8?q?1.icon=E7=BB=84=E4=BB=B6=E5=AD=97=E4=BD=93?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E6=94=B9=E4=B8=BA14=EF=BC=8C=E5=92=8C?= =?UTF-8?q?=E6=96=87=E5=AD=97=E5=A4=A7=E5=B0=8F=E4=BF=9D=E6=8C=81=E4=B8=80?= =?UTF-8?q?=E8=87=B4=202.=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Icon/src/Icon.vue | 2 +- src/components/TableRightToolbar/index.vue | 53 +++++++ src/views/system/user/index.vue | 168 ++++++++++++++------- 3 files changed, 166 insertions(+), 57 deletions(-) create mode 100644 src/components/TableRightToolbar/index.vue diff --git a/src/components/Icon/src/Icon.vue b/src/components/Icon/src/Icon.vue index 4246539f..4b597513 100644 --- a/src/components/Icon/src/Icon.vue +++ b/src/components/Icon/src/Icon.vue @@ -15,7 +15,7 @@ const props = defineProps({ // icon color color: propTypes.string, // icon size - size: propTypes.number.def(16), + size: propTypes.number.def(14), // icon svg class svgClass: propTypes.string.def('') }) diff --git a/src/components/TableRightToolbar/index.vue b/src/components/TableRightToolbar/index.vue new file mode 100644 index 00000000..aedbaece --- /dev/null +++ b/src/components/TableRightToolbar/index.vue @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 4f04dff5..94f20675 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -12,12 +12,13 @@ - + @@ -26,7 +27,7 @@ placeholder="请输入用户名称" clearable @keyup.enter="handleQuery" - class="!w-240px" + class="!w-200px" /> @@ -35,67 +36,85 @@ placeholder="请输入手机号码" clearable @keyup.enter="handleQuery" - class="!w-240px" + class="!w-200px" /> - - - + + + + + + + - - - - - + + - 搜索 - 重置 - - 新增 - - - 导入 - - 搜索 - 导出 + 重置 + + + - - + + + + + 新增 + + + 导出 + + + 导入 + + + + + - + - 修改 + 修改 handleCommand(command, scope.row)" @@ -152,6 +171,7 @@ 'system:user:update-password', 'system:permission:assign-user-role' ]" + class="ml-5px" > 更多 @@ -228,6 +248,9 @@ const queryParams = reactive({ createTime: [] }) const queryFormRef = ref() // 搜索的表单 +const showSearchContent = ref(true) // 是否显示搜索内容 +const showSearchOther = ref(false) // 是否显示其余搜索内容 +const tableHeight = ref(500) // 表格高度 /** 查询列表 */ const getList = async () => { @@ -355,8 +378,41 @@ const handleRole = (row: UserApi.UserVO) => { assignRoleFormRef.value.open(row) } +// table自适应高度 todo 临时方案实现自适应高度,需要优化 +window.onresize = onWindowResize +function onWindowResize() { + const windowHeight = document.documentElement.clientHeight || document.bodyclientHeight + // 100是根据页面情况调整的大小 + const searchContentHeight = showSearchContent.value ? queryFormRef.value.$el.offsetHeight + 100 : 0 + tableHeight.value = windowHeight - 250 - searchContentHeight +} +watch( + () => showSearchContent.value, + () => { + nextTick(() => { + onWindowResize() + }) + } +) +watch( + () => showSearchOther.value, + () => { + nextTick(() => { + onWindowResize() + }) + } +) + /** 初始化 */ onMounted(() => { getList() + onWindowResize() }) + + -- Gitee