index.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  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. <el-table
  99. :data="treeData"
  100. style="width: 100%; height: 600px; overflow-y: scroll"
  101. row-key="id"
  102. border
  103. default-expand-all
  104. :expand-row-keys="['0']"
  105. :tree-props="{ children: 'children' }"
  106. >
  107. <el-table-column
  108. prop="name"
  109. label="项目名称"
  110. sortable
  111. ></el-table-column>
  112. <el-table-column
  113. prop="judegVulue"
  114. label="状态"
  115. sortable
  116. ></el-table-column>
  117. </el-table>
  118. </el-dialog>
  119. </div>
  120. </template>
  121. <script>
  122. import ComTable from "@com/coms/table/table.vue";
  123. export default {
  124. // 名称
  125. name: "cutAnalyse",
  126. // 使用组件
  127. components: {
  128. ComTable,
  129. },
  130. // 数据
  131. data() {
  132. const that = this;
  133. return {
  134. isAsc: "asc",
  135. wpArray: [],
  136. wpId: "",
  137. projectId: "",
  138. projectArray: [],
  139. modelId: "2",
  140. modelArray: [
  141. {
  142. id: "2",
  143. value: "2",
  144. name: "极限学习机",
  145. },
  146. {
  147. id: "1",
  148. value: "1",
  149. name: "决策树分类法",
  150. },
  151. ],
  152. typeId: "1",
  153. typeArray: [
  154. {
  155. id: "1",
  156. value: "1",
  157. name: "顺时",
  158. },
  159. {
  160. id: "2",
  161. value: "2",
  162. name: "趋势",
  163. },
  164. ],
  165. dialogShow: false,
  166. tableData: {
  167. column: [
  168. {
  169. name: "风机",
  170. field: "wtid",
  171. is_num: false,
  172. is_light: false,
  173. sortable: true,
  174. },
  175. {
  176. name: "型号",
  177. field: "modelid",
  178. is_num: false,
  179. is_light: false,
  180. sortable: true,
  181. },
  182. {
  183. name: "评分",
  184. field: "judegvulue",
  185. is_num: false,
  186. is_light: false,
  187. sortable: true,
  188. },
  189. {
  190. name: "操作",
  191. field: "",
  192. is_num: false,
  193. is_light: false,
  194. template() {
  195. return "<el-button type='text' style='cursor: pointer;'>详情</el-button>";
  196. },
  197. click(e, row) {
  198. that.getTree(row);
  199. },
  200. },
  201. ],
  202. data: [],
  203. },
  204. };
  205. },
  206. // 函数
  207. methods: {
  208. // 请求服务
  209. requestData() {
  210. let that = this;
  211. that.API.requestData({
  212. method: "GET",
  213. subUrl: "powercompare/windfarmAjax",
  214. success(res) {
  215. that.wpArray = res.data;
  216. that.wpId = res.data[0].id;
  217. that.getProject();
  218. },
  219. });
  220. },
  221. // 获取期数
  222. getProject() {
  223. let that = this;
  224. that.API.requestData({
  225. method: "GET",
  226. subUrl: "powercompare/projectAjax",
  227. data: {
  228. wpIds: that.wpId,
  229. },
  230. success(res) {
  231. that.projectArray = res.data;
  232. that.projectId = res.data[0].id;
  233. that.getTableData();
  234. },
  235. });
  236. },
  237. getTableData() {
  238. let that = this;
  239. if (!that.wpId || !that.projectId) {
  240. that.BASE.showMsg({
  241. msg: "场站与期数不可为空",
  242. });
  243. } else if (!that.modelId || !that.typeId) {
  244. that.BASE.showMsg({
  245. msg: "模型与时间类型不可为空",
  246. });
  247. } else {
  248. that.API.requestData({
  249. method: "POST",
  250. subUrl: "stopanalysis/stopAnalysisList",
  251. data: {
  252. wpId: that.wpId,
  253. isAsc: that.isAsc,
  254. modelId: that.modelId,
  255. typeId: that.typeId,
  256. },
  257. success(res) {
  258. that.tableData.data = res.data;
  259. },
  260. });
  261. }
  262. },
  263. // 获取故障诊断树
  264. getTree(item) {
  265. let that = this;
  266. that.API.requestData({
  267. method: "POST",
  268. subUrl: "stopanalysis/stopAnalysisTree",
  269. data: {
  270. mainId: item.id,
  271. wtId: item.wtid,
  272. values: item.judegvulue,
  273. },
  274. success(res) {
  275. res.data[0].id = "0";
  276. that.treeData = res.data;
  277. that.dialogShow = true;
  278. },
  279. });
  280. },
  281. search() {
  282. this.getTableData();
  283. },
  284. },
  285. created() {
  286. this.requestData();
  287. },
  288. mounted() {},
  289. unmounted() {},
  290. };
  291. </script>
  292. <style lang="less" scoped>
  293. .draught-fan-list {
  294. width: 100%;
  295. height: 100%;
  296. display: flex;
  297. flex-direction: column;
  298. .btn-group-tabs {
  299. display: flex;
  300. flex-direction: row;
  301. .photovoltaic {
  302. margin-left: 1.481vh;
  303. }
  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>