WindturbineMinCard.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /* 风机矩阵小卡片 */
  2. <template>
  3. <div :class="cardStyle" @click="sigSelectClick">
  4. <el-row>
  5. <div :class="leftStyle">
  6. <el-row>
  7. <div :class="title1Style">SG</div>
  8. </el-row>
  9. <el-row>
  10. <div :class="title2Style">223</div>
  11. </el-row>
  12. </div>
  13. <div :class="rightStyle">
  14. <el-row>
  15. <div :class="contentStyle">123.54 kw</div>
  16. </el-row>
  17. <el-row>
  18. <div :class="contentStyle">8.23 m/s</div>
  19. </el-row>
  20. <el-row>
  21. <div :class="contentStyle">1234.56 rpm</div>
  22. </el-row>
  23. </div>
  24. </el-row>
  25. </div>
  26. </template>
  27. <script>
  28. export default {
  29. name: "WindturbineMinCard",
  30. props: {
  31. status: Number,
  32. },
  33. data() {
  34. return {
  35. sigSelect: false
  36. }
  37. },
  38. computed: {
  39. cardStyle: function () {
  40. if (this.sigSelect) {
  41. return "card-style card-style-select-" + this.status;
  42. } else {
  43. return "card-style card-style-" + this.status;
  44. }
  45. },
  46. leftStyle: function () {
  47. if (this.sigSelect) {
  48. return "card-style-left card-left-style-select-" + this.status;
  49. } else {
  50. return "card-style-left card-left-style-" + this.status;
  51. }
  52. },
  53. rightStyle: function () {
  54. return "card-right-style card-right-style-" + this.status;
  55. },
  56. title1Style: function () {
  57. return "card-title1-style card-title1-style-" + this.status;
  58. },
  59. title2Style: function () {
  60. return "card-title2-style card-title2-style-" + this.status;
  61. },
  62. contentStyle: function () {
  63. return "card-content-style-" + this.status;
  64. }
  65. },
  66. methods: {
  67. sigSelectClick() {
  68. let sigSelect = this.sigSelect
  69. if (sigSelect) {
  70. this.sigSelect = false
  71. } else {
  72. this.sigSelect = true
  73. }
  74. // todo retun id,父组件中接收id
  75. }
  76. }
  77. };
  78. </script>
  79. <style scoped>
  80. .card-style{
  81. position: relative;
  82. width: 116px;
  83. height: 50px;
  84. box-sizing: border-box;
  85. display: inline-block;
  86. }
  87. .card-style-1 {
  88. border: 2px solid #4952a6;
  89. background-color: rgba(73, 82, 166, 0.5);
  90. }
  91. .card-style-select-1 {
  92. border: 2px solid #4952a6;
  93. background-color: rgba(200, 10, 10, 0.3);
  94. }
  95. .card-style-left{
  96. position: relative;
  97. width: 25px;
  98. height: 41px;
  99. box-sizing: border-box;
  100. margin: 3px;
  101. display: inline-block;
  102. }
  103. .card-left-style-1 {
  104. background-color: rgba(73, 82, 166, 0.7);
  105. }
  106. .card-left-style-select-1 {
  107. position: relative;
  108. width: 25px;
  109. height: 41px;
  110. background-color: rgba(200, 40, 40, 0.5);
  111. box-sizing: border-box;
  112. margin: 3px;
  113. display: inline-block;
  114. }
  115. .card-right-style{
  116. position: relative;
  117. width: calc(116px - 4px - 6px - 25px);
  118. height: calc(50px - 2px);
  119. box-sizing: border-box;
  120. display: inline-block;
  121. }
  122. .card-right-style-1 {
  123. border-left: 2px dashed #4952a6;
  124. }
  125. .card-title1-style{
  126. margin-top: 2px;
  127. font-size: 14px;
  128. width: 100%;
  129. text-align: center;
  130. }
  131. .card-title1-style-1 {
  132. font-size: 14px;
  133. }
  134. .card-title2-style{
  135. margin-top: 2px;
  136. font-size: 12px;
  137. width: 100%;
  138. text-align: center;
  139. }
  140. .card-title2-style-1 {
  141. font-size: 12px;
  142. }
  143. .card-content-style{
  144. width: 100%;
  145. text-align: right;
  146. font-size: 12px;
  147. }
  148. .card-content-style-1 {
  149. font-size: 12px;
  150. }
  151. </style>