controlPanel.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <view class="control">
  3. <view class="control-title">
  4. 控制面板
  5. </view>
  6. <view class="current">
  7. <view class="item" v-for="item in preview" :key="item.paramname">
  8. <view class="label">{{ item.paramname }}</view>
  9. <view class="value">{{ item.lastvalue || '' }}{{ item.unit || '' }}</view>
  10. </view>
  11. </view>
  12. <view class="show-list">
  13. <control-item v-for="item in itemList" :key="item.paramName" :item="item" @click.native="onClick(item)" />
  14. </view>
  15. <My_input ref="MyInput" />
  16. </view>
  17. </template>
  18. <script>
  19. let model = null;
  20. export default {
  21. name: "controlPanel",
  22. data() {
  23. return {
  24. itemList: [],
  25. preview: []
  26. }
  27. },
  28. methods: {
  29. onClick(item) {
  30. if (!model) model = this.$refs.MyInput;
  31. model.openInput(item)
  32. }
  33. }
  34. }
  35. </script>
  36. <style lang="scss" scoped>
  37. .current {
  38. display: flex;
  39. justify-content: space-around;
  40. color: #fff;
  41. margin-bottom: 10px;
  42. font-size: 12px;
  43. .label {
  44. margin-bottom: 5px;
  45. }
  46. }
  47. .show-list {
  48. display: flex;
  49. flex-wrap: wrap;
  50. justify-content: space-between;
  51. margin-top: -5px;
  52. box-sizing: border-box;
  53. }
  54. </style>