status-panel.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. <template>
  2. <div class="status-panel">
  3. <div class="pause" v-if="data.breakOff">中断</div>
  4. <ComPanel class="status-com-panel" :title="data.title" @click="jumpPage(data.wpId)">
  5. <div class="p-body">
  6. <div class="category-box">
  7. <div class="score">
  8. <span>{{ data.category.score }}</span>
  9. </div>
  10. <div class="box">
  11. <div class="category-item" v-for="(item, index) of data.category.datas" :key="index">
  12. <div>{{ item.text }}</div>
  13. <div :class="item.color">{{ item.num }}</div>
  14. </div>
  15. </div>
  16. </div>
  17. <div class="item-box">
  18. <div class="data-item" v-for="(item, index) of data.items" :key="index" :class="{ light: item.is_light }">
  19. <div class="f1">{{ item.f1 }}</div>
  20. <div class="f2">{{ item.f2 }}</div>
  21. <div class="f3">{{ item.f3 }}</div>
  22. <div class="f4">{{ item.f4 }}</div>
  23. <div class="f5">{{ item.f5 }}</div>
  24. </div>
  25. </div>
  26. </div>
  27. </ComPanel>
  28. </div>
  29. </template>
  30. <script>
  31. import ComPanel from "@com/coms/panel/panel.vue";
  32. export default {
  33. // 名称
  34. name: "StatusPanel",
  35. // 使用组件
  36. components: {
  37. ComPanel,
  38. },
  39. /**
  40. * {
  41. title: "某某某风电场",
  42. weather: {
  43. type: "cloudy",
  44. temperature: 11
  45. },
  46. breakOff: false,
  47. category: {
  48. score: 66,
  49. datas: [
  50. { text: "运行", num: 30, color: 'green' },
  51. { text: "待机", num: 27, color: 'purple' },
  52. { text: "限电", num: 30, color: 'yellow' },
  53. { text: "检修", num: 30, color: 'orange' },
  54. { text: "故障", num: 13, color: 'red' },
  55. { text: "受累", num: 30, color: 'blue' },
  56. { text: "离线", num: 30, color: 'gray' },
  57. ]
  58. },
  59. items: [
  60. { f1: 'AGC宋六:', f2: '设定', f3: '66', f4: '出线', f5: '11', is_light: true },
  61. { f1: '升压站:', f2: '出线Uab/La', f3: '23/3 23/3', f4: '电压', f5: '103 103', is_light: false },
  62. { f1: '风功:', f2: '未来15分钟', f3: '103', f4: '', f5: '', is_light: false },
  63. { f1: '测风塔:', f2: '风速', f3: '103KM', f4: '风向', f5: '103 62', is_light: false },
  64. { f1: '电能量表:', f2: '', f3: '103 62', f4: '', f5: '', is_light: false },
  65. ]
  66. }
  67. */
  68. props: {
  69. data: Object,
  70. },
  71. // 数据
  72. data() {
  73. return {};
  74. },
  75. // 函数
  76. methods: {
  77. jumpPage(wpId) {
  78. this.$router.push({
  79. path: `/monitor/windsite/home/${wpId}`,
  80. // query: { wpId: id },
  81. });
  82. console.log('wpid:',wpId)
  83. },
  84. },
  85. // 生命周期钩子
  86. beforeCreate() {
  87. // 创建前
  88. },
  89. created() {
  90. // 创建后
  91. },
  92. beforeMount() {
  93. // 渲染前
  94. },
  95. mounted() {
  96. // 渲染后
  97. },
  98. beforeUpdate() {
  99. // 数据更新前
  100. },
  101. updated() {
  102. // 数据更新后
  103. },
  104. };
  105. </script>
  106. <style lang="less" scoped>
  107. .status-panel {
  108. position: relative;
  109. height: 29.315vh;
  110. cursor: pointer;
  111. .pause {
  112. position: absolute;
  113. width: 100%;
  114. height: 100%;
  115. z-index: 1;
  116. left: 0;
  117. top: 0;
  118. background-color: fade(@darkgray, 50%);
  119. color: fade(@write, 60%);
  120. font-size: 5.556vh;
  121. font-weight: 600;
  122. display: flex;
  123. align-items: center;
  124. justify-content: center;
  125. opacity: 0.9;
  126. backdrop-filter: blur(0.37vh);
  127. }
  128. .status-com-panel {
  129. width: 100%;
  130. height: 100%;
  131. .p-body {
  132. width: 100%;
  133. height: 19.074vh;
  134. display: flex;
  135. flex-direction: column;
  136. margin-top: -0.926vh;
  137. .category-box {
  138. width: 100%;
  139. background-color: fade(@darkgray, 30%);
  140. display: flex;
  141. margin-bottom: 0.37vh;
  142. .score {
  143. padding: 0.833vh 1.481vh;
  144. span {
  145. width: 3.889vh;
  146. height: 3.889vh;
  147. border-radius: 50%;
  148. display: flex;
  149. align-items: center;
  150. justify-content: center;
  151. color: @green;
  152. border: 0.093vh solid @green;
  153. background-color: fade(@green, 20%);
  154. font-size: @fontsize;
  155. }
  156. }
  157. .box {
  158. flex-grow: 1;
  159. display: flex;
  160. .category-item {
  161. flex: 1;
  162. display: flex;
  163. flex-direction: column;
  164. align-items: center;
  165. justify-content: center;
  166. font-weight: 600;
  167. div {
  168. flex: 1;
  169. font-size: @fontsize-s;
  170. &:first-child {
  171. display: flex;
  172. align-items: flex-end;
  173. color: @gray;
  174. }
  175. }
  176. }
  177. }
  178. }
  179. .item-box {
  180. flex-grow: 1;
  181. display: flex;
  182. flex-direction: column;
  183. .data-item {
  184. flex: 1;
  185. display: flex;
  186. flex-direction: row;
  187. background-color: fade(@darkgray, 20%);
  188. margin-top: 0.278vh;
  189. div {
  190. font-size: @fontsize-s;
  191. overflow: hidden;
  192. display: flex;
  193. align-items: center;
  194. }
  195. .f1,
  196. .f2,
  197. .f3,
  198. .f4,
  199. .f5{
  200. line-height: 38px;
  201. }
  202. .f1,
  203. .f2,
  204. .f4 {
  205. text-align: right;
  206. color: @gray;
  207. justify-content: flex-end;
  208. }
  209. .f3,
  210. .f5 {
  211. font-family: "Bicubik";
  212. text-align: left;
  213. color: @green;
  214. justify-content: flex-start;
  215. }
  216. .f1 {
  217. flex: 2;
  218. }
  219. .f2 {
  220. flex: 3;
  221. margin-right: 0.556vh;
  222. }
  223. .f3 {
  224. flex: 3;
  225. }
  226. .f4 {
  227. flex: 1;
  228. margin-right: 0.556vh;
  229. }
  230. .f5 {
  231. flex: 2;
  232. margin-right: 0;
  233. }
  234. &.light {
  235. background-color: fade(@darkgray, 50%);
  236. position: relative;
  237. &::after {
  238. content: "";
  239. position: absolute;
  240. height: 100%;
  241. width: 0.278vh;
  242. background-color: @green;
  243. top: 0;
  244. left: 0;
  245. }
  246. .f1,
  247. .f2,
  248. .f4 {
  249. color: @write;
  250. }
  251. .f3,
  252. .f5 {
  253. color: fade(@write, 60%);
  254. }
  255. }
  256. }
  257. }
  258. }
  259. }
  260. }
  261. </style>