diff --git a/src/components/Icon/src/Icon.vue b/src/components/Icon/src/Icon.vue index a90bb37e8..6e75e40a9 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 000000000..aedbaece9 --- /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 4f04dff54..94f206752 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() }) + +