spectaculars.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <view class="container">
  3. <view hover-class="navigator-hover" class="item">
  4. <view class="label">在线设备</view>
  5. <view class="count u-line-1">{{ statistics.today_devices }}</view>
  6. </view>
  7. <view hover-class="navigator-hover" class="item">
  8. <view class="label">今日警告</view>
  9. <view class="count u-line-1">{{ statistics.today_warns }}</view>
  10. </view>
  11. <view hover-class="navigator-hover" class="item">
  12. <view class="label">今日工单</view>
  13. <view class="count u-line-1">{{ statistics.today_orders }}</view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. name: 'spectaculars',
  20. data() {
  21. return {
  22. statistics: {
  23. today_devices: 0,
  24. today_warns: 0,
  25. today_orders: 0,
  26. }
  27. };
  28. },
  29. created() {
  30. this.getDetail()
  31. },
  32. methods: {
  33. getDetail() {
  34. this.$Http.basic({
  35. "id": 20230721153102,
  36. "content": {}
  37. }).then(res => {
  38. console.log("数据看板", res)
  39. if (this.cutoff(res.msg)) return;
  40. this.statistics = res.data;
  41. })
  42. }
  43. }
  44. }
  45. </script>
  46. <style lang="scss" scoped>
  47. .container {
  48. display: flex;
  49. justify-content: space-between;
  50. width: 355px;
  51. height: 72px;
  52. margin: 0 auto;
  53. margin-top: 10px;
  54. .item {
  55. width: 112px;
  56. height: 72px;
  57. padding: 10px;
  58. box-sizing: border-box;
  59. border-radius: 4px;
  60. background: #FFFFFF;
  61. .label {
  62. line-height: 20px;
  63. font-size: 14px;
  64. font-family: PingFang SC-Regular, PingFang SC;
  65. color: #333333;
  66. }
  67. .count {
  68. line-height: 22px;
  69. font-size: 16px;
  70. font-family: PingFang SC-Medium, PingFang SC;
  71. font-weight: bold;
  72. color: #3874F6;
  73. margin-top: 10px;
  74. }
  75. }
  76. }
  77. </style>