horizontalDirection.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <scroll-view class="scroll" v-if="list.length" :scroll-x="true">
  3. <view class="box">
  4. <view class="item" v-for="item in list" :key="item.w_dataparamid">
  5. <view class="label">
  6. {{ item.paramname }}
  7. <text v-if="item.unit">
  8. ({{ item.unit }})
  9. </text>
  10. </view>
  11. <view class="value">
  12. {{ item.lastvalue }}
  13. </view>
  14. </view>
  15. </view>
  16. </scroll-view>
  17. </template>
  18. <script>
  19. export default {
  20. props: {},
  21. name: "horizontalDirection",
  22. data() {
  23. return {
  24. list: []
  25. }
  26. },
  27. methods: {
  28. getList(w_deviceid) {
  29. this.$Http.basic({
  30. "id": 20230711165702,
  31. "content": {
  32. w_deviceid
  33. }
  34. }).then(res => {
  35. console.log("设备实时数据查询", res)
  36. if (this.cutoff(res.msg)) return;
  37. this.list = res.data;
  38. })
  39. }
  40. }
  41. }
  42. </script>
  43. <style lang="scss" scoped>
  44. .scroll {
  45. width: 355px;
  46. background: #FFFFFF;
  47. border-radius: 4px;
  48. margin: 15px auto 0;
  49. height: 62px;
  50. .box {
  51. display: flex;
  52. flex-wrap: nowrap;
  53. align-items: center;
  54. padding: 12px;
  55. box-sizing: border-box;
  56. .item {
  57. flex-shrink: 0;
  58. padding-right: 15px;
  59. .label {
  60. line-height: 14px;
  61. font-size: 10px;
  62. color: #666666;
  63. }
  64. .value {
  65. margin-top: 5px;
  66. line-height: 20px;
  67. font-size: 14px;
  68. font-family: PingFang SC-Bold, PingFang SC;
  69. font-weight: bold;
  70. color: #333333;
  71. }
  72. }
  73. }
  74. }
  75. </style>