mpattern.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. let model = null;
  37. export default {
  38. name: "mpattern",
  39. data() {
  40. return {
  41. ctrlModel: {},
  42. preview: null
  43. }
  44. },
  45. methods: {
  46. onClick(item) {
  47. if (!model) model = this.$refs.MyInput;
  48. model.openInput(item)
  49. }
  50. }
  51. }
  52. </script>
  53. <style lang="scss" scoped>
  54. .row {
  55. position: relative;
  56. display: flex;
  57. padding: 4px 6px 0;
  58. height: 60px;
  59. box-sizing: border-box;
  60. background: #fff;
  61. border-radius: 4px;
  62. margin-bottom: 5px;
  63. .box {
  64. width: 49%;
  65. .content {
  66. display: flex;
  67. margin-top: 10px;
  68. align-items: flex-end;
  69. .value {
  70. width: 0;
  71. flex: 1;
  72. color: #333;
  73. font-size: 16px;
  74. flex-shrink: 0;
  75. font-weight: bold;
  76. }
  77. .unit {
  78. font-size: 10px;
  79. color: #666;
  80. flex-shrink: 0;
  81. max-width: 50px;
  82. }
  83. }
  84. }
  85. .dot {
  86. position: absolute;
  87. right: 2px;
  88. top: 2px;
  89. width: 10px;
  90. height: 10px;
  91. background: #D9001B;
  92. border-radius: 50%;
  93. }
  94. }
  95. </style>