Decision1Mx.vue 38 KB

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