ssddgjxx.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <div class="table-wrapper">
  3. <div class="table-box">
  4. <vue-seamless-scroll :data="tableData" class="warp" :class-option="classOption">
  5. <el-table
  6. :cell-style="{border:0,color:'rgba(255,255,255,1)'}"
  7. :data="tableData"
  8. :header-cell-style="{color:'#fff'}"
  9. :row-class-name="tableRowClassName"
  10. :row-style="{backgroundColor:'rgb(4,66,115,0.3)'}"
  11. :show-header="false"
  12. style="background: none;margin-top: -1%;font-size: 15px"
  13. >
  14. <el-table-column align="center" label="信息" prop="info">
  15. <template slot-scope="scope">
  16. <div v-if="scope.row.level === '2'" style="height: 25px;opacity: 0.5">
  17. <img :height="20"
  18. :width="20"
  19. alt=""
  20. src="../../../assets/vpp/images/warning1.png"
  21. style="top: 10px;opacity: 0.5">
  22. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ scope.row.str }}
  23. </div>
  24. <div v-if="scope.row.level === '3'" style="height: 25px;">
  25. <img :height="20"
  26. :width="20"
  27. alt=""
  28. src="../../../assets/vpp/images/warning.png" style="top: 10px;">
  29. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ scope.row.str }}
  30. </div>
  31. </template>
  32. </el-table-column>
  33. </el-table>
  34. </vue-seamless-scroll>
  35. </div>
  36. </div>
  37. </template>
  38. <script>
  39. import vueSeamlessScroll from "vue-seamless-scroll";
  40. import {listRealTimeMessageAlarm} from "@/api/vpp/message";
  41. export default {
  42. components: { vueSeamlessScroll },
  43. data() {
  44. return {
  45. form: {
  46. taskNumber: '',
  47. date: '',
  48. current: 1,
  49. size: 10
  50. },
  51. tableData: [],
  52. tableData1: []
  53. }
  54. },
  55. created() {
  56. this.listAlarm()
  57. },
  58. computed:{
  59. classOption() {
  60. return {
  61. step: 0.5, // 数值越大速度滚动越快
  62. limitMoveNum: 5, // 开始无缝滚动的数据量
  63. hoverStop: true, // 是否开启鼠标悬停stop
  64. direction: 1, // 0向下 1向上 2向左 3向右
  65. openWatch: true, // 开启数据实时监控刷新dom
  66. singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
  67. singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3
  68. waitTime: 500, // 单步运动停止的时间(默认值1000ms)
  69. };
  70. },
  71. },
  72. methods: {
  73. listAlarm() {
  74. listRealTimeMessageAlarm().then(res => {
  75. this.tableData = res.rows.slice(0, 5)
  76. });
  77. },
  78. handleRowClick(row, event, column) {
  79. // 在这里处理行点击事件
  80. console.log('行点击事件:', row, event, column);
  81. },
  82. tableRowClassName({row}) {
  83. if (row.level == "2") {
  84. return "tablerow1";
  85. } else {
  86. return "tablerow2"
  87. }
  88. },
  89. },
  90. mounted() {
  91. this.listAlarm()
  92. }
  93. }
  94. </script>
  95. <style lang="less" scoped>
  96. @font-face {
  97. font-family: AliMaMa;//自定义字体名称
  98. src: url("../Articles/font/AlimamaDaoLiTi.ttf")
  99. }
  100. /deep/ .el-table .tablerow1 {
  101. background: url('./img/矩形866.4.png') no-repeat;
  102. }
  103. /deep/ .el-table .tablerow2 {
  104. background: url('./img/矩形866.png') no-repeat;
  105. }
  106. .table-wrapper {
  107. //width: 1483px;
  108. //padding-left: 20px;
  109. .table-box {
  110. //min-height: 600px;
  111. margin-left: 6%;
  112. margin-top: 9%;
  113. width: 92%;
  114. background-size: cover;
  115. }
  116. /deep/ .el-form-item__label {
  117. color: #fff;
  118. //font-size: 17px;
  119. }
  120. /deep/ .el-input__inner {
  121. background-color: rgba(14, 73, 131);
  122. border: 1px solid rgb(64, 153, 255);
  123. //height: 34px;
  124. //font-size: 17px;
  125. }
  126. /deep/ .el-table tbody tr {
  127. pointer-events: none;
  128. }
  129. /deep/ .el-table__header {
  130. background: url(../Articles/img/bg1.png);
  131. }
  132. /deep/ .el-table--enable-row-hover .el-table__body tr:hover > td {
  133. background-color: rgb(103, 118, 49) !important
  134. }
  135. /deep/ .el-col {
  136. padding: 0;
  137. display: inline-block;
  138. position: relative;
  139. }
  140. /deep/ .el-col:nth-child(1) {
  141. width: 19%;
  142. }
  143. /deep/ .el-col:nth-child(2) {
  144. width: 22%;
  145. }
  146. /deep/ .el-col:nth-child(3) {
  147. width: 19%;
  148. }
  149. /deep/ .el-col:nth-child(4) {
  150. width: 19%;
  151. }
  152. /deep/ .el-col:nth-child(5) {
  153. width: 15%;
  154. }
  155. /deep/ .el-input__inner:nth-child(1) {
  156. //width: 176px;
  157. }
  158. /deep/ .el-input__inner:nth-child(2) {
  159. //width: 176px;
  160. }
  161. /deep/ .el-input__inner:nth-child(2) {
  162. //width: 126px;
  163. }
  164. /deep/ .el-input__inner:nth-child(2) {
  165. //width: 175px;
  166. }
  167. /deep/ .el-icon-arrow-up {
  168. transform: rotateZ(0deg);
  169. }
  170. /deep/ .el-icon-arrow-up:before {
  171. content: url(../Articles/img/xiala2.png);
  172. }
  173. /deep/ .el-input__prefix {
  174. right: -60px;
  175. padding-top: 3px;
  176. }
  177. /deep/ .el-icon-date:before {
  178. content: url(../Articles/img/riqi.png);
  179. }
  180. /deep/ .el-table__header tr {
  181. background: url(../Articles/img/bg1.png);
  182. //height: 49px;
  183. }
  184. /deep/ .el-table__body {
  185. //-webkit-border-vertical-spacing: 5px; // 垂直间距
  186. }
  187. /deep/ .el-form-item__content {
  188. text-align: left;
  189. }
  190. /deep/ .el-table, .el-table__expanded-cell {
  191. background-color: rgb(1, 40, 81);
  192. }
  193. /deep/ .el-table th.el-table__cell {
  194. border: 0;
  195. }
  196. .el-table::before {
  197. height: 0;
  198. }
  199. .el-table__row > td {
  200. border: none;
  201. }
  202. .warp {
  203. margin: 0 auto;
  204. overflow: hidden;
  205. height: 240px;
  206. ul {
  207. list-style: none;
  208. padding: 0;
  209. margin: 0 auto;
  210. li,
  211. a {
  212. display: block;
  213. height: 30px;
  214. display: flex;
  215. justify-content: space-between;
  216. font-size: 15px;
  217. }
  218. }
  219. }
  220. }
  221. </style>