123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <template>
- <view v-show="show">
- <view class="item" hover-class="navigator-hover" v-for="item in list" :key="item.rowindex">
- <view class="title">{{ item.createdate || ' --' }}</view>
- <view class="row u-line-3">
- {{ item.action == 'off' ? '离线' : '在线' }}
- </view>
- </view>
- </view>
- </template>
- <script>
- let paging = {}
- export default {
- name: "uploadRecord",
- 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": 20231123163602,
- "content": {
- "type": 1,
- "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>
- .item {
- width: 355px;
- margin: 0 auto 10px;
- padding: 10px;
- background: #fff;
- border-radius: 4px;
- box-sizing: border-box;
- .title {
- line-height: 21px;
- font-size: 15px;
- font-family: PingFang SC-Medium, PingFang SC;
- font-weight: bold;
- color: #333333;
- margin-bottom: 10px;
- }
- .row {
- line-height: 17px;
- font-size: 12px;
- color: #666666;
- margin-bottom: 5px;
- }
- }
- /deep/.u-empty {
- z-index: 1 !important;
- }
- </style>
|