修改测试bug

This commit is contained in:
GGJ
2024-10-22 10:50:47 +08:00
parent 29150a3c82
commit 7d2394f75d
6 changed files with 126 additions and 65 deletions

View File

@@ -1,14 +1,9 @@
<template>
<div ref="tableHeader" class="cn-table-header">
<div class="table-header ba-scroll-style">
<el-form
style="flex: 1; height: 34px; margin-right: 20px; display: flex; flex-wrap: wrap"
ref="headerForm"
@submit.prevent=""
@keyup.enter="onComSearch"
label-position="left"
:inline="true"
>
<div class="table-header ba-scroll-style" :key="num">
<el-form style="flex: 1; height: 34px; margin-right: 20px; display: flex; flex-wrap: wrap" ref="headerForm"
@submit.prevent="" @keyup.enter="onComSearch" label-position="left" :inline="true">
<el-form-item label="日期" v-if="datePicker" style="grid-column: span 2; max-width: 570px">
<DatePicker ref="datePickerRef" :nextFlag="nextFlag" :theCurrentTime="theCurrentTime"></DatePicker>
</el-form-item>
@@ -28,14 +23,9 @@
</template>
<slot name="operation"></slot>
</div>
<el-form
:style="showSelect && showUnfoldButton ? headerFormSecondStyleOpen : headerFormSecondStyleClose"
ref="headerFormSecond"
@submit.prevent=""
@keyup.enter="onComSearch"
label-position="left"
:inline="true"
></el-form>
<el-form :style="showSelect && showUnfoldButton ? headerFormSecondStyleOpen : headerFormSecondStyleClose"
ref="headerFormSecond" @submit.prevent="" @keyup.enter="onComSearch" label-position="left"
:inline="true"></el-form>
</div>
</template>
@@ -57,7 +47,7 @@ const dictData = useDictData()
const areaRef = ref()
const headerForm = ref()
const headerFormSecond = ref()
const num = ref(0)
interface Props {
datePicker?: boolean
area?: boolean
@@ -74,7 +64,7 @@ const props = withDefaults(defineProps<Props>(), {
theCurrentTime: false
})
// 动态计算table高度
const resizeObserver = new ResizeObserver(entries => {
let resizeObserver = new ResizeObserver(entries => {
for (const entry of entries) {
handlerHeight()
computedSearchRow()
@@ -118,9 +108,11 @@ const handlerHeight = () => {
).height as string
}
}
// 刷新页面handler高度出下拉
const computedSearchRow = () => {
if (!headerForm.value.$el) return
// 清空headerFormSecond.value.$el下的元素
while (headerFormSecond.value.$el.firstChild) {
headerForm.value.$el.appendChild(headerFormSecond.value.$el.firstChild)
@@ -173,13 +165,15 @@ const setInterval = (val: any) => {
datePickerRef.value.setInterval(val)
}
defineExpose({ onComSearch, areaRef, setDatePicker, setInterval, datePickerRef, showSelectChange })
defineExpose({ onComSearch, areaRef, setDatePicker, setInterval, datePickerRef, showSelectChange, computedSearchRow })
</script>
<style scoped lang="scss">
.cn-table-header {
border: 1px solid var(--el-border-color);
}
.table-header {
position: relative;
overflow-x: auto;
@@ -221,7 +215,7 @@ defineExpose({ onComSearch, areaRef, setDatePicker, setInterval, datePickerRef,
margin-left: 12px;
}
.mlr-12 + .el-button {
.mlr-12+.el-button {
margin-left: 12px;
}
@@ -256,7 +250,7 @@ defineExpose({ onComSearch, areaRef, setDatePicker, setInterval, datePickerRef,
border-radius: 0;
}
.el-button + .el-button {
.el-button+.el-button {
margin: 0;
}
@@ -267,6 +261,7 @@ defineExpose({ onComSearch, areaRef, setDatePicker, setInterval, datePickerRef,
html.dark {
.table-search-button-group {
button:focus,
button:active {
background-color: var(--el-color-info-dark-2);
@@ -285,11 +280,13 @@ html.dark {
}
}
}
#header-form,
#header-form-second {
:deep(.el-select) {
--el-select-width: 220px;
}
:deep(.el-input) {
--el-input-width: 220px;
}