basics.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <view class="control">
  3. <view class="update-line">
  4. <view class="label">
  5. {{ ctrlModel.funcname }}
  6. </view>
  7. <view class="content">
  8. {{ ctrlModel.showValue }}
  9. <view
  10. class="control-updata-but"
  11. hover-class="navigator-hover"
  12. @click="onClick(ctrlModel)"
  13. >{{ ctrlModel.isfeedback ? "待更新" : "更新" }}</view
  14. >
  15. </view>
  16. </view>
  17. <view v-if="subcontrol" class="update-line">
  18. <view class="label">
  19. {{ subcontrol.funcname }}
  20. </view>
  21. <view class="content">
  22. {{ subcontrol.showValue || subcontrol.params.lastvalue }}
  23. <view
  24. class="control-updata-but"
  25. hover-class="navigator-hover"
  26. @click="onClick(subcontrol)"
  27. >{{ subcontrol.isfeedback ? "待更新" : "更新" }}</view
  28. >
  29. </view>
  30. </view>
  31. <view class="list-box">
  32. <view class="item" v-for="item in list" :key="item.param">
  33. <view class="label">
  34. {{ item.paramname }}
  35. </view>
  36. <view class="value">
  37. {{ item.lastvalue }}
  38. <text class="">
  39. {{ item.unit }}
  40. </text>
  41. </view>
  42. </view>
  43. </view>
  44. <My_input ref="MyInput" />
  45. </view>
  46. </template>
  47. <script>
  48. export default {
  49. name: "basics",
  50. data() {
  51. return {
  52. ctrlModel: {},
  53. list: [],
  54. subcontrol: null,
  55. replenish: {
  56. TimeConOFF: 0,
  57. TimeConON: 0,
  58. },
  59. };
  60. },
  61. methods: {
  62. onClick(item) {
  63. this.$refs.MyInput.openInput(item, false, this.replenish);
  64. this.$Http.changeOptions = function (options) {
  65. let item = options.find((v) => v.key == "ConstantConON");
  66. if (item) {
  67. this.replenish.ConstantConOFF = item.value == 0 ? 1 : 0;
  68. }
  69. }.bind(this);
  70. },
  71. },
  72. };
  73. </script>
  74. <style lang="scss" scoped>
  75. .list-box {
  76. width: 100%;
  77. display: flex;
  78. flex-wrap: wrap;
  79. background: #fff;
  80. border-radius: 4px;
  81. padding: 6px;
  82. box-sizing: border-box;
  83. padding-bottom: 0;
  84. .item {
  85. width: 50%;
  86. .label {
  87. margin-bottom: 6px;
  88. }
  89. .value {
  90. margin-bottom: 6px;
  91. font-weight: bold;
  92. padding-left: 2px;
  93. }
  94. }
  95. }
  96. </style>