12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <template>
- <view class="content">
- <uni-list>
- <uni-list-item v-for="item in reportList" :key="item.id" :title="item.reportTableName"
- :note="item.createTime" link ellipsis="1"
- :to="`/pages/reportForm/report-detail/index?id=${item.id}&title=${item.reportTableName}`" />
- </uni-list>
- <u-empty v-if="!reportList.length" class="empty" icon="../../static/data.png">
- </u-empty>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- // 查询参数
- queryParams: {
- page: 1,
- limit: 20
- },
- // 列表数据
- reportList: []
- };
- },
- onShow() {
- this.queryParams.limit = 20
- this.getAllReport()
- },
- onPullDownRefresh() {
- this.queryParams.limit = 20
- this.getAllReport()
- },
- onReachBottom() {
- this.queryParams.limit += 10
- this.getAllReport()
- },
- methods: {
- // 获取报表数据
- getAllReport() {
- uni.$http.get('/reportTable/getAllOkReportTable', this.queryParams).then(res => {
- const data = res.data
- if (data.code === 200) {
- this.reportList = data.data.reportTableList
- uni.stopPullDownRefresh()
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .content {
- padding: 0 25rpx 0rpx 25rpx;
- }
- .empty {
- width: 400rpx;
- height: 400rpx;
- position: absolute;
- top: 50%;
- left: 50%;
- margin-top: -280rpx !important;
- margin-left: -200rpx;
- }
- </style>
|