<!--
|
* @Date: 2024-04-04 22:45:43
|
* @LastEditors: Sneed
|
* @LastEditTime: 2024-04-06 14:30:47
|
* @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/console/base/CalenderTab.vue
|
-->
|
<template>
|
<el-container>
|
<el-aside width="220px">
|
<el-button type="primary" icon="el-icon-plus">新建日历</el-button>
|
<div v-infinite-scroll="load">
|
<el-card shadow="never" class="card" v-for="item in caleList" :key="item.id">
|
<h3>{{item.code}}</h3>
|
<p>日历名称: {{item.name}}</p>
|
<p>应用年份: {{item.year}}</p>
|
</el-card>
|
</div>
|
|
</el-aside>
|
</el-container>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
current: 0,
|
total: 1,
|
caleList: []
|
}
|
},
|
created() {
|
this.load()
|
},
|
methods: {
|
load() {
|
if (this.current * 15 >= this.total) {
|
return
|
}
|
this.current += 1
|
this.$API.calender.getList.post({ statusList: [1] }, { current: this.current, size: 15 }).then(res => {
|
this.total = res?.data?.total
|
if (res?.data?.records) {
|
if (this.current === 1) {
|
this.caleList = res?.data?.records || []
|
} else {
|
this.caleList.push(
|
...res?.data?.records || []
|
)
|
}
|
|
}
|
})
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.card {
|
cursor: pointer;
|
margin: 12px 12px 12px 0;
|
}
|
</style>
|