Status.vue 8.3 KB

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