smodule78.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <div class="module-main">
  3. <div class="module-box">
  4. <div class="module-box-one">
  5. <div class="content">
  6. <img src="../../images/smodule/ys-circle.png" alt="">
  7. <div class="title">当日工单总量</div>
  8. <div class="nums">{{data.count}}</div>
  9. </div>
  10. </div>
  11. <div class="bottom">
  12. <div>本年总量:{{data.count2}}</div>
  13. <div>本月总量:{{data.count1}}</div>
  14. </div>
  15. </div>
  16. </div>
  17. </template>
  18. <script>
  19. import Vue from 'vue';
  20. import Component from 'vue-class-component';
  21. import api from '../../api';
  22. @Component({
  23. components: {
  24. },
  25. props: {
  26. data: {
  27. type: Object,
  28. default: null,
  29. },
  30. },
  31. })
  32. export default class Smodule14 extends Vue {
  33. nums = 0;
  34. data = {}
  35. created() {
  36. this.getTodoNum();
  37. setInterval(() => {
  38. this.getTodoNum();
  39. }, 3000 * 60);
  40. }
  41. getTodoNum() {
  42. console.log('xxxxxxxxxxxxxxxx');
  43. api.getTodoNum().then((res) => {
  44. this.data = res.data;
  45. }).catch(() => {}).finally(() => {
  46. });
  47. }
  48. }
  49. </script>
  50. <style scoped lang="scss">
  51. .module-box-one{
  52. width: 100%;
  53. height: 80%;
  54. display: flex;
  55. justify-content: center;
  56. align-items: center;
  57. text-align: center;
  58. }
  59. .module-box-one .content{
  60. width: 57%;
  61. height: auto;
  62. position: relative;
  63. }
  64. .module-box-one .content img{
  65. margin-top: 20px;
  66. width: 100%;
  67. }
  68. .module-box-one .content .title{
  69. width: 100%;
  70. font-size: 18px;
  71. color: #333;
  72. position: absolute;
  73. top: 28%;
  74. }
  75. .module-box-one .content .nums{
  76. width: 100%;
  77. font-size: 50px;
  78. font-family: DIN;
  79. font-weight: bold;
  80. color: #0163FF ;
  81. position: absolute;
  82. top: 45%;
  83. overflow: hidden;
  84. }
  85. .bottom{
  86. width: 100%;
  87. height: 20%;
  88. div{
  89. width: 50%;
  90. text-align: center;
  91. display: inline-block;
  92. float: left;
  93. overflow: hidden;
  94. }
  95. }
  96. </style>