index.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <view class="content">
  3. <uni-list>
  4. <uni-list-item v-for="item in reportList" :key="item.id" :title="item.reportTableName"
  5. :note="item.createTime" link ellipsis="1"
  6. :to="`/pages/reportForm/report-detail/index?id=${item.id}&title=${item.reportTableName}`" />
  7. </uni-list>
  8. <u-empty v-if="!reportList.length" class="empty" icon="../../static/data.png">
  9. </u-empty>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. data() {
  15. return {
  16. // 查询参数
  17. queryParams: {
  18. page: 1,
  19. limit: 20
  20. },
  21. // 列表数据
  22. reportList: []
  23. };
  24. },
  25. onShow() {
  26. this.queryParams.limit = 20
  27. this.getAllReport()
  28. },
  29. onPullDownRefresh() {
  30. this.queryParams.limit = 20
  31. this.getAllReport()
  32. },
  33. onReachBottom() {
  34. this.queryParams.limit += 10
  35. this.getAllReport()
  36. },
  37. methods: {
  38. // 获取报表数据
  39. getAllReport() {
  40. uni.$http.get('/reportTable/getAllOkReportTable', this.queryParams).then(res => {
  41. const data = res.data
  42. if (data.code === 200) {
  43. this.reportList = data.data.reportTableList
  44. uni.stopPullDownRefresh()
  45. }
  46. })
  47. }
  48. }
  49. }
  50. </script>
  51. <style lang="scss" scoped>
  52. .content {
  53. padding: 0 25rpx 0rpx 25rpx;
  54. }
  55. .empty {
  56. width: 400rpx;
  57. height: 400rpx;
  58. position: absolute;
  59. top: 50%;
  60. left: 50%;
  61. margin-top: -280rpx !important;
  62. margin-left: -200rpx;
  63. }
  64. </style>