controlItem.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <view class="box" hover-class="navigator-hover">
  3. <view class="funcname u-line-1" :style="{ paddingRight: item.isfeedback ? '10px' : '' }">
  4. {{ item.funcname }}
  5. </view>
  6. <view class="row">
  7. <view class="value u-line-1">{{ item.showValue || item.params.lastvalue || ' --' }}</view>
  8. <view class="unit u-line-1">{{ item.params.unit }}</view>
  9. </view>
  10. <view v-if="item.isfeedback" class="dot" />
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. name: "ControlItem",
  16. props: {
  17. item: Object
  18. }
  19. }
  20. </script>
  21. <style lang="scss" scoped>
  22. .box {
  23. position: relative;
  24. width: 175px;
  25. height: 60px;
  26. border-radius: 4px;
  27. padding: 4px 6px 0;
  28. box-sizing: border-box;
  29. background-color: #fff;
  30. margin-top: 5px;
  31. .funcname {
  32. font-size: 15px;
  33. color: #333;
  34. }
  35. .dot {
  36. position: absolute;
  37. right: 2px;
  38. top: 2px;
  39. width: 12px;
  40. height: 12px;
  41. background: #D9001B;
  42. border-radius: 50%;
  43. }
  44. .row {
  45. display: flex;
  46. margin-top: 10px;
  47. align-items: flex-end;
  48. .value {
  49. width: 0;
  50. flex: 1;
  51. color: #333;
  52. font-size: 16px;
  53. flex-shrink: 0;
  54. font-weight: bold;
  55. }
  56. .unit {
  57. font-size: 12px;
  58. color: #666;
  59. flex-shrink: 0;
  60. max-width: 50px;
  61. }
  62. }
  63. }
  64. </style>