status-panel.vue 6.4 KB

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