bottomRight2.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <div id="bottomRight2">
  3. <div class="bg-color-black">
  4. <div class="d-flex pt-2 pl-2">
  5. <span>
  6. <icon name="chart-line" class="text-icon"></icon>
  7. </span>
  8. <div class="d-flex">
  9. <span class="fs-xl text mx-2">ATE良率</span>
  10. </div>
  11. </div>
  12. <div class="d-flex jc-center body-box">
  13. <dv-scroll-board class="dv-scr-board" :config="config" ref="scroll-board" />
  14. </div>
  15. </div>
  16. </div>
  17. </template>
  18. <script>
  19. export default {
  20. data() {
  21. return {
  22. config: {
  23. header: ['线别', '良率%'],
  24. data: [/*
  25. ['组件1', 'dev-1', "<span class='colorGrass'>↑75%</span>"],
  26. */
  27. ],
  28. rowNum: 8, //表格行数
  29. headerHeight: 35,
  30. headerBGC: '#0f1325', //表头
  31. oddRowBGC: '#0f1325', //奇数行
  32. evenRowBGC: '#171c33', //偶数行
  33. index: true,
  34. columnWidth: [50,130],
  35. align: ['center']
  36. }
  37. }
  38. },
  39. mounted() {
  40. this.refreshdata()
  41. },
  42. methods: {
  43. refreshdata() {
  44. this.getdata(); //获取-数据
  45. setInterval(() => {
  46. this.getdata(); //获取--数据
  47. }, 30000);
  48. },
  49. async getdata() {
  50. await this.$http.get("kanban/datalist.action?caller=ATERATE!ZZ&_noc=1&page=1&pageSize=100",{
  51. params: {
  52. condition: "1=1",
  53. }
  54. }).then((result)=>{
  55. let dataList = JSON.parse(result.data.data);
  56. let resultList = new Array();
  57. for (let index = 0; index < dataList.length; index++) {
  58. const element = dataList[index];
  59. let item = new Array();
  60. item.push(element.linecode);
  61. if(element.value<97.5) {
  62. item.push("<span class='colorRed'>" + element.value + "</span>");
  63. }else{
  64. item.push("<span class='colorGrass'>" + element.value + "</span>");
  65. }
  66. resultList.push(item);
  67. }
  68. const scrollBoard = this.$refs['scroll-board'];
  69. //刷新数据
  70. scrollBoard.updateRows(resultList);
  71. },(result)=>{
  72. console.error(result)
  73. }
  74. );
  75. }
  76. }
  77. }
  78. </script>
  79. <style lang="scss" scoped>
  80. $box-height: 520px;
  81. $box-width: 315px;
  82. #bottomRight2 {
  83. padding: 16px;
  84. padding-top: 20px;
  85. height: $box-height;
  86. width: $box-width;
  87. border-radius: 5px;
  88. .bg-color-black {
  89. height: $box-height - 30px;
  90. border-radius: 10px;
  91. }
  92. .text {
  93. color: #c3cbde;
  94. // font-size: 15px;
  95. }
  96. .body-box {
  97. border-radius: 10px;
  98. overflow: hidden;
  99. .dv-scr-board {
  100. width: 270px;
  101. height: 450px;
  102. }
  103. }
  104. }
  105. </style>