tab2.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  1. <template>
  2. <div class="draught-fan-list">
  3. <div class="query mg-b-8">
  4. <div class="query-items">
  5. <div class="query-item">
  6. <div class="lable">风场:</div>
  7. <div class="search-input">
  8. <el-select v-model="wpId" clearable placeholder="请选择" popper-class="select" @change="getWtArray">
  9. <el-option v-for="item in wpArray" :key="item.id" :value="item.id" :label="item.name" />
  10. </el-select>
  11. </div>
  12. </div>
  13. <div class="query-item">
  14. <div class="lable">风机:</div>
  15. <div class="search-input">
  16. <el-select v-model="wtId" clearable placeholder="请选择" popper-class="select">
  17. <el-option v-for="item in wtArray" :key="item.id" :value="item.id" :label="item.name" />
  18. </el-select>
  19. </div>
  20. </div>
  21. </div>
  22. <div class="query-actions">
  23. <button class="btn green" @click="search()">查询</button>
  24. </div>
  25. </div>
  26. <div class="df-table">
  27. <ComTable height="78vh" :data="tableData"></ComTable>
  28. </div>
  29. </div>
  30. </template>
  31. <script>
  32. import ComTable from "@com/coms/table/table.vue";
  33. export default {
  34. // 名称
  35. name: "cutAnalyse",
  36. // 使用组件
  37. components: {
  38. ComTable
  39. },
  40. // 数据
  41. data () {
  42. const that = this;
  43. return {
  44. wpArray: [],
  45. wpId: "",
  46. wtArray: [],
  47. wtId: "",
  48. tableData: {
  49. column: [
  50. // {
  51. // name: "风机编号",
  52. // field: "wtnum",
  53. // is_num: false,
  54. // is_light: false,
  55. // sortable: true
  56. // },
  57. // {
  58. // name: "所属风电场",
  59. // field: "ownerwf",
  60. // is_num: false,
  61. // is_light: false,
  62. // sortable: true
  63. // },
  64. // {
  65. // name: "所属工程",
  66. // field: "ownerproject",
  67. // is_num: false,
  68. // is_light: false,
  69. // sortable: true
  70. // },
  71. // {
  72. // name: "所属线路",
  73. // field: "ownerline",
  74. // is_num: false,
  75. // is_light: false,
  76. // sortable: true
  77. // },
  78. // {
  79. // name: "编号",
  80. // field: "wtwfnum",
  81. // is_num: false,
  82. // is_light: false,
  83. // sortable: true
  84. // },
  85. // {
  86. // name: "编号",
  87. // field: "wtgridnum",
  88. // is_num: false,
  89. // is_light: false,
  90. // sortable: true
  91. // },
  92. {
  93. name: "供应商",
  94. field: "vendor",
  95. is_num: false,
  96. is_light: false,
  97. sortable: true
  98. },
  99. {
  100. name: "型号",
  101. field: "model",
  102. is_num: false,
  103. is_light: false,
  104. sortable: true
  105. },
  106. {
  107. name: "额定功率",
  108. field: "ratedpower",
  109. is_num: false,
  110. is_light: false,
  111. sortable: true
  112. },
  113. {
  114. name: "额定风速",
  115. field: "ratedwinspe",
  116. is_num: false,
  117. is_light: false,
  118. sortable: true
  119. },
  120. {
  121. name: "额定电压",
  122. field: "ratedvoltage",
  123. is_num: false,
  124. is_light: false,
  125. sortable: true
  126. },
  127. {
  128. name: "额定转速",
  129. field: "ratedrev",
  130. is_num: false,
  131. is_light: false,
  132. sortable: true
  133. },
  134. {
  135. name: "切入风速",
  136. field: "cutinwinspe",
  137. is_num: false,
  138. is_light: false,
  139. sortable: true
  140. },
  141. {
  142. name: "切出风速",
  143. field: "cutoutwinspe",
  144. is_num: false,
  145. is_light: false,
  146. sortable: true
  147. },
  148. {
  149. name: "生存风速",
  150. field: "maxwinspe",
  151. is_num: false,
  152. is_light: false,
  153. sortable: true
  154. },
  155. // {
  156. // name: "最低温度",
  157. // field: "lowertemp",
  158. // is_num: false,
  159. // is_light: false,
  160. // sortable: true
  161. // },
  162. // {
  163. // name: "最高温度",
  164. // field: "hightemp",
  165. // is_num: false,
  166. // is_light: false,
  167. // sortable: true
  168. // },
  169. // {
  170. // name: "最低转速",
  171. // field: "lowerrev",
  172. // is_num: false,
  173. // is_light: false,
  174. // sortable: true
  175. // },
  176. // {
  177. // name: "最高转速",
  178. // field: "highrev",
  179. // is_num: false,
  180. // is_light: false,
  181. // sortable: true
  182. // },
  183. // {
  184. // name: "风轮直径",
  185. // field: "roterdiameter",
  186. // is_num: false,
  187. // is_light: false,
  188. // },
  189. // {
  190. // name: "月大风切入合格率",
  191. // field: "monthinputbigratio",
  192. // is_num: false,
  193. // is_light: false,
  194. // sortable: true
  195. // },
  196. // {
  197. // name: "轮毂高度",
  198. // field: "hubheight",
  199. // is_num: false,
  200. // is_light: false,
  201. // sortable: true
  202. // },
  203. // {
  204. // name: "出厂日期",
  205. // field: "releasedate",
  206. // is_num: false,
  207. // is_light: false,
  208. // sortable: true
  209. // },
  210. {
  211. name: "吊装日期",
  212. field: "installdate",
  213. is_num: false,
  214. is_light: false,
  215. sortable: true
  216. },
  217. // {
  218. // name: "调试日期",
  219. // field: "testdate",
  220. // is_num: false,
  221. // is_light: false,
  222. // sortable: true
  223. // },
  224. // {
  225. // name: "投运日期",
  226. // field: "opdate",
  227. // is_num: false,
  228. // is_light: false,
  229. // sortable: true
  230. // },
  231. // {
  232. // name: "位置",
  233. // field: "location",
  234. // is_num: false,
  235. // is_light: false,
  236. // sortable: true
  237. // },
  238. {
  239. name: "风机位置",
  240. field: "wflocation",
  241. is_num: false,
  242. is_light: false,
  243. sortable: true
  244. },
  245. {
  246. name: "风机ID",
  247. field: "wtid",
  248. is_num: false,
  249. is_light: false,
  250. sortable: true
  251. }
  252. ],
  253. data: [],
  254. }
  255. };
  256. },
  257. // 函数
  258. methods: {
  259. // 获取风场
  260. getWpArray () {
  261. let that = this;
  262. that.API.requestData({
  263. method: "GET",
  264. subUrl: "powercompare/windfarmAjax",
  265. success (res) {
  266. that.wpArray = res.data;
  267. that.wpId = that.wpId || res.data[0].id;
  268. that.getWtArray(that.wpId, true);
  269. }
  270. });
  271. },
  272. // 获取风机
  273. getWtArray (wpId, keepRequest) {
  274. let that = this;
  275. if (wpId) {
  276. that.API.requestData({
  277. method: "GET",
  278. subUrl: "powercompare/windturbineAjax",
  279. data: {
  280. wpId
  281. },
  282. success (res) {
  283. that.wtArray = res.data;
  284. const findRes = res.data.some(ele => {
  285. return ele.id === that.wtId;
  286. });
  287. that.wtId = (findRes ? that.wtId : res.data[0].id);
  288. that.getTableData();
  289. }
  290. });
  291. } else {
  292. that.wtArray = [];
  293. that.wtId = "";
  294. }
  295. },
  296. getTableData () {
  297. let that = this;
  298. if (!that.wpId) {
  299. that.BASE.showMsg({
  300. msg: "场站与日期不可为空"
  301. });
  302. } else {
  303. that.API.requestData({
  304. method: "GET",
  305. baseURL:"http://192.168.10.18:9988/",
  306. subUrl: "windturbine/list",
  307. data: {
  308. wtid:that.wtId
  309. },
  310. success (res) {
  311. res.data.forEach(ele => {
  312. ele.installdate = new Date(ele.installdate).formatDate("yyyy-MM-dd hh:mm:ss");
  313. ele.opdate = new Date(ele.opdate).formatDate("yyyy-MM-dd hh:mm:ss");
  314. ele.releasedate = new Date(ele.releasedate).formatDate("yyyy-MM-dd hh:mm:ss");
  315. ele.testdate = new Date(ele.testdate).formatDate("yyyy-MM-dd hh:mm:ss");
  316. });
  317. that.tableData.data = res.data;
  318. }
  319. });
  320. }
  321. },
  322. search () {
  323. this.getTableData();
  324. }
  325. },
  326. created () {
  327. this.getWpArray();
  328. },
  329. mounted () { },
  330. unmounted () { },
  331. };
  332. </script>
  333. <style lang="less" scoped>
  334. .draught-fan-list {
  335. width: 100%;
  336. height: 100%;
  337. display: flex;
  338. flex-direction: column;
  339. .btn-group-tabs {
  340. display: flex;
  341. flex-direction: row;
  342. .photovoltaic {
  343. margin-left: 1.481vh;
  344. }
  345. }
  346. .df-table {
  347. border: 0.093vh solid fade(@darkgray, 50%);
  348. position: relative;
  349. overflow: auto;
  350. flex-grow: 1;
  351. margin-top: 1.481vh;
  352. &:before {
  353. content: '';
  354. width: 0.37vh;
  355. height: 0.37vh;
  356. background: @write;
  357. position: absolute;
  358. left: 0.278vh;
  359. top: 0.278vh;
  360. }
  361. tbody {
  362. height: calc(100vh - 166px);
  363. }
  364. }
  365. }
  366. </style>