Decision1.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  1. <template>
  2. <div class="decision-page-1">
  3. <!-- 查询样式统一处理 样式在 assets/styles/form.less 文件中 -->
  4. <div class="query mg-b-8">
  5. <div class="query-items">
  6. <div class="query-item">
  7. <div class="lable">场站:</div>
  8. <div class="search-input">
  9. <el-select v-model="value1" @change="ChangZhanChange(value1)" clearable placeholder="请选择"
  10. popper-class="select">
  11. <el-option v-for="item in ChangZhan" :key="item.id" :value="item.id" :label="item.name">
  12. </el-option>
  13. </el-select>
  14. </div>
  15. </div>
  16. <div class="query-item">
  17. <div class="lable">项目:</div>
  18. <div class="search-input">
  19. <el-select v-model="value2" @change="XiangMuChange(value2)" multiple placeholder="请选择"
  20. popper-class="select">
  21. <el-option v-for="item in XiangMu" :key="item.id" :value="item.id" :label="item.name">
  22. </el-option>
  23. </el-select>
  24. </div>
  25. </div>
  26. <div class="query-item">
  27. <div class="lable">线路:</div>
  28. <div class="search-input">
  29. <el-select v-model="value3" @change="XianLuChange(value3)" multiple placeholder="请选择"
  30. popper-class="select">
  31. <el-option v-for="item in XianLu" :key="item.id" :label="item.name" :value="item.id">
  32. </el-option>
  33. </el-select>
  34. </div>
  35. </div>
  36. <div class="query-item">
  37. <div class="lable">开始日期:</div>
  38. <div class="search-input">
  39. <el-date-picker v-model="value4" @change="BeginChange(value4)" type="date"
  40. value-format="YYYY-MM-DD" placeholder="选择日期" popper-class="date-select">
  41. </el-date-picker>
  42. </div>
  43. </div>
  44. <div class="query-item">
  45. <div class="lable">结束日期:</div>
  46. <div class="search-input">
  47. <el-date-picker v-model="value5" @change="EndChange(value5)" type="date"
  48. value-format="YYYY-MM-DD" placeholder="选择日期" popper-class="date-select">
  49. </el-date-picker>
  50. <div class="unit svg-icon svg-icon-gray">
  51. <svg-icon :svgid="''" />
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. <div class="query-actions">
  57. <button class="btn green">搜索</button>
  58. <button class="btn" @click="mxClick()">明细信息</button>
  59. <button class="btn">导出</button>
  60. </div>
  61. </div>
  62. <div class="actions mg-b-8">
  63. <button class="btn" :class="TypeClass==1?'green':''" @click="TypeClick(1)">风场</button>
  64. <button class="btn" :class="TypeClass==2?'green':''" @click="TypeClick(2)">项目</button>
  65. <button class="btn" :class="TypeClass==3?'green':''" @click="TypeClick(3)">集电线路</button>
  66. </div>
  67. <el-row :type="'flex'" class="content">
  68. <el-col :span="12" class="pd-r-8">
  69. <toolbar-panel title="风机绩效榜" :showLine="false">
  70. <bar-line-chart :height="'calc(100vh - 180px)'" :bardata="bardata" :lineData="lineData"
  71. :color="barColor" lineName="理论发电量" />
  72. </toolbar-panel>
  73. </el-col>
  74. <el-col :span="12" class="pd-l-8">
  75. <panel :title="'项目列表'" :showLine="false">
  76. <div class="project-table">
  77. <!-- 分页Table -->
  78. <Table :data="tableData"
  79. :height="'calc(80vh - 50px)'">
  80. <template v-slot:tr v-if="tableData.data.length > 0">
  81. <tr>
  82. <td style="width: 50px;">
  83. {{tableDataEnd.index}}
  84. </td>
  85. <td>
  86. {{tableDataEnd.name}}
  87. </td>
  88. <td>
  89. {{tableDataEnd.llfdl}}
  90. </td>
  91. <td>
  92. {{tableDataEnd.sjfdl}}
  93. </td>
  94. <td>
  95. {{tableDataEnd.speed}}
  96. </td>
  97. <td>
  98. {{tableDataEnd.fjhjx}}
  99. </td>
  100. <td>
  101. {{tableDataEnd.jhjx}}
  102. </td>
  103. <td>
  104. {{tableDataEnd.sl}}
  105. </td>
  106. <td>
  107. {{tableDataEnd.xd}}
  108. </td>
  109. <td>
  110. {{tableDataEnd.xn}}
  111. </td>
  112. <td>
  113. {{tableDataEnd.fnlly}}
  114. </td>
  115. </tr>
  116. </template>
  117. </Table>
  118. <!-- <Table :data="tableData"></Table> -->
  119. </div>
  120. </panel>
  121. </el-col>
  122. </el-row>
  123. </div>
  124. </template>
  125. <script>
  126. import BarLineChart from "../../components/chart/combination/bar-line-chart.vue";
  127. import Panel from "../../components/coms/panel/panel.vue";
  128. import SvgIcon from "../../components/coms/icon/svg-icon.vue";
  129. import ToolbarPanel from "../../components/coms/panel/toolbar-panel.vue";
  130. import Table from "./table.vue";
  131. import partten from "@/helper/partten.js";
  132. export default {
  133. components: {
  134. ToolbarPanel,
  135. BarLineChart,
  136. Panel,
  137. Table,
  138. partten,
  139. SvgIcon
  140. },
  141. data() {
  142. return {
  143. tableData: {
  144. column: [{
  145. name: "",
  146. field: "index",
  147. is_num: false,
  148. is_light: false,
  149. width: "50px",
  150. },
  151. {
  152. name: "名称",
  153. field: "name",
  154. is_num: false,
  155. is_light: false,
  156. },
  157. {
  158. name: "理论发电量",
  159. field: "llfdl",
  160. is_num: false,
  161. is_light: false,
  162. sortable: true
  163. },
  164. {
  165. name: "SCADA发电量",
  166. field: "sjfdl",
  167. is_num: false,
  168. is_light: false,
  169. sortable: true
  170. },
  171. {
  172. name: "风速",
  173. field: "speed",
  174. is_num: false,
  175. is_light: false,
  176. sortable: true
  177. },
  178. {
  179. name: "非计划检修",
  180. field: "fjhjx",
  181. is_num: false,
  182. is_light: false,
  183. sortable: true
  184. },
  185. {
  186. name: "计划检修",
  187. field: "jhjx",
  188. is_num: false,
  189. is_light: false,
  190. sortable: true
  191. },
  192. {
  193. name: "受累",
  194. field: "sl",
  195. is_num: false,
  196. is_light: false,
  197. sortable: true
  198. },
  199. {
  200. name: "限电",
  201. field: "xd",
  202. is_num: false,
  203. is_light: false,
  204. sortable: true
  205. },
  206. {
  207. name: "性能",
  208. field: "xn",
  209. is_num: false,
  210. is_light: false,
  211. sortable: true
  212. },
  213. {
  214. name: "风能利用率%",
  215. field: "fnlly",
  216. is_num: false,
  217. is_light: false,
  218. sortable: true
  219. }
  220. ],
  221. data: [],
  222. },
  223. tableDataEnd: [], //合计
  224. ChangZhan: [], //场站
  225. XiangMu: [], //项目
  226. XianLu: [], //线路
  227. value1: [],
  228. value2: [],
  229. value3: [],
  230. value4: "",
  231. value5: "",
  232. barColor: [partten.getColor("purple"), partten.getColor("green"), partten.getColor("pink"), partten
  233. .getColor("red"), partten.getColor("orange"), partten.getColor("grayl")
  234. ],
  235. TypeClass: 1, //风场,项目,集电线路 的按钮颜色,默认第一个
  236. bardata: [],
  237. lineData: [],
  238. };
  239. },
  240. created() {
  241. this.ChangZhanVal();
  242. this.value4 = this.getTime(1);
  243. this.value5 = this.getTime(2);
  244. this.AjaxCommon();
  245. },
  246. methods: {
  247. ChangZhanVal() {
  248. var that = this;
  249. that.API.requestData({
  250. method: "GET",
  251. baseURL: "http://10.155.32.4:9001/",
  252. subUrl: "benchmarking/wplist",
  253. success(res) {
  254. that.ChangZhan = res.data;
  255. }
  256. });
  257. },
  258. ChangZhanChange(val) {
  259. this.TypeClass = "";
  260. this.value1 = val;
  261. this.value2 = [];
  262. this.value3 = [];
  263. this.AjaxCommon();
  264. this.XiangMuVal(val);
  265. },
  266. XiangMuVal(val) {
  267. var that = this;
  268. that.API.requestData({
  269. method: "GET",
  270. baseURL: "http://10.155.32.4:9001/",
  271. subUrl: "benchmarking/projectList",
  272. data: {
  273. wpids: val
  274. },
  275. success(res) {
  276. that.XiangMu = res.data;
  277. }
  278. });
  279. },
  280. XiangMuChange(val) {
  281. this.TypeClass = "";
  282. this.value2 = val;
  283. this.value3 = [];
  284. this.AjaxCommon();
  285. this.XianLuVal(val);
  286. },
  287. XianLuVal(val) {
  288. var that = this;
  289. that.API.requestData({
  290. method: "GET",
  291. baseURL: "http://10.155.32.4:9001/",
  292. subUrl: "benchmarking/lineList",
  293. data: {
  294. projects: val
  295. },
  296. success(res) {
  297. that.XianLu = res.data;
  298. }
  299. });
  300. },
  301. XianLuChange(val) {
  302. this.TypeClass = "";
  303. this.value3 = val;
  304. this.AjaxCommon();
  305. },
  306. BeginChange(val) {
  307. this.value4 = val;
  308. this.AjaxCommon();
  309. },
  310. EndChange(val) {
  311. this.value5 = val;
  312. this.AjaxCommon();
  313. },
  314. TypeClick(val) {
  315. this.TypeClass = val;
  316. // 重置状态start
  317. this.value1 = [];
  318. this.value2 = [];
  319. this.value3 = [];
  320. this.value4 = this.getTime(1);
  321. this.value5 = this.getTime(2);
  322. this.AjaxCommon();
  323. // 重置状态end
  324. },
  325. getTime(val) { //时间戳处理,val=1是默认开始时间(当前月第一天),val=2是默认结束时间(今天)
  326. var date = new Date();
  327. var year = date.getFullYear(),
  328. month = date.getMonth() + 1,
  329. day = date.getDate();
  330. month >= 1 && month <= 9 ? (month = '0' + month) : '';
  331. day >= 0 && day <= 9 ? (day = '0' + day) : '';
  332. var begin = year + '-' + month + '-01';
  333. var end = year + '-' + month + '-' + day;
  334. if (val == 1) {
  335. return begin;
  336. } else if (val == 2) {
  337. return end;
  338. }
  339. },
  340. AjaxCommon() {
  341. var that = this;
  342. that.API.requestData({
  343. method: "GET",
  344. baseURL: "http://10.155.32.4:9001/",
  345. subUrl: "benchmarking/fjjxb",
  346. data: {
  347. wpids: that.value1,
  348. projectids: that.value2,
  349. lineids: that.value3,
  350. beginDate: that.value4,
  351. endDate: that.value5,
  352. type: that.TypeClass,
  353. target: '',
  354. sort: ''
  355. },
  356. success(res) {
  357. console.log(res)
  358. var name = [],
  359. data = [],
  360. llfdl = [],
  361. legend = ["实际电量", "计划检修损失", "非计划检修损失", "限电损失", "受累损失", "性能损失"],
  362. data2 = []; //项目列表
  363. res.data.forEach((item, index) => {
  364. name.push(item.name);
  365. data.push([item.sjfdl, item.jhjx, item.fjhjx, item.xd, item.sl, item.xn])
  366. llfdl.push(item.llfdl);
  367. data2.push({
  368. index: index + 1,
  369. name: item.name,
  370. llfdl: item.llfdl,
  371. sjfdl: item.sjfdl,
  372. speed: item.speed,
  373. fjhjx: item.fjhjx,
  374. jhjx: item.jhjx,
  375. sl: item.sl,
  376. xd: item.xd,
  377. xn: item.xn,
  378. fnlly: item.fnlly,
  379. is_light: false
  380. })
  381. })
  382. name.pop();
  383. data.pop();
  384. llfdl.pop();
  385. if (data.length > 0) {
  386. let arr1 = [];
  387. const length = data[0].length;
  388. for (var i = 0; i < length; i++) {
  389. let arr2 = [];
  390. data.forEach(ele => {
  391. arr2.push(ele[i])
  392. });
  393. arr1.push(arr2);
  394. }
  395. that.lineData = llfdl;
  396. that.bardata = {
  397. area: name,
  398. legend: legend,
  399. data: arr1
  400. };
  401. }
  402. that.tableDataEnd = data2[data2.length - 1];
  403. data2.pop();
  404. that.tableData.data = data2;
  405. }
  406. });
  407. },
  408. mxClick() {
  409. this.$router.push("/decision/decision1Mx")
  410. },
  411. onChangePage(params) {
  412. console.log(params);
  413. },
  414. }
  415. };
  416. </script>
  417. <style lang="less">
  418. .decision-page-1 {
  419. .com-panel .panel-title {
  420. line-height: 3.4259vh;
  421. }
  422. .tools {
  423. display: flex;
  424. line-height: 3.4259vh;
  425. .tool-block {
  426. display: flex;
  427. align-items: center;
  428. margin-left: 0.741vh;
  429. .legend {
  430. flex: auto;
  431. width: 0.741vh;
  432. height: 0.741vh;
  433. margin-right: 0.741vh;
  434. &.long {
  435. width: 2.963vh;
  436. height: 0.37vh;
  437. }
  438. }
  439. .legend-text {
  440. color: @gray-l;
  441. font-size: @fontsize-s;
  442. }
  443. }
  444. }
  445. .project-table {
  446. overflow: auto;
  447. tbody {
  448. height: calc(100vh - 24.5vh);
  449. }
  450. td {
  451. color: #b2bdc0;
  452. }
  453. }
  454. .contentMx {
  455. width: 100%;
  456. overflow-x: auto;
  457. }
  458. .activeMx {
  459. width: 150%;
  460. }
  461. }
  462. </style>