index.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974
  1. <template>
  2. <div class="draught-fan-list">
  3. <div class="form-wrapper">
  4. <div class="search mg-b-8">
  5. <div class="search-items">
  6. <div class="search-item">
  7. <div class="lable">场站:</div>
  8. <div class="search-content">
  9. <el-select
  10. v-model="station"
  11. clearable
  12. size="mini"
  13. placeholder="请选择"
  14. popper-class="select"
  15. @change="
  16. (station) => {
  17. getWt(station, true);
  18. }
  19. "
  20. >
  21. <el-option
  22. v-for="item in wpArray"
  23. :key="item.id"
  24. :value="item.id"
  25. :label="item.name"
  26. />
  27. </el-select>
  28. </div>
  29. </div>
  30. <div class="search-item">
  31. <div class="lable">风机:</div>
  32. <div class="search-content">
  33. <el-select
  34. v-model="wtIds"
  35. clearable
  36. size="mini"
  37. :multiple="isMultiple"
  38. collapse-tags
  39. placeholder="请选择"
  40. popper-class="select"
  41. >
  42. <el-option
  43. v-for="item in wtArray"
  44. :key="item.id"
  45. :value="item.id"
  46. :label="item.nemCode"
  47. />
  48. </el-select>
  49. </div>
  50. </div>
  51. <div class="search-item">
  52. <div class="lable">开始时间:</div>
  53. <div class="search-content">
  54. <el-date-picker
  55. v-model="st"
  56. type="date"
  57. size="mini"
  58. :disabled-date="disabledDate"
  59. placeholder="选择日期"
  60. popper-class="date-select"
  61. >
  62. </el-date-picker>
  63. </div>
  64. </div>
  65. <div class="search-item">
  66. <div class="lable">结束时间:</div>
  67. <div class="search-content">
  68. <el-date-picker
  69. v-model="et"
  70. type="date"
  71. :disabled-date="disabledDate2"
  72. size="mini"
  73. placeholder="选择日期"
  74. popper-class="date-select"
  75. >
  76. </el-date-picker>
  77. </div>
  78. </div>
  79. <div class="search-item custom">
  80. <div class="lable">等间隔:</div>
  81. <div class="search-content" style="width: 530px">
  82. <el-radio-group v-model="interval">
  83. <el-radio
  84. v-for="item in radioList"
  85. :key="item.code"
  86. size="mini"
  87. :label="item.code"
  88. >{{ item.name }}</el-radio
  89. >
  90. </el-radio-group>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. <div class="search mg-b-8">
  96. <div class="search-items">
  97. <div class="search-item">
  98. <div class="lable">最大风速:</div>
  99. <div class="search-content">
  100. <el-input-number
  101. v-model="maxs"
  102. size="mini"
  103. clearable
  104. :min="mins + 1"
  105. :max="25"
  106. placeholder="请选择"
  107. popper-class="select"
  108. >
  109. </el-input-number>
  110. </div>
  111. </div>
  112. <div class="search-item">
  113. <div class="lable">最小风速:</div>
  114. <div class="search-content">
  115. <el-input-number
  116. v-model="mins"
  117. size="mini"
  118. clearable
  119. :min="3"
  120. :max="maxs - 1"
  121. placeholder="请选择"
  122. popper-class="select"
  123. >
  124. </el-input-number>
  125. </div>
  126. </div>
  127. <div class="search-item">
  128. <div class="lable">最大功率:</div>
  129. <div class="search-content">
  130. <el-input-number
  131. v-model="maxp"
  132. size="mini"
  133. clearable
  134. :min="minp + 1"
  135. placeholder="请选择"
  136. popper-class="select"
  137. >
  138. </el-input-number>
  139. </div>
  140. </div>
  141. <div class="search-item">
  142. <div class="lable">最小功率:</div>
  143. <div class="search-content">
  144. <el-input-number
  145. v-model="minp"
  146. size="mini"
  147. :min="0"
  148. clearable
  149. placeholder="请选择"
  150. popper-class="select"
  151. >
  152. </el-input-number>
  153. </div>
  154. </div>
  155. <div class="search-item">
  156. <div class="lable">多项式:</div>
  157. <div class="search-content">
  158. <el-select v-model="dimension" size="mini">
  159. <el-option
  160. v-for="item in 10"
  161. :key="item"
  162. :value="item"
  163. :label="item"
  164. />
  165. </el-select>
  166. </div>
  167. </div>
  168. <div class="search-item">
  169. <div class="lable">拟合方式:</div>
  170. <div class="search-content">
  171. <el-select v-model="mode" size="mini">
  172. <el-option
  173. v-for="item in selectList"
  174. :key="item.code"
  175. size="mini"
  176. :value="item.code"
  177. :label="item.name"
  178. />
  179. </el-select>
  180. </div>
  181. </div>
  182. </div>
  183. </div>
  184. <div class="search mg-b-8">
  185. <div class="search-items">
  186. <div class="search-item custom">
  187. <div class="lable">筛选条件:</div>
  188. <div class="search-content">
  189. <el-checkbox-group v-model="checkedList" :min="1">
  190. <el-checkbox
  191. v-for="item in checkList"
  192. :key="item.code"
  193. :label="item.code"
  194. >{{ item.name }}</el-checkbox
  195. >
  196. </el-checkbox-group>
  197. </div>
  198. </div>
  199. </div>
  200. <div class="search-actions">
  201. <el-button size="mini" class="btn-search" @click="search"
  202. >曲线拟合</el-button
  203. >
  204. <el-button
  205. size="mini"
  206. :class="{ 'btn-active': isChartArea }"
  207. :disabled="!seriesData?.length"
  208. @click="funChartArea"
  209. >区域划分</el-button
  210. >
  211. </div>
  212. </div>
  213. </div>
  214. <div style="height: calc(100% - 125px); padding-bottom: 10px">
  215. <el-tabs v-model="activeTab">
  216. <el-tab-pane label="表格数据" name="1"> </el-tab-pane>
  217. <el-tab-pane label="图表展示" name="2"> </el-tab-pane>
  218. <table-cop
  219. v-show="activeTab === '1'"
  220. :data="tableData"
  221. :loading="tableLoading"
  222. :column="tableColumn"
  223. height="calc(100% - 20px)"
  224. :tableId="tableShowId"
  225. :tableName="tableName"
  226. ></table-cop>
  227. <div v-show="activeTab === '2'" style="height: 100%">
  228. <CurrentScatterChart
  229. ref="chartRef"
  230. width="100%"
  231. height="100%"
  232. :chartTitle="
  233. avgObj.title +
  234. '&nbsp;&nbsp;' +
  235. '平均Cp值:' +
  236. avgObj.cpavg +
  237. '; 静风频率:' +
  238. avgObj.frequency +
  239. '%; 曲线偏差率:' +
  240. avgObj.pcratio +
  241. '%'
  242. "
  243. :xAxisData="xAxisData"
  244. :yAxisData="{ splitLine: { show: false } }"
  245. :seriesData="seriesData"
  246. :brushSelected="!isChartArea"
  247. :showLegend="true"
  248. :dataSet="dataSet"
  249. @getSelected="funChartSelect"
  250. />
  251. </div>
  252. </el-tabs>
  253. </div>
  254. <el-dialog v-model="wtDialog" width="60%" top="120px" draggable>
  255. <template #title>
  256. <div class="dialog-title">
  257. <div class="title">风机功率点位</div>
  258. </div>
  259. </template>
  260. <el-tabs v-model="wtTab">
  261. <el-tab-pane label="数据" name="table">
  262. <el-table :data="wtData" row-key="id" :max-height="550">
  263. <el-table-column property="wtId" align="center" label="风机" />
  264. <el-table-column
  265. property="time"
  266. sortable
  267. width="200"
  268. align="center"
  269. label="时间"
  270. />
  271. <el-table-column
  272. property="speed"
  273. sortable
  274. width="140"
  275. align="center"
  276. label="风速(m/s)"
  277. />
  278. <el-table-column
  279. property="power"
  280. sortable
  281. width="140"
  282. align="center"
  283. label="功率(kW)"
  284. />
  285. <el-table-column
  286. property="rr"
  287. sortable
  288. width="140"
  289. align="center"
  290. label="转速"
  291. />
  292. <el-table-column
  293. property="filter"
  294. sortable
  295. width="140"
  296. align="center"
  297. label="是否有用点"
  298. />
  299. </el-table>
  300. </el-tab-pane>
  301. <el-tab-pane label="故障" name="problem" disabled> </el-tab-pane>
  302. <el-tab-pane label="预警" name="warning" disabled> </el-tab-pane>
  303. </el-tabs>
  304. </el-dialog>
  305. </div>
  306. </template>
  307. <script>
  308. // import ScatterLineChart from "@com/chart/combination/scatter-line-chart.vue";
  309. import tableCop from "./components/table.vue";
  310. import CurrentScatterChart from "./components/current-scatter-chart.vue";
  311. import api1 from "@api/economic/index.js";
  312. // import api from "@api/wisdomOverhaul/energy/index.js";
  313. import dayjs from "dayjs";
  314. import {
  315. getPowerFittingId,
  316. getPowerFittingChart,
  317. getPowerFittingTable,
  318. getPowerFittingSelectedChart,
  319. } from "@/api/powerAnalyse.js";
  320. export default {
  321. // 名称
  322. name: "healthPowerCurve",
  323. // 使用组件
  324. components: {
  325. // ScatterLineChart,
  326. CurrentScatterChart,
  327. tableCop,
  328. },
  329. // 数据
  330. data() {
  331. return {
  332. activeTab: "2",
  333. checkList: [
  334. { name: "非并网", code: "isfbw" },
  335. { name: "非合理值", code: "isfhl" },
  336. { name: "并网后十分钟", code: "isbw" },
  337. { name: "停机前十分钟", code: "istj" },
  338. { name: "功率曲线偏差", code: "isglpc" },
  339. ],
  340. selectList: [
  341. { name: "单台拟合", code: 0 },
  342. { name: "合并拟合", code: 1 },
  343. // { name: "同名拟合", code: 2 },
  344. ],
  345. radioList: [
  346. { name: "一秒钟", code: 1 },
  347. { name: "一分钟", code: 60 },
  348. { name: "十分钟", code: 600 },
  349. { name: "十五分钟", code: 900 },
  350. ],
  351. isAsc: "asc",
  352. wpArray: [],
  353. wtArray: [],
  354. station: "",
  355. wtIds: "",
  356. st: dayjs().add(-1, "month").startOf("day").format("YYYY-MM-DD HH:mm:ss"),
  357. et: dayjs().startOf("day").format("YYYY-MM-DD HH:mm:ss"),
  358. interval: 600,
  359. maxs: 25,
  360. mins: 3,
  361. maxp: 2500,
  362. minp: 0,
  363. checkedList: ["isfbw", "isfhl", "isbw", "istj", "isglpc"],
  364. dimension: 10,
  365. mode: 0,
  366. fittingId: "",
  367. seriesData: [],
  368. avgObj: {
  369. //平均cpz等
  370. title: "",
  371. cpavg: "",
  372. frequency: "",
  373. pcratio: "",
  374. },
  375. markDot: {
  376. //3-5 point点等
  377. pcl5: null,
  378. pcl10: null,
  379. pcl12: null,
  380. pcl25: null,
  381. },
  382. xAxisData: [],
  383. dataSet: "",
  384. isChartArea: false,
  385. tableShowId: "",
  386. tableColumn: [],
  387. tableLoading: false,
  388. tableName: "",
  389. tableData: [],
  390. wtTab: "table",
  391. wtDialog: false,
  392. wtData: [],
  393. };
  394. },
  395. // 函数
  396. methods: {
  397. // 时间选择器第一个禁用
  398. disabledDate(time) {
  399. if (this.et) {
  400. return time.getTime() > Date.parse(this.et);
  401. } else {
  402. return null;
  403. }
  404. },
  405. // 时间选择器第二个禁用
  406. disabledDate2(time) {
  407. if (this.st) {
  408. return time.getTime() < Date.parse(this.st);
  409. } else {
  410. return null;
  411. }
  412. },
  413. // 获取风场
  414. getWp(reGetWp) {
  415. api1
  416. .getWpList({
  417. type: "-1",
  418. })
  419. .then((res) => {
  420. if (res.data.code === 200) {
  421. this.wpArray = res.data.data;
  422. this.station = res.data.data[0].id;
  423. this.getWt(this.station, reGetWp);
  424. }
  425. });
  426. },
  427. // 获取风机
  428. getWt(wpid, reGetWp) {
  429. if (wpid) {
  430. api1
  431. .getWtList({
  432. wpId: wpid,
  433. })
  434. .then((res) => {
  435. if (res.code === 200) {
  436. this.wtArray = res.data;
  437. this.wtIds = this.isMultiple ? [res.data[0].id] : res.data[0].id;
  438. if (!reGetWp) {
  439. this.search();
  440. }
  441. }
  442. });
  443. }
  444. },
  445. //获取拟合id
  446. getChartId() {
  447. this.BASE.showLoading();
  448. let obj = {
  449. isfbw: false,
  450. isfhl: false,
  451. isbw: false,
  452. istj: false,
  453. isglpc: false,
  454. };
  455. this.checkedList.length &&
  456. this.checkedList.forEach((i) => {
  457. for (let key in obj) {
  458. if (key == i) {
  459. obj[key] = true;
  460. }
  461. }
  462. });
  463. let params = {
  464. station: this.station,
  465. wtIds: this.isMultiple ? this.wtIds.join(",") : this.wtIds,
  466. st: dayjs(this.st).valueOf(),
  467. et: dayjs(this.et).valueOf(),
  468. interval: this.interval,
  469. maxs: this.maxs,
  470. mins: this.mins,
  471. maxp: this.maxp,
  472. minp: this.minp,
  473. ...obj,
  474. dimension: this.dimension,
  475. mode: this.mode,
  476. };
  477. getPowerFittingId(params).then((res) => {
  478. if (res.code == 200) {
  479. this.fittingId = res.data.id;
  480. this.getChartData();
  481. this.getTableData();
  482. } else {
  483. this.BASE.closeLoading();
  484. this.$message.error(res.msg);
  485. this.clear();
  486. }
  487. });
  488. },
  489. //清空数据
  490. clear() {
  491. this.fittingId = "";
  492. this.seriesData = [];
  493. this.avgObj = {
  494. //平均cpz等
  495. title: "",
  496. cpavg: "",
  497. frequency: "",
  498. pcratio: "",
  499. };
  500. this.markDot = {
  501. //3-5 point点等
  502. pcl5: null,
  503. pcl10: null,
  504. pcl12: null,
  505. pcl25: null,
  506. };
  507. this.xAxisData = [];
  508. this.dataSet = "";
  509. },
  510. //是否区域划分
  511. funChartArea() {
  512. this.BASE.showLoading();
  513. if (this.seriesData.length) {
  514. if (!this.isChartArea) {
  515. // 请求一下
  516. this.seriesData[0] = {
  517. ...this.seriesData[0],
  518. markLine: {
  519. symbol: "none",
  520. label: {
  521. show: false,
  522. },
  523. lineStyle: {
  524. color: "rgba(96,174,255, 1)",
  525. },
  526. data: [
  527. {
  528. xAxis: 3,
  529. valueIndex: 0,
  530. },
  531. {
  532. xAxis: 5,
  533. valueIndex: 0,
  534. },
  535. {
  536. xAxis: 10,
  537. valueIndex: 0,
  538. },
  539. {
  540. xAxis: 12,
  541. valueIndex: 0,
  542. },
  543. {
  544. xAxis: 25,
  545. valueIndex: 0,
  546. },
  547. ],
  548. },
  549. markArea: {
  550. label: {
  551. fontSize: 13,
  552. color: "#ccc",
  553. fontWeight: "normal",
  554. fontFamily: "Arial",
  555. },
  556. itemStyle: {
  557. color: "rgba(236,245,255, 0)",
  558. },
  559. emphasis: {
  560. itemStyle: {
  561. color: "rgba(96,174,255, 0.5)",
  562. },
  563. },
  564. data: [
  565. [
  566. {
  567. name: `3~5m 偏差率: ${this.markDot.pcl5}%`,
  568. xAxis: 3,
  569. },
  570. {
  571. xAxis: 5,
  572. },
  573. ],
  574. [
  575. {
  576. name: `5~10m 偏差率: ${this.markDot.pcl10}%`,
  577. xAxis: 5,
  578. },
  579. {
  580. xAxis: 10,
  581. },
  582. ],
  583. [
  584. {
  585. name: `10~12m 偏差率: ${this.markDot.pcl12}%`,
  586. xAxis: 10,
  587. },
  588. {
  589. xAxis: 12,
  590. },
  591. ],
  592. [
  593. {
  594. name: `12~25m 偏差率: ${this.markDot.pcl25}%`,
  595. xAxis: 12,
  596. },
  597. {
  598. xAxis: 25,
  599. },
  600. ],
  601. ],
  602. },
  603. };
  604. this.isChartArea = true;
  605. this.BASE.closeLoading();
  606. } else {
  607. this.seriesData[0] = {
  608. ...this.seriesData[0],
  609. markLine: null,
  610. markArea: null,
  611. };
  612. this.isChartArea = false;
  613. this.BASE.closeLoading();
  614. }
  615. }
  616. },
  617. // 获取表格数据
  618. getTableData() {
  619. this.tableLoading = true;
  620. getPowerFittingTable({
  621. id: this.fittingId,
  622. }).then((res) => {
  623. if (res.code == 200) {
  624. this.tableColumn = res.data.title.map((o) => {
  625. return {
  626. prop: o.key,
  627. width: o.des === "时间" ? 100 : 80,
  628. label: o.des,
  629. };
  630. });
  631. this.tableData = res.data.data;
  632. this.$message.success(res.msg);
  633. }
  634. this.tableLoading = false;
  635. });
  636. },
  637. // 获取图表数据
  638. getChartData() {
  639. getPowerFittingChart({
  640. id: this.fittingId,
  641. }).then((res) => {
  642. if (res.code == 200) {
  643. let chartRes = {
  644. scatterhs: [[]],
  645. scatterls: [[]],
  646. sjgl: [[]],
  647. llgl: [[]],
  648. cpz: [[]],
  649. };
  650. chartRes = res.data;
  651. this.markDot.pcl5 = chartRes.obj.pc5ratio;
  652. this.markDot.pcl10 = chartRes.obj.pc10ratio;
  653. this.markDot.pcl12 = chartRes.obj.pc12ratio;
  654. this.markDot.pcl25 = chartRes.obj.pc25ratio;
  655. this.avgObj.title =
  656. this.mode == 0
  657. ? chartRes.obj.code
  658. : chartRes.obj.path
  659. .substring(
  660. chartRes.obj.path.indexOf(chartRes.obj.station + "_") +
  661. (chartRes.obj.station + "_").length
  662. )
  663. .split("_")[0];
  664. this.avgObj.cpavg = Number(chartRes.obj.cpavg).toFixed(2);
  665. this.avgObj.frequency = Number(chartRes.obj.frequency).toFixed(2);
  666. this.avgObj.pcratio = Number(chartRes.obj.pcratio).toFixed(2);
  667. this.dataSet = JSON.stringify([
  668. {
  669. source: chartRes.wyd,
  670. },
  671. {
  672. source: chartRes.yyd,
  673. },
  674. ]);
  675. this.seriesData = [
  676. {
  677. name: "拟合功率",
  678. type: "line",
  679. symbol: "line", //设定为实心点
  680. symbolSize: 0, //设定实心点的大小
  681. smooth: true, //这个是把线变成曲线
  682. data: chartRes.sjgl,
  683. xAxisIndex: 0,
  684. },
  685. {
  686. name: "保证功率",
  687. type: "line",
  688. symbol: "line", //设定为实心点
  689. symbolSize: 0, //设定实心点的大小
  690. smooth: true, //这个是把线变成曲线
  691. data: chartRes.llgl,
  692. xAxisIndex: 0,
  693. },
  694. {
  695. type: "effectScatter",
  696. showEffectOn: "emphasis",
  697. rippleEffect: {
  698. scale: 1,
  699. },
  700. name: "无用点",
  701. symbolSize: (data) => {
  702. return data.s ? (data.s > 10 ? 10 : data.s) : 4;
  703. },
  704. datasetIndex: 0,
  705. encode: {
  706. x: "x",
  707. y: "y",
  708. },
  709. xAxisIndex: 0,
  710. yAxisIndex: 0,
  711. },
  712. {
  713. type: "effectScatter",
  714. showEffectOn: "emphasis",
  715. rippleEffect: {
  716. scale: 1,
  717. },
  718. name: "有用点",
  719. symbolSize: (data) => {
  720. return data.s ? (data.s > 10 ? 10 : data.s) : 4;
  721. },
  722. datasetIndex: 1,
  723. encode: {
  724. x: "x",
  725. y: "y",
  726. },
  727. xAxisIndex: 0,
  728. yAxisIndex: 0,
  729. },
  730. {
  731. name: "Cp值",
  732. type: "line",
  733. symbol: "line", //设定为实心点
  734. symbolSize: 0, //设定实心点的大小
  735. smooth: true, //这个是把线变成曲线
  736. data: chartRes.cpz,
  737. xAxisIndex: 0,
  738. yAxisIndex: 1,
  739. },
  740. ];
  741. this.$message.success(res.msg);
  742. }
  743. this.BASE.closeLoading();
  744. });
  745. },
  746. //拟合按钮
  747. search() {
  748. this.isChartArea = false;
  749. if (!this.station || !this.wtIds || !this.wtIds.length) {
  750. this.BASE.showMsg({
  751. msg: "场站与风机为必选项",
  752. });
  753. } else {
  754. this.getChartId();
  755. }
  756. },
  757. async funChartSelect(batch) {
  758. const wDataArr = [];
  759. const yDataArr = [];
  760. let scatterls = [];
  761. let scatterhs = [];
  762. let dataSetObj = [];
  763. this.wtData = [];
  764. if (batch?.length && this.dataSet) {
  765. scatterls = batch[0].selected[2].dataIndex;
  766. scatterhs = batch[0].selected[3].dataIndex;
  767. if (scatterls?.length || scatterhs?.length) {
  768. dataSetObj = JSON.parse(this.dataSet);
  769. if (scatterls?.length) {
  770. for (const scatterIndex of scatterls) {
  771. wDataArr.push(dataSetObj[0].source[scatterIndex].k);
  772. }
  773. }
  774. if (scatterhs?.length) {
  775. for (const scatterIndex of scatterhs) {
  776. yDataArr.push(dataSetObj[1].source[scatterIndex].k);
  777. }
  778. }
  779. const wtRes = await getPowerFittingSelectedChart({
  780. yk: yDataArr.join(","),
  781. wk: wDataArr.join(","),
  782. });
  783. if (wtRes.code === 200) {
  784. let id = 1;
  785. const tempArr = []; //用于以风机id 聚合dataArr
  786. if (wtRes.data?.length) {
  787. for (const data of wtRes.data) {
  788. if (tempArr.length) {
  789. const findIndex = tempArr.findIndex(
  790. (o) => o.wtId === data.wtId
  791. );
  792. if (findIndex !== -1) {
  793. if (!tempArr[findIndex].children) {
  794. tempArr[findIndex].children = [];
  795. }
  796. tempArr[findIndex].children.push({
  797. ...data,
  798. id: id,
  799. filter: data.filter === 0 ? "是" : "否",
  800. });
  801. id++;
  802. } else {
  803. tempArr.push({
  804. ...data,
  805. id: id,
  806. filter: data.filter === 0 ? "是" : "否",
  807. });
  808. id++;
  809. }
  810. } else {
  811. tempArr.push({
  812. ...data,
  813. id: id,
  814. filter: data.filter === 0 ? "是" : "否",
  815. });
  816. id++;
  817. }
  818. }
  819. this.wtDialog = true;
  820. this.$nextTick(() => {
  821. this.wtTab = "table";
  822. this.wtData = tempArr;
  823. });
  824. }
  825. }
  826. }
  827. }
  828. },
  829. },
  830. created() {
  831. this.getWp();
  832. },
  833. watch: {
  834. mode(val) {
  835. if (val == 0) {
  836. this.isMultiple = false;
  837. this.wtIds =
  838. typeof this.wtIds == "string"
  839. ? this.wtIds
  840. : this.wtIds.length
  841. ? this.wtIds[0]
  842. : [];
  843. } else {
  844. this.isMultiple = true;
  845. this.wtIds = [this.wtIds];
  846. }
  847. },
  848. },
  849. unmounted() {},
  850. };
  851. </script>
  852. <style lang="less" scoped>
  853. .draught-fan-list {
  854. width: 100%;
  855. height: 100%;
  856. display: flex;
  857. flex-direction: column;
  858. padding: 10px 20px;
  859. .form-wrapper ::v-deep {
  860. .el-checkbox__input {
  861. display: block;
  862. }
  863. .el-input-number {
  864. width: 100%;
  865. .el-input-number__decrease,
  866. .el-input-number__increase {
  867. background: rgba(67, 81, 107, 0.2) !important;
  868. position: absolute;
  869. z-index: 10;
  870. border: 0;
  871. // height: 33px;
  872. // line-height: 33px;
  873. &:hover {
  874. color: #05be4c;
  875. }
  876. }
  877. }
  878. .el-date-editor,
  879. .el-select {
  880. width: 100%;
  881. }
  882. .el-radio-group {
  883. width: 100%;
  884. display: flex;
  885. .el-radio {
  886. flex: 1;
  887. }
  888. }
  889. .search {
  890. display: flex;
  891. align-items: center;
  892. .search-items {
  893. display: flex;
  894. align-items: center;
  895. .search-item {
  896. width: 296px;
  897. display: flex;
  898. align-items: center;
  899. margin-right: 10px;
  900. .lable {
  901. font-size: 14px;
  902. font-family: Microsoft YaHei;
  903. font-weight: 400;
  904. color: #b3b3b3;
  905. margin-right: 5px;
  906. width: 65px;
  907. white-space: nowrap;
  908. }
  909. .search-content {
  910. flex: 1;
  911. }
  912. &:nth-last-child(1) {
  913. margin-right: 0;
  914. }
  915. }
  916. .custom {
  917. width: auto;
  918. }
  919. }
  920. .search-actions {
  921. .el-button {
  922. background-color: rgba(5, 187, 76, 0.3);
  923. border: 1px solid #3b6c53;
  924. color: #b3b3b3;
  925. font-size: 14px;
  926. border: none;
  927. width: 108px;
  928. min-height: 25px !important;
  929. &.btn-search:hover {
  930. background-color: rgba(5, 187, 76, 0.6);
  931. color: #ffffff;
  932. }
  933. }
  934. .btn-active {
  935. background-color: rgba(5, 187, 76, 0.6);
  936. color: #ffffff;
  937. }
  938. }
  939. &:nth-last-child(1) {
  940. justify-content: space-between;
  941. }
  942. }
  943. }
  944. .el-tabs ::v-deep {
  945. height: 100%;
  946. .el-tabs__item {
  947. color: #b3b3b3;
  948. }
  949. .el-tabs__nav-wrap::after {
  950. background-color: #14221f;
  951. }
  952. .el-tabs__active-bar {
  953. background-color: #05bb4c;
  954. }
  955. .el-tabs__item.is-active,
  956. .el-tabs__item:hover {
  957. color: #05bb4c;
  958. }
  959. .el-tabs__content {
  960. height: calc(100% - 40px);
  961. }
  962. }
  963. }
  964. </style>