This commit is contained in:
sdaduanbilei-d1581 2025-10-17 20:21:38 +08:00
parent 03c5d4da2a
commit b3493b5e27

View File

@ -5,10 +5,10 @@
<div class="flex flex-center flex-justify-start"> <div class="flex flex-center flex-justify-start">
<edit @ok="fetchList"/> <edit @ok="fetchList"/>
</div> </div>
<a-table class="mt-20" :columns="columns" :data="list" > <a-table class="mt-20" :columns="columns" :data="list" :pagination="page" @pageChange="change">
<template #name="{record}"> <template #name="{record}">
<div class="flex flex-center flex-justify-start"> <div class="flex flex-center flex-justify-start">
<a-image width="60" height="60" :src="record.oss.url" :alt="record.id"/> <a-image v-if="record.oss" width="60" height="60" :src="record.oss.url" :alt="record.id"/>
<div class="ml-10">{{record.name}}</div> <div class="ml-10">{{record.name}}</div>
</div> </div>
</template> </template>
@ -40,6 +40,7 @@ export default {
page:{ page:{
current:1, current:1,
pageSize:10, pageSize:10,
total:0
}, },
columns :[ columns :[
{ {
@ -69,11 +70,16 @@ export default {
this.fetchList() this.fetchList()
}, },
methods: { methods: {
change(page){
this.page.current = page
this.fetchList()
},
fetchList() { fetchList() {
const data ={...this.page} const data ={...this.page}
this.$api.flower.list(data).then(res => { this.$api.flower.list(data).then(res => {
if (res.code === 200){ if (res.code === 200){
this.list = res.data.list this.list = res.data.list
this.page.total = res.data.total
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }