Status.vue 8.5 KB

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