DraughtFanList.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. <template>
  2. <div class="draught-fan-list">
  3. <div class="btn-group-tabs">
  4. <BtnGroup2 :btnGroups="btnGroupsss" :rowIndex="rowIndex" :index="selectIndex" @select="select"></BtnGroup2>
  5. </div>
  6. <div class="df-table">
  7. <table-2 :data="data" :height="'100%'" @headerClick="headerClick"></table-2>
  8. </div>
  9. </div>
  10. </template>
  11. <script>
  12. import Table2 from "@com/coms/table/table2.vue";
  13. import BtnGroup2 from "@com/coms/btn/btn-group-double.vue";
  14. export default {
  15. // 名称
  16. name: "DraughtFanList",
  17. // 使用组件
  18. components: {
  19. Table2,
  20. BtnGroup2,
  21. },
  22. // 数据
  23. data() {
  24. return {
  25. btnGroupsss: [
  26. {
  27. icon: "fa fa-fire",
  28. btns: [
  29. {
  30. text: "某某风场",
  31. code: "mmfdc1",
  32. },
  33. {
  34. text: "某某风场",
  35. code: "mhsfc",
  36. },
  37. {
  38. text: "某某风场",
  39. code: "mmfdc2",
  40. },
  41. {
  42. text: "某某风场",
  43. code: "mmfdc3",
  44. },
  45. {
  46. text: "某某风场",
  47. code: "mmfdc4",
  48. },
  49. ],
  50. },
  51. {
  52. icon: "fa fa-fire-extinguisher",
  53. btns: [
  54. {
  55. text: "某某风场",
  56. code: "mmgf1",
  57. },
  58. {
  59. text: "某某风场",
  60. code: "mmgf2",
  61. },
  62. {
  63. text: "某某风场",
  64. code: "mmgf3",
  65. },
  66. {
  67. text: "某某风场",
  68. code: "mmgf4",
  69. },
  70. ],
  71. },
  72. ],
  73. data: {
  74. column: [
  75. {
  76. name: "风机名称",
  77. field: "code",
  78. sortable: false,
  79. is_num: false,
  80. is_light: false,
  81. },
  82. {
  83. name: "冷却风温度",
  84. field: "FDJLQFWD",
  85. sortable: false,
  86. is_num: true,
  87. is_light: false,
  88. },
  89. {
  90. name: "有功功率",
  91. field: "FJGL",
  92. sortable: false,
  93. is_num: true,
  94. is_light: false,
  95. },
  96. {
  97. name: "液压油温度",
  98. field: "YYYW",
  99. sortable: false,
  100. is_num: true,
  101. is_light: false,
  102. },
  103. {
  104. name: "Pcspp温度",
  105. field: "PCS_WD",
  106. sortable: false,
  107. is_num: true,
  108. is_light: false,
  109. },
  110. {
  111. name: "U1绕组温度",
  112. field: "U1YZWD",
  113. sortable: false,
  114. is_num: true,
  115. is_light: false,
  116. },
  117. {
  118. name: "U2绕组温度",
  119. field: "U2YZWD",
  120. sortable: false,
  121. is_num: true,
  122. is_light: false,
  123. },
  124. {
  125. name: "V1绕组温度",
  126. field: "V1YZWD",
  127. sortable: false,
  128. is_num: true,
  129. is_light: false,
  130. },
  131. {
  132. name: "V2绕组温度",
  133. field: "V2YZWD",
  134. sortable: false,
  135. is_num: true,
  136. is_light: false,
  137. },
  138. {
  139. name: "W1绕组温度",
  140. field: "W1YZWD",
  141. sortable: false,
  142. is_num: true,
  143. is_light: false,
  144. },
  145. {
  146. name: "W2绕组温度",
  147. field: "W2YZWD",
  148. sortable: false,
  149. is_num: true,
  150. is_light: false,
  151. },
  152. {
  153. name: "轴承A温度",
  154. field: "FDJZCAWD",
  155. sortable: false,
  156. is_num: true,
  157. is_light: false,
  158. },
  159. {
  160. name: "轴承B温度",
  161. field: "FDJZCBWD",
  162. sortable: false,
  163. is_num: true,
  164. is_light: false,
  165. },
  166. {
  167. name: "齿轮箱温度",
  168. field: "CLXWD",
  169. sortable: false,
  170. is_num: true,
  171. is_light: false,
  172. },
  173. {
  174. name: "齿轮箱轴1温度",
  175. field: "CLXSRZ1WD",
  176. sortable: false,
  177. is_num: true,
  178. is_light: false,
  179. },
  180. {
  181. name: "齿轮箱轴2温度",
  182. field: "CLXSRZ2WD",
  183. sortable: false,
  184. is_num: true,
  185. is_light: false,
  186. },
  187. {
  188. name: "机舱温度",
  189. field: "JCWD",
  190. sortable: false,
  191. is_num: true,
  192. is_light: false,
  193. },
  194. {
  195. name: "滑环温度",
  196. field: "FDJHHWD",
  197. sortable: false,
  198. is_num: true,
  199. is_light: false,
  200. },
  201. {
  202. name: "环境温度",
  203. field: "JCWWD",
  204. sortable: false,
  205. is_num: true,
  206. is_light: false,
  207. },
  208. ],
  209. data: [],
  210. total: 1000,
  211. },
  212. };
  213. },
  214. // 函数
  215. methods: {
  216. // 请求服务
  217. requestData(showLoading) {
  218. if (this.wpId.indexOf("GDC") != -1) {
  219. this.requestDataGDC(showLoading);
  220. return 0;
  221. }
  222. let that = this;
  223. that.API.requestData({
  224. showLoading,
  225. method: "POST",
  226. subUrl: "monitorwt/findWtInfoList",
  227. data: {
  228. wpId: that.wpId,
  229. },
  230. success(res) {
  231. res.data.forEach((ele) => {
  232. for (let key in ele) {
  233. if (key !== "code" && key !== "lnid" && key !== "model" && key !== "pjid" && key !== "wpid") {
  234. ele[key] = ele[key] || 0;
  235. }
  236. }
  237. });
  238. that.data = {
  239. data: res.data,
  240. column: [
  241. {
  242. name: "风机名称",
  243. field: "code",
  244. width: 100,
  245. is_num: false,
  246. is_light: false,
  247. },
  248. {
  249. name: "冷却风温度",
  250. field: "FDJLQFWD",
  251. width: 100,
  252. is_num: true,
  253. is_light: false,
  254. },
  255. {
  256. name: "有功功率",
  257. field: "FJGL",
  258. width: 100,
  259. is_num: true,
  260. is_light: false,
  261. },
  262. {
  263. name: "液压油温度",
  264. field: "YYYW",
  265. width: 100,
  266. is_num: true,
  267. is_light: false,
  268. },
  269. {
  270. name: "Pcspp温度",
  271. field: "PCS_WD",
  272. width: 100,
  273. is_num: true,
  274. is_light: false,
  275. },
  276. {
  277. name: "U1绕组温度",
  278. field: "U1YZWD",
  279. width: 100,
  280. is_num: true,
  281. is_light: false,
  282. },
  283. {
  284. name: "U2绕组温度",
  285. field: "U2YZWD",
  286. width: 100,
  287. is_num: true,
  288. is_light: false,
  289. },
  290. {
  291. name: "V1绕组温度",
  292. field: "V1YZWD",
  293. width: 100,
  294. is_num: true,
  295. is_light: false,
  296. },
  297. {
  298. name: "V2绕组温度",
  299. field: "V2YZWD",
  300. width: 100,
  301. is_num: true,
  302. is_light: false,
  303. },
  304. {
  305. name: "W1绕组温度",
  306. field: "W1YZWD",
  307. width: 100,
  308. is_num: true,
  309. is_light: false,
  310. },
  311. {
  312. name: "W2绕组温度",
  313. field: "W2YZWD",
  314. width: 100,
  315. is_num: true,
  316. is_light: false,
  317. },
  318. {
  319. name: "轴承A温度",
  320. field: "FDJZCAWD",
  321. width: 100,
  322. is_num: true,
  323. is_light: false,
  324. },
  325. {
  326. name: "轴承B温度",
  327. field: "FDJZCBWD",
  328. width: 100,
  329. is_num: true,
  330. is_light: false,
  331. },
  332. {
  333. name: "齿轮箱温度",
  334. field: "CLXWD",
  335. width: 100,
  336. is_num: true,
  337. is_light: false,
  338. },
  339. {
  340. name: "齿轮箱轴1温度",
  341. field: "CLXSRZ1WD",
  342. width: 100,
  343. is_num: true,
  344. is_light: false,
  345. },
  346. {
  347. name: "齿轮箱轴2温度",
  348. field: "CLXSRZ2WD",
  349. width: 100,
  350. is_num: true,
  351. is_light: false,
  352. },
  353. {
  354. name: "机舱温度",
  355. field: "JCWD",
  356. width: 100,
  357. is_num: true,
  358. is_light: false,
  359. },
  360. {
  361. name: "滑环温度",
  362. field: "FDJHHWD",
  363. width: 100,
  364. is_num: true,
  365. is_light: false,
  366. },
  367. {
  368. name: "环境温度",
  369. field: "JCWWD",
  370. width: 100,
  371. is_num: true,
  372. is_light: false,
  373. },
  374. ],
  375. };
  376. },
  377. });
  378. },
  379. // 光伏电站列表
  380. async requestDataGDC(showLoading) {
  381. let res = await this.API.requestData({
  382. showLoading,
  383. method: "POST",
  384. subUrl: "monitorinverter/findInverterInfoList",
  385. data: {
  386. wpId: this.wpId,
  387. },
  388. });
  389. let column = [
  390. { name: "逆变器", field: "code" },
  391. { name: "光照强度", field: "JSSSFS" },
  392. { name: "有功功率", field: "AI130" },
  393. { name: "功率因数", field: "AI067" },
  394. { name: "机内温度", field: "AIG071" },
  395. { name: "逆变效率", field: "AIG072" },
  396. { name: "日发电量", field: "RFDL" },
  397. { name: "月发电量", field: "YFDL" },
  398. { name: "年发电量", field: "NFDL" },
  399. { name: "累计发电量", field: "AIG064" },
  400. ];
  401. this.data = { data: res.data.data, column: column };
  402. },
  403. getWp() {
  404. let that = this;
  405. that.API.requestData({
  406. method: "GET",
  407. subUrl: "powercompare/windfarmAllAjax",
  408. success(res) {
  409. let btnGroups = [
  410. {
  411. icon: "svg-wind-site",
  412. btns: [],
  413. },
  414. {
  415. icon: "svg-photovoltaic",
  416. btns: [],
  417. },
  418. ];
  419. res.data.forEach((ele, index) => {
  420. if (ele.id.indexOf("FDC") !== -1) {
  421. btnGroups[0].btns.push({
  422. text: ele.name,
  423. code: ele.id,
  424. });
  425. } else {
  426. btnGroups[1].btns.push({
  427. text: ele.name,
  428. code: ele.id,
  429. });
  430. }
  431. });
  432. that.btnGroupsss = btnGroups;
  433. that.renderBtnActiveIndex();
  434. },
  435. });
  436. },
  437. renderBtnActiveIndex() {
  438. this.btnGroupsss.forEach((pEle, pIndex) => {
  439. pEle.btns.forEach((cEle, cIndex) => {
  440. if (cEle.code === this.wpId) {
  441. this.rowIndex = pIndex;
  442. this.selectIndex = cIndex;
  443. }
  444. });
  445. });
  446. },
  447. select(res) {
  448. this.$router.replace({
  449. path: `/monitor/windsite/draughtfanlist/${res.code}`,
  450. });
  451. },
  452. headerClick(param) {
  453. this.data.column.forEach((item) => {
  454. item.sortable = false;
  455. });
  456. this.data.column[param.index].sortable = true;
  457. },
  458. },
  459. created() {
  460. let that = this;
  461. that.wpId = that.$route.params.wpId;
  462. that.getWp();
  463. that.$nextTick(() => {
  464. that.requestData(false);
  465. that.timmer = setInterval(() => {
  466. that.$nextTick(() => {
  467. that.requestData(false);
  468. });
  469. }, that.$store.state.websocketTimeSec);
  470. });
  471. },
  472. mounted() {},
  473. unmounted() {
  474. clearInterval(this.timmer);
  475. this.timmer = null;
  476. },
  477. watch: {
  478. $route(res) {
  479. this.wpId = res.params.wpId;
  480. if (res.params.wpId) {
  481. this.requestData(false);
  482. this.renderBtnActiveIndex();
  483. }
  484. },
  485. },
  486. };
  487. </script>
  488. <style lang="less">
  489. .draught-fan-list {
  490. width: 100%;
  491. height: 100%;
  492. display: flex;
  493. flex-direction: column;
  494. .btn-group-tabs {
  495. display: flex;
  496. flex-direction: row;
  497. }
  498. .df-table {
  499. border: 0.093vh solid fade(@darkgray, 50%);
  500. position: relative;
  501. overflow: auto;
  502. flex-grow: 1;
  503. margin-top: 1.481vh;
  504. &:before {
  505. content: "";
  506. width: 0.37vh;
  507. height: 0.37vh;
  508. background: @write;
  509. position: absolute;
  510. left: 0.278vh;
  511. top: 0.278vh;
  512. }
  513. tbody {
  514. height: calc(100vh - 166px);
  515. }
  516. }
  517. }
  518. </style>