2024-01-23 23:42:34 +08:00
|
|
|
<template>
|
|
|
|
<div class="tit" v-if="baseData.tit">{{ baseData.tit }}</div>
|
2024-01-25 16:31:34 +08:00
|
|
|
<el-table :data="pager.lists" style="width: 80vw">
|
2024-01-23 23:42:34 +08:00
|
|
|
<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;
|
|
|
|
}
|
|
|
|
|
2024-01-25 16:31:34 +08:00
|
|
|
// :deep(.my-label) {
|
|
|
|
// width: 150px;
|
|
|
|
// }
|
2024-01-23 23:42:34 +08:00
|
|
|
</style>
|