Browse Source

HL-4981 SCP 供应商发货申请,新增时,明细中存在多条明细,无法同时查看下面的数据和表头

hella_online_20240821
wangyufei 3 months ago
parent
commit
066a1e4a78
  1. 15
      src/components/TableForm/src/TableForm.vue
  2. 26
      src/directives/permission/clientTable.ts

15
src/components/TableForm/src/TableForm.vue

@ -1,12 +1,15 @@
<!-- 附件组件 --> <!-- 附件组件 -->
<template> <template>
<div class="table-form"> <div class="table-form">
<el-table <el-table v-clientTableForm="{
isShowPagination:tableData.length > 10,
isShowButton: isShowButton || isShowReduceButtonSelection,
isFullscreen:isFullscreen
}"
class="multipleTableComponents" class="multipleTableComponents"
ref="TableBaseComponents_Ref" ref="TableBaseComponents_Ref"
v-loading="tableLoading" v-loading="tableLoading"
:data="showTableData()" :data="showTableData()"
:max-height="maxHeight"
row-key="id" row-key="id"
:border="border" :border="border"
@selection-change="tableSelectionChange" @selection-change="tableSelectionChange"
@ -736,11 +739,17 @@ const initValue = (headerItem, op) => {
return op.value return op.value
} }
} }
const isFullscreen = ref(false)
const reloadFullscreen = (fullscreen)=>{
isFullscreen.value = fullscreen
}
// setup // setup
defineExpose({ defineExpose({
TableBaseComponents_Ref, TableBaseComponents_Ref,
validateForm, validateForm,
keyWord keyWord,
reloadFullscreen
}) })
</script> </script>

26
src/directives/permission/clientTable.ts

@ -41,4 +41,30 @@ export function clientTable(app: App<Element>) {
} }
}) })
}) })
app.directive('clientTableForm', (el, binding) => {
nextTick(() => {
let {isShowPagination,isShowButton,isFullscreen} = binding.value
let footerHeight = 0
let headerHeight = 0
el.offsetParent?.children?.forEach(element => {
if(element.className=='el-dialog__footer'){
footerHeight = element.clientHeight
}
if(element.className=='el-dialog__header'){
headerHeight = element.clientHeight
}
});
let top = el.getBoundingClientRect().top
let tableFormTop = top - (el.offsetParent?.offsetTop||0)
let height = el.offsetParent?.clientHeight - tableFormTop - footerHeight - 30
if(isShowPagination){
height = height- 34
}
if(isShowButton){
height = height- 50
}
el.style.height = height + 'px'
})
})
} }

Loading…
Cancel
Save