record.vue
1.49 KB
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
<template>
<view class="container">
<z-paging ref="paging" v-model="dataList" @query="queryList">
<view class="ul fs-p20">
<view class="li fs-bg__white fs-p30 fs-size__h4 fs-radius__sm fs-mt20" v-for="(item, index) in dataList">
<view class="fs-color__subtitle">{{item.remark}}</view>
<view v-if="item.imgList.length" class="fs-flex fs-mt20">
<view class="fs-mr30" v-for="(value, key) in item.imgList">
<tui-lazyload-img radius="12rpx" width="200rpx" height="200rpx" mode="aspectFill" :src="value" @click="previewImage(index,key)"></tui-lazyload-img>
</view>
</view>
<view class="fs-mt20 fs-align__right fs-color__label">{{item.createTime}}</view>
</view>
</view>
</z-paging>
</view>
</template>
<script>
import { apiInspectionRecord } from '@/api/work'
export default {
data() {
return {
planNo: '',
dataList: []
}
},
onLoad(options) {
this.planNo = options.planno
},
methods: {
// 获取巡检记录
queryList(pageNo, pageSize) {
const params = {
pageReq: {isAsc: 'desc', orderByColumn: 'id', pageNum: pageNo, pageSize: pageSize},
planNo: this.planNo
}
apiInspectionRecord({data:params}).then(res => {
this.$refs.paging.complete(res.rows)
})
},
// 图片预览
previewImage(index, key) {
const imageList = this.dataList[index].imgList
uni.previewImage({
current: imageList[key],
loop: true,
urls: imageList
})
}
}
}
</script>
<style lang="scss" scoped>
.ul .li:first-child {
margin-top: 0;
}
</style>