DraughtFanList.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  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. <ComTable :data="data"></ComTable>
  8. </div>
  9. </div>
  10. </template>
  11. <script>
  12. import ComTable from "@com/coms/table/table.vue";
  13. import BtnGroup2 from "@com/coms/btn/btn-group-double.vue";
  14. export default {
  15. // 名称
  16. name: "DraughtFanList",
  17. // 使用组件
  18. components: {
  19. ComTable,
  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. is_num: false,
  79. is_light: false,
  80. },
  81. {
  82. name: "冷却风温度",
  83. field: "FDJLQFWD",
  84. is_num: true,
  85. is_light: false,
  86. },
  87. {
  88. name: "有功功率",
  89. field: "FJGL",
  90. is_num: true,
  91. is_light: false,
  92. },
  93. {
  94. name: "液压油温度",
  95. field: "YYYW",
  96. is_num: true,
  97. is_light: false,
  98. },
  99. {
  100. name: "Pcspp温度",
  101. field: "PCS_WD",
  102. is_num: true,
  103. is_light: false,
  104. },
  105. {
  106. name: "U1绕组温度",
  107. field: "U1YZWD",
  108. is_num: true,
  109. is_light: false,
  110. },
  111. {
  112. name: "U2绕组温度",
  113. field: "U2YZWD",
  114. is_num: true,
  115. is_light: false,
  116. },
  117. {
  118. name: "V1绕组温度",
  119. field: "V1YZWD",
  120. is_num: true,
  121. is_light: false,
  122. },
  123. {
  124. name: "V2绕组温度",
  125. field: "V2YZWD",
  126. is_num: true,
  127. is_light: false,
  128. },
  129. {
  130. name: "W1绕组温度",
  131. field: "W1YZWD",
  132. is_num: true,
  133. is_light: false,
  134. },
  135. {
  136. name: "W2绕组温度",
  137. field: "W2YZWD",
  138. is_num: true,
  139. is_light: false,
  140. },
  141. {
  142. name: "轴承A温度",
  143. field: "FDJZCAWD",
  144. is_num: true,
  145. is_light: false,
  146. },
  147. {
  148. name: "轴承B温度",
  149. field: "FDJZCBWD",
  150. is_num: true,
  151. is_light: false,
  152. },
  153. {
  154. name: "齿轮箱温度",
  155. field: "CLXWD",
  156. is_num: true,
  157. is_light: false,
  158. },
  159. {
  160. name: "齿轮箱轴1温度",
  161. field: "CLXSRZ1WD",
  162. is_num: true,
  163. is_light: false,
  164. },
  165. {
  166. name: "齿轮箱轴2温度",
  167. field: "CLXSRZ2WD",
  168. is_num: true,
  169. is_light: false,
  170. },
  171. {
  172. name: "机舱温度",
  173. field: "JCWD",
  174. is_num: true,
  175. is_light: false,
  176. },
  177. {
  178. name: "滑环温度",
  179. field: "FDJHHWD",
  180. is_num: true,
  181. is_light: false,
  182. },
  183. {
  184. name: "环境温度",
  185. field: "JCWWD",
  186. is_num: true,
  187. is_light: false,
  188. },
  189. ],
  190. data: [],
  191. },
  192. };
  193. },
  194. // 函数
  195. methods: {
  196. // 请求服务
  197. requestData(showLoading) {
  198. let that = this;
  199. that.API.requestData({
  200. showLoading,
  201. method: "POST",
  202. subUrl: "monitorwt/findWtInfoList",
  203. data: {
  204. wpId: that.wpId
  205. },
  206. success(res) {
  207. res.data.forEach((ele) => {
  208. for (let key in ele) {
  209. if (key !== "code" && key !== "lnid" && key !== "model" && key !== "pjid" && key !== "wpid") {
  210. ele[key] = ele[key] || 0;
  211. }
  212. }
  213. });
  214. that.data.data = res.data;
  215. },
  216. });
  217. },
  218. getWp () {
  219. let that = this;
  220. that.API.requestData({
  221. method: "GET",
  222. subUrl: "powercompare/windfarmAllAjax",
  223. success (res) {
  224. let btnGroups = [
  225. {
  226. icon: "svg-wind-site",
  227. btns: [],
  228. },
  229. {
  230. icon: "svg-photovoltaic",
  231. btns: [],
  232. },
  233. ];
  234. res.data.forEach((ele, index) => {
  235. if (ele.id.indexOf("FDC") !== -1) {
  236. btnGroups[0].btns.push({
  237. text: ele.name,
  238. code: ele.id,
  239. });
  240. } else {
  241. btnGroups[1].btns.push({
  242. text: ele.name,
  243. code: ele.id,
  244. });
  245. }
  246. });
  247. that.btnGroupsss = btnGroups;
  248. that.renderBtnActiveIndex();
  249. },
  250. });
  251. },
  252. renderBtnActiveIndex () {
  253. this.btnGroupsss.forEach((pEle, pIndex) => {
  254. pEle.btns.forEach((cEle, cIndex) => {
  255. if (cEle.code === this.wpId) {
  256. this.rowIndex = pIndex;
  257. this.selectIndex = cIndex;
  258. }
  259. });
  260. });
  261. },
  262. select (res) {
  263. debugger;
  264. this.$router.replace({
  265. path: `/monitor/windsite/draughtfanlist/${res.code}`,
  266. });
  267. },
  268. },
  269. created() {
  270. let that = this;
  271. that.wpId = that.$route.params.wpId;
  272. that.getWp();
  273. that.$nextTick(() => {
  274. that.requestData(false);
  275. that.timmer = setInterval(() => {
  276. that.requestData(false);
  277. }, that.$store.state.websocketTimeSec);
  278. });
  279. },
  280. mounted() {},
  281. unmounted() {
  282. clearInterval(this.timmer);
  283. this.timmer = null;
  284. }, watch: {
  285. $route (res) {
  286. this.wpId = res.params.wpId;
  287. if (res.params.wpId) {
  288. this.requestData(false);
  289. this.renderBtnActiveIndex();
  290. }
  291. },
  292. },
  293. };
  294. </script>
  295. <style lang="less">
  296. .draught-fan-list {
  297. width: 100%;
  298. height: 100%;
  299. display: flex;
  300. flex-direction: column;
  301. .btn-group-tabs {
  302. display: flex;
  303. flex-direction: row;
  304. }
  305. .df-table {
  306. border: 0.093vh solid fade(@darkgray, 50%);
  307. position: relative;
  308. overflow: auto;
  309. flex-grow: 1;
  310. margin-top: 1.481vh;
  311. &:before {
  312. content: "";
  313. width: 0.37vh;
  314. height: 0.37vh;
  315. background: @write;
  316. position: absolute;
  317. left: 0.278vh;
  318. top: 0.278vh;
  319. }
  320. tbody {
  321. height: calc(100vh - 166px);
  322. }
  323. }
  324. }
  325. </style>