mpattern.vue 1.9 KB

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