DraughtFanList.vue 13 KB

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