WindturbineMinCard.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. /* 风机矩阵小卡片 */
  2. <template>
  3. <div :class="cardStyle" @click="sigSelectClick">
  4. <el-row>
  5. <div :class="leftStyle">
  6. <el-row>
  7. <div :class="title1Style">{{stationName}}</div>
  8. </el-row>
  9. <el-row>
  10. <div :class="title2Style">{{windturbineName}}</div>
  11. </el-row>
  12. </div>
  13. <div :class="rightStyle">
  14. <el-row>
  15. <div :class="contentStyle" style="font-size: 12px;position: absolute;right: 5px;">{{power.toFixed(2)}} kw</div>
  16. </el-row>
  17. <el-row>
  18. <div :class="contentStyle" style="font-size: 12px;position: absolute;right: 5px;top:15px;">{{windSpeed.toFixed(2)}} m/s</div>
  19. </el-row>
  20. <el-row>
  21. <div :class="contentStyle" style="font-size: 12px;position: absolute;right: 5px;top:30px;">{{rollSpeed.toFixed(2)}} 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. power:Number,
  33. windSpeed:Number,
  34. rollSpeed:Number,
  35. windturbineId:String,
  36. },
  37. data() {
  38. return {
  39. sigSelect: false
  40. }
  41. },
  42. computed: {
  43. cardStyle: function () {
  44. if (this.sigSelect) {
  45. return "card-style card-style-select-" + this.status;
  46. } else {
  47. return "card-style card-style-" + this.status;
  48. }
  49. },
  50. leftStyle: function () {
  51. if (this.sigSelect) {
  52. return "card-style-left card-left-style-select-" + this.status;
  53. } else {
  54. return "card-style-left card-left-style-" + this.status;
  55. }
  56. },
  57. rightStyle: function () {
  58. return "card-right-style card-right-style-" + this.status;
  59. },
  60. title1Style: function () {
  61. return "card-title1-style card-title1-style-" + this.status;
  62. },
  63. title2Style: function () {
  64. return "card-title2-style card-title2-style-" + this.status;
  65. },
  66. contentStyle: function () {
  67. return "card-content-style-" + this.status;
  68. },
  69. stationName:function () {
  70. return this.windturbineId.slice(0,2);
  71. },
  72. windturbineName:function () {
  73. var vs = this.windturbineId.split('_');
  74. return vs[1];
  75. }
  76. },
  77. methods: {
  78. sigSelectClick() {
  79. let sigSelect = this.sigSelect
  80. if (sigSelect) {
  81. this.sigSelect = false
  82. } else {
  83. this.sigSelect = true
  84. }
  85. // todo retun id,父组件中接收id
  86. }
  87. }
  88. };
  89. </script>
  90. <style scoped>
  91. .card-style{
  92. position: relative;
  93. width: 116px;
  94. height: 50px;
  95. box-sizing: border-box;
  96. display: inline-block;
  97. }
  98. .card-style-0 {
  99. border: 2px solid rgb(255, 255, 255);
  100. background-color: rgba(255, 255, 255, 0.15);
  101. color: rgb(200, 200, 200);
  102. }
  103. .card-style-1 {
  104. border: 2px solid rgb(197, 48, 72);
  105. background-color: rgba(197, 48, 72, 0.15);
  106. }
  107. .card-style-2 {
  108. border: 2px solid rgb(05, 187, 76);
  109. background-color: rgba(05, 187, 76, 0.15);
  110. }
  111. .card-style-3 {
  112. border: 2px solid rgb(05, 187, 76);
  113. background-color: rgba(05, 187, 76, 0.15);
  114. }
  115. .card-style-4 {
  116. border: 2px solid rgb(75, 85, 174);
  117. background-color: rgba(75, 85, 174, 0.15);
  118. }
  119. .card-style-5 {
  120. border: 2px solid rgba(186, 50, 55);
  121. background-color: rgba(186, 50, 55, 0.15);
  122. }
  123. .card-style-6 {
  124. border: 2px solid rgb(225, 125, 36);
  125. background-color: rgba(225, 125, 36, 0.15);
  126. }
  127. .card-style-7 {
  128. border: 2px solid rgb(96, 103, 105);
  129. background-color: rgba(96, 103, 105, 0.15);
  130. }
  131. .card-style-select-0 {
  132. border: 2px solid rgba(255, 255, 255, 0.5);
  133. background-color: rgba(255, 255, 255, 0.1);
  134. color: rgba(120, 120, 120,0.5);
  135. }
  136. .card-style-select-1 {
  137. border: 2px solid rgba(197, 48, 72, 0.5);
  138. background-color: rgba(197, 48, 72, 0.1);
  139. }
  140. .card-style-select-2 {
  141. border: 2px solid rgba(05, 187, 76, 0.5);
  142. background-color: rgba(05, 187, 76, 0.1);
  143. }
  144. .card-style-select-3 {
  145. border: 2px solid rgba(05, 187, 76, 0.5);
  146. background-color: rgba(05, 187, 76, 0.1);
  147. }
  148. .card-style-select-4 {
  149. border: 2px solid rgba(75, 85, 174, 0.5);
  150. background-color: rgba(75, 85, 174, 0.1);
  151. }
  152. .card-style-select-5 {
  153. border: 2px solid rgba(186, 50, 55, 0.5);
  154. background-color: rgba(186, 50, 55, 0.1);
  155. }
  156. .card-style-select-6 {
  157. border: 2px solid rgba(225, 125, 36, 0.5);
  158. background-color: rgba(225, 125, 36, 0.1);
  159. }
  160. .card-style-select-7 {
  161. border: 2px solid rgba(159, 163, 165, 0.5);
  162. background-color: rgba(159, 163, 165, 0.1);
  163. }
  164. .card-style-left{
  165. position: relative;
  166. width: 25px;
  167. height: 41px;
  168. box-sizing: border-box;
  169. margin: 3px;
  170. display: inline-block;
  171. }
  172. .card-left-style-0 {
  173. background-color: rgb(255, 255, 255);
  174. color: rgb(80, 80, 80);
  175. }
  176. .card-left-style-1 {
  177. background-color: rgb(121, 73, 81);
  178. }
  179. .card-left-style-2 {
  180. background-color: rgb(05, 187, 76);
  181. }
  182. .card-left-style-3 {
  183. background-color: rgb(05, 187, 76);
  184. }
  185. .card-left-style-4 {
  186. background-color: rgb(75, 85, 174);
  187. }
  188. .card-left-style-5 {
  189. background-color: rgb(186, 50, 55);
  190. }
  191. .card-left-style-6 {
  192. background-color: rgb(225, 125, 36);
  193. }
  194. .card-left-style-7 {
  195. background-color: rgb(159, 163, 165);
  196. }
  197. .card-left-style-select-0 {
  198. background-color: rgba(255, 255, 255,0.7);
  199. color: rgba(200, 200, 200,0.7);
  200. }
  201. .card-left-style-select-1 {
  202. background-color: rgba(121, 73, 81,0.7);
  203. }
  204. .card-left-style-select-2 {
  205. background-color: rgba(05, 187, 76,0.7);
  206. }
  207. .card-left-style-select-3 {
  208. background-color: rgba(05, 187, 76,0.7);
  209. }
  210. .card-left-style-select-4 {
  211. background-color: rgba(75, 85, 174,0.7);
  212. }
  213. .card-left-style-select-5 {
  214. background-color: rgba(186, 50, 55,0.7);
  215. }
  216. .card-left-style-select-6 {
  217. background-color: rgba(225, 125, 36,0.7);
  218. }
  219. .card-left-style-select-7 {
  220. background-color: rgba(159, 163, 165,0.7);
  221. }
  222. .card-left-style-select {
  223. position: relative;
  224. width: 25px;
  225. height: 41px;
  226. box-sizing: border-box;
  227. margin: 3px;
  228. display: inline-block;
  229. }
  230. .card-right-style{
  231. width: calc(116px - 4px - 6px - 25px);
  232. height: calc(50px - 2px);
  233. box-sizing: border-box;
  234. display: inline-block;
  235. position: absolute;
  236. right: 0px;
  237. }
  238. .card-right-style-0 {
  239. border-left: 2px dashed rgb(255, 255, 255);
  240. color: rgb(120, 120, 120);
  241. }
  242. .card-right-style-1 {
  243. border-left: 2px dashed rgb(121, 73, 81);
  244. }
  245. .card-right-style-2 {
  246. border-left: 2px dashed rgb(05, 187, 76);
  247. }
  248. .card-right-style-3 {
  249. border-left: 2px dashed rgb(05, 187, 76);
  250. }
  251. .card-right-style-4 {
  252. border-left: 2px dashed rgb(75, 85, 174);
  253. }
  254. .card-right-style-5 {
  255. border-left: 2px dashed rgb(186, 50, 55);
  256. }
  257. .card-right-style-6 {
  258. border-left: 2px dashed rgb(225, 125, 36);
  259. }
  260. .card-right-style-7 {
  261. border-left: 2px dashed rgb(159, 163, 165);
  262. }
  263. .card-right-style-select-0 {
  264. border-left: 2px dashed rgba(255, 255, 255,0.7);
  265. color: rgba(120, 120, 120,0.7);
  266. }
  267. .card-right-style-select-1 {
  268. border-left: 2px dashed rgba(121, 73, 81,0.7);
  269. }
  270. .card-right-style-select-2 {
  271. border-left: 2px dashed rgba(05, 187, 76,0.7);
  272. }
  273. .card-right-style-select-3 {
  274. border-left: 2px dashed rgba(05, 187, 76,0.7);
  275. }
  276. .card-right-style-select-4 {
  277. border-left: 2px dashed rgba(75, 85, 174,0.7);
  278. }
  279. .card-right-style-select-5 {
  280. border-left: 2px dashed rgba(186, 50, 55,0.7);
  281. }
  282. .card-right-style-select-6 {
  283. border-left: 2px dashed rgba(225, 125, 36,0.7);
  284. }
  285. .card-right-style-select-7 {
  286. border-left: 2px dashed rgba(159, 163, 165,0.7);
  287. }
  288. .card-title1-style{
  289. margin-top: 2px;
  290. font-size: 14px;
  291. width: 100%;
  292. text-align: center;
  293. }
  294. .card-title1-style-1 {
  295. font-size: 14px;
  296. }
  297. .card-title2-style{
  298. margin-top: 2px;
  299. font-size: 12px;
  300. width: 100%;
  301. text-align: center;
  302. }
  303. .card-title2-style-1 {
  304. font-size: 12px;
  305. }
  306. .card-content-style{
  307. width: 100%;
  308. text-align: right;
  309. font-size: 12px;
  310. }
  311. .card-content-style-1 {
  312. font-size: 12px;
  313. }
  314. </style>