|
@@ -1,5 +1,6 @@
|
|
|
<template>
|
|
|
<div class="module-view"
|
|
|
+ :style="{height:attrs.calculateH?'100%':'auto'}"
|
|
|
v-loading="load"
|
|
|
:ref="viewID"
|
|
|
element-loading-text="拼命加载中"
|
|
@@ -35,7 +36,9 @@ interface Page{
|
|
|
}
|
|
|
@Component
|
|
|
export default class ModuleView extends ModuleViewHandle {
|
|
|
-
|
|
|
+ get attrs(){
|
|
|
+ return this.config.attr ? this.config.attr : {};
|
|
|
+ }
|
|
|
//搜索配置
|
|
|
get searchConfig(){
|
|
|
return this.config?.search ? this.config.search : null;
|
|
@@ -59,10 +62,12 @@ export default class ModuleView extends ModuleViewHandle {
|
|
|
}
|
|
|
}
|
|
|
mounted(){
|
|
|
- // this.getList()
|
|
|
- // this.$nextTick(()=>{
|
|
|
- // this.initTable();
|
|
|
- // })
|
|
|
+ this.getList()
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ if(this.attrs.calculateH){
|
|
|
+ this.initTable();
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
initTable(){
|
|
|
if(!this.$refs[this.tableID]){
|
|
@@ -79,12 +84,11 @@ export default class ModuleView extends ModuleViewHandle {
|
|
|
let tHeight = 0;
|
|
|
let vHeight = (this as any).$el.offsetHeight;
|
|
|
if(this.$refs[this.searchID]){
|
|
|
- fHeight = (this.$refs[this.searchID] as any).$el.offsetHeight + 28;
|
|
|
+ fHeight = (this.$refs[this.searchID] as any).$el.offsetHeight + 28 + 8;
|
|
|
}
|
|
|
if(this.$refs[this.toolID]){
|
|
|
- tHeight = (this.$refs[this.toolID] as any).$el.offsetHeight
|
|
|
+ tHeight = (this.$refs[this.toolID] as any).$el.offsetHeight + 16;
|
|
|
}
|
|
|
- console.log('aaaaaaa',vHeight);
|
|
|
if(this.config.table && vHeight > 0){
|
|
|
const h = vHeight - 32 - fHeight - tHeight - 48;
|
|
|
this.config.table.attr.height = h;
|