Decision2Xmdb.vue 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497
  1. <template>
  2. <div class="decision-page-2">
  3. <div class="query-form">
  4. <div class="station1">
  5. 场站:
  6. <el-select
  7. v-model="value1"
  8. @change="ChangZhanChange(value1)"
  9. size="mini"
  10. multiple
  11. collapse-tags
  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="station1">
  25. 项目:
  26. <el-select
  27. v-model="value2"
  28. @change="XiangMuChange(value2)"
  29. size="mini"
  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="station1">
  45. 线路:
  46. <el-select
  47. v-model="value3"
  48. @change="XianLuChange(value3)"
  49. size="mini"
  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 class="btn green" @click="AjaxCommon()">搜索</el-button>
  99. <el-button round class="btn" @click="dbfx">对标分析</el-button>
  100. <el-button round class="btn" @click="exportExcel()">导出</el-button>
  101. <el-button round class="btn" v-show="detailShow == 2" @click="back">返回</el-button>
  102. </div>
  103. </div>
  104. <div v-show="detailShow == 1">
  105. <div class="tabCut2">
  106. <div class="tabCut-item">
  107. <span>项目对标</span>
  108. </div>
  109. </div>
  110. <!-- <toolbar-panel title="项目对标" :showLine="false"></toolbar-panel> -->
  111. <div class="mg-b-16">
  112. <div class="project-table">
  113. <Table :data="tableData" :canScroll="false" ref="curRef"></Table>
  114. </div>
  115. </div>
  116. <div class="echarts">
  117. <div class="pie-echarts">
  118. <div class="chart-name">
  119. <div class="point left bottom"></div>
  120. <div class="point right bottom"></div>
  121. 发电量占比
  122. </div>
  123. <!-- <panel title="发电量占比"> -->
  124. <dual-pie-chart
  125. height="21.296vh"
  126. :innerData="innerFdl"
  127. :outerData="outerFdl"
  128. />
  129. <!-- </panel> -->
  130. </div>
  131. <div class="bar-echarts">
  132. <div class="chart-name">
  133. <div class="point left bottom"></div>
  134. <div class="point right bottom"></div>
  135. 损失电量分析
  136. </div>
  137. <!-- <panel title="损失电量分析"> -->
  138. <multiple-bar-chart
  139. :height="'calc(100vh - 21.3vh - 550px)'"
  140. :list="analyis"
  141. :customerTooltip="true"
  142. @tooltip="tooltip"
  143. :units="['(万KWh)']"
  144. />
  145. <!-- </panel> -->
  146. </div>
  147. </div>
  148. </div>
  149. <!-- <el-row class="mg-b-16">
  150. <el-col :span="12">
  151. <panel title="发电量占比">
  152. <dual-pie-chart
  153. height="21.296vh"
  154. :innerData="innerFdl"
  155. :outerData="outerFdl"
  156. />
  157. </panel>
  158. </el-col>
  159. <el-col :span="12">
  160. <panel title="各场站损失电量占比">
  161. <dual-pie-chart
  162. height="21.296vh"
  163. :innerData="innerCz"
  164. :outerData="outerCz"
  165. />
  166. </panel>
  167. </el-col>
  168. </el-row>
  169. <div>
  170. <panel title="损失电量分析">
  171. <multiple-bar-chart
  172. :height="'calc(100vh - 21.3vh - 550px)'"
  173. :list="analyis"
  174. :customerTooltip="true"
  175. @tooltip="tooltip"
  176. :units="['(万KWh)']"
  177. />
  178. </panel>
  179. </div>
  180. </div>-->
  181. <el-row :type="'flex'" class="content" v-show="detailShow == 2">
  182. <el-col :span="24" class="pd-l-8">
  183. <div class="tabCut2">
  184. <div class="tabCut-item">
  185. <span>风机对标列表明细</span>
  186. </div>
  187. </div>
  188. <!-- <panel :title="'风机对标列表明细'" :showLine="false"> -->
  189. <div class="project-table">
  190. <Table :data="tableDataDetail" ref="curRef"></Table>
  191. </div>
  192. <!-- </panel> -->
  193. </el-col>
  194. </el-row>
  195. <el-dialog
  196. title="对标排名分析"
  197. v-model="dialogVisible"
  198. width="70%"
  199. top="10vh"
  200. custom-class="modal"
  201. :close-on-click-modal="false"
  202. >
  203. <dayinfo
  204. :radarValue="radarValue"
  205. :title="[windNum, windNum2]"
  206. :windNum="windNum"
  207. :windNum2="windNum2"
  208. :tabs="tabs"
  209. :analyisDialog="analyisDialog"
  210. />
  211. </el-dialog>
  212. </div>
  213. </template>
  214. <script>
  215. import MultipleBarChart from "../../components/chart/bar/multiple-bar-chart.vue";
  216. import DualPieChart from "./dual-pie-chart.vue";
  217. import SvgIcon from "../../components/coms/icon/svg-icon.vue";
  218. import Panel from "../../components/coms/panel/panel.vue";
  219. import Table from "../../components/coms/table/table.vue";
  220. import ToolbarPanel from "../../components/coms/panel/toolbar-panel.vue";
  221. import Dayinfo from "./dayinfo.vue";
  222. import api from "@api/economic/index.js";
  223. export default {
  224. components: {
  225. Panel,
  226. Table,
  227. SvgIcon,
  228. DualPieChart,
  229. MultipleBarChart,
  230. ToolbarPanel,
  231. Dayinfo,
  232. },
  233. data() {
  234. let that = this;
  235. return {
  236. tableIdArr: [], //放checkbox的id数组
  237. tableId: [],
  238. checkLength: 0, //对标分析只能选择2个
  239. tableData: {
  240. column: [
  241. // {
  242. // name: "",
  243. // field: "index",
  244. // is_num: false,
  245. // is_light: false,
  246. // },
  247. {
  248. name: "",
  249. field: "check",
  250. is_num: false,
  251. is_light: false,
  252. template: function () {
  253. return "<input class='check curCheckBox' type='CheckBox'/>";
  254. },
  255. click: function (event, data) {
  256. // checkbox 事件
  257. // event.target checkbox or td 需进行判断
  258. // event.target.checked 判断 checkbox 是否选中
  259. // data 当前数据
  260. var dataId = that.tableIdArr[data.index - 1];
  261. if (event.target.checked == false && that.checkLength <= 2) {
  262. that.tableId.forEach((item, i) => {
  263. if (item == dataId) {
  264. that.tableId.splice(i, 1);
  265. that.dbData.splice(i, 1);
  266. }
  267. });
  268. that.checkLength--;
  269. } else if (event.target.checked && that.checkLength < 2) {
  270. that.tableId.push(dataId);
  271. that.dbData.push(data);
  272. that.checkLength++;
  273. } else if (that.checkLength == 2) {
  274. event.target.checked = false;
  275. }
  276. },
  277. },
  278. {
  279. name: "名称",
  280. field: "name",
  281. is_num: false,
  282. is_light: false,
  283. width: "100px",
  284. },
  285. {
  286. name: "综合排名",
  287. field: "zhpm",
  288. is_num: false,
  289. is_light: false,
  290. sortable: true,
  291. },
  292. {
  293. name: "发电量排名",
  294. field: "fdlpm",
  295. is_num: false,
  296. is_light: false,
  297. sortable: true,
  298. },
  299. {
  300. name: "发电量(万kWh)",
  301. field: "fdl",
  302. is_num: false,
  303. is_light: false,
  304. sortable: true,
  305. },
  306. {
  307. name: "故障损失排名",
  308. field: "gzssdlpm",
  309. is_num: false,
  310. is_light: false,
  311. sortable: true,
  312. },
  313. {
  314. name: "故障损失(万kWh)",
  315. field: "gzssdl",
  316. is_num: false,
  317. is_light: false,
  318. sortable: true,
  319. },
  320. {
  321. name: "检修损失排名",
  322. field: "jxssdlpm",
  323. is_num: false,
  324. is_light: false,
  325. sortable: true,
  326. },
  327. {
  328. name: "检修损失(万kWh)",
  329. field: "jxssdl",
  330. is_num: false,
  331. is_light: false,
  332. sortable: true,
  333. },
  334. {
  335. name: "性能损失排名",
  336. field: "xnssdlpm",
  337. is_num: false,
  338. is_light: false,
  339. sortable: true,
  340. },
  341. {
  342. name: "性能损失(万kWh)",
  343. field: "xnssdl",
  344. is_num: false,
  345. is_light: false,
  346. sortable: true,
  347. },
  348. {
  349. name: "限电损失排名",
  350. field: "xdssdlpm",
  351. is_num: false,
  352. is_light: false,
  353. sortable: true,
  354. },
  355. {
  356. name: "限电损失(万kWh)",
  357. field: "xdssdl",
  358. is_num: false,
  359. is_light: false,
  360. sortable: true,
  361. },
  362. {
  363. name: "受累损失排名",
  364. field: "slssdlpm",
  365. is_num: false,
  366. is_light: false,
  367. sortable: true,
  368. },
  369. {
  370. name: "受累损失(万kWh)",
  371. field: "slssdl",
  372. is_num: false,
  373. is_light: false,
  374. sortable: true,
  375. },
  376. {
  377. name: "风能利用率排名",
  378. field: "fnlylpm",
  379. is_num: false,
  380. is_light: false,
  381. sortable: true,
  382. },
  383. {
  384. name: "风能利用率(%)",
  385. field: "fnlyl",
  386. is_num: false,
  387. is_light: false,
  388. sortable: true,
  389. },
  390. {
  391. name: "故障损失率排名",
  392. field: "gzsslpm",
  393. is_num: false,
  394. is_light: false,
  395. sortable: true,
  396. },
  397. {
  398. name: "故障损失率(%)",
  399. field: "gzssl",
  400. is_num: false,
  401. is_light: false,
  402. sortable: true,
  403. },
  404. {
  405. name: "检修损失率排名",
  406. field: "jxsslpm",
  407. is_num: false,
  408. is_light: false,
  409. sortable: true,
  410. },
  411. {
  412. name: "检修损失率(%)",
  413. field: "jxssl",
  414. is_num: false,
  415. is_light: false,
  416. sortable: true,
  417. },
  418. {
  419. name: "弃风率排名",
  420. field: "qflpm",
  421. is_num: false,
  422. is_light: false,
  423. sortable: true,
  424. },
  425. {
  426. name: "弃风率(%)",
  427. field: "qfl",
  428. is_num: false,
  429. is_light: false,
  430. sortable: true,
  431. },
  432. {
  433. name: "性能损失率排名",
  434. field: "xnsslpm",
  435. is_num: false,
  436. is_light: false,
  437. sortable: true,
  438. },
  439. {
  440. name: "性能损失率(%)",
  441. field: "xnssl",
  442. is_num: false,
  443. is_light: false,
  444. sortable: true,
  445. },
  446. {
  447. name: "受累损失率排名",
  448. field: "slsslpm",
  449. is_num: false,
  450. is_light: false,
  451. sortable: true,
  452. },
  453. {
  454. name: "受累损失率(%)",
  455. field: "slssl",
  456. is_num: false,
  457. is_light: false,
  458. sortable: true,
  459. },
  460. {
  461. name: "操作",
  462. field: "cz",
  463. is_num: false,
  464. is_light: false,
  465. template: function () {
  466. return "<a class='action'>详情</a>";
  467. },
  468. click: function (event, data) {
  469. var dataId = that.tableIdArr[data.index - 1];
  470. that.clearDb();
  471. that.detailShow = 2;
  472. // var that = this;
  473. api
  474. .benchmarkingDetails({
  475. id: dataId,
  476. beginDate: that.value4,
  477. endDate: that.value5,
  478. target: "",
  479. sort: "",
  480. })
  481. .then((res) => {
  482. var dataTab = [];
  483. res.data.forEach((item, index) => {
  484. that.tableIdArr.push(item.id);
  485. dataTab.push({
  486. //表格
  487. // index: index + 1,
  488. name: item.name,
  489. zhpm: item.zhpm,
  490. gzssdl: item.gzssdl,
  491. jxssdlpm: item.jxssdlpm,
  492. jxssdl: item.jxssdl,
  493. xnssdlpm: item.xnssdlpm,
  494. xnssdl: item.xnssdl,
  495. xdssdlpm: item.xdssdlpm,
  496. xdssdl: item.xdssdl,
  497. slssdlpm: item.slssdlpm,
  498. slssdl: item.slssdl,
  499. fnlylpm: item.fnlylpm,
  500. fnlyl: item.fnlyl,
  501. gzsslpm: item.gzsslpm,
  502. gzssl: item.gzssl,
  503. jxsslpm: item.jxsslpm,
  504. jxssl: item.jxssl,
  505. qflpm: item.qflpm,
  506. qfl: item.qfl,
  507. xnsslpm: item.xnsslpm,
  508. xnssl: item.xnssl,
  509. slsslpm: item.slsslpm,
  510. slssl: item.slssl,
  511. is_light: false,
  512. });
  513. });
  514. that.tableDataDetail.data = dataTab;
  515. });
  516. // that.API.requestData({
  517. // method: "GET",
  518. // baseURL: "http://10.83.66.220:8020/",
  519. // subUrl: "benchmarking/details",
  520. // data: {
  521. // id: dataId,
  522. // beginDate: that.value4,
  523. // endDate: that.value5,
  524. // target: "",
  525. // sort: "",
  526. // },
  527. // success(res) {
  528. // var dataTab = [];
  529. // res.data.forEach((item, index) => {
  530. // that.tableIdArr.push(item.id);
  531. // dataTab.push({
  532. // //表格
  533. // index: index + 1,
  534. // name: item.name,
  535. // zhpm: item.zhpm,
  536. // gzssdl: item.gzssdl,
  537. // jxssdlpm: item.jxssdlpm,
  538. // jxssdl: item.jxssdl,
  539. // xnssdlpm: item.xnssdlpm,
  540. // xnssdl: item.xnssdl,
  541. // xdssdlpm: item.xdssdlpm,
  542. // xdssdl: item.xdssdl,
  543. // slssdlpm: item.slssdlpm,
  544. // slssdl: item.slssdl,
  545. // fnlylpm: item.fnlylpm,
  546. // fnlyl: item.fnlyl,
  547. // gzsslpm: item.gzsslpm,
  548. // gzssl: item.gzssl,
  549. // jxsslpm: item.jxsslpm,
  550. // jxssl: item.jxssl,
  551. // qflpm: item.qflpm,
  552. // qfl: item.qfl,
  553. // xnsslpm: item.xnsslpm,
  554. // xnssl: item.xnssl,
  555. // slsslpm: item.slsslpm,
  556. // slssl: item.slssl,
  557. // is_light: false,
  558. // });
  559. // });
  560. // that.tableDataDetail.data = dataTab;
  561. // },
  562. // });
  563. },
  564. },
  565. ],
  566. data: [],
  567. },
  568. tableDataDetail: {
  569. column: [
  570. // {
  571. // name: "",
  572. // field: "index",
  573. // is_num: false,
  574. // is_light: false,
  575. // },
  576. {
  577. name: "",
  578. field: "check",
  579. is_num: false,
  580. is_light: false,
  581. template: function () {
  582. return "<input class='check curCheckBox checkItem' type='CheckBox'/>";
  583. },
  584. click: function (event, data) {
  585. var dataId = that.tableIdArr[data.index - 1];
  586. if (event.target.checked == false && that.checkLength <= 2) {
  587. that.tableId.forEach((item, i) => {
  588. if (item == dataId) {
  589. that.tableId.splice(i, 1);
  590. that.dbData.splice(i, 1);
  591. }
  592. });
  593. that.checkLength--;
  594. } else if (event.target.checked && that.checkLength < 2) {
  595. that.tableId.push(dataId);
  596. that.dbData.push(data);
  597. that.checkLength++;
  598. } else if (that.checkLength == 2) {
  599. event.target.checked = false;
  600. }
  601. },
  602. },
  603. {
  604. name: "风机名称",
  605. field: "name",
  606. is_num: false,
  607. is_light: false,
  608. },
  609. {
  610. name: "综合排名",
  611. field: "zhpm",
  612. is_num: false,
  613. is_light: false,
  614. sortable: true,
  615. },
  616. {
  617. name: "故障损失",
  618. field: "gzssdl",
  619. is_num: false,
  620. is_light: false,
  621. sortable: true,
  622. },
  623. {
  624. name: "检修损失排名",
  625. field: "jxssdlpm",
  626. is_num: false,
  627. is_light: false,
  628. sortable: true,
  629. },
  630. {
  631. name: "检修损失",
  632. field: "jxssdl",
  633. is_num: false,
  634. is_light: false,
  635. sortable: true,
  636. },
  637. {
  638. name: "性能损失排名",
  639. field: "xnssdlpm",
  640. is_num: false,
  641. is_light: false,
  642. sortable: true,
  643. },
  644. {
  645. name: "性能损失",
  646. field: "xnssdl",
  647. is_num: false,
  648. is_light: false,
  649. sortable: true,
  650. },
  651. {
  652. name: "限电损失排名",
  653. field: "xdssdlpm",
  654. is_num: false,
  655. is_light: false,
  656. sortable: true,
  657. },
  658. {
  659. name: "限电损失",
  660. field: "xdssdl",
  661. is_num: false,
  662. is_light: false,
  663. sortable: true,
  664. },
  665. {
  666. name: "受累损失排名",
  667. field: "slssdlpm",
  668. is_num: false,
  669. is_light: false,
  670. sortable: true,
  671. },
  672. {
  673. name: "受累损失",
  674. field: "slssdl",
  675. is_num: false,
  676. is_light: false,
  677. sortable: true,
  678. },
  679. {
  680. name: "故障损失率排名",
  681. field: "gzsslpm",
  682. is_num: false,
  683. is_light: false,
  684. sortable: true,
  685. },
  686. {
  687. name: "故障损失率(%)",
  688. field: "gzssl",
  689. is_num: false,
  690. is_light: false,
  691. sortable: true,
  692. },
  693. {
  694. name: "检修损失率排名",
  695. field: "jxsslpm",
  696. is_num: false,
  697. is_light: false,
  698. sortable: true,
  699. },
  700. {
  701. name: "检修损失率(%)",
  702. field: "jxssl",
  703. is_num: false,
  704. is_light: false,
  705. sortable: true,
  706. },
  707. {
  708. name: "弃风率排名",
  709. field: "qflpm",
  710. is_num: false,
  711. is_light: false,
  712. sortable: true,
  713. },
  714. {
  715. name: "弃风率(%)",
  716. field: "qfl",
  717. is_num: false,
  718. is_light: false,
  719. sortable: true,
  720. },
  721. {
  722. name: "性能损失率排名",
  723. field: "xnsslpm",
  724. is_num: false,
  725. is_light: false,
  726. sortable: true,
  727. },
  728. {
  729. name: "性能损失率(%)",
  730. field: "xnssl",
  731. is_num: false,
  732. is_light: false,
  733. sortable: true,
  734. },
  735. {
  736. name: "受累损失率排名",
  737. field: "slsslpm",
  738. is_num: false,
  739. is_light: false,
  740. sortable: true,
  741. },
  742. {
  743. name: "受累损失率(%)",
  744. field: "slssl",
  745. is_num: false,
  746. is_light: false,
  747. sortable: true,
  748. },
  749. ],
  750. data: [],
  751. },
  752. options: [],
  753. ChangZhan: [], //场站
  754. XiangMu: [], //项目
  755. value1: [],
  756. value2: [],
  757. value4: "",
  758. value5: "",
  759. innerFdl: [], //发电量占比
  760. outerFdl: [],
  761. innerCz: [], //各场站损失电量占比
  762. outerCz: [],
  763. innerLl: [], //理论发电量占比
  764. outerLl: [],
  765. analyis: [], //损失电量分析
  766. dialogVisible: false,
  767. radarValue: [],
  768. windNum: "dd",
  769. windNum2: "dd",
  770. tabs: [],
  771. analyisDialog: [],
  772. detailShow: 1,
  773. ajaxData: [],
  774. dbData: [],
  775. };
  776. },
  777. created() {
  778. this.ChangZhanVal();
  779. this.value4 = this.getTime(1);
  780. this.value5 = this.getTime(2);
  781. // this.AjaxCommon();
  782. },
  783. methods: {
  784. ChangZhanVal() {
  785. api.benchmarkingWplist({}).then((res) => {
  786. this.ChangZhan = res.data;
  787. this.AjaxCommon();
  788. });
  789. // var that = this;
  790. // that.API.requestData({
  791. // method: "GET",
  792. // baseURL: "http://10.83.66.220:8020/",
  793. // subUrl: "benchmarking/wplist",
  794. // success(res) {
  795. // that.ChangZhan = res.data;
  796. // that.AjaxCommon();
  797. // },
  798. // });
  799. },
  800. ChangZhanChange(val) {
  801. this.value1 = val;
  802. this.value2 = [];
  803. this.AjaxCommon();
  804. this.XiangMuVal(val);
  805. this.clearDb();
  806. },
  807. XiangMuVal(val) {
  808. api
  809. .benchmarkingProjectList({
  810. wpids: val,
  811. })
  812. .then((res) => {
  813. this.XiangMu = res.data;
  814. });
  815. // var that = this;
  816. // that.API.requestData({
  817. // method: "GET",
  818. // baseURL: "http://10.83.66.220:8020/",
  819. // subUrl: "benchmarking/projectList",
  820. // data: {
  821. // wpids: val,
  822. // },
  823. // success(res) {
  824. // that.XiangMu = res.data;
  825. // },
  826. // });
  827. },
  828. XiangMuChange(val) {
  829. this.value2 = val;
  830. this.AjaxCommon();
  831. this.clearDb();
  832. },
  833. BeginChange(val) {
  834. this.value4 = val;
  835. this.AjaxCommon();
  836. this.clearDb();
  837. },
  838. EndChange(val) {
  839. this.value5 = val;
  840. this.AjaxCommon();
  841. this.clearDb();
  842. },
  843. getTime(val) {
  844. //时间戳处理,val=1是默认开始时间(当前月第一天),val=2是默认结束时间(今天)
  845. var date = new Date();
  846. var year = date.getFullYear(),
  847. month = date.getMonth() + 1,
  848. day = date.getDate();
  849. month >= 1 && month <= 9 ? (month = "0" + month) : "";
  850. day >= 0 && day <= 9 ? (day = "0" + day) : "";
  851. var begin = year + "-" + month + "-01";
  852. var end = year + "-" + month + "-" + day;
  853. if (val == 1) {
  854. return begin;
  855. } else if (val == 2) {
  856. return end;
  857. }
  858. },
  859. AjaxCommon() {
  860. api
  861. .benchmarkingXmdb({
  862. wpids: this.value1,
  863. projectids: this.value2,
  864. beginDate: this.value4,
  865. endDate: this.value5,
  866. target: "",
  867. sort: "",
  868. })
  869. .then((res) => {
  870. this.tableIdArr = [];
  871. this.ajaxData = res.data;
  872. var dataTab = [], //表格
  873. fdl = [],
  874. cz = [],
  875. ll = [],
  876. analyis = [],
  877. gzssdl = [],
  878. jxssdl = [],
  879. xnssdl = [],
  880. xdssdl = [],
  881. slssdl = [];
  882. res.data.forEach((item, index) => {
  883. this.tableIdArr.push(item.id);
  884. dataTab.push({
  885. //表格
  886. index: index + 1,
  887. name: item.name,
  888. zhpm: item.zhpm,
  889. fdlpm: item.fdlpm,
  890. fdl: item.fdl,
  891. gzssdlpm: item.gzssdlpm,
  892. gzssdl: item.gzssdl,
  893. jxssdlpm: item.jxssdlpm,
  894. jxssdl: item.jxssdl,
  895. xnssdlpm: item.xnssdlpm,
  896. xnssdl: item.xnssdl,
  897. xdssdlpm: item.xdssdlpm,
  898. xdssdl: item.xdssdl,
  899. slssdlpm: item.slssdlpm,
  900. slssdl: item.slssdl,
  901. fnlylpm: item.fnlylpm,
  902. fnlyl: item.fnlyl,
  903. gzsslpm: item.gzsslpm,
  904. gzssl: item.gzssl,
  905. jxsslpm: item.jxsslpm,
  906. jxssl: item.jxssl,
  907. qflpm: item.qflpm,
  908. qfl: item.qfl,
  909. xnsslpm: item.xnsslpm,
  910. xnssl: item.xnssl,
  911. slsslpm: item.slsslpm,
  912. slssl: item.slssl,
  913. is_light: false,
  914. });
  915. fdl.push({
  916. value: item.fdl,
  917. name: item.name.slice(0, item.name.length - 2),
  918. });
  919. cz.push({
  920. value: (
  921. item.gzssdl +
  922. item.jxssdl +
  923. item.xnssdl +
  924. item.xdssdl +
  925. item.slssdl
  926. ).toFixed(2),
  927. name: item.name.slice(0, item.name.length - 2),
  928. });
  929. ll.push({
  930. value: item.llfdl,
  931. name: item.name.slice(0, item.name.length - 2),
  932. });
  933. gzssdl.push({
  934. text: item.name,
  935. value: item.gzssdl,
  936. });
  937. jxssdl.push({
  938. text: item.name,
  939. value: item.jxssdl,
  940. });
  941. xnssdl.push({
  942. text: item.name,
  943. value: item.xnssdl,
  944. });
  945. xdssdl.push({
  946. text: item.name,
  947. value: item.xdssdl,
  948. });
  949. slssdl.push({
  950. text: item.name,
  951. value: item.slssdl,
  952. });
  953. });
  954. analyis.push(
  955. {
  956. title: "故障损失电量",
  957. yAxisIndex: 0,
  958. value: gzssdl,
  959. },
  960. {
  961. title: "检修损失电量",
  962. yAxisIndex: 0,
  963. value: jxssdl,
  964. },
  965. {
  966. title: "性能损失电量",
  967. yAxisIndex: 0,
  968. value: xnssdl,
  969. },
  970. {
  971. title: "限电损失电量",
  972. yAxisIndex: 0,
  973. value: xdssdl,
  974. },
  975. {
  976. title: "受累损失电量",
  977. yAxisIndex: 0,
  978. value: slssdl,
  979. }
  980. );
  981. this.tableData.data = dataTab;
  982. this.innerFdl = fdl;
  983. this.outerFdl = fdl;
  984. this.innerCz = cz;
  985. this.outerCz = cz;
  986. this.innerLl = ll;
  987. this.outerLl = ll;
  988. this.analyis = analyis;
  989. });
  990. // var that = this;
  991. // that.API.requestData({
  992. // //五项损失率
  993. // method: "GET",
  994. // baseURL: "http://10.83.66.220:8020/",
  995. // subUrl: "benchmarking/xmdb",
  996. // data: {
  997. // wpids: that.value1,
  998. // projectids: that.value2,
  999. // beginDate: that.value4,
  1000. // endDate: that.value5,
  1001. // target: "",
  1002. // sort: "",
  1003. // },
  1004. // success(res) {
  1005. // that.ajaxData = res.data;
  1006. // var dataTab = [], //表格
  1007. // fdl = [],
  1008. // cz = [],
  1009. // ll = [],
  1010. // analyis = [],
  1011. // gzssdl = [],
  1012. // jxssdl = [],
  1013. // xnssdl = [],
  1014. // xdssdl = [],
  1015. // slssdl = [];
  1016. // res.data.forEach((item, index) => {
  1017. // that.tableIdArr.push(item.id);
  1018. // dataTab.push({
  1019. // //表格
  1020. // index: index + 1,
  1021. // name: item.name,
  1022. // zhpm: item.zhpm,
  1023. // fdlpm: item.fdlpm,
  1024. // fdl: item.fdl,
  1025. // gzssdlpm: item.gzssdlpm,
  1026. // gzssdl: item.gzssdl,
  1027. // jxssdlpm: item.jxssdlpm,
  1028. // jxssdl: item.jxssdl,
  1029. // xnssdlpm: item.xnssdlpm,
  1030. // xnssdl: item.xnssdl,
  1031. // xdssdlpm: item.xdssdlpm,
  1032. // xdssdl: item.xdssdl,
  1033. // slssdlpm: item.slssdlpm,
  1034. // slssdl: item.slssdl,
  1035. // fnlylpm: item.fnlylpm,
  1036. // fnlyl: item.fnlyl,
  1037. // gzsslpm: item.gzsslpm,
  1038. // gzssl: item.gzssl,
  1039. // jxsslpm: item.jxsslpm,
  1040. // jxssl: item.jxssl,
  1041. // qflpm: item.qflpm,
  1042. // qfl: item.qfl,
  1043. // xnsslpm: item.xnsslpm,
  1044. // xnssl: item.xnssl,
  1045. // slsslpm: item.slsslpm,
  1046. // slssl: item.slssl,
  1047. // is_light: false,
  1048. // });
  1049. // fdl.push({
  1050. // value: item.fdl,
  1051. // name: item.name,
  1052. // });
  1053. // cz.push({
  1054. // value: (
  1055. // item.gzssdl +
  1056. // item.jxssdl +
  1057. // item.xnssdl +
  1058. // item.xdssdl +
  1059. // item.slssdl
  1060. // ).toFixed(2),
  1061. // name: item.name,
  1062. // });
  1063. // ll.push({
  1064. // value: item.llfdl,
  1065. // name: item.name,
  1066. // });
  1067. // gzssdl.push({
  1068. // text: item.name,
  1069. // value: item.gzssdl,
  1070. // });
  1071. // jxssdl.push({
  1072. // text: item.name,
  1073. // value: item.jxssdl,
  1074. // });
  1075. // xnssdl.push({
  1076. // text: item.name,
  1077. // value: item.xnssdl,
  1078. // });
  1079. // xdssdl.push({
  1080. // text: item.name,
  1081. // value: item.xdssdl,
  1082. // });
  1083. // slssdl.push({
  1084. // text: item.name,
  1085. // value: item.slssdl,
  1086. // });
  1087. // });
  1088. // analyis.push(
  1089. // {
  1090. // title: "故障损失电量",
  1091. // yAxisIndex: 0,
  1092. // value: gzssdl,
  1093. // },
  1094. // {
  1095. // title: "检修损失电量",
  1096. // yAxisIndex: 0,
  1097. // value: jxssdl,
  1098. // },
  1099. // {
  1100. // title: "性能损失电量",
  1101. // yAxisIndex: 0,
  1102. // value: xnssdl,
  1103. // },
  1104. // {
  1105. // title: "限电损失电量",
  1106. // yAxisIndex: 0,
  1107. // value: xdssdl,
  1108. // },
  1109. // {
  1110. // title: "受累损失电量",
  1111. // yAxisIndex: 0,
  1112. // value: slssdl,
  1113. // }
  1114. // );
  1115. // that.tableData.data = dataTab;
  1116. // that.innerFdl = fdl;
  1117. // that.outerFdl = fdl;
  1118. // that.innerCz = cz;
  1119. // that.outerCz = cz;
  1120. // that.innerLl = ll;
  1121. // that.outerLl = ll;
  1122. // that.analyis = analyis;
  1123. // },
  1124. // });
  1125. },
  1126. AjaxDbfx() {
  1127. var that = this;
  1128. var data = that.dbData;
  1129. that.windNum = data[0].name;
  1130. that.windNum2 = data[1].name;
  1131. that.tabs = [
  1132. {
  1133. name: "发电量",
  1134. windData1: data[0].fdl,
  1135. windData2: data[1].fdl,
  1136. },
  1137. {
  1138. name: "故障损失电量",
  1139. windData1: data[0].gzssdl,
  1140. windData2: data[1].gzssdl,
  1141. },
  1142. {
  1143. name: "检修损失电量",
  1144. windData1: data[0].jxssdl,
  1145. windData2: data[1].jxssdl,
  1146. },
  1147. {
  1148. name: "性能未达标损失电量",
  1149. windData1: data[0].xnssdl,
  1150. windData2: data[1].xnssdl,
  1151. },
  1152. {
  1153. name: "受累损失电量",
  1154. windData1: data[0].slssdl,
  1155. windData2: data[1].slssdl,
  1156. },
  1157. {
  1158. name: "风能利用率",
  1159. windData1: data[0].fnlyl,
  1160. windData2: data[1].fnlyl,
  1161. },
  1162. {
  1163. name: "故障损失率",
  1164. windData1: data[0].gzssl,
  1165. windData2: data[1].gzssl,
  1166. },
  1167. {
  1168. name: "检修损失率",
  1169. windData1: data[0].jxssl,
  1170. windData2: data[1].jxssl,
  1171. },
  1172. {
  1173. name: "弃风率",
  1174. windData1: data[0].qfl,
  1175. windData2: data[1].qfl,
  1176. },
  1177. {
  1178. name: "性能损失率",
  1179. windData1: data[0].xnssl,
  1180. windData2: data[1].xnssl,
  1181. },
  1182. {
  1183. name: "受累损失率",
  1184. windData1: data[0].slssl,
  1185. windData2: data[1].slssl,
  1186. },
  1187. ];
  1188. that.radarValue = [
  1189. {
  1190. indicator: [
  1191. "风能利用率",
  1192. "故障损失率",
  1193. "检修损失率",
  1194. "弃风率",
  1195. "性能损失率",
  1196. "受累损失率",
  1197. ],
  1198. data: [
  1199. {
  1200. value: [
  1201. data[0].fnlylpm,
  1202. data[0].gzsslpm,
  1203. data[0].jxsslpm,
  1204. data[0].qflpm,
  1205. data[0].xnsslpm,
  1206. data[0].slsslpm,
  1207. ],
  1208. },
  1209. {
  1210. value: [
  1211. data[1].fnlylpm,
  1212. data[1].gzsslpm,
  1213. data[1].jxsslpm,
  1214. data[1].qflpm,
  1215. data[1].xnsslpm,
  1216. data[1].slsslpm,
  1217. ],
  1218. },
  1219. ],
  1220. },
  1221. ];
  1222. var analyis = [],
  1223. gzssdl = [],
  1224. jxssdl = [],
  1225. xnssdl = [],
  1226. xdssdl = [],
  1227. slssdl = [];
  1228. data.forEach((item, index) => {
  1229. gzssdl.push({
  1230. text: item.name,
  1231. value: item.gzssdl,
  1232. });
  1233. jxssdl.push({
  1234. text: item.name,
  1235. value: item.jxssdl,
  1236. });
  1237. xnssdl.push({
  1238. text: item.name,
  1239. value: item.xnssdl,
  1240. });
  1241. xdssdl.push({
  1242. text: item.name,
  1243. value: item.xdssdl,
  1244. });
  1245. slssdl.push({
  1246. text: item.name,
  1247. value: item.slssdl,
  1248. });
  1249. });
  1250. analyis.push(
  1251. {
  1252. title: "故障损失电量",
  1253. yAxisIndex: 0,
  1254. value: gzssdl,
  1255. },
  1256. {
  1257. title: "检修损失电量",
  1258. yAxisIndex: 0,
  1259. value: jxssdl,
  1260. },
  1261. {
  1262. title: "性能损失电量",
  1263. yAxisIndex: 0,
  1264. value: xnssdl,
  1265. },
  1266. {
  1267. title: "限电损失电量",
  1268. yAxisIndex: 0,
  1269. value: xdssdl,
  1270. },
  1271. {
  1272. title: "受累损失电量",
  1273. yAxisIndex: 0,
  1274. value: slssdl,
  1275. }
  1276. );
  1277. that.analyisDialog = analyis;
  1278. },
  1279. tooltip(param, callback) {
  1280. var color = ["#05bb4c", "#4b55ae", "#fa8c16", "#f8de5b"];
  1281. var result = param[0].axisValue;
  1282. param.forEach((value, index) => {
  1283. result +=
  1284. "<br />" +
  1285. `<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${color[index]};"></span>` +
  1286. value.seriesName +
  1287. ":" +
  1288. value.value;
  1289. });
  1290. callback(result);
  1291. return true;
  1292. },
  1293. dbfx() {
  1294. var that = this;
  1295. if (that.tableId.length == 2) {
  1296. that.dialogVisible = true;
  1297. this.AjaxDbfx();
  1298. this.clearDb();
  1299. }
  1300. },
  1301. clearDb() {
  1302. //清空对标状态
  1303. this.$refs.curRef.clearCheckBox();
  1304. this.tableId = [];
  1305. this.dbData = [];
  1306. this.checkLength = 0;
  1307. },
  1308. back() {
  1309. this.detailShow = 1;
  1310. this.clearDb();
  1311. },
  1312. exportExcel() {
  1313. let that = this;
  1314. const { export_json_to_excel } = require("@tools/excel/Export2Excel.js"); // 注意这个Export2Excel路径
  1315. let tHeader = []; // 上面设置Excel的表格第一行的标题
  1316. let filterVal = []; // 上面的index、nickName、name是tableData里对象的属性key值
  1317. that.tableData.column.forEach((ele, index) => {
  1318. if (index > 1 && index !== that.tableData.column.length - 1) {
  1319. tHeader.push(ele.name);
  1320. filterVal.push(ele.field);
  1321. }
  1322. });
  1323. var list = [];
  1324. that.tableData.data.forEach((i, index) => {
  1325. list.push(i);
  1326. });
  1327. const data = that.formatJson(filterVal, list);
  1328. export_json_to_excel(tHeader, data, "项目对标"); // 最后一个是表名字
  1329. },
  1330. formatJson(filterVal, jsonData) {
  1331. return jsonData.map((v) => filterVal.map((j) => v[j]));
  1332. },
  1333. },
  1334. };
  1335. </script>
  1336. <style lang="less">
  1337. .decision-page-2 {
  1338. .content .project-table {
  1339. tbody {
  1340. height: calc(100vh - 24.5vh);
  1341. }
  1342. }
  1343. .project-table {
  1344. overflow: auto;
  1345. tbody {
  1346. height: 440px;
  1347. }
  1348. th,
  1349. td {
  1350. color: #b2bdc0;
  1351. &:nth-child(1) {
  1352. width: 50px;
  1353. }
  1354. &:nth-child(2) {
  1355. width: 50px;
  1356. }
  1357. }
  1358. }
  1359. .action {
  1360. text-decoration: underline;
  1361. color: @green;
  1362. cursor: pointer;
  1363. }
  1364. }
  1365. .title {
  1366. display: flex;
  1367. flex-direction: row;
  1368. align-items: center;
  1369. margin-top: 10px;
  1370. margin-bottom: 10px;
  1371. .station {
  1372. display: flex;
  1373. flex-direction: row;
  1374. align-items: center;
  1375. font-size: 14px;
  1376. font-family: Microsoft YaHei;
  1377. font-weight: 400;
  1378. color: #b3b3b3;
  1379. margin-right: 10px;
  1380. }
  1381. .search-input {
  1382. margin-left: 10px;
  1383. }
  1384. .but {
  1385. display: flex;
  1386. flex-direction: row;
  1387. align-content: center;
  1388. margin-left: 10px;
  1389. }
  1390. .buttons {
  1391. width: 80px;
  1392. height: 25px;
  1393. background: rgba(0, 70, 199, 0.5);
  1394. border: 1px solid #1f51ae;
  1395. border-radius: 13px;
  1396. color: #ffffff;
  1397. font-size: 14px;
  1398. font-family: Microsoft YaHei;
  1399. font-weight: 400;
  1400. &:hover {
  1401. background-color: rgba(0, 70, 199, 0.5);
  1402. color: #ffffff;
  1403. }
  1404. }
  1405. }
  1406. .echarts {
  1407. width: 100%;
  1408. height: 26vh;
  1409. display: flex;
  1410. flex-direction: row;
  1411. align-items: center;
  1412. // margin-top: 30px;
  1413. .chart-name {
  1414. display: flex;
  1415. align-items: center;
  1416. padding-left: 20px;
  1417. position: relative;
  1418. height: 39px;
  1419. width: 100%;
  1420. // margin-left: 1%;
  1421. background:rgba(0, 0, 0, 0.45) ;
  1422. border-bottom: 1px solid rgba(153, 153, 153, 0.5);
  1423. font-size: 16px;
  1424. font-family: Microsoft YaHei;
  1425. font-weight: 400;
  1426. color: #ffffff;
  1427. }
  1428. .pie-echarts {
  1429. width: 30%;
  1430. height: 100%;
  1431. border: 1px solid rgba(153, 153, 153, 0.5);
  1432. // background: rgba(0, 0, 0, 0.45);
  1433. border-radius: 5px;
  1434. }
  1435. .bar-echarts {
  1436. width: 69%;
  1437. margin-left: 1%;
  1438. height: 100%;
  1439. border: 1px solid rgba(153, 153, 153, 0.5);
  1440. // background: rgba(0, 0, 0, 0.45);
  1441. border-radius: 5px;
  1442. }
  1443. }
  1444. </style>