bottom1.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <div id="bottom1">
  3. <div class = "up">
  4. <div class="bg-color-black">
  5. <div class="d-flex pt-2 pl-2">
  6. <span>
  7. <icon name="chart-area" class="text-icon"></icon>
  8. </span>
  9. <div class="d-flex">
  10. <span class="fs-xl text mx-2">7日质量趋势分析</span>
  11. <div class="decoration2">
  12. <dv-decoration-2 :reverse="true" style="width:5px;height:6rem;" />
  13. </div>
  14. </div>
  15. </div>
  16. <div>
  17. <Bottom1Chart />
  18. </div>
  19. </div>
  20. </div>
  21. <div class="down">
  22. <div class="bg-color-black">
  23. <div class="d-flex pt-2 pl-2">
  24. <span>
  25. <icon name="chart-line" class="text-icon"></icon>
  26. </span>
  27. <div class="d-flex">
  28. <span class="fs-xl text mx-2">线体当日累计产量统计</span>
  29. </div>
  30. </div>
  31. <div class="d-flex jc-center body-box">
  32. <dv-scroll-board class="dv-scr-board" :config="config" ref="scroll-board" />
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. </template>
  38. <script>
  39. import Bottom1Chart from "@/components/smtechart/bottom/bottom1Chart";
  40. export default {
  41. components: {
  42. Bottom1Chart
  43. },
  44. data() {
  45. return {
  46. config: {
  47. //线别,产出,不良,良率PLANQTY 计划数 GETRATE 达成率
  48. header: ['线别', '产出', '不良','良率%','计划数','达成率%'],
  49. data: [],
  50. // rowNum: 5, //表格行数
  51. headerHeight: 35,
  52. headerBGC: '#0f1325', //表头
  53. oddRowBGC: '#0f1325', //奇数行
  54. evenRowBGC: '#171c33', //偶数行
  55. columnWidth: [200,170,170,200,170,100],
  56. align: ['center']
  57. },
  58. timing:null,
  59. }
  60. },
  61. mounted() {
  62. this.refreshdata()
  63. },
  64. beforeDestroy () {
  65. clearInterval(this.timing)
  66. },
  67. methods: {
  68. refreshdata() {
  69. this.getdata(); //获取-数据
  70. this.timing = setInterval(() => {
  71. this.getdata(); //获取--数据
  72. }, 10000);
  73. },
  74. async getdata() {
  75. var caller = 'KB!SMT!BUTTOM1!DPLANTOUTPUT';
  76. if (sessionStorage.getItem('li_code') == '所有'){
  77. caller = 'KB!SMT!BUTTOM1!DPLANTOUTPUT!ALL';
  78. }
  79. await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100", {
  80. params: {
  81. condition: "1=1",
  82. }
  83. })
  84. .then((result)=>{
  85. let dataList = JSON.parse(result.data.data);
  86. let resultList = new Array();
  87. for (let index = 0; index < dataList.length; index++) {
  88. const element = dataList[index];
  89. let item = new Array();
  90. item.push(element.linecode);
  91. item.push("<span class='colorGrass'>"+element.value+"</span>");
  92. item.push("<span class='colorGrass'>"+element.ngqty+"</span>");
  93. if(element.okrate<98) { //98%
  94. item.push("<span class='colorRed'>" + element.okrate + "</span>");
  95. }else {
  96. item.push("<span class='colorGrass'>" + element.okrate + "</span>");
  97. }
  98. item.push("<span class='colorGrass'>"+element.planqty+"</span>");
  99. item.push("<span class='colorGrass'>"+element.getrate+"</span>");
  100. resultList.push(item);
  101. }
  102. const scrollBoard = this.$refs['scroll-board'];
  103. //刷新数据
  104. scrollBoard.updateRows(resultList);
  105. },(result)=>{
  106. console.error(result)
  107. }
  108. );
  109. }
  110. }
  111. };
  112. </script>
  113. <style lang="scss" class>
  114. $box-height: 475px;
  115. $box-width: 100%;
  116. #bottom1 {
  117. padding: 8px 10px;
  118. height: $box-height;
  119. width: $box-width;
  120. border-radius: 5px;
  121. display: flex;
  122. flex-direction: column;
  123. .up {
  124. .bg-color-black {
  125. border-radius: 10px;
  126. height: 225px;
  127. }
  128. .text {
  129. color: #c3cbde;
  130. //font-size: 15px;
  131. }
  132. //下滑线动态
  133. .decoration2 {
  134. position: absolute;
  135. right: 0.125rem;
  136. }
  137. .chart-box {
  138. margin-top: 16px;
  139. width: 90px;
  140. height: 90px;
  141. .active-ring-name {
  142. padding-top: 10px;
  143. }
  144. }
  145. }
  146. .down{
  147. height: 225px;
  148. padding-top: 5px;
  149. .bg-color-black {
  150. border-radius: 10px;
  151. height: 225px;
  152. padding-top: 5px;
  153. .dv-scr-board {
  154. height: 205px;
  155. .header{
  156. font-size: 18px;
  157. }
  158. .rows .row-item{
  159. font-size: 17px;
  160. }
  161. }
  162. }
  163. }
  164. }
  165. </style>