tab3.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  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
  9. v-model="wpId"
  10. clearable
  11. placeholder="请选择"
  12. popper-class="select"
  13. @change="getWtArray"
  14. >
  15. <el-option
  16. v-for="item in wpArray"
  17. :key="item.id"
  18. :value="item.id"
  19. :label="item.name"
  20. />
  21. </el-select>
  22. </div>
  23. </div>
  24. <div class="query-item">
  25. <div class="lable">风机:</div>
  26. <div class="search-input">
  27. <el-select
  28. v-model="wtId"
  29. clearable
  30. placeholder="请选择"
  31. popper-class="select"
  32. >
  33. <el-option
  34. v-for="item in wtArray"
  35. :key="item.id"
  36. :value="item.id"
  37. :label="item.name"
  38. />
  39. </el-select>
  40. </div>
  41. </div>
  42. <div class="query-item">
  43. <div class="lable">开始日期:</div>
  44. <div class="search-input">
  45. <el-date-picker
  46. v-model="starttime"
  47. type="date"
  48. value-format="YYYY-MM-DD"
  49. placeholder="选择日期"
  50. popper-class="date-select"
  51. >
  52. </el-date-picker>
  53. </div>
  54. </div>
  55. <div class="query-item">
  56. <div class="lable">结束日期:</div>
  57. <div class="search-input">
  58. <el-date-picker
  59. v-model="endtime"
  60. type="date"
  61. value-format="YYYY-MM-DD"
  62. placeholder="选择日期"
  63. popper-class="date-select"
  64. >
  65. </el-date-picker>
  66. </div>
  67. </div>
  68. <div class="query-item">
  69. <div class="lable">类型:</div>
  70. <div class="search-input">
  71. <el-select
  72. v-model="type"
  73. clearable
  74. placeholder="请选择"
  75. popper-class="select"
  76. >
  77. <el-option
  78. v-for="item in typeArray"
  79. :key="item.id"
  80. :value="item.id"
  81. :label="item.name"
  82. />
  83. </el-select>
  84. </div>
  85. </div>
  86. </div>
  87. <div class="query-actions">
  88. <button class="btn green" @click="search()">查询</button>
  89. </div>
  90. </div>
  91. <div class="df-table">
  92. <ComTable height="78vh" :data="tableData"></ComTable>
  93. </div>
  94. </div>
  95. </template>
  96. <script>
  97. import ComTable from "@com/coms/table/table.vue";
  98. import api from "@api/wisdomOverhaul/lifecycle/index.js";
  99. import api1 from "@api/economic/index.js";
  100. export default {
  101. // 名称
  102. name: "cutAnalyse",
  103. // 使用组件
  104. components: {
  105. ComTable,
  106. },
  107. // 数据
  108. data() {
  109. const that = this;
  110. return {
  111. wpArray: [],
  112. wpId: "",
  113. wtArray: [],
  114. wtId: "",
  115. type: "异动",
  116. typeArray: [
  117. {
  118. id: "检修",
  119. label: "检修",
  120. value: "检修",
  121. },
  122. {
  123. id: "异动",
  124. label: "异动",
  125. value: "异动",
  126. },
  127. {
  128. id: "故障",
  129. label: "故障",
  130. value: "故障",
  131. },
  132. ],
  133. starttime: new Date().formatDate("yyyy-MM") + "-01",
  134. endtime: new Date().formatDate("yyyy-MM-dd"),
  135. tableData: {
  136. column: [
  137. {
  138. name: "检修负责人",
  139. field: "leader",
  140. is_num: false,
  141. is_light: false,
  142. sortable: true,
  143. },
  144. {
  145. name: "检修类型",
  146. field: "type",
  147. is_num: false,
  148. is_light: false,
  149. sortable: true,
  150. },
  151. {
  152. name: "风机编号",
  153. field: "wtnum",
  154. is_num: false,
  155. is_light: false,
  156. sortable: true,
  157. },
  158. {
  159. name: "开始时间",
  160. field: "starttime",
  161. is_num: false,
  162. is_light: false,
  163. sortable: true,
  164. },
  165. {
  166. name: "结束时间",
  167. field: "endtime",
  168. is_num: false,
  169. is_light: false,
  170. sortable: true,
  171. },
  172. {
  173. name: "检修原因",
  174. field: "problem",
  175. is_num: false,
  176. is_light: false,
  177. sortable: true,
  178. },
  179. {
  180. name: "检修方式",
  181. field: "solveway",
  182. is_num: false,
  183. is_light: false,
  184. sortable: true,
  185. },
  186. {
  187. name: "设备唯一编号",
  188. field: "eqnum",
  189. is_num: false,
  190. is_light: false,
  191. sortable: true,
  192. },
  193. ],
  194. data: [],
  195. },
  196. };
  197. },
  198. // 函数
  199. methods: {
  200. // 获取风场
  201. getWpArray() {
  202. api1.benchmarkingWplist({}).then((res) => {
  203. this.wpArray = res.data;
  204. this.wpId = this.wpId || res.data[0].id;
  205. this.getWtArray(this.wpId, true);
  206. });
  207. },
  208. // getWpArray() {
  209. // // let that = this;
  210. // // that.API.requestData({
  211. // // method: "GET",
  212. // // subUrl: "powercompare/windfarmAjax",
  213. // // success (res) {
  214. // // that.wpArray = res.data;
  215. // // that.wpId = that.wpId || res.data[0].id;
  216. // // that.getWtArray(that.wpId, true);
  217. // // }
  218. // // });
  219. // },
  220. // 获取风机
  221. getWtArray(wpId, keepRequest) {
  222. let that = this;
  223. if (wpId) {
  224. api1
  225. .powercompareWindturbineAjax({
  226. wpId: wpId,
  227. })
  228. .then((res) => {
  229. this.wtArray = res.data;
  230. const findRes = res.data.some((ele) => {
  231. return ele.id === this.wtId;
  232. });
  233. this.wtId = findRes ? this.wtId : res.data[0].id;
  234. this.getTableData();
  235. });
  236. // that.API.requestData({
  237. // method: "GET",
  238. // subUrl: "powercompare/windturbineAjax",
  239. // data: {
  240. // wpId,
  241. // },
  242. // success(res) {
  243. // that.wtArray = res.data;
  244. // const findRes = res.data.some((ele) => {
  245. // return ele.id === that.wtId;
  246. // });
  247. // that.wtId = findRes ? that.wtId : res.data[0].id;
  248. // that.getTableData();
  249. // },
  250. // });
  251. } else {
  252. that.wtArray = [];
  253. that.wtId = "";
  254. }
  255. },
  256. getTableData() {
  257. let that = this;
  258. if (!that.wpId || !that.starttime || !that.endtime) {
  259. that.BASE.showMsg({
  260. msg: "场站与日期不可为空",
  261. });
  262. } else {
  263. api
  264. .equoperationrecordList({
  265. wtid: this.wtId,
  266. starttime: this.starttime,
  267. endtime: this.endtime,
  268. type: this.type,
  269. pagenum: 1,
  270. pagesize: 50000,
  271. })
  272. .then((res) => {
  273. this.tableData.data = res.data.records;
  274. });
  275. // that.API.requestData({
  276. // method: "GET",
  277. // baseURL: "http://192.168.1.18:9988/",
  278. // subUrl: "equoperationrecord/list",
  279. // data: {
  280. // wtid: that.wtId,
  281. // starttime: that.starttime,
  282. // endtime: that.endtime,
  283. // type: that.type,
  284. // pagenum: 1,
  285. // pagesize: 50000,
  286. // },
  287. // success(res) {
  288. // that.tableData.data = res.data.records;
  289. // },
  290. // });
  291. }
  292. },
  293. search() {
  294. this.getTableData();
  295. },
  296. },
  297. created() {
  298. this.getWpArray();
  299. },
  300. mounted() {},
  301. unmounted() {},
  302. };
  303. </script>
  304. <style lang="less" scoped>
  305. .draught-fan-list {
  306. width: 100%;
  307. height: 100%;
  308. display: flex;
  309. flex-direction: column;
  310. .btn-group-tabs {
  311. display: flex;
  312. flex-direction: row;
  313. .photovoltaic {
  314. margin-left: 1.481vh;
  315. }
  316. }
  317. .df-table {
  318. border: 0.093vh solid fade(@darkgray, 50%);
  319. position: relative;
  320. overflow: auto;
  321. flex-grow: 1;
  322. margin-top: 1.481vh;
  323. &:before {
  324. content: "";
  325. width: 0.37vh;
  326. height: 0.37vh;
  327. background: @write;
  328. position: absolute;
  329. left: 0.278vh;
  330. top: 0.278vh;
  331. }
  332. tbody {
  333. height: calc(100vh - 166px);
  334. }
  335. }
  336. }
  337. </style>