status-panel.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  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">
  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. // 函数
  77. methods: {},
  78. // 生命周期钩子
  79. beforeCreate() {
  80. // 创建前
  81. },
  82. created() {
  83. // 创建后
  84. },
  85. beforeMount() {
  86. // 渲染前
  87. },
  88. mounted() {
  89. // 渲染后
  90. },
  91. beforeUpdate() {
  92. // 数据更新前
  93. },
  94. updated() {
  95. // 数据更新后
  96. },
  97. }
  98. </script>
  99. <style lang="less" scoped>
  100. .status-panel {
  101. position: relative;
  102. height: 22.315vh;
  103. .pause {
  104. position: absolute;
  105. width: 100%;
  106. height: 100%;
  107. z-index: 1;
  108. left: 0;
  109. top: 0;
  110. background-color: fade(@darkgray, 50%);
  111. color: fade(@write, 60%);
  112. font-size: 5.556vh;
  113. font-weight: 600;
  114. display: flex;
  115. align-items: center;
  116. justify-content: center;
  117. opacity: 0.9;
  118. backdrop-filter: blur(0.370vh);
  119. }
  120. .status-com-panel {
  121. width: 100%;
  122. height: 100%;
  123. .p-body {
  124. width: 100%;
  125. height: 19.074vh;
  126. display: flex;
  127. flex-direction: column;
  128. margin-top: -0.926vh;
  129. .category-box {
  130. width: 100%;
  131. background-color: fade(@darkgray, 30%);
  132. display: flex;
  133. margin-bottom: 0.37vh;
  134. .score {
  135. padding: 0.833vh 1.481vh;
  136. span {
  137. width: 3.889vh;
  138. height: 3.889vh;
  139. border-radius: 50%;
  140. display: flex;
  141. align-items: center;
  142. justify-content: center;
  143. color: @green;
  144. border: 0.093vh solid @green;
  145. background-color: fade(@green, 20%);
  146. font-size: @fontsize;
  147. }
  148. }
  149. .box {
  150. flex-grow: 1;
  151. display: flex;
  152. .category-item {
  153. flex: 1;
  154. display: flex;
  155. flex-direction: column;
  156. align-items: center;
  157. justify-content: center;
  158. font-weight: 600;
  159. div {
  160. flex: 1;
  161. font-size: @fontsize-s;
  162. &:first-child {
  163. display: flex;
  164. align-items: flex-end;
  165. color: @gray;
  166. }
  167. }
  168. }
  169. }
  170. }
  171. .item-box {
  172. flex-grow: 1;
  173. display: flex;
  174. flex-direction: column;
  175. .data-item {
  176. flex: 1;
  177. display: flex;
  178. flex-direction: row;
  179. background-color: fade(@darkgray, 20%);
  180. margin-top: 0.278vh;
  181. div {
  182. font-size: @fontsize-s;
  183. overflow: hidden;
  184. display: flex;
  185. align-items: center;
  186. }
  187. .f1,
  188. .f2,
  189. .f4 {
  190. text-align: right;
  191. color: @gray;
  192. justify-content: flex-end;
  193. }
  194. .f3,
  195. .f5 {
  196. font-family: "Bicubik";
  197. text-align: left;
  198. color: @green;
  199. justify-content: flex-start;
  200. }
  201. .f1 {
  202. flex: 2;
  203. }
  204. .f2 {
  205. flex: 3;
  206. margin-right: 0.556vh;
  207. }
  208. .f3 {
  209. flex: 3;
  210. }
  211. .f4 {
  212. flex: 1;
  213. margin-right: 0.556vh;
  214. }
  215. .f5 {
  216. flex: 2;
  217. margin-right: 0;
  218. }
  219. &.light {
  220. background-color: fade(@darkgray, 50%);
  221. position: relative;
  222. &::after {
  223. content: '';
  224. position: absolute;
  225. height: 100%;
  226. width: 0.278vh;
  227. background-color: @green;
  228. top: 0;
  229. left: 0;
  230. }
  231. .f1,
  232. .f2,
  233. .f4 {
  234. color: @write;
  235. }
  236. .f3,
  237. .f5 {
  238. color: fade(@write, 60%);
  239. }
  240. }
  241. }
  242. }
  243. }
  244. }
  245. }
  246. </style>