<template>
    <view v-show="show">
        <operate-list :list="list" />
    </view>
</template>

<script>
let paging = {}
import operateList from "./operateList";
export default {
    components: { operateList },
    name: "queue",
    props: {
        w_deviceid: String
    },
    data() {
        return {
            show: false,
            uninitialized: true,
            list: [],
            "where": {
                "begindate": "",
                "enddate": ""
            }
        }
    },
    methods: {
        getList(init = false) {
            if (init) paging = {
                pageNumber: 1,
                pageTotal: 1,
            };
            return new Promise((resolve) => {
                if (paging.pageNumber > paging.pageTotal) return resolve()
                this.$Http.basic({
                    "id": 20230701132202,
                    "content": {
                        "type": 2,
                        "w_deviceid": this.w_deviceid,
                        ...paging,
                        "where": this.where
                    }
                }).then(res => {
                    console.log('操作队列', res)
                    resolve(!this.cutoff(res.msg));
                    if (this.cutoff(res.msg)) return;
                    paging.pageNumber = res.pageNumber + 1;
                    paging.pageTotal = res.pageTotal;
                    this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data)
                })
            })
        }
    },
}
</script>

<style lang="scss" scoped>
.search {
    position: sticky;
    top: 34px;
    z-index: 998;
}
</style>