guoshilong
2023-10-27 2311b03aee9db1bebacdd2ced13c071efda6a011
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<template>
    <view class="u-page">
        <view v-if="list.length<=0" class="line-center">
            <u-empty mode="data" />
        </view>
        <u-list @scrolltolower="scrolltolower" v-else>
            <u-list-item v-for="(item, index) in list" :key="item.id">
                <u-cell isLink :url='`../../jcsb/modules/scheduling?detail=${JSON.stringify(item)}`'
                    :title="`${item.title}`">
                </u-cell>
            </u-list-item>
        </u-list>
 
        <u-loading-page :loading="loadingPage"></u-loading-page>
    </view>
</template>
 
<script>
    import {
        getList
    } from "@/api/modules/modules.js"
    import {
        convertTimestampToDate
    } from "@/utils/date"
    export default {
        data() {
            return {
                list: [],
                pages: {
                    current: 1,
                    size: 15,
                    total: 0,
                },
                query: {
                    createUser: uni.getStorageSync("userInfo").user_id,
                },
                loadingPage: false,
            }
        },
        created() {
 
        },
        mounted() {
 
        },
        onLoad(option) {
 
        },
        onShow() {
            this.list = []
            this.pages.current = 1
            this.getList()
        },
        methods: {
            getList(params = {}) {
                this.loadingPage = true
                getList(this.pages.current, this.pages.size, Object.assign(params, this.query)).then(res => {
                    let data = res.data.records
                    data.forEach(e => {
                        e.title = convertTimestampToDate(e.createTime, "MM-dd hh:mm") + "调度"
                    })
 
                    if (this.list.length == 0) {
                        this.list = data
                    } else {
                        this.list = [...this.list, ...data]
                    }
                    this.loadingPage = false
 
                })
            },
            scrolltolower() {
                this.pages.current += 1
                this.getList()
            },
        }
    }
</script>
 
<style scoped lang="scss">
    .u-page {
        .tab {
            display: flex;
            flex-direction: column;
            justify-content: space-evenly;
            width: 100%;
            background-color: #ffffff;
            align-items: center;
        }
    }
 
    .line-center {
        height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }
</style>