deviceCardWater.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <div class="deviceCardAir" :style="{backgroundColor: color}">
  3. <div class="deviceCardAir-top">
  4. <span>#{{ item.id }}</span>
  5. <span @click="toggle(item)" class="anticon" style="float: right;border-radius: 15px;cursor: pointer;padding: 6px 8px 7px;margin-right: 15px">
  6. <a-icon type="poweroff" />
  7. </span>
  8. </div>
  9. <div class="deviceCardAir-bottom">
  10. <a-row>
  11. <a-col :span="8">
  12. <div style="height: 8px"></div>
  13. <div :style="{backgroundColor: item.online?'#2eb8e6':'#bebebe'}" style="font-size: 14px;text-align: center;width: 60px;padding: 3px 0;vertical-align: top;">
  14. <div>净水量</div>
  15. <div v-if="item.online && item.waterNum">{{ item.waterNum }}m²</div>
  16. <div v-else>-</div>
  17. </div>
  18. </a-col>
  19. <a-col :span="8"></a-col>
  20. <a-col :span="8">
  21. <div>
  22. <div v-if="item.online && item.tm">{{ item.tm + '℃' }}</div>
  23. <div v-else>-</div>
  24. <div>
  25. <span v-if="item.online && item.status=='1'">加水中</span>
  26. <span v-if="item.online && item.status=='2'">保温中</span>
  27. </div>
  28. </div>
  29. </a-col>
  30. </a-row>
  31. <!--<span style="margin-left: 15px">-->
  32. <!-- {{ item.name }}-->
  33. <!--</span>-->
  34. </div>
  35. </div>
  36. </template>
  37. <script>
  38. export default {
  39. data() {
  40. return {
  41. color: '',
  42. }
  43. },
  44. props: {
  45. item: Object,
  46. toggle: Function
  47. },
  48. watch: {
  49. "item.online": function (val) {
  50. if (this.item.online) {
  51. this.color='#2ea8e5';
  52. } else {
  53. this.color='#bebebe'
  54. }
  55. },
  56. },
  57. mounted() {
  58. if (this.item.online) {
  59. this.color='#2ea8e5';
  60. } else {
  61. this.color='#bebebe'
  62. }
  63. },
  64. methods: {
  65. }
  66. }
  67. </script>
  68. <style lang="less" scoped>
  69. .deviceCardAir {
  70. width: 100%;
  71. height: 10rem;
  72. background-color: #2ea8e5;
  73. border-radius: 4px;
  74. color: white;
  75. background-image: url("@/assets/images/scene/device/shuiweijianceshebei.png");
  76. background-repeat: no-repeat;
  77. background-position: 47% 70%;
  78. background-size: 25%;
  79. .deviceCardAir-top {
  80. padding-top: 14px;
  81. padding-left: 20px;
  82. font-size: 20px;
  83. .anticon:hover {
  84. background-color: rgba(182, 182, 182, 0.7);
  85. }
  86. }
  87. .deviceCardAir-bottom {
  88. margin-top: 10px;
  89. margin-left: 18px;
  90. font-size: 23px;
  91. }
  92. .anticon {
  93. //padding: 6px;
  94. }
  95. }
  96. </style>