update 表格的doLayout

This commit is contained in:
lb 2023-02-14 15:59:48 +08:00
parent d4926584fe
commit 839a6f6d52
2 changed files with 24 additions and 12 deletions

View File

@ -100,6 +100,10 @@ export default {
type: Array,
default: () => [],
},
refreshLayoutKey: {
type: Number,
default: 0,
},
},
inject: ["urls"],
data() {
@ -108,12 +112,9 @@ export default {
};
},
watch: {
// 'props.tableData': {
// handler: () => {
// this.$refs['base-list-table'].doLayout();
// },
// immediate: true,
// },
refreshLayoutKey(val) {
this.$refs["base-list-table"].doLayout();
},
},
methods: {
handleSubEmitData(payload) {

View File

@ -114,11 +114,22 @@
</el-row>
</el-form>
</div>
<div v-if="dataForm.id && tab.key === 'attr'">
<BaseListTable :table-config="null" :column-config="filteredTableProps" :table-data="subList" @operate-event="handleTableRowOperate" />
<div v-show="dataForm.id && tab.key === 'attr'" key="attr-list">
<BaseListTable
:table-config="null"
:column-config="filteredTableProps"
:table-data="subList"
@operate-event="handleTableRowOperate"
:current-page="attrPage"
:current-size="attrSize"
:refresh-layout-key="Math.random()"
/>
<!-- paginator -->
<el-pagination
class="mt-5 flex justify-end"
class=""
style="text-align: left"
background
hide-on-single-page
@size-change="handleSizeChange"
@current-change="handlePageChange"
:current-page.sync="attrPage"
@ -129,7 +140,7 @@
></el-pagination>
<!-- layout="total, sizes, prev, pager, next, jumper" -->
</div>
<div v-if="dataForm.id && tab.key === 'attachment'">附件</div>
<div v-show="dataForm.id && tab.key === 'attachment'" key="attachment">附件</div>
</el-tab-pane>
</el-tabs>
</div>
@ -499,10 +510,10 @@ export default {
if (res.code === 0 && res.data?.list) {
//
this.subList = res.data.list;
this.attrTotal = res.data.total
this.attrTotal = res.data.total;
} else {
this.subList.splice(0);
this.attrTotal = 0
this.attrTotal = 0;
}
});
},