tableH mix

This commit is contained in:
朱菊兰 2024-07-18 13:25:49 +08:00
parent f043a6a0a2
commit b3623d29c5
2 changed files with 24 additions and 2 deletions

View File

@ -0,0 +1,20 @@
export default {
data() {
return {
tableH: this.tableHeight(260),
};
},
created() {
this.tableH = this?.heightNum ? this.tableHeight(this.heightNum) : this.tableHeight(260);
window.addEventListener('resize', this._setTableHeight);
},
destroyed() {
window.removeEventListener('resize', this._setTableHeight);
},
methods: {
_setTableHeight() {
this.tableH = this?.heightNum ? this.tableHeight(this.heightNum) : this.tableHeight(260);
// this.tableH = this.tableHeight(260);
},
},
};

View File

@ -12,7 +12,8 @@
:page="queryParams.pageNo" :page="queryParams.pageNo"
:limit="queryParams.pageSize" :limit="queryParams.pageSize"
:table-data="list" :table-data="list"
@emitFun="handleEmitFun"> @emitFun="handleEmitFun"
:max-height="tableH">
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
@ -86,10 +87,11 @@ import {
exportQualityInspectionTypeExcel, exportQualityInspectionTypeExcel,
} from '@/api/base/qualityInspectionType'; } from '@/api/base/qualityInspectionType';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import tableHeightMixin from '@/mixins/tableHeightMixin';
export default { export default {
name: 'QualityInspectionType', name: 'QualityInspectionType',
mixins: [basicPageMixin], mixins: [basicPageMixin, tableHeightMixin],
data() { data() {
return { return {
tableBtn: [ tableBtn: [