index.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  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="
  14. (wpId) => {
  15. getProject();
  16. }
  17. "
  18. >
  19. <el-option
  20. v-for="item in wpArray"
  21. :key="item.id"
  22. :value="item.id"
  23. :label="item.name"
  24. />
  25. </el-select>
  26. </div>
  27. </div>
  28. <!-- <div class="query-item">
  29. <div class="lable">项目:</div>
  30. <div class="search-input">
  31. <el-select
  32. v-model="projectId"
  33. clearable
  34. placeholder="请选择"
  35. popper-class="select"
  36. >
  37. <el-option
  38. v-for="item in projectArray"
  39. :key="item.id"
  40. :value="item.id"
  41. :label="item.name"
  42. />
  43. </el-select>
  44. </div>
  45. </div> -->
  46. <div class="query-item">
  47. <div class="lable">模型:</div>
  48. <div class="search-input">
  49. <el-select
  50. v-model="modelId"
  51. clearable
  52. placeholder="请选择"
  53. popper-class="select"
  54. >
  55. <el-option
  56. v-for="item in modelArray"
  57. :key="item.id"
  58. :value="item.id"
  59. :label="item.name"
  60. />
  61. </el-select>
  62. </div>
  63. </div>
  64. <div class="query-item">
  65. <div class="lable">时间类型:</div>
  66. <div class="search-input">
  67. <el-select
  68. v-model="typeId"
  69. clearable
  70. placeholder="请选择"
  71. popper-class="select"
  72. >
  73. <el-option
  74. v-for="item in typeArray"
  75. :key="item.id"
  76. :value="item.id"
  77. :label="item.name"
  78. />
  79. </el-select>
  80. </div>
  81. </div>
  82. </div>
  83. <div class="query-actions">
  84. <button class="btn green" @click="search()">查询</button>
  85. </div>
  86. </div>
  87. <div class="df-table">
  88. <ComTable height="78vh" :data="tableData"></ComTable>
  89. </div>
  90. <el-dialog
  91. title="批量诊断"
  92. v-model="dialogShow"
  93. width="85%"
  94. top="10vh"
  95. custom-class="modal"
  96. :close-on-click-modal="true"
  97. >
  98. 123123
  99. </el-dialog>
  100. </div>
  101. </template>
  102. <script>
  103. import ComTable from "@com/coms/table/table.vue";
  104. export default {
  105. // 名称
  106. name: "cutAnalyse",
  107. // 使用组件
  108. components: {
  109. ComTable,
  110. },
  111. // 数据
  112. data() {
  113. const that = this;
  114. return {
  115. isAsc: "asc",
  116. wpArray: [],
  117. wpId: "",
  118. projectId: "",
  119. projectArray: [],
  120. modelId: "2",
  121. modelArray: [
  122. {
  123. id: "2",
  124. value: "2",
  125. name: "极限学习机",
  126. },
  127. {
  128. id: "1",
  129. value: "1",
  130. name: "决策树分类法",
  131. },
  132. ],
  133. typeId: "1",
  134. typeArray: [
  135. {
  136. id: "1",
  137. value: "1",
  138. name: "顺时",
  139. },
  140. {
  141. id: "2",
  142. value: "2",
  143. name: "趋势",
  144. },
  145. ],
  146. dialogShow: false,
  147. tableData: {
  148. column: [
  149. {
  150. name: "风机",
  151. field: "wtid",
  152. is_num: false,
  153. is_light: false,
  154. sortable: true,
  155. },
  156. {
  157. name: "型号",
  158. field: "modelid",
  159. is_num: false,
  160. is_light: false,
  161. sortable: true,
  162. },
  163. {
  164. name: "评分",
  165. field: "judegvulue",
  166. is_num: false,
  167. is_light: false,
  168. sortable: true,
  169. },
  170. {
  171. name: "操作",
  172. field: "",
  173. is_num: false,
  174. is_light: false,
  175. template() {
  176. return "<el-button type='text' style='cursor: pointer;'>详情</el-button>";
  177. },
  178. click(e, row) {
  179. that.getTree(row);
  180. that.dialogShow = true;
  181. },
  182. },
  183. ],
  184. data: [],
  185. },
  186. };
  187. },
  188. // 函数
  189. methods: {
  190. // 请求服务
  191. requestData() {
  192. let that = this;
  193. that.API.requestData({
  194. method: "GET",
  195. subUrl: "powercompare/windfarmAjax",
  196. success(res) {
  197. that.wpArray = res.data;
  198. that.wpId = res.data[0].id;
  199. that.getProject();
  200. },
  201. });
  202. },
  203. // 获取期数
  204. getProject() {
  205. let that = this;
  206. that.API.requestData({
  207. method: "GET",
  208. subUrl: "powercompare/projectAjax",
  209. data: {
  210. wpIds: that.wpId,
  211. },
  212. success(res) {
  213. that.projectArray = res.data;
  214. that.projectId = res.data[0].id;
  215. that.getTableData();
  216. },
  217. });
  218. },
  219. getTableData() {
  220. let that = this;
  221. if (!that.wpId || !that.projectId) {
  222. that.BASE.showMsg({
  223. msg: "场站与期数不可为空",
  224. });
  225. } else if (!that.modelId || !that.typeId) {
  226. that.BASE.showMsg({
  227. msg: "模型与时间类型不可为空",
  228. });
  229. } else {
  230. that.API.requestData({
  231. method: "POST",
  232. subUrl: "stopanalysis/stopAnalysisList",
  233. data: {
  234. wpId: that.wpId,
  235. isAsc: that.isAsc,
  236. modelId: that.modelId,
  237. typeId: that.typeId,
  238. },
  239. success(res) {
  240. that.tableData.data = res.data;
  241. },
  242. });
  243. }
  244. },
  245. // 获取故障诊断树
  246. getTree(item) {
  247. let that = this;
  248. that.API.requestData({
  249. method: "POST",
  250. subUrl: "stopanalysis/stopAnalysisTree",
  251. data: {
  252. wtId: item.wtid,
  253. },
  254. success(res) {
  255. console.log(123123, res);
  256. },
  257. });
  258. },
  259. search() {
  260. this.getTableData();
  261. },
  262. },
  263. created() {
  264. this.requestData();
  265. },
  266. mounted() {},
  267. unmounted() {},
  268. };
  269. </script>
  270. <style lang="less" scoped>
  271. .draught-fan-list {
  272. width: 100%;
  273. height: 100%;
  274. display: flex;
  275. flex-direction: column;
  276. .btn-group-tabs {
  277. display: flex;
  278. flex-direction: row;
  279. .photovoltaic {
  280. margin-left: 1.481vh;
  281. }
  282. }
  283. .df-table {
  284. border: 0.093vh solid fade(@darkgray, 50%);
  285. position: relative;
  286. overflow: auto;
  287. flex-grow: 1;
  288. margin-top: 1.481vh;
  289. &:before {
  290. content: "";
  291. width: 0.37vh;
  292. height: 0.37vh;
  293. background: @write;
  294. position: absolute;
  295. left: 0.278vh;
  296. top: 0.278vh;
  297. }
  298. tbody {
  299. height: calc(100vh - 166px);
  300. }
  301. }
  302. }
  303. </style>