Blame view

subPackages/treePage/treeRecord.vue 2.11 KB
c7744156   刘淇   录入树木
1
2
  <template>
    <view class="container">
21397afd   刘淇   树 新增
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  
      <tui-no-data imgUrl="/static/images/nodata.png" v-if="rows.length==0">暂无数据</tui-no-data>
      <view class="record-wrap" v-else>
        <view class="record-list-wrap" v-for="i in rows" @click="toEditPage(i.id)">
          <view class="record-list-left" :style="`background-image: url(${i.treephoto});`"></view>
          <view class="record-list-right">
            <view class="record-list-right-title">
              <view>{{i.treetype}}</view>
              <view>{{i.updatetime.substring(0,10)}}</view>
            </view>
            <view class="fs-mt8">
              高度:{{i.treeheight}}
            </view>
            <view class="fs-mt8">
              胸径:{{i.dbh}}
            </view>
            <view class="fs-mt8">
              树木编号:{{i.treenumber}}
            </view>
          </view>
        </view>
c7744156   刘淇   录入树木
24
25
26
      </view>
  
  
21397afd   刘淇   树 新增
27
      <tui-button class="addTree" @click="toAddTreePage">新增树木录入</tui-button>
c7744156   刘淇   录入树木
28
29
30
31
32
    </view>
  
  </template>
  
  <script>
21397afd   刘淇   树 新增
33
  import { treeRoadReq } from "@/api/tree";
c7744156   刘淇   录入树木
34
  export default {
21397afd   刘淇   树 新增
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
    name: "treeRecord",
    data(){
      return{
        rows:[],
        roadId:''
      }
    },
    onLoad(options){
      this.roadId = options.roadId
      this.treeRoadQuery()
    },
    methods:{
      toEditPage(id){  // 前往修改页面
        uni.$tui.href(`/subPackages/treePage/editTree?id=${id}`)
      },
      toAddTreePage(){
        uni.$tui.href(`/subPackages/treePage/addTree?roadId=${this.roadId}`)
      },
      // 记录列表
      treeRoadQuery(){
        treeRoadReq({data:{road: this.roadId}}).then(res=>{
          console.log(res)
          this.rows = res.rows
        })
      },
    }
c7744156   刘淇   录入树木
61
62
63
64
65
66
67
68
  }
  </script>
  
  <style scoped>
  .record-wrap{
    padding-bottom: 120rpx;
  }
  .record-list-wrap{
21397afd   刘淇   树 新增
69
    height: 130px;
c7744156   刘淇   录入树木
70
71
72
73
    margin: 20rpx 20rpx 0 20rpx;
    padding: 20rpx;
    box-shadow: 0 1rpx 2rpx 5rpx rgb(0, 0, 0, .3);
    border-radius: 10rpx;
21397afd   刘淇   树 新增
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
    display: flex;
  }
  .record-list-left{
    height: 100px;
    width: 100px;
    background-size: 100% 100%;
  }
  .record-list-right{
    height: 140px;
    margin-left: 20px;
    flex:1
  }
  .record-list-right-title{
    display: flex;
    justify-content: space-between;
c7744156   刘淇   录入树木
89
  }
c7744156   刘淇   录入树木
90
91
92
93
94
95
96
  .addTree{
    width: 100%;
    position: fixed;
    bottom: 0;
  }
  
  </style>