Status.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. <template>
  2. <div class="status">
  3. <div class="panel-box">
  4. <StatusPanel class="panel-item" v-for="(data, index) of datas" :key="index" :data="data"></StatusPanel>
  5. </div>
  6. <div class="table-box">
  7. <ComTable :data="tableData"></ComTable>
  8. </div>
  9. </div>
  10. </template>
  11. <script>
  12. import StatusPanel from "./components/status-panel.vue";
  13. import ComTable from "@com/coms/table/table.vue";
  14. import util from "@/helper/util.js";
  15. import store from "@store/index.js";
  16. export default {
  17. // 名称
  18. name: "Status",
  19. // 使用组件
  20. components: {
  21. StatusPanel,
  22. ComTable,
  23. },
  24. // 数据
  25. data() {
  26. return {
  27. timmer: null, // 遮罩开关
  28. sourceMap: {}, // 核心数据
  29. datas: [],
  30. tableData: {
  31. column: [
  32. {
  33. name: "场站名称",
  34. field: "wpName",
  35. unit: "",
  36. is_num: false,
  37. is_light: false,
  38. },
  39. // {
  40. // name: "调度名称",
  41. // field: "ddname",
  42. // unit: "",
  43. // is_num: false,
  44. // is_light: false,
  45. // },
  46. {
  47. name: "装机容量",
  48. field: "zjrl",
  49. unit: "MW",
  50. is_num: true,
  51. is_light: false,
  52. },
  53. {
  54. name: "发电量",
  55. field: "fdl",
  56. unit: "万kwh",
  57. is_num: true,
  58. is_light: false,
  59. },
  60. {
  61. name: "上网电量",
  62. field: "swdl",
  63. unit: "万kwh",
  64. is_num: true,
  65. is_light: false,
  66. },
  67. {
  68. name: "利用小时",
  69. field: "lyxs",
  70. unit: "",
  71. is_num: true,
  72. is_light: false,
  73. },
  74. {
  75. name: "风速m/s",
  76. field: "fs",
  77. unit: "日照强度w/m2",
  78. is_num: true,
  79. is_light: false,
  80. },
  81. {
  82. name: "功率",
  83. field: "gl",
  84. unit: "MW",
  85. is_num: true,
  86. is_light: false,
  87. },
  88. {
  89. name: "出线功率",
  90. field: "cxgl",
  91. unit: "MW",
  92. is_num: true,
  93. is_light: false,
  94. },
  95. {
  96. name: "理论功率",
  97. field: "llgl",
  98. unit: "MW",
  99. is_num: true,
  100. is_light: false,
  101. },
  102. {
  103. name: "保证功率",
  104. field: "bzgl",
  105. unit: "MW",
  106. is_num: true,
  107. is_light: false,
  108. },
  109. {
  110. name: "预测功率",
  111. field: "ycgl",
  112. unit: "MW",
  113. is_num: true,
  114. is_light: false,
  115. },
  116. {
  117. name: "AGC指令",
  118. field: "agczl",
  119. unit: "MW",
  120. is_num: true,
  121. is_light: false,
  122. },
  123. {
  124. name: "理论发电量",
  125. field: "llfdl",
  126. unit: "万kwh",
  127. is_num: true,
  128. is_light: false,
  129. },
  130. {
  131. name: "SCADA发电量",
  132. field: "scadafdl",
  133. unit: "万kwh",
  134. is_num: true,
  135. is_light: false,
  136. },
  137. {
  138. name: "维修损失电量",
  139. field: "whss",
  140. unit: "万kwh",
  141. is_num: true,
  142. is_light: false,
  143. },
  144. {
  145. name: "故障损失电量",
  146. field: "gzss",
  147. unit: "万kwh",
  148. is_num: true,
  149. is_light: false,
  150. },
  151. {
  152. name: "受理损失电量",
  153. field: "slss",
  154. unit: "万kwh",
  155. is_num: true,
  156. is_light: false,
  157. },
  158. {
  159. name: "限电损失电量",
  160. field: "xdss",
  161. unit: "万kwh",
  162. is_num: true,
  163. is_light: false,
  164. },
  165. {
  166. name: "性能损失电量",
  167. field: "xnss",
  168. unit: "万kwh",
  169. is_num: true,
  170. is_light: false,
  171. },
  172. ],
  173. data: [],
  174. },
  175. };
  176. },
  177. methods: {
  178. // 请求服务
  179. requestData(showLoading) {
  180. let that = this;
  181. that.API.requestData({
  182. showLoading,
  183. method: "POST",
  184. subUrl: "monitor/monitor",
  185. success(res) {
  186. if (res.data) {
  187. let sourceMap = res.data;
  188. let datas = [];
  189. let data = [];
  190. sourceMap.maps.forEach((ele) => {
  191. datas.push({
  192. title: ele.name,
  193. wpId: sourceMap.vos.find((findEle) => {
  194. return findEle.wpName === ele.name;
  195. }).wpId,
  196. weather: {
  197. type: "cloudy",
  198. temperature: 11,
  199. },
  200. breakOff: ele.fczt === 3,
  201. category: {
  202. score: ele.zjts,
  203. datas: [
  204. { text: "运行", num: ele.yxts, color: "green" },
  205. { text: "待机", num: ele.djts, color: "purple" },
  206. { text: "限电", num: ele.xdts, color: "yellow" },
  207. { text: "检修", num: ele.whts, color: "orange" },
  208. { text: "故障", num: ele.gzts, color: "red" },
  209. { text: "受累", num: ele.slts || 0, color: "blue" },
  210. { text: "离线", num: ele.lxts, color: "gray" },
  211. ],
  212. },
  213. items: [
  214. {
  215. // f1: ("AGC" + ele.name.replace(/风电场/g, "") + ":"),
  216. f1: "AGC:",
  217. f2: "设定",
  218. f3: ele.agcygsd,
  219. f4: "出线",
  220. f5: ele.agccxyg,
  221. is_light: true,
  222. },
  223. {
  224. f1: "升压站:",
  225. f2: "Uab",
  226. f3: ele.uab,
  227. f4: "Ia",
  228. f5: ele.ia,
  229. is_light: false,
  230. },
  231. {
  232. f1: "风功:",
  233. f2: "未来15分钟",
  234. f3: ele.ycgl,
  235. f4: "",
  236. f5: "",
  237. is_light: false,
  238. },
  239. {
  240. f1: "测风塔:",
  241. f2: "风速",
  242. f3: (ele.cftfs || 0) + "m/s",
  243. f4: "风向",
  244. f5: ele.cftfx || 0,
  245. is_light: false,
  246. },
  247. {
  248. f1: "电能量表:",
  249. f2: "",
  250. f3: ele.dnlb,
  251. f4: "",
  252. f5: "",
  253. is_light: false,
  254. },
  255. ],
  256. });
  257. });
  258. sourceMap.vos.forEach((ele) => {
  259. ele.row_span = [];
  260. ele.col_span = [];
  261. ele.is_light = false;
  262. data.push(ele);
  263. });
  264. that.sourceMap = sourceMap;
  265. that.datas = datas;
  266. that.tableData.data = data;
  267. } else {
  268. that.sourceMap = {};
  269. that.datas = [];
  270. that.tableData.data = [];
  271. }
  272. },
  273. });
  274. },
  275. },
  276. created() {
  277. let that = this;
  278. that.$nextTick(() => {
  279. that.requestData(false);
  280. that.timmer = setInterval(() => {
  281. that.requestData(false);
  282. }, that.$store.state.websocketTimeSec);
  283. });
  284. },
  285. mounted() {},
  286. unmounted() {
  287. clearInterval(this.timmer);
  288. this.timmer = null;
  289. },
  290. };
  291. </script>
  292. <style lang="less" scoped>
  293. .status {
  294. width: 100%;
  295. height: calc(100vh - 7.222vh);
  296. overflow: auto;
  297. display: flex;
  298. flex-direction: column;
  299. .panel-box {
  300. width: 100%;
  301. display: flex;
  302. flex-direction: row;
  303. flex-wrap: wrap;
  304. .panel-item {
  305. width: calc(20% - 1.185vh);
  306. margin-left: 1.481vh;
  307. margin-bottom: 1.481vh;
  308. &:nth-child(5n + 1) {
  309. margin-left: 0;
  310. }
  311. }
  312. }
  313. .table-box {
  314. border: 0.093vh solid @darkgray;
  315. position: relative;
  316. overflow: auto;
  317. flex-grow: 1;
  318. &::after,
  319. &::before {
  320. content: "";
  321. position: absolute;
  322. width: 0.185vh;
  323. height: 0.185vh;
  324. background-color: @write;
  325. top: 0.37vh;
  326. }
  327. &::after {
  328. left: 0.37vh;
  329. }
  330. &::before {
  331. right: 0.37vh;
  332. }
  333. }
  334. }
  335. </style>