1
Surpriseplus
2022-09-16 8d1a91c23df335b090e38b2edd15203aa3b03da9
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
<template>
  <div class="evaluate">
    <div class="title">
      <span>种子接苗</span>
      <img src="../../../assets/img/zonlan (9).png" alt="" />
    </div>
    <div class="content">
      <table class="table_main">
        <thead>
          <tr>
            <th class="coll1">品种名称</th>
            <th class="coll2">产品代码</th>
            <th class="coll3">作物种类</th>
            <th class="coll4">种子生产单位</th>
            <th class="coll5">产品类别</th>
            <th class="coll6">种子类别</th>
            <th class="coll7">包装规格</th>
            <th class="coll8">换算单位/粒</th>
            <th class="coll9">质量保证期</th>
            <th class="coll10">种源产地</th>
            <th class="coll11">上下架</th>
          </tr>
        </thead>
 
        <tbody :class="{ anim: animate == true, hei: isLenght === true }">
          <tr v-for="(item, index) in tableData" :key="index">
            <td class="coll1" :title="item.varietyName">
              {{ item.varietyName }}
            </td>
            <td class="coll2" :title="item.productCode">
              {{ item.productCode }}
            </td>
            <td class="coll3" :title="item.cropCategory1name">
              {{ item.cropCategory1name }}
            </td>
            <td class="coll4" :title="item.produceUnit">
              {{ item.produceUnit }}
            </td>
            <td class="coll5" :title="item.productType">
              {{ item.productType }}
            </td>
            <td class="coll6" :title="item.seedType">{{ item.seedType }}</td>
            <td class="coll7" :title="item.size">{{ item.size }}</td>
            <td class="coll8" :title="item.convertQuantity">
              {{ item.convertQuantity }}
            </td>
            <td class="coll9" :title="item.qualityPeriod">
              {{ item.qualityPeriod }}
            </td>
            <td class="coll10" :title="item.originPlace">
              {{ item.originPlace }}
            </td>
            <td class="coll11" :title="item.updown">{{ item.updown }}</td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</template>
 
<script>
export default {
  //import引入的组件需要注入到对象中才能使用
  components: {},
  data() {
    //这里存放数据
    return {
      timer: "",
      animate: false,
      tableData: [],
      endId: "",
      isLenght: false,
    };
  },
  //方法集合
  methods: {
    async getList() {
      const { data: dt } = await this.$http.get(
        "/jeecg-boot/seed/seed/queryall"
      );
 
      this.tableData = dt.result;
 
      this.endId = this.tableData[this.tableData.length - 1].id;
      if (this.tableData.length > 10) {
        this.isLenght = true;
        this.timer = setInterval(this.scroll, 5000);
      } else {
        this.isLenght = false;
        clearInterval(this.timer);
      }
    },
 
    scroll() {
      this.animate = true;
      setTimeout(() => {
        this.tableData.push(this.tableData[0]);
        this.tableData.shift();
        this.animate = false;
        if (this.tableData[0].id === this.endId) {
          // console.log('请求刷新数据')
          this.getList();
          clearInterval(this.timer);
        }
      }, 500);
    },
  },
  created() {
    //this.getList()
  },
  mounted() {
    this.getList();
  },
};
</script>
<style lang="less" scoped>
//@import url(); 引入公共css类
.evaluate {
  height: 45%;
  margin-top: 5%;
  width: 100%;
  background: rgba(8, 32, 58, 0.7);
  .title {
    width: 100%;
    position: relative;
 
    img {
      width: 100%;
    }
 
    span {
      font-size: 78px;
      font-weight: 400;
      color: #ffe86b;
      background: linear-gradient(0deg, #bce7ff 0%, #69efff 98.6572265625%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      position: absolute;
      left: 50%;
      top: 0;
      transform: translateX(-50%);
    }
  }
}
 
.content {
  width: 100%;
  height: 90%;
  padding: 10px;
  overflow: hidden;
  margin-top: 20px;
  table {
    text-align: center;
    border: none;
    width: 100%;
    height: 88%;
    tbody tr:nth-of-type(odd) {
      background-color: #202e3b;
    }
    tbody tr:nth-of-type(even) {
      background-color: #08213c;
    }
  }
}
 
.table_main {
  width: 100%;
 
  text-align: center;
  border: 1px solid #86c7ff;
  color: #fff;
  position: relative;
}
 
.table_main tr {
  line-height: 10%;
}
 
.table_main thead {
  background-color: #054b75;
  width: 100%;
  font-size: 30px;
  display: table;
  table-layout: fixed;
  box-sizing: border-box;
}
 
.zindex {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 99;
  /* background: #06067a; */
  background: #10107a;
  border: none;
}
 
.zindex tr th {
  border: none;
}
 
.table_main thead th {
  height: 124px;
  font-weight: 300;
  table-layout: fixed;
  box-sizing: border-box;
}
 
.table_main tbody.hei {
  height: 100%;
}
 
.table_main tbody {
  //   padding-top: 80px;
  display: block;
  width: 100%;
  /* height: 352px; */
  /* 隐藏滚动条兼容 */
  -ms-scroll-chaining: chained;
  -ms-content-zooming: zoom;
  -ms-scroll-rails: none;
  -ms-content-zoom-limit-min: 100%;
  -ms-content-zoom-limit-max: 500%;
  /* -ms-scroll-snap-type: proximity; */
  -ms-scroll-snap-points-x: snapList(100%, 200%, 300%, 400%, 500%);
  -ms-overflow-style: none;
  overflow-y: scroll;
  /* 火狐 */
  scrollbar-width: none;
  /* ie */
  -ms-overflow-style: none;
}
 
.table_main tbody::-webkit-scrollbar {
  display: none;
}
 
.table_main tbody tr {
  display: table;
  table-layout: fixed;
  width: 100%;
}
 
.table_main tbody tr td {
  color: #848b91;
  font-size: 38px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: none;
}
 
.content .coll1 {
  height: 60px;
  width: 8%;
}
.content .coll2 {
  width: 8%;
}
.content .coll3 {
  width: 8%;
}
.content .coll4 {
  width: 8%;
}
.content .coll5 {
  width: 8%;
}
.content .coll6 {
  width: 8%;
}
.content .coll7 {
  width: 8%;
}
.content .coll8 {
  width: 8%;
}
.content .coll9 {
  width: 8%;
}
.content .coll10 {
  width: 8%;
}
.content .coll11 {
  width: 8%;
}
.content .coll12 {
  width: 8%;
  button {
    border: none;
    background-color: #00784c;
    width: 60%;
    margin-left: 20%;
    height: 90%;
    text-align: center;
    color: #ffffff;
    border-radius: 10px;
  }
}
 
.anim {
  transition: all 0.5s;
  margin-top: -32px;
}
@media only screen and (max-width: 2560px) {
  .evaluate {
    overflow: visible;
    height: auto;
    background: transparent;
    margin-top: 0;
    .content {
      height: 5000px;
      .coll1 {
        height: 200px;
      }
      .table_main tr {
        height: 150px;
        line-height: 150px;
      }
    }
  }
}
</style>