mpattern.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <view class="control">
  3. <view class="control-title">
  4. 控制模式
  5. </view>
  6. <view class="update-line">
  7. <view class="label">
  8. {{ ctrlModel.funcname }}
  9. </view>
  10. <view class="content">
  11. {{ ctrlModel.showValue }}
  12. <view class="control-updata-but" hover-class="navigator-hover" @click="onClick(ctrlModel)">{{
  13. ctrlModel.isfeedback ? '待更新' : '更新' }}</view>
  14. </view>
  15. </view>
  16. <view class="row" v-if="preview" hover-class="navigator-hover" @click="onClick(preview.tar)">
  17. <view class="box">
  18. <view class="label">{{ preview.now.paramname || '' }}</view>
  19. <view class="content">
  20. <view class="value">{{ preview.now.lastvalue || '--' }}</view>
  21. </view>
  22. </view>
  23. <view class="box">
  24. <view class="label">{{ preview.tar.funcname }}</view>
  25. <view class="content">
  26. <view class="value">{{ preview.tar.params.lastvalue || '--' }}</view>
  27. <view class="unit">{{ preview.tar.params.unit || '' }}</view>
  28. </view>
  29. </view>
  30. <view class="dot" v-if="preview.tar.isfeedback" />
  31. </view>
  32. <My_input ref="MyInput" />
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. name: "mpattern",
  38. data() {
  39. return {
  40. ctrlModel: {},
  41. preview: null
  42. }
  43. },
  44. methods: {
  45. onClick(item) {
  46. this.$refs.MyInput.openInput(item)
  47. }
  48. }
  49. }
  50. </script>
  51. <style lang="scss" scoped>
  52. .row {
  53. position: relative;
  54. display: flex;
  55. padding: 4px 6px 0;
  56. height: 60px;
  57. box-sizing: border-box;
  58. background: #fff;
  59. border-radius: 4px;
  60. margin-bottom: 5px;
  61. .box {
  62. width: 49%;
  63. .content {
  64. display: flex;
  65. margin-top: 10px;
  66. align-items: flex-end;
  67. .value {
  68. width: 0;
  69. flex: 1;
  70. color: #333;
  71. font-size: 16px;
  72. flex-shrink: 0;
  73. font-weight: bold;
  74. }
  75. .unit {
  76. font-size: 10px;
  77. color: #666;
  78. flex-shrink: 0;
  79. max-width: 50px;
  80. }
  81. }
  82. }
  83. .dot {
  84. position: absolute;
  85. right: 2px;
  86. top: 2px;
  87. width: 10px;
  88. height: 10px;
  89. background: #D9001B;
  90. border-radius: 50%;
  91. }
  92. }
  93. </style>