12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <template>
- <view class="content">
- <Nav title="报表" :isBack="false"/>
- <view class="section">
- <u-list finished-text="没有更多了" @scrolltolower="scrolltolower">
- <view v-for="item in reportList" :key="item.id" @click="handelDetail(item.id)">
- <u-list-item>
- <u-cell-group>
- <u-cell :title="item.reportTableName" :label="item.createTime" isLink></u-cell>
- </u-cell-group>
- </u-list-item>
- </view>
- </u-list>
- <view class="empty" v-if="!this.reportList.length">
- <u-empty mode="data" icon="../../static/data.png">
- </u-empty>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- // 查询参数
- queryParams: {
- page: 1,
- limit: 13
- },
- // 列表数据
- reportList: []
- };
- },
- onShow() {
- 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
- }
- })
- },
- // 前往详情页
- handelDetail(id) {
- uni.navigateTo({
- url: "/pages/reportForm/report-detail/index?id="+id
- })
- },
- // 列表滚动到底部触发
- scrolltolower() {
- this.queryParams.limit += 10
- this.getAllReport()
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .content {
- padding: 25rpx;
- }
- .section {
- position: relative;
- }
- .empty {
- position: absolute;
- top: 0;
- right: 0;
- left: 0;
- bottom: 0;
- }
- </style>
|