Decision1Mx.vue 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328
  1. <template>
  2. <div class="decision-page-1">
  3. <div class="query-form">
  4. <!-- mg-b-8-->
  5. <div class="station">
  6. 场站:
  7. <el-select
  8. size="mini"
  9. v-model="value1"
  10. @change="ChangZhanChange(value1)"
  11. clearable
  12. placeholder="请选择"
  13. popper-class="select"
  14. >
  15. <el-option
  16. v-for="item in ChangZhan"
  17. :key="item.id"
  18. :value="item.id"
  19. :label="item.name"
  20. >
  21. </el-option>
  22. </el-select>
  23. </div>
  24. <div class="station">
  25. 项目:
  26. <el-select
  27. size="mini"
  28. v-model="value2"
  29. @change="XiangMuChange(value2)"
  30. multiple
  31. collapse-tags
  32. placeholder="请选择"
  33. popper-class="select"
  34. >
  35. <el-option
  36. v-for="item in XiangMu"
  37. :key="item.id"
  38. :value="item.id"
  39. :label="item.name"
  40. >
  41. </el-option>
  42. </el-select>
  43. </div>
  44. <div class="station">
  45. 线路:
  46. <el-select
  47. size="mini"
  48. v-model="value3"
  49. @change="XianLuChange(value3)"
  50. multiple
  51. collapse-tags
  52. placeholder="请选择"
  53. popper-class="select"
  54. >
  55. <el-option
  56. v-for="item in XianLu"
  57. :key="item.id"
  58. :label="item.name"
  59. :value="item.id"
  60. >
  61. </el-option>
  62. </el-select>
  63. </div>
  64. <div class="dates">
  65. 开始日期:
  66. <div class="search-input">
  67. <el-date-picker
  68. size="mini"
  69. v-model="value4"
  70. @change="BeginChange(value4)"
  71. type="date"
  72. value-format="YYYY-MM-DD"
  73. placeholder="选择日期"
  74. popper-class="date-select"
  75. >
  76. </el-date-picker>
  77. </div>
  78. </div>
  79. <div class="dates">
  80. 结束日期:
  81. <div class="search-input">
  82. <el-date-picker
  83. size="mini"
  84. v-model="value5"
  85. @change="EndChange(value5)"
  86. type="date"
  87. value-format="YYYY-MM-DD"
  88. placeholder="选择日期"
  89. popper-class="date-select"
  90. >
  91. </el-date-picker>
  92. <!-- <div class="unit svg-icon svg-icon-gray">
  93. <svg-icon :svgid="''" />
  94. </div> -->
  95. </div>
  96. </div>
  97. <div class="query-actions">
  98. <el-button round size="mini" class="btn" @click="mxClick"
  99. >搜索</el-button
  100. >
  101. <el-button round size="mini" class="btn green" @click="AjaxCommon"
  102. >明细信息</el-button
  103. >
  104. <el-button round size="mini" class="btn" @click="exportExcel"
  105. >导出</el-button
  106. >
  107. </div>
  108. </div>
  109. <div class="tabCut1">
  110. <div
  111. class="tabCut-item"
  112. @click="TypeClick(val.id)"
  113. :class="TypeClass === val.id ? 'green1' : ''"
  114. v-for="val in typeOptions"
  115. :key="val.id"
  116. >
  117. <span>{{ val.name }}</span>
  118. </div>
  119. </div>
  120. <!-- <div class="performance-title">
  121. <div class="left-title">风机绩效榜</div>
  122. <div class="right-title">项目列表</div>
  123. </div> -->
  124. <div class="performance" style="height: 90vh">
  125. <div class="economicTable" style="height: 86vh">
  126. <el-table
  127. :data="tableData.data"
  128. size="mini"
  129. :cell-style="{ padding: '6px' }"
  130. :row-style="{ height: '0px' }"
  131. cell-class-name="table_cell"
  132. stripe
  133. @header-click="onHeaderClick"
  134. >
  135. <el-table-column prop="" label="" width="1050"> </el-table-column>
  136. <el-table-column align="center" prop="" label="" type="index">
  137. </el-table-column>
  138. <el-table-column align="center" prop="name" label="名称" width="180">
  139. </el-table-column>
  140. <el-table-column
  141. align="center"
  142. prop="llfdl"
  143. label="理论发电量"
  144. width="100"
  145. >
  146. </el-table-column>
  147. <el-table-column
  148. align="center"
  149. prop="sjfdl"
  150. label="实际发电量"
  151. width="100"
  152. >
  153. </el-table-column>
  154. <el-table-column
  155. align="center"
  156. prop="fnlly"
  157. label="风能利用率%"
  158. width="140"
  159. >
  160. </el-table-column>
  161. <el-table-column
  162. align="center"
  163. prop="speed"
  164. show-overflow-tooltip
  165. label="风速"
  166. >
  167. </el-table-column>
  168. <el-table-column align="center" prop="fjhjx1" label="故障损失">
  169. </el-table-column>
  170. <el-table-column align="center" prop="fjhjx2" label="故障受累">
  171. </el-table-column>
  172. <el-table-column align="center" prop="jhjx1" label="检修损失">
  173. </el-table-column>
  174. <el-table-column align="center" prop="jhjx2" label="检修受累">
  175. </el-table-column>
  176. <el-table-column align="center" prop="sl1" label="电网受累">
  177. </el-table-column>
  178. <el-table-column align="center" prop="sl2" label="天气受累">
  179. </el-table-column>
  180. <el-table-column align="center" prop="xd1" label="限电降出">
  181. </el-table-column>
  182. <el-table-column align="center" prop="xd2" label="限电停机">
  183. </el-table-column>
  184. <el-table-column align="center" prop="xn1" label="待风损失">
  185. </el-table-column>
  186. <el-table-column align="center" prop="xn2" label="手动停机">
  187. </el-table-column>
  188. <el-table-column align="center" prop="xn3" label="正常发电">
  189. </el-table-column>
  190. <el-table-column align="center" prop="xn4" label="缺陷降出">
  191. </el-table-column>
  192. </el-table>
  193. </div>
  194. <div class="left">
  195. <bar-line-chart
  196. v-if="showDisplay"
  197. :height="height"
  198. :bardata="bardata"
  199. :lineData="lineData"
  200. :color="barColor"
  201. lineName="理论发电量"
  202. />
  203. <div class="lyl" :style="{ height: tableData.data.length * 35 + 'px' }">
  204. <div
  205. class="lyl-item"
  206. v-for="(item, index) in tableData.data"
  207. :key="index"
  208. >
  209. {{ item.fnlly }}%
  210. <img class="lyl-item-img" src="@assets/images/fnlyl.png" />
  211. </div>
  212. </div>
  213. <div class="dashed" :style="{ height: height }"></div>
  214. </div>
  215. </div>
  216. <!-- <div class="contentMx">
  217. <div class="activeMx">
  218. <el-row :type="'flex'" class="content">
  219. <el-col :span="10" class="pd-r-8">
  220. <toolbar-panel title="风机绩效榜明细(万kWh)" :showLine="false">
  221. <bar-line-chart
  222. :height="'calc(100vh - 250px)'"
  223. :bardata="bardata"
  224. :lineData="lineData"
  225. :color="barColor"
  226. lineName="理论发电量"
  227. />
  228. </toolbar-panel>
  229. </el-col>
  230. <el-col :span="14" class="pd-l-8">
  231. <panel :title="'项目列表'" :showLine="false">
  232. <div class="project-table">
  233. <Table :data="tableData">
  234. <template v-slot:tr v-if="tableData.data.length > 0">
  235. <tr>
  236. <td>
  237. {{ tableDataEnd.index }}
  238. </td>
  239. <td style="width: 150px">
  240. {{ tableDataEnd.name }}
  241. </td>
  242. <td>
  243. {{ tableDataEnd.llfdl }}
  244. </td>
  245. <td>
  246. {{ tableDataEnd.sjfdl }}
  247. </td>
  248. <td>
  249. {{ tableDataEnd.speed }}
  250. </td>
  251. <td>
  252. {{ tableDataEnd.fjhjx1 }}
  253. </td>
  254. <td>
  255. {{ tableDataEnd.fjhjx2 }}
  256. </td>
  257. <td>
  258. {{ tableDataEnd.jhjx1 }}
  259. </td>
  260. <td>
  261. {{ tableDataEnd.jhjx2 }}
  262. </td>
  263. <td>
  264. {{ tableDataEnd.sl1 }}
  265. </td>
  266. <td>
  267. {{ tableDataEnd.sl2 }}
  268. </td>
  269. <td>
  270. {{ tableDataEnd.xd1 }}
  271. </td>
  272. <td>
  273. {{ tableDataEnd.xd2 }}
  274. </td>
  275. <td>
  276. {{ tableDataEnd.xn1 }}
  277. </td>
  278. <td>
  279. {{ tableDataEnd.xn2 }}
  280. </td>
  281. <td>
  282. {{ tableDataEnd.xn3 }}
  283. </td>
  284. <td>
  285. {{ tableDataEnd.xn4 }}
  286. </td>
  287. <td>
  288. {{ tableDataEnd.fnlly }}
  289. </td>
  290. </tr>
  291. </template>
  292. </Table>
  293. </div>
  294. </panel>
  295. </el-col>
  296. </el-row>
  297. </div>
  298. </div> -->
  299. </div>
  300. </template>
  301. <script>
  302. import BarLineChart from "../../components/chart/combination/bar-line-chart.vue";
  303. import SvgIcon from "../../components/coms/icon/svg-icon.vue";
  304. import Panel from "../../components/coms/panel/panel.vue";
  305. import ToolbarPanel from "../../components/coms/panel/toolbar-panel.vue";
  306. import Table from "./table.vue";
  307. import partten from "@/helper/partten.js";
  308. import api from "@api/economic/index.js";
  309. export default {
  310. components: {
  311. ToolbarPanel,
  312. BarLineChart,
  313. Panel,
  314. Table,
  315. partten,
  316. SvgIcon,
  317. },
  318. data() {
  319. return {
  320. tableData: {
  321. column: [
  322. {
  323. name: "",
  324. field: "index",
  325. is_num: false,
  326. is_light: false,
  327. },
  328. {
  329. name: "名称",
  330. field: "name",
  331. width: "150px",
  332. is_num: false,
  333. is_light: false,
  334. },
  335. {
  336. name: "理论发电量(万kWh)",
  337. field: "llfdl",
  338. is_num: false,
  339. is_light: false,
  340. sortable: true,
  341. },
  342. {
  343. name: "SCADA发电量(万kWh)",
  344. field: "sjfdl",
  345. is_num: false,
  346. is_light: false,
  347. sortable: true,
  348. },
  349. {
  350. name: "风速(m/s)",
  351. field: "speed",
  352. is_num: false,
  353. is_light: false,
  354. sortable: true,
  355. },
  356. {
  357. name: "故障损失(万kWh)",
  358. field: "fjhjx1",
  359. is_num: false,
  360. is_light: false,
  361. sortable: true,
  362. },
  363. {
  364. name: "故障受累(万kWh)",
  365. field: "fjhjx2",
  366. is_num: false,
  367. is_light: false,
  368. sortable: true,
  369. },
  370. {
  371. name: "检修损失(万kWh)",
  372. field: "jhjx1",
  373. is_num: false,
  374. is_light: false,
  375. sortable: true,
  376. },
  377. {
  378. name: "检修受累(万kWh)",
  379. field: "jhjx2",
  380. is_num: false,
  381. is_light: false,
  382. sortable: true,
  383. },
  384. {
  385. name: "电网受累(万kWh)",
  386. field: "sl1",
  387. is_num: false,
  388. is_light: false,
  389. sortable: true,
  390. },
  391. {
  392. name: "天气受累(万kWh)",
  393. field: "sl2",
  394. is_num: false,
  395. is_light: false,
  396. sortable: true,
  397. },
  398. {
  399. name: "限电降出(万kWh)",
  400. field: "xd1",
  401. is_num: false,
  402. is_light: false,
  403. sortable: true,
  404. },
  405. {
  406. name: "限电停机(万kWh)",
  407. field: "xd2",
  408. is_num: false,
  409. is_light: false,
  410. sortable: true,
  411. },
  412. {
  413. name: "待风损失(万kWh)",
  414. field: "xn1",
  415. is_num: false,
  416. is_light: false,
  417. sortable: true,
  418. },
  419. {
  420. name: "手动停机(万kWh)",
  421. field: "xn2",
  422. is_num: false,
  423. is_light: false,
  424. sortable: true,
  425. },
  426. {
  427. name: "正常发电(万kWh)",
  428. field: "xn3",
  429. is_num: false,
  430. is_light: false,
  431. sortable: true,
  432. },
  433. {
  434. name: "缺陷降出(万kWh)",
  435. field: "xn4",
  436. is_num: false,
  437. is_light: false,
  438. sortable: true,
  439. },
  440. {
  441. name: "风能利用率%",
  442. field: "fnlly",
  443. is_num: false,
  444. is_light: false,
  445. sortable: true,
  446. },
  447. ],
  448. data: [],
  449. },
  450. tableDataEnd: [], //合计
  451. ChangZhan: [], //场站
  452. XiangMu: [], //项目
  453. XianLu: [], //线路
  454. value1: [],
  455. value2: [],
  456. value3: [],
  457. value4: "",
  458. value5: "",
  459. barColor: [
  460. partten.getColor("purple"),
  461. partten.getColor("green"),
  462. partten.getColor("pink"),
  463. partten.getColor("red"),
  464. partten.getColor("orange"),
  465. partten.getColor("grayl"),
  466. partten.getColor("yellow"),
  467. partten.getColor("gray"),
  468. partten.getColor("blue"),
  469. partten.getColor("cyan"),
  470. partten.getColor("brown"),
  471. partten.getColor("mauve"),
  472. ],
  473. TypeClass: "1", //风场,项目,集电线路 的按钮颜色,默认第一个
  474. typeOptions: [
  475. { id: "1", name: "风场" },
  476. { id: "2", name: "项目" },
  477. { id: "3", name: "集电线路" },
  478. ],
  479. bardata: [],
  480. lineData: [],
  481. showDisplay: true,
  482. height: "858px",
  483. sort: "",
  484. target: "",
  485. sortList: [
  486. {
  487. id: "name",
  488. sort: false,
  489. },
  490. {
  491. id: "llfdl",
  492. sort: false,
  493. },
  494. {
  495. id: "sjfdl",
  496. sort: false,
  497. },
  498. {
  499. id: "speed",
  500. sort: false,
  501. },
  502. {
  503. id: "fjhjx1",
  504. sort: false,
  505. },
  506. {
  507. id: "fjhjx2",
  508. sort: false,
  509. },
  510. {
  511. id: "jhjx1",
  512. sort: false,
  513. },
  514. {
  515. id: "jhjx2",
  516. sort: false,
  517. },
  518. {
  519. id: "sl1",
  520. sort: false,
  521. },
  522. {
  523. id: "sl2",
  524. sort: false,
  525. },
  526. {
  527. id: "xd1",
  528. sort: false,
  529. },
  530. {
  531. id: "xd2",
  532. sort: false,
  533. },
  534. {
  535. id: "xn1",
  536. sort: false,
  537. },
  538. {
  539. id: "xn2",
  540. sort: false,
  541. },
  542. {
  543. id: "xn3",
  544. sort: false,
  545. },
  546. {
  547. id: "xn4",
  548. sort: false,
  549. },
  550. {
  551. id: "fnlly",
  552. sort: false,
  553. },
  554. ],
  555. };
  556. },
  557. created() {
  558. this.ChangZhanVal();
  559. this.value4 = this.getTime(1);
  560. this.value5 = this.getTime(2);
  561. this.AjaxCommon();
  562. },
  563. methods: {
  564. ChangZhanVal() {
  565. api.benchmarkingWplist({}).then((res) => {
  566. this.ChangZhan = res.data;
  567. });
  568. },
  569. ChangZhanChange(val) {
  570. this.TypeClass = "";
  571. this.value1 = val;
  572. this.value2 = [];
  573. this.value3 = [];
  574. this.AjaxCommon();
  575. this.XiangMuVal(val);
  576. },
  577. XiangMuVal(val) {
  578. api
  579. .benchmarkingProjectList({
  580. wpids: val,
  581. })
  582. .then((res) => {
  583. this.XiangMu = res.data;
  584. });
  585. },
  586. XiangMuChange(val) {
  587. this.TypeClass = "";
  588. this.value2 = val;
  589. this.value3 = [];
  590. this.AjaxCommon();
  591. this.XianLuVal(val);
  592. },
  593. XianLuVal(val) {
  594. api
  595. .benchmarkingLineList({
  596. projects: val,
  597. })
  598. .then((res) => {
  599. this.XianLu = res.data;
  600. });
  601. },
  602. XianLuChange(val) {
  603. this.TypeClass = "";
  604. this.value3 = val;
  605. this.AjaxCommon();
  606. },
  607. BeginChange(val) {
  608. this.value4 = val;
  609. this.AjaxCommon();
  610. },
  611. EndChange(val) {
  612. this.value5 = val;
  613. this.AjaxCommon();
  614. },
  615. TypeClick(val) {
  616. this.TypeClass = val;
  617. // 重置状态start
  618. this.value1 = [];
  619. this.value2 = [];
  620. this.value3 = [];
  621. // this.value4 = this.getTime(1);
  622. // this.value5 = this.getTime(2);
  623. this.AjaxCommon();
  624. // 重置状态end
  625. },
  626. getTime(val) {
  627. //时间戳处理,val=1是默认开始时间(当前月第一天),val=2是默认结束时间(今天)
  628. var date = new Date();
  629. var year = date.getFullYear(),
  630. month = date.getMonth() + 1,
  631. day = date.getDate();
  632. month >= 1 && month <= 9 ? (month = "0" + month) : "";
  633. day >= 0 && day <= 9 ? (day = "0" + day) : "";
  634. var begin = year + "-" + month + "-01";
  635. var end = year + "-" + month + "-" + day;
  636. if (val == 1) {
  637. return begin;
  638. } else if (val == 2) {
  639. return end;
  640. }
  641. },
  642. // AjaxCommon() {
  643. // var that = this;
  644. // that.API.requestData({
  645. // method: "GET",
  646. // baseURL: "http://10.83.66.220:8020/",
  647. // subUrl: "http://10.83.66.220:8020/mx",
  648. // data: {
  649. // wpids: that.value1,
  650. // projectids: that.value2,
  651. // lineids: that.value3,
  652. // beginDate: that.value4,
  653. // endDate: that.value5,
  654. // type: that.TypeClass,
  655. // target: "",
  656. // sort: "",
  657. // },
  658. // success(res) {
  659. // var name = [],
  660. // data = [],
  661. // llfdl = [],
  662. // legend = [
  663. // "实际电量",
  664. // "故障损失",
  665. // "故障受累",
  666. // "检修受累",
  667. // "电网受累",
  668. // "天气受累",
  669. // "限电降出",
  670. // "限电停机",
  671. // "待风损失",
  672. // "手动停机",
  673. // "正常发电",
  674. // "缺陷降出",
  675. // ],
  676. // data2 = []; //项目列表
  677. // if (that.value1.length) {
  678. // let arr = [];
  679. // let hj = res.data.pop();
  680. // res.data.forEach((ele, index) => {
  681. // arr[ele.id.split("_")[1] - 1] = ele;
  682. // });
  683. // arr.push(hj);
  684. // res.data = arr;
  685. // }
  686. // res.data.forEach((item, index) => {
  687. // name.push(item.name);
  688. // llfdl.push(item.llfdl);
  689. // data.push([
  690. // item.sjfdl,
  691. // item.fjhjx1,
  692. // item.fjhjx2,
  693. // item.jhjx1,
  694. // item.jhjx2,
  695. // item.sl1,
  696. // item.sl2,
  697. // item.xd1,
  698. // item.xd2,
  699. // item.xn1,
  700. // item.xn2,
  701. // item.xn3,
  702. // item.xn4,
  703. // ]);
  704. // data2.push({
  705. // index: index + 1,
  706. // name: item.name,
  707. // llfdl: item.llfdl,
  708. // sjfdl: item.sjfdl,
  709. // speed: item.speed,
  710. // fjhjx1: item.fjhjx1,
  711. // fjhjx2: item.fjhjx2,
  712. // jhjx1: item.jhjx1,
  713. // jhjx2: item.jhjx2,
  714. // sl1: item.sl1,
  715. // sl2: item.sl2,
  716. // xd1: item.xd1,
  717. // xd2: item.xd2,
  718. // xn1: item.xn1,
  719. // xn2: item.xn2,
  720. // xn3: item.xn3,
  721. // xn4: item.xn4,
  722. // fnlly: item.fnlly,
  723. // is_light: false,
  724. // });
  725. // });
  726. // name.pop();
  727. // data.pop();
  728. // llfdl.pop();
  729. // if (data.length > 0) {
  730. // let arr1 = [];
  731. // const length = data[0].length;
  732. // for (var i = 0; i < length; i++) {
  733. // let arr2 = [];
  734. // data.forEach((ele) => {
  735. // arr2.push(ele[i]);
  736. // });
  737. // arr1.push(arr2);
  738. // }
  739. // that.lineData = llfdl;
  740. // that.bardata = {
  741. // area: name,
  742. // legend: legend,
  743. // data: arr1,
  744. // };
  745. // }
  746. // that.tableDataEnd = data2[data2.length - 1];
  747. // data2.pop();
  748. // that.tableData.data = data2;
  749. // },
  750. // });
  751. // },
  752. mxClick() {
  753. this.$router.push("/decision/decision1");
  754. },
  755. formatJson(filterVal, jsonData) {
  756. return jsonData.map((v) => filterVal.map((j) => v[j]));
  757. },
  758. exportExcel() {
  759. let that = this;
  760. const { export_json_to_excel } = require("@tools/excel/Export2Excel.js"); // 注意这个Export2Excel路径
  761. let tHeader = []; // 上面设置Excel的表格第一行的标题
  762. let filterVal = []; // 上面的index、nickName、name是tableData里对象的属性key值
  763. // var that = this;
  764. // that.API.requestData({
  765. // method: "GET",
  766. // baseURL: "http://10.83.66.220:8020/",
  767. // subUrl: "benchmarking/projectList",
  768. // data: {
  769. // wpids: val,
  770. // },
  771. // success(res) {
  772. // that.XiangMu = res.data;
  773. // },
  774. // });
  775. },
  776. XiangMuChange(val) {
  777. this.TypeClass = "";
  778. this.value2 = val;
  779. this.value3 = [];
  780. this.AjaxCommon();
  781. this.XianLuVal(val);
  782. },
  783. XianLuVal(val) {
  784. api
  785. .benchmarkingLineList({
  786. projects: val,
  787. })
  788. .then((res) => {
  789. this.XianLu = res.data;
  790. });
  791. // var that = this;
  792. // that.API.requestData({
  793. // method: "GET",
  794. // baseURL: "http://10.83.66.220:8020/",
  795. // subUrl: "benchmarking/lineList",
  796. // data: {
  797. // projects: val,
  798. // },
  799. // success(res) {
  800. // that.XianLu = res.data;
  801. // },
  802. // });
  803. },
  804. XianLuChange(val) {
  805. this.TypeClass = "";
  806. this.value3 = val;
  807. this.AjaxCommon();
  808. },
  809. BeginChange(val) {
  810. this.value4 = val;
  811. this.AjaxCommon();
  812. },
  813. EndChange(val) {
  814. this.value5 = val;
  815. this.AjaxCommon();
  816. },
  817. TypeClick(val) {
  818. this.TypeClass = val;
  819. // 重置状态start
  820. this.value1 = [];
  821. this.value2 = [];
  822. this.value3 = [];
  823. this.value4 = this.getTime(1);
  824. this.value5 = this.getTime(2);
  825. this.AjaxCommon();
  826. // 重置状态end
  827. },
  828. getTime(val) {
  829. //时间戳处理,val=1是默认开始时间(当前月第一天),val=2是默认结束时间(今天)
  830. var date = new Date();
  831. var year = date.getFullYear(),
  832. month = date.getMonth() + 1,
  833. day = date.getDate();
  834. month >= 1 && month <= 9 ? (month = "0" + month) : "";
  835. day >= 0 && day <= 9 ? (day = "0" + day) : "";
  836. var begin = year + "-" + month + "-01";
  837. var end = year + "-" + month + "-" + day;
  838. if (val == 1) {
  839. return begin;
  840. } else if (val == 2) {
  841. return end;
  842. }
  843. },
  844. onHeaderClick(column) {
  845. console.log(column);
  846. this.target = column.property;
  847. this.sortList.forEach((item) => {
  848. if (item.id === column.property) {
  849. item.sort = !item.sort;
  850. this.sort = item.sort ? 1 : 2;
  851. } else {
  852. item.sort = false;
  853. }
  854. });
  855. this.AjaxCommon();
  856. },
  857. AjaxCommon() {
  858. api
  859. .benchmarkingmx({
  860. wpids: this.value1,
  861. projectids: this.value2,
  862. lineids: this.value3,
  863. beginDate: this.value4,
  864. endDate: this.value5,
  865. type: this.TypeClass,
  866. target: this.target,
  867. sort: this.sort,
  868. })
  869. .then((res) => {
  870. var name = [],
  871. data = [],
  872. llfdl = [],
  873. legend = [
  874. "实际电量",
  875. "故障损失",
  876. "故障受累",
  877. "检修受累",
  878. "电网受累",
  879. "天气受累",
  880. "限电降出",
  881. "限电停机",
  882. "待风损失",
  883. "手动停机",
  884. "正常发电",
  885. "缺陷降出",
  886. ],
  887. data2 = []; //项目列表
  888. res.data.forEach((item, index) => {
  889. name.push(item.name);
  890. llfdl.push(item.llfdl);
  891. data.push([
  892. item.sjfdl,
  893. item.fjhjx1,
  894. item.fjhjx2,
  895. item.jhjx1,
  896. item.jhjx2,
  897. item.sl1,
  898. item.sl2,
  899. item.xd1,
  900. item.xd2,
  901. item.xn1,
  902. item.xn2,
  903. item.xn3,
  904. item.xn4,
  905. ]);
  906. data2.push({
  907. index: index + 1,
  908. name: item.name,
  909. llfdl: item.llfdl,
  910. sjfdl: item.sjfdl,
  911. speed: item.speed,
  912. fjhjx1: item.fjhjx1,
  913. fjhjx2: item.fjhjx2,
  914. jhjx1: item.jhjx1,
  915. jhjx2: item.jhjx2,
  916. sl1: item.sl1,
  917. sl2: item.sl2,
  918. xd1: item.xd1,
  919. xd2: item.xd2,
  920. xn1: item.xn1,
  921. xn2: item.xn2,
  922. xn3: item.xn3,
  923. xn4: item.xn4,
  924. fnlly: item.fnlly,
  925. is_light: false,
  926. });
  927. });
  928. name.pop();
  929. data.pop();
  930. llfdl.pop();
  931. if (data.length > 0) {
  932. let arr1 = [];
  933. const length = data[0].length;
  934. for (var i = 0; i < length; i++) {
  935. let arr2 = [];
  936. data.forEach((ele) => {
  937. arr2.push(ele[i]);
  938. });
  939. arr1.push(arr2);
  940. }
  941. this.lineData = llfdl;
  942. this.bardata = {
  943. area: name,
  944. legend: legend,
  945. data: arr1,
  946. };
  947. }
  948. // if (this.lineData.length > 22) {
  949. // this.height = this.lineData.length * 35 + 148 + "px";
  950. // } else if (this.lineData.length == 14) {
  951. // this.height = 23 * 35 + 36 + "px";
  952. // } else {
  953. // this.height = 23 * 35 + "px";
  954. // }
  955. if (this.lineData.length > 22) {
  956. this.height = this.lineData.length * 35 + 85 + "px";
  957. } else if (this.lineData.length == 14) {
  958. this.height = 22 * 35 + 46 + "px";
  959. } else {
  960. this.height = 21 * 35 + 46 + "px";
  961. }
  962. this.showDisplay = false;
  963. setTimeout(() => {
  964. this.showDisplay = true;
  965. }, 10);
  966. this.tableDataEnd = data2[data2.length - 1];
  967. data2.pop();
  968. this.tableData.data = data2;
  969. });
  970. // var that = this;
  971. // that.API.requestData({
  972. // method: "GET",
  973. // baseURL: "http://10.83.66.220:8020/",
  974. // subUrl: "http://10.83.66.220:8020/mx",
  975. // data: {
  976. // wpids: that.value1,
  977. // projectids: that.value2,
  978. // lineids: that.value3,
  979. // beginDate: that.value4,
  980. // endDate: that.value5,
  981. // type: that.TypeClass,
  982. // target: "",
  983. // sort: "",
  984. // },
  985. // success(res) {
  986. // console.log(res);
  987. // var name = [],
  988. // data = [],
  989. // llfdl = [],
  990. // legend = [
  991. // "实际电量",
  992. // "故障损失",
  993. // "故障受累",
  994. // "检修受累",
  995. // "电网受累",
  996. // "天气受累",
  997. // "限电降出",
  998. // "限电停机",
  999. // "待风损失",
  1000. // "手动停机",
  1001. // "正常发电",
  1002. // "缺陷降出",
  1003. // ],
  1004. // data2 = []; //项目列表
  1005. // res.data.forEach((item, index) => {
  1006. // name.push(item.name);
  1007. // llfdl.push(item.llfdl);
  1008. // data.push([
  1009. // item.sjfdl,
  1010. // item.fjhjx1,
  1011. // item.fjhjx2,
  1012. // item.jhjx1,
  1013. // item.jhjx2,
  1014. // item.sl1,
  1015. // item.sl2,
  1016. // item.xd1,
  1017. // item.xd2,
  1018. // item.xn1,
  1019. // item.xn2,
  1020. // item.xn3,
  1021. // item.xn4,
  1022. // ]);
  1023. // data2.push({
  1024. // index: index + 1,
  1025. // name: item.name,
  1026. // llfdl: item.llfdl,
  1027. // sjfdl: item.sjfdl,
  1028. // speed: item.speed,
  1029. // fjhjx1: item.fjhjx1,
  1030. // fjhjx2: item.fjhjx2,
  1031. // jhjx1: item.jhjx1,
  1032. // jhjx2: item.jhjx2,
  1033. // sl1: item.sl1,
  1034. // sl2: item.sl2,
  1035. // xd1: item.xd1,
  1036. // xd2: item.xd2,
  1037. // xn1: item.xn1,
  1038. // xn2: item.xn2,
  1039. // xn3: item.xn3,
  1040. // xn4: item.xn4,
  1041. // fnlly: item.fnlly,
  1042. // is_light: false,
  1043. // });
  1044. // });
  1045. // name.pop();
  1046. // data.pop();
  1047. // llfdl.pop();
  1048. // if (data.length > 0) {
  1049. // let arr1 = [];
  1050. // const length = data[0].length;
  1051. // for (var i = 0; i < length; i++) {
  1052. // let arr2 = [];
  1053. // data.forEach((ele) => {
  1054. // arr2.push(ele[i]);
  1055. // });
  1056. // arr1.push(arr2);
  1057. // }
  1058. // that.lineData = llfdl;
  1059. // that.bardata = {
  1060. // area: name,
  1061. // legend: legend,
  1062. // data: arr1,
  1063. // };
  1064. // }
  1065. // that.tableDataEnd = data2[data2.length - 1];
  1066. // data2.pop();
  1067. // that.tableData.data = data2;
  1068. // },
  1069. // });
  1070. },
  1071. mxClick() {
  1072. this.$router.push("/decision/decision1");
  1073. },
  1074. formatJson(filterVal, jsonData) {
  1075. return jsonData.map((v) => filterVal.map((j) => v[j]));
  1076. },
  1077. exportExcel() {
  1078. let that = this;
  1079. const { export_json_to_excel } = require("@tools/excel/Export2Excel.js"); // 注意这个Export2Excel路径
  1080. let tHeader = []; // 上面设置Excel的表格第一行的标题
  1081. let filterVal = []; // 上面的index、nickName、name是tableData里对象的属性key值
  1082. that.tableData.column.forEach((ele) => {
  1083. tHeader.push(ele.name);
  1084. filterVal.push(ele.field);
  1085. });
  1086. var list = [];
  1087. that.tableData.data.forEach((i, index) => {
  1088. list.push(i);
  1089. });
  1090. list.push(that.tableDataEnd);
  1091. const data = that.formatJson(filterVal, list);
  1092. export_json_to_excel(tHeader, data, "导出的Excel"); // 最后一个是表名字
  1093. },
  1094. },
  1095. };
  1096. </script>
  1097. <style lang="less" scoped>
  1098. .decision-page-1 {
  1099. height: 93vh;
  1100. display: flex;
  1101. flex-direction: column;
  1102. // 新样式
  1103. .performance-title {
  1104. display: flex;
  1105. height: 41px;
  1106. justify-content: space-between;
  1107. align-items: center;
  1108. .left-title,
  1109. .right-title {
  1110. width: 45.8%;
  1111. padding-left: 30px;
  1112. }
  1113. }
  1114. .performance {
  1115. display: flex;
  1116. flex-direction: row;
  1117. width: 98.5%;
  1118. background-color: rgba(0, 0, 0, 0.4);
  1119. border-radius: 5px;
  1120. overflow-y: auto;
  1121. position: relative;
  1122. margin-top: 10px;
  1123. .left {
  1124. width: 53%;
  1125. height: 100%;
  1126. position: absolute;
  1127. left: 0;
  1128. top: 0;
  1129. display: flex;
  1130. flex-direction: row;
  1131. .dashed {
  1132. position: absolute;
  1133. width: 1px;
  1134. background-image: linear-gradient(
  1135. #3a4043 0%,
  1136. #3a4043 40%,
  1137. transparent 50%
  1138. );
  1139. background-size: 1px 9px;
  1140. margin-top: 45px;
  1141. height: 100%;
  1142. right: -50px;
  1143. }
  1144. }
  1145. .lyl {
  1146. display: flex;
  1147. flex-direction: column;
  1148. align-items: center;
  1149. width: 70px;
  1150. font-size: 14px;
  1151. font-family: Arial;
  1152. font-weight: 400;
  1153. color: #1c98fe;
  1154. margin-top: 27px;
  1155. margin-left: 10px;
  1156. }
  1157. .lyl-item {
  1158. display: flex;
  1159. align-items: center;
  1160. justify-content: center;
  1161. height: 35px;
  1162. position: relative;
  1163. width: 120px;
  1164. }
  1165. .lyl-item-img {
  1166. position: absolute;
  1167. left: 0;
  1168. bottom: 0;
  1169. // height: 33px;
  1170. }
  1171. .dashed {
  1172. width: 1px;
  1173. background-image: linear-gradient(
  1174. #3a4043 0%,
  1175. #3a4043 40%,
  1176. transparent 50%
  1177. );
  1178. background-size: 1px 9px;
  1179. margin-top: 45px;
  1180. }
  1181. .dashed1 {
  1182. width: 1px;
  1183. background-image: linear-gradient(
  1184. #3a4043 0%,
  1185. #3a4043 40%,
  1186. transparent 50%
  1187. );
  1188. background-size: 1px 9px;
  1189. margin-top: 45px;
  1190. margin-left: 20px;
  1191. }
  1192. .table {
  1193. width: 48%;
  1194. // background-color: yellowgreen;
  1195. }
  1196. .table_cell .cell {
  1197. white-space: nowrap;
  1198. }
  1199. }
  1200. }
  1201. .contentMx::-webkit-scrollbar {
  1202. width: 10px;
  1203. height: 20px;
  1204. }
  1205. .contentMx::-webkit-scrollbar-track-piece {
  1206. background-color: rgba(255, 255, 255, 0.05);
  1207. -webkit-border-radius: 4px;
  1208. }
  1209. .contentMx::-webkit-scrollbar-thumb {
  1210. background-color: fade(@gray, 75);
  1211. -webkit-border-radius: 4px;
  1212. outline: none;
  1213. outline-offset: 0px;
  1214. border: none;
  1215. }
  1216. .decision-page-1 {
  1217. .com-panel .panel-title {
  1218. line-height: 3.4259vh;
  1219. }
  1220. .tools {
  1221. display: flex;
  1222. line-height: 3.4259vh;
  1223. .tool-block {
  1224. display: flex;
  1225. align-items: center;
  1226. margin-left: 0.741vh;
  1227. .legend {
  1228. flex: auto;
  1229. width: 0.741vh;
  1230. height: 0.741vh;
  1231. margin-right: 0.741vh;
  1232. &.long {
  1233. width: 2.963vh;
  1234. height: 0.37vh;
  1235. }
  1236. }
  1237. .legend-text {
  1238. color: @gray-l;
  1239. font-size: @fontsize-s;
  1240. }
  1241. }
  1242. }
  1243. .project-table {
  1244. overflow: auto;
  1245. tbody {
  1246. height: calc(100vh - 31.5vh);
  1247. }
  1248. td {
  1249. color: #b2bdc0;
  1250. }
  1251. }
  1252. .contentMx {
  1253. width: 100%;
  1254. overflow-x: auto;
  1255. }
  1256. .activeMx {
  1257. width: 130%;
  1258. }
  1259. }
  1260. .main {
  1261. overflow: auto;
  1262. }
  1263. // .main .main-body{height: calc(100vh - 6.63vh);}
  1264. .bg-olive {
  1265. background-color: #8dc63f;
  1266. color: #ffffff;
  1267. }
  1268. .bg-cyan {
  1269. background-color: #1cbbb4;
  1270. }
  1271. .bg-mauve {
  1272. background-color: #9c26b0;
  1273. }
  1274. .bg-pink {
  1275. background-color: #e03997;
  1276. }
  1277. .bg-brown {
  1278. background-color: #a5673f;
  1279. }
  1280. .bg-pink2 {
  1281. background-color: #ff0099;
  1282. }
  1283. .bg-blue2 {
  1284. background-color: #07abf5;
  1285. }
  1286. .bg-green2 {
  1287. background-color: #1d3638;
  1288. }
  1289. </style>