Browse Source

添加clientSearchTable命令,处理SearchTable中数据内容过多超出屏幕的问题

master_hella_20240701
yufei0306 5 months ago
parent
commit
65297071bb
  1. 2
      src/components/SearchTable/src/SearchTable.vue
  2. 16
      src/directives/permission/clientTable.ts

2
src/components/SearchTable/src/SearchTable.vue

@ -14,7 +14,7 @@
:allSchemas="allSchemasRef" :allSchemas="allSchemasRef"
/> />
<ContentWrap> <ContentWrap>
<Table <Table v-clientSearchTable
ref="searchTableRef" ref="searchTableRef"
:columns="tableColumns" :columns="tableColumns"
:data="tableObjectRef.tableList" :data="tableObjectRef.tableList"

16
src/directives/permission/clientTable.ts

@ -18,4 +18,20 @@ export function clientTable(app: App<Element>) {
el.firstChild.style.height = '100%' el.firstChild.style.height = '100%'
}) })
}) })
app.directive('clientSearchTable', (el, binding) => {
nextTick(() => {
const top = el.getBoundingClientRect().top
const qustionHeight = 150
let paginationHeight = 0
if(el.children&&el.children.length>1){
paginationHeight = 70
}
const height = window.innerHeight - top - paginationHeight - qustionHeight
if(el.getBoundingClientRect().height>height){
console.log('高度',el.getBoundingClientRect().height)
el.style.height = height + 'px'
el.firstChild.style.height = '100%'
}
})
})
} }

Loading…
Cancel
Save