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
<template>
  <div class="population" style="background: rgba(8, 32, 58, 0.7)">
    <p class="message">本月统筹情况</p>
    <div class="rollTitle">
      <el-row>
        <el-col :span="4">序号</el-col>
        <el-col :span="5">时间</el-col>
        <el-col :span="5">名称</el-col>
        <el-col :span="5">数据量</el-col>
        <el-col :span="5">状态</el-col>
      </el-row>
    </div>
    <vue-seamless-scroll
      :data="tableData"
      class="seamless-warp"
      :class-option="defaultOption"
    >
      <ul>
        <li v-for="(item, index) in tableData" :key="index">
          <el-row class="click_box">
            <el-col :span="4" class="rollItem_id">{{ index + 1 }}</el-col>
 
            <el-col :span="5" class="rollItem">{{ item.NY }}</el-col>
            <el-col :span="5" class="rollItem">{{ item.NAME }}</el-col>
            <el-col :span="5" class="rollItem">{{
              item.ALL_SIZE == undefined ? "0条" : `${item.ALL_SIZE}条`
            }}</el-col>
            <el-col :span="5" class="rollItem">{{ item.STATUS }}</el-col>
          </el-row>
        </li>
      </ul>
    </vue-seamless-scroll>
  </div>
</template>
 
<script>
import { constructionData } from "../../../utils/api.js";
export default {
  //import引入的组件需要注入到对象中才能使用
  components: {},
  data() {
    //这里存放数据
    return {
      param: {
        TYPE: 4,
      },
      tableData: [],
    };
  },
  computed: {
    defaultOption() {
      return {
        step: 0.2, // 数值越大速度滚动越快
        limitMoveNum: 2, // 开始无缝滚动的数据量 this.dataList.length
        hoverStop: true, // 是否开启鼠标悬停stop
        direction: 1, // 0向下 1向上 2向左 3向右
        openWatch: true, // 开启数据实时监控刷新dom
        singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
        singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3
        waitTime: 1000, // 单步运动停止的时间(默认值1000ms)
      };
    },
  },
  //方法集合
  methods: {
    async construction() {
      let { data: dt } = await constructionData(this.param);
      if (dt.errno !== 200) {
        return this.$message.error(dt.errmsg);
      }
      this.tableData = dt.pd.varList;
    },
  },
  created() {
    this.construction();
  },
};
</script>
<style lang="less" scoped>
//@import url(); 引入公共css类
.population {
  overflow: hidden;
  width: 100%;
  height: 25%;
  box-sizing: border-box;
  .message {
    font-size: 60px;
    font-weight: 400;
    color: #ffffff;
    text-align: center;
    padding-top: 25px;
    padding-bottom: 40px;
  }
  .seamless-warp {
    height: 300px;
    overflow: hidden;
  }
 
  /* 标题头的设置 */
  .rollTitle {
    // margin-top: 10px;
    height: 70px;
    line-height: 70px !important;
    color: #fff !important;
    font-size: 26px !important;
    background: #054b75;
    // opacity: 0.27;
  }
  /* 标题中文字居中 */
  .rollTitle .el-col {
    text-align: center !important;
    color: #fff;
  }
  /* 滚动项的字体大小 */
  .rollItem {
    font-size: 30px !important;
    color: #fff;
  }
  .rollItem_id {
    font-family: dig;
    font-size: 12px;
    font-weight: 300;
    color: #fff;
  }
  /* 去除ul的左内边距 */
  .seamless-warp ul {
    padding: 0 !important;
    margin: 0 !important;
  }
  /* 去除li的小点 */
  .seamless-warp ul li {
    list-style-type: none !important;
    border-bottom: 1px solid white;
  }
  .seamless-warp ul li:hover {
    background-color: rgba(0, 162, 255, 0.3);
    cursor: pointer;
  }
  /* 每行数据的样式调整 */
  .seamless-warp ul li .el-row .el-col {
    text-align: center !important;
    height: 70px !important;
    line-height: 70px !important;
  }
}
 
@media only screen and (max-width: 2560px) {
  .population {
    height: auto;
    overflow: visible;
    .seamless-warp {
      height: 900px;
      overflow: hidden;
    }
    .rollTitle {
      // margin-top: 10px;
      height: 210px;
      line-height: 210px !important;
    }
    .seamless-warp ul li .el-row .el-col {
      height: 210px !important;
      line-height: 210px !important;
    }
  }
}
</style>