39 lines
912 B
Vue
39 lines
912 B
Vue
![]() |
<template>
|
||
|
<div class="tit" v-if="baseData.tit">{{ baseData.tit }}</div>
|
||
|
<el-table :data="pager.lists" style="width: 100%">
|
||
|
<el-table-column :label="item.label" :prop='item.prop' width="180" v-for="(item, index) in baseData.columnList"
|
||
|
:key="index" />
|
||
|
</el-table>
|
||
|
<div class="flex justify-end mt-4">
|
||
|
<pagination v-model="pager" @change="getLists" />
|
||
|
</div>
|
||
|
</template>
|
||
|
<script setup>
|
||
|
import { ref, reactive, defineProps, toRaw } from "vue"
|
||
|
import { usePaging } from '@/hooks/usePaging'
|
||
|
const props = defineProps({
|
||
|
baseData: Object,
|
||
|
})
|
||
|
|
||
|
|
||
|
// 分页相关
|
||
|
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||
|
fetchFun: props.baseData.fetchFun,
|
||
|
params: props.baseData.queryParams || ""
|
||
|
|
||
|
})
|
||
|
|
||
|
getLists()
|
||
|
|
||
|
|
||
|
</script>
|
||
|
<style lang="scss" scoped>
|
||
|
.tit {
|
||
|
font-size: 1.2em;
|
||
|
margin-bottom: 10px;
|
||
|
}
|
||
|
|
||
|
:deep(.my-label) {
|
||
|
width: 150px;
|
||
|
}
|
||
|
</style>
|