up2.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <div id="center">
  3. <div class="up">
  4. <div
  5. class=" item"
  6. v-for="item in titleItem"
  7. :key="item.title"
  8. >
  9. <p class="ml-3 colorText fw-b " style="font-size:26px;">{{ item.title }}</p>
  10. <div>
  11. <dv-digital-flop
  12. class="dv-dig-flop ml-1 mt-3 pl-3"
  13. :config="item.number"
  14. />
  15. </div>
  16. </div>
  17. </div>
  18. <div class="down">
  19. <div>
  20. <Up2Chart />
  21. </div>
  22. </div>
  23. </div>
  24. </template>
  25. <script>
  26. import Up2Chart from '@/components/smtechart/up/up2Chart'
  27. export default {
  28. data() {
  29. return {
  30. titleItem:[],
  31. }
  32. },
  33. components: {
  34. Up2Chart
  35. },
  36. mounted () {
  37. this.drawTimingFn();
  38. },
  39. methods: {
  40. drawTimingFn () {
  41. this.setData();
  42. setInterval(() => {
  43. this.setData(); //获取-数据
  44. }, 30000);
  45. },
  46. async setData () {
  47. // 基板总数 ,总实装点数 name value
  48. await this.$http.get("kanban/datalist.action?caller=KB!SMT!UP2!1&_noc=1&page=1&pageSize=100&condition=1=1")
  49. .then((result)=>{
  50. let dataList = JSON.parse(result.data.data);
  51. let titleitems = new Array();
  52. for (let index = 0; index < dataList.length; index++) {
  53. const element = dataList[index];
  54. titleitems.push({
  55. title: element.v_name,
  56. number: {
  57. number: [element.v_value],
  58. //toFixed: 1,
  59. textAlign: 'center',
  60. content: (element.v_name =='实装点数'? '{nt}K':'{nt}'),
  61. style: {
  62. fontSize: 35,
  63. fill: '#2e92e7',
  64. fontWeight:'bold',
  65. // fontFamily:'"Lucida Console", "Courier New", monospace'
  66. }
  67. }
  68. });
  69. }
  70. this.titleItem = titleitems;
  71. },(result)=>{
  72. console.error(result)
  73. }
  74. );
  75. }
  76. }
  77. }
  78. </script>
  79. <style lang="scss" scoped>
  80. #center {
  81. display: flex;
  82. flex-direction: column;
  83. .up {
  84. width: 100%;
  85. display: flex;
  86. flex-wrap: wrap;
  87. justify-content: space-around;
  88. margin: 70px 0px 0 0px;
  89. .bg-color-black {
  90. background-color: rgba(19, 25, 47, 0.6) !important;
  91. }
  92. .item {
  93. border-radius: 6px;
  94. padding-top: 20px;
  95. margin-top: 8px;
  96. width: 30%;
  97. height: 100px;
  98. padding-left: 20px;
  99. text-align: center;
  100. .dv-dig-flop {
  101. // width: 350px;
  102. height: 30px;
  103. }
  104. .dv-border-box-10{
  105. width: 180px;
  106. height: 80px;
  107. }
  108. }
  109. }
  110. .down {
  111. padding: 6px 4px;
  112. padding-bottom: 0;
  113. width: 100%;
  114. //display: flex;
  115. height: 355px;
  116. justify-content: space-between;
  117. }
  118. }
  119. </style>