leftdata.vue 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141
  1. <template>
  2. <div class="backbone" :class="{ 'backbone--flat': panel !== 'all' }">
  3. <div
  4. v-if="showTaskBlock"
  5. class="BOXYI"
  6. v-hasPermi="['home:performance:performanceData']"
  7. >
  8. <h3>任务统计</h3>
  9. <div class="BOXsan cockpit-task-kpi">
  10. <div class="YC02" @click="getwgl">
  11. <strong> {{ onrelevance ? onrelevance : 0 }}</strong>
  12. <span>待分析</span>
  13. </div>
  14. <div class="YC02" @click="getwfx">
  15. <strong class="textred"> {{ abnormal ? abnormal : 0 }}</strong>
  16. <span>异常中断</span>
  17. </div>
  18. <div class="YC03" @click="getpd">
  19. <strong class="texyellow">
  20. {{ queueNumber ? queueNumber : 0 }}</strong
  21. >
  22. <span>排队中</span>
  23. </div>
  24. </div>
  25. <el-dialog title="待分析任务统计表" :visible.sync="glShow" width="45%">
  26. <!-- 外部容器设置最大高度和滚动条 -->
  27. <div style="max-height: 400px; overflow-y: auto">
  28. <el-table :data="glData" style="width: 100%">
  29. <el-table-column
  30. prop="fieldName"
  31. label="风场名称"
  32. width="180"
  33. ></el-table-column>
  34. <el-table-column
  35. prop="analysisName"
  36. label="分析名称"
  37. ></el-table-column>
  38. <el-table-column
  39. prop="createTime"
  40. label="创建时间"
  41. width="180"
  42. ></el-table-column>
  43. <el-table-column fixed="right" label="操作" width="100">
  44. <template slot-scope="scope">
  45. <el-button
  46. @click="handleClick(scope.row)"
  47. type="text"
  48. size="small"
  49. >编辑</el-button
  50. >
  51. </template>
  52. </el-table-column>
  53. </el-table>
  54. </div>
  55. </el-dialog>
  56. <el-dialog title="异常任务统计表" :visible.sync="YCShow" width="45%">
  57. <div style="max-height: 400px; overflow-y: auto">
  58. <el-table :data="FXData" style="width: 100%">
  59. <el-table-column prop="fieldName" label="风场名称" width="180">
  60. </el-table-column>
  61. <el-table-column prop="analysisName" label="分析名称">
  62. </el-table-column>
  63. <el-table-column prop="createTime" label="创建时间" width="180">
  64. </el-table-column>
  65. <el-table-column fixed="right" label="操作" width="100">
  66. <template slot-scope="scope">
  67. <el-button
  68. @click="YChandleClick(scope.row)"
  69. type="text"
  70. size="small"
  71. >编辑</el-button
  72. >
  73. </template>
  74. </el-table-column>
  75. </el-table>
  76. </div>
  77. </el-dialog>
  78. <el-dialog title="排队任务统计表" :visible.sync="PdShow" width="45%">
  79. <div style="max-height: 400px; overflow-y: auto">
  80. <el-table :data="PdData" style="width: 100%">
  81. <el-table-column prop="fieldName" label="风场名称" width="180">
  82. </el-table-column>
  83. <el-table-column prop="analysisName" label="分析名称">
  84. </el-table-column>
  85. <el-table-column prop="createTime" label="创建时间" width="180">
  86. </el-table-column>
  87. <el-table-column fixed="right" label="操作" width="100">
  88. <template slot-scope="scope">
  89. <el-button @click="PDClick(scope.row)" type="text" size="small"
  90. >编辑</el-button
  91. >
  92. </template>
  93. </el-table-column>
  94. </el-table>
  95. </div>
  96. </el-dialog>
  97. </div>
  98. <template v-if="showInboundBlock">
  99. <div v-if="panel === 'inbound'" class="cockpit-inbound-panel">
  100. <CockpitTechTabs
  101. v-model="inboundTab"
  102. :tabs="inboundTabs"
  103. variant="panel"
  104. >
  105. <template #extra>
  106. <i
  107. class="el-icon-arrow-right cockpit-tech-tabs__chevron"
  108. title="更多"
  109. @click="onInboundChevronClick"
  110. />
  111. </template>
  112. </CockpitTechTabs>
  113. <div class="cockpit-inbound-body">
  114. <div v-show="inboundTab === 'import'" class="cockpit-inbound-pane">
  115. <div class="cockpit-inbound-pane-header">
  116. <div
  117. class="cockpit-inbound-subtitle"
  118. v-hasPermi="['home:offlinedata']"
  119. >
  120. 入库数据
  121. </div>
  122. <span class="cockpit-inbound-col-data">
  123. <span class="cockpit-inbound-more-link" @click="more"
  124. >更多</span
  125. >
  126. </span>
  127. </div>
  128. <div
  129. class="cockpit-inbound-table-wrap cockpit-table-block cockpit-unified-table cockpit-unified-table--inbound-import BOX BOX--flat"
  130. v-hasPermi="['home:offlinedata']"
  131. >
  132. <p
  133. class="titleYC cockpit-unified-table-head cockpit-unified-table-head--inbound-import"
  134. >
  135. <span class="cockpit-inbound-col-name">风场名称</span>
  136. <span class="cockpit-inbound-col-extra"> 入库时间 </span>
  137. </p>
  138. <tabroll
  139. :table-data="tableData"
  140. :shujuloading="shujuloading"
  141. :columns="inboundImportColumns"
  142. :column-widths="inboundImportColumnWidths"
  143. :max-height="140"
  144. />
  145. </div>
  146. </div>
  147. <div v-show="inboundTab === 'access'" class="cockpit-inbound-pane">
  148. <div
  149. class="cockpit-inbound-subtitle"
  150. v-hasPermi="['home:onlinData']"
  151. >
  152. 接入数据
  153. </div>
  154. <div
  155. class="cockpit-inbound-table-wrap cockpit-table-block cockpit-unified-table cockpit-unified-table--inbound-two BOX BOX--flat"
  156. v-hasPermi="['home:onlinData']"
  157. >
  158. <p
  159. class="titleYC cockpit-unified-table-head cockpit-unified-table-head--inbound-two"
  160. >
  161. <span class="cockpit-inbound-col-name">风场名称</span>
  162. <span class="cockpit-inbound-col-extra">采集状态</span>
  163. </p>
  164. <tabroll
  165. :table-data="hometopdata"
  166. :hometoploading="hometoploading"
  167. :columns="hometopColumns"
  168. :column-widths="hometopcolumnWidths"
  169. :max-height="cockpitTableBodyHeight"
  170. />
  171. </div>
  172. </div>
  173. </div>
  174. </div>
  175. <template v-else>
  176. <!-- 入库信息 -->
  177. <!-- 离线 -->
  178. <div class="BOX" v-hasPermi="['home:offlinedata']">
  179. <h3 class="centeredh3">
  180. 入库数据
  181. <span>
  182. <span style="cursor: pointer" @click="importdata">导入数据</span>
  183. <span style="cursor: pointer" @click="more">更多</span>
  184. </span>
  185. </h3>
  186. <div>
  187. <p class="titleYC"><span>风场名称</span><span>入库时间</span></p>
  188. <tabroll
  189. :table-data="tableData"
  190. :shujuloading="shujuloading"
  191. :columns="YCtableColumns"
  192. :column-widths="YCcolumnWidths"
  193. :max-height="140"
  194. ></tabroll>
  195. </div>
  196. </div>
  197. <!-- 在线 -->
  198. <div class="BOX" v-hasPermi="['home:onlinData']">
  199. <h3 class="centeredh3">
  200. 接入数据
  201. <span>
  202. <span style="cursor: pointer" @click="onlinedata">更多</span>
  203. </span>
  204. </h3>
  205. <div>
  206. <p class="titleYC"><span>风场名称</span><span>采集状态</span></p>
  207. <tabroll
  208. :table-data="hometopdata"
  209. :hometoploading="hometoploading"
  210. :columns="hometopColumns"
  211. :column-widths="hometopcolumnWidths"
  212. :max-height="140"
  213. ></tabroll>
  214. </div>
  215. </div>
  216. </template>
  217. </template>
  218. <el-dialog
  219. title="实时数据采集统计"
  220. :visible.sync="lineShow"
  221. width="1340px"
  222. :before-close="handleClose"
  223. >
  224. <el-container>
  225. <el-aside width="300px">
  226. <h1>当日实时数据</h1>
  227. <el-input
  228. placeholder="请输入内容"
  229. size="small"
  230. v-model="searchvalue"
  231. prefix-icon="el-icon-search"
  232. ></el-input>
  233. <div class="windbox">
  234. <el-empty
  235. v-if="filteredWindList.length === 0"
  236. :image-size="200"
  237. ></el-empty>
  238. <div
  239. class="windlist"
  240. v-for="(item, index) in filteredWindList"
  241. :key="index"
  242. >
  243. <h3>{{ item.windFarmName }}</h3>
  244. <p>数据类型: {{ item.typeName }}</p>
  245. <p>采集条数: {{ item.count }} 条</p>
  246. <p>采集时间: {{ item.latestDataTime }}</p>
  247. </div>
  248. </div>
  249. </el-aside>
  250. <el-main>
  251. <div class="inquire">
  252. <p>
  253. 风场名称:
  254. <el-select v-model="windvalue" placeholder="请选择" size="small">
  255. <el-option
  256. v-for="item in windoptions"
  257. :key="item.fieldCode"
  258. :label="item.fieldName"
  259. :value="item.fieldCode"
  260. >
  261. </el-option>
  262. </el-select>
  263. </p>
  264. <p>
  265. 类型:
  266. <el-select v-model="typevalue" placeholder="请选择" size="small">
  267. <el-option
  268. v-for="item in typeoptions"
  269. :key="item.paramKey"
  270. :label="item.paramValue"
  271. :value="item.paramKey"
  272. >
  273. </el-option>
  274. </el-select>
  275. </p>
  276. <p>
  277. 选择日期:
  278. <el-date-picker
  279. size="small"
  280. v-model="timeval"
  281. type="daterange"
  282. range-separator="至"
  283. start-placeholder="开始日期"
  284. end-placeholder="结束日期"
  285. @change="onDateChange"
  286. >
  287. </el-date-picker>
  288. </p>
  289. <div>
  290. <el-button size="small" @click="conditions">查询</el-button>
  291. <el-button size="small" @click="reset">重置</el-button>
  292. </div>
  293. </div>
  294. <el-table
  295. :data="ListtableData"
  296. style="width: 100%"
  297. class="custom-table"
  298. height="550"
  299. >
  300. <el-table-column prop="windFarmName" label="风场名称">
  301. </el-table-column>
  302. <el-table-column prop="typeName" label="类型" align="center">
  303. </el-table-column>
  304. <el-table-column
  305. prop="totalDays"
  306. label="采集总天数"
  307. align="center"
  308. width="150"
  309. >
  310. </el-table-column>
  311. <el-table-column
  312. prop="totalDataCount"
  313. label="采集总条数"
  314. align="center"
  315. width="180"
  316. >
  317. </el-table-column>
  318. <el-table-column
  319. prop="latestDataTime"
  320. label="最近采集时间"
  321. align="center"
  322. >
  323. </el-table-column>
  324. <el-table-column prop="canAnalysis" label="采集状态" align="center">
  325. <template #default="{ row }">
  326. {{ row.canAnalysis === 0 ? "不可分析" : "可分析" }}
  327. </template>
  328. </el-table-column>
  329. </el-table>
  330. </el-main>
  331. </el-container>
  332. </el-dialog>
  333. <el-dialog title="入库信息" width="70%" :visible.sync="dialogTableVisible">
  334. <el-button size="small" @click="importdata">导入数据</el-button>
  335. <el-table :data="gridData" style="max-height: 400px; overflow: auto">
  336. <el-table-column
  337. property="windFarmName"
  338. label="风场名称"
  339. show-overflow-tooltip
  340. width="150px"
  341. ></el-table-column>
  342. <el-table-column
  343. property="minuteTimeAreaList"
  344. label="SCADA分钟级"
  345. show-overflow-tooltip
  346. ></el-table-column>
  347. <el-table-column
  348. property="secondTimeAreaList"
  349. label="SCADA秒级"
  350. show-overflow-tooltip
  351. ></el-table-column>
  352. <el-table-column
  353. property="faultTimeAreaList"
  354. label="故障数据"
  355. show-overflow-tooltip
  356. ></el-table-column>
  357. <el-table-column
  358. property="warnTimeAreaList"
  359. label="报警数据"
  360. show-overflow-tooltip
  361. ></el-table-column>
  362. <el-table-column
  363. property="vibrationTimeAreaList"
  364. label="振动数据"
  365. show-overflow-tooltip
  366. ></el-table-column>
  367. </el-table>
  368. </el-dialog>
  369. </div>
  370. </template>
  371. <script>
  372. import {
  373. queryWaitTask,
  374. getAnalysisResultStateList,
  375. getAnalysisResultErrStateList,
  376. analysisResultList,
  377. getWindFieldNames,
  378. } from "@/api/ledger.js";
  379. import axios from "axios";
  380. import Tabroll from "./tabroll.vue";
  381. import CockpitTechTabs from "./CockpitTechTabs.vue";
  382. import { COCKPIT_TABLE_BODY_HEIGHT } from "./cockpitTableMetrics";
  383. export default {
  384. props: {
  385. /** task | inbound | all */
  386. panel: { type: String, default: "all" },
  387. },
  388. components: {
  389. Tabroll,
  390. CockpitTechTabs,
  391. },
  392. computed: {
  393. showTaskBlock() {
  394. return this.panel === "all" || this.panel === "task";
  395. },
  396. showInboundBlock() {
  397. return this.panel === "all" || this.panel === "inbound";
  398. },
  399. shouldPollInbound() {
  400. return this.panel === "inbound" || this.panel === "all";
  401. },
  402. filteredWindList() {
  403. return this.searchvalue
  404. ? this.windList.filter((item) =>
  405. item.windFarmName.includes(this.searchvalue),
  406. )
  407. : this.windList;
  408. },
  409. inboundImportColumns() {
  410. return [
  411. { prop: "windFarmName", label: "风场名称" },
  412. { prop: "createTime", label: "导入数据" },
  413. ];
  414. },
  415. inboundImportColumnWidths() {
  416. return {
  417. windFarmName: "42%",
  418. createTime: "auto",
  419. };
  420. },
  421. inboundTabs() {
  422. return [
  423. { label: "入库", value: "import" },
  424. { label: "接入", value: "access" },
  425. ];
  426. },
  427. },
  428. data() {
  429. return {
  430. cockpitTableBodyHeight: COCKPIT_TABLE_BODY_HEIGHT,
  431. inboundTab: "import",
  432. onrelevance: "",
  433. abnormal: "",
  434. queueNumber: "",
  435. glShow: false,
  436. YCShow: false,
  437. PdShow: false,
  438. lineShow: false,
  439. dialogTableVisible: false,
  440. glData: [],
  441. FXData: [],
  442. PdData: [],
  443. tableData: [],
  444. hometopdata: [],
  445. maxHeight: "200",
  446. gridData: [],
  447. shujuloading: false,
  448. hometoploading: false,
  449. searchvalue: "",
  450. timeval: [],
  451. windvalue: "",
  452. typevalue: "",
  453. windoptions: [],
  454. typeoptions: [
  455. {
  456. id: 1,
  457. type: "trans_type",
  458. typeName: "转化类型",
  459. paramKey: "second",
  460. paramValue: "SCADA秒级",
  461. status: 1,
  462. },
  463. {
  464. id: 2,
  465. type: "trans_type",
  466. typeName: "转化类型",
  467. paramKey: "minute",
  468. paramValue: "SCADA分钟级",
  469. status: 1,
  470. },
  471. {
  472. id: 3,
  473. type: "trans_type",
  474. typeName: "转化类型",
  475. paramKey: "fault",
  476. paramValue: "SCADA故障",
  477. status: 1,
  478. },
  479. {
  480. id: 4,
  481. type: "trans_type",
  482. typeName: "转化类型",
  483. paramKey: "warn",
  484. paramValue: "SCADA报警",
  485. status: 1,
  486. },
  487. // {
  488. // id: 5,
  489. // type: "trans_type",
  490. // typeName: "转化类型",
  491. // paramKey: "wave",
  492. // paramValue: "振动",
  493. // status: 1,
  494. // },
  495. ],
  496. windList: [],
  497. YCtableColumns: [{ prop: "windFarmName" }, { prop: "createTime" }],
  498. YCcolumnWidths: {
  499. windFarmName: 130,
  500. createTime: 150,
  501. },
  502. hometopColumns: [
  503. { prop: "windFarmName", label: "风场名称" },
  504. {
  505. prop: "canAnalysis",
  506. label: "分析状态",
  507. },
  508. ],
  509. hometopcolumnWidths: {
  510. windFarmName: "42%",
  511. canAnalysis: "auto",
  512. },
  513. ListtableData: [],
  514. startDate: "",
  515. endDate: "",
  516. pollInterval: null, // 轮询定时器
  517. pollTime: 5000, // 轮询间隔,单位:毫秒
  518. };
  519. },
  520. created() {
  521. if (this.showTaskBlock) {
  522. this.getbacklog();
  523. }
  524. if (this.showInboundBlock) {
  525. this.ruku();
  526. }
  527. },
  528. mounted() {
  529. if (this.shouldPollInbound) {
  530. this.startPolling();
  531. }
  532. },
  533. beforeDestroy() {
  534. if (this.shouldPollInbound) {
  535. this.stopPolling();
  536. }
  537. },
  538. methods: {
  539. getbacklog() {
  540. queryWaitTask().then((res) => {
  541. this.abnormal = res?.data?.errCount;
  542. this.onrelevance = res?.data?.uncorrelatedCount;
  543. this.queueNumber = res?.data?.queueNumber;
  544. });
  545. },
  546. getwgl() {
  547. const arr = {
  548. pageSize: 999,
  549. analysisState: "-1",
  550. };
  551. analysisResultList(arr).then((res) => {
  552. this.glData = res.data.list;
  553. this.glShow = true;
  554. });
  555. },
  556. getwfx() {
  557. const arr = {
  558. pageSize: 999,
  559. errState: 1,
  560. };
  561. analysisResultList(arr).then((res) => {
  562. this.FXData = res.data.list;
  563. this.YCShow = true;
  564. });
  565. },
  566. getpd() {
  567. const arr = {
  568. pageSize: 999,
  569. analysisState: "10",
  570. };
  571. analysisResultList(arr).then((res) => {
  572. this.PdData = res.data.list;
  573. this.PdShow = true;
  574. });
  575. },
  576. PDClick(row) {
  577. const fieldName = row.fieldName; // 获取当前行的 fieldName 数据
  578. const analysisState = "10";
  579. // 打开新窗口
  580. const newWindow = window.open(
  581. "/home/performance/assetssMag?id=195",
  582. "_blank",
  583. );
  584. // 等待窗口加载完成后发送消息
  585. newWindow.onload = () => {
  586. newWindow.postMessage({ fieldName, analysisState }, "*");
  587. };
  588. },
  589. handleClick(row) {
  590. const fieldName = row.fieldName; // 获取当前行的 fieldName 数据
  591. const analysisState = "-1";
  592. // 打开新窗口
  593. const newWindow = window.open(
  594. "/home/performance/assetssMag?id=195",
  595. "_blank",
  596. );
  597. // 等待窗口加载完成后发送消息
  598. newWindow.onload = () => {
  599. newWindow.postMessage({ fieldName, analysisState }, "*");
  600. };
  601. },
  602. YChandleClick(row) {
  603. const fieldName = row.fieldName; // 获取当前行的 fieldName 数据
  604. const errState = 1;
  605. const analysisState = "30";
  606. // 打开新窗口
  607. const newWindow = window.open(
  608. "/home/performance/assetssMag?id=195",
  609. "_blank",
  610. );
  611. // 等待窗口加载完成后发送消息
  612. newWindow.onload = () => {
  613. newWindow.postMessage({ fieldName, errState, analysisState }, "*");
  614. };
  615. },
  616. more() {
  617. this.dialogTableVisible = true;
  618. axios
  619. .post(`/ETLapi/dataTransfer/pltIndexMore`)
  620. .then((res) => {
  621. if (res.data.code === 200) {
  622. this.gridData = res.data.datas.map((item) => {
  623. // 合并数组中的元素,用 '/' 分隔
  624. if (
  625. item.secondTimeAreaList &&
  626. item.secondTimeAreaList.length > 0
  627. ) {
  628. item.secondTimeAreaList = [item.secondTimeAreaList.join(" / ")];
  629. }
  630. if (item.faultTimeAreaList && item.faultTimeAreaList.length > 0) {
  631. item.faultTimeAreaList = [item.faultTimeAreaList.join(" / ")];
  632. }
  633. if (
  634. item.minuteTimeAreaList &&
  635. item.minuteTimeAreaList.length > 0
  636. ) {
  637. item.minuteTimeAreaList = [item.minuteTimeAreaList.join(" / ")];
  638. }
  639. if (
  640. item.vibrationTimeAreaList &&
  641. item.vibrationTimeAreaList.length > 0
  642. ) {
  643. item.vibrationTimeAreaList = [
  644. item.vibrationTimeAreaList.join(" / "),
  645. ];
  646. }
  647. if (item.warnTimeAreaList && item.warnTimeAreaList.length > 0) {
  648. item.warnTimeAreaList = [item.warnTimeAreaList.join(" / ")];
  649. }
  650. return item;
  651. });
  652. }
  653. if (res.data.code === 500) {
  654. this.$message.error(res.data.message);
  655. }
  656. })
  657. .catch((error) => {
  658. console.error("Error fetching data:", error);
  659. });
  660. },
  661. onInboundChevronClick() {
  662. if (this.inboundTab === "import") {
  663. this.more();
  664. } else {
  665. this.onlinedata();
  666. }
  667. },
  668. importdata() {
  669. window.open(this.$router.resolve({ path: "/transition" }).href, "_blank");
  670. },
  671. ruku() {
  672. axios
  673. .post(`/ETLapi/dataTransfer/recentlyImportedSuccessful5Data`)
  674. .then((res) => {
  675. if (res.data.code === 200) {
  676. this.tableData = res.data.datas;
  677. }
  678. if (res.data.code === 500) {
  679. this.$message.error(res.data.message);
  680. }
  681. })
  682. .catch((error) => {
  683. console.error("Error fetching data:", error);
  684. });
  685. },
  686. // 在线数据
  687. onlinedata() {
  688. this.windsite();
  689. this.lineShow = true;
  690. // 获取在线数据
  691. axios.post(`/transDataWeb/windFarmDayCount/getTodayData`).then((res) => {
  692. this.windList = res.data.datas;
  693. });
  694. this.conditions();
  695. },
  696. // 首页top
  697. hometop() {
  698. axios
  699. .post("/transDataWeb/windFarmDayCount/getIndexOnlineData")
  700. .then((res) => {
  701. this.hometopdata = res.data.datas.map((item) => ({
  702. ...item,
  703. canAnalysis: item.canAnalysis === 1 ? "可分析" : "不可分析",
  704. }));
  705. this.errorCount = 0; // 请求成功时重置错误计数
  706. })
  707. .catch((err) => {
  708. this.errorCount++;
  709. if (this.errorCount < 3) {
  710. console.log(`请求失败(第 ${this.errorCount} 次):`, err.message);
  711. }
  712. });
  713. },
  714. startPolling() {
  715. this.hometop(); // 先执行一次
  716. this.pollInterval = setInterval(this.hometop, this.pollTime);
  717. },
  718. stopPolling() {
  719. if (this.pollInterval) {
  720. clearInterval(this.pollInterval);
  721. this.pollInterval = null;
  722. }
  723. },
  724. conditions() {
  725. // 获取历史数据
  726. axios
  727. .post(`/transDataWeb/windFarmDayCount/getHistoryDataSummary`, {
  728. beginDate: this.startDate,
  729. endDate: this.endDate,
  730. type: this.typevalue,
  731. windFarmCode: this.windvalue,
  732. })
  733. .then((res) => {
  734. this.ListtableData = res.data.datas;
  735. });
  736. },
  737. reset() {
  738. this.startDate = "";
  739. this.endDate = "";
  740. this.typevalue = "";
  741. this.windvalue = "";
  742. this.timeval = [];
  743. },
  744. async windsite() {
  745. try {
  746. const res = await getWindFieldNames();
  747. this.windoptions = res.data;
  748. } catch (error) {
  749. console.error("Error fetching data:", error);
  750. }
  751. },
  752. onDateChange(date) {
  753. if (Array.isArray(date)) {
  754. this.startDate = this.$formatDate(date[0]);
  755. this.endDate = this.$formatDate(date[1]);
  756. if (this.endDate < this.startDate) {
  757. this.endDate = this.startDate;
  758. }
  759. } else {
  760. this.startDate = null;
  761. this.endDate = null;
  762. }
  763. },
  764. handleClose() {
  765. this.lineShow = false;
  766. this.reset();
  767. },
  768. },
  769. };
  770. </script>
  771. <style lang="scss" scoped>
  772. .backbone {
  773. width: 100%;
  774. color: inherit;
  775. border-radius: 0;
  776. }
  777. .backbone--flat .BOXYI,
  778. .backbone--flat .BOX {
  779. background: transparent !important;
  780. padding-left: 0 !important;
  781. padding-right: 0 !important;
  782. margin-bottom: 0 !important;
  783. color: inherit !important;
  784. }
  785. .BOXYI {
  786. background: transparent;
  787. display: flex;
  788. flex-wrap: wrap;
  789. padding: 0;
  790. color: inherit;
  791. border-radius: 0;
  792. margin-bottom: 0;
  793. .BOXsan {
  794. width: 100%;
  795. display: flex;
  796. justify-content: space-around;
  797. .YC01 {
  798. width: 154px;
  799. height: 60px;
  800. background-image: url("../../../../assets/001.png");
  801. background-size: 154px 60px;
  802. background-repeat: no-repeat;
  803. background-position: center;
  804. margin-top: 15px;
  805. text-align: center;
  806. strong {
  807. display: block;
  808. font-size: 26px;
  809. color: #4bffff;
  810. }
  811. span {
  812. display: block;
  813. font-size: 12px;
  814. }
  815. }
  816. .YC02 {
  817. width: 70px;
  818. height: 60px;
  819. background-image: url("../../../../assets/002.png");
  820. background-size: 70px 60px;
  821. background-repeat: no-repeat;
  822. background-position: center;
  823. margin-top: 15px;
  824. text-align: center;
  825. cursor: pointer;
  826. .textred {
  827. color: #d9001b;
  828. }
  829. .texyellow {
  830. color: #facd91;
  831. }
  832. strong {
  833. display: block;
  834. font-size: 26px;
  835. color: #4bffff;
  836. }
  837. span {
  838. display: block;
  839. font-size: 12px;
  840. }
  841. }
  842. .YC03 {
  843. width: 70px;
  844. height: 60px;
  845. background-image: url("../../../../assets/002.png");
  846. background-size: 70px 60px;
  847. background-repeat: no-repeat;
  848. background-position: center;
  849. margin-top: 15px;
  850. text-align: center;
  851. cursor: pointer;
  852. .textred {
  853. color: #d9001b;
  854. }
  855. .texyellow {
  856. color: #facd91;
  857. }
  858. strong {
  859. display: block;
  860. font-size: 26px;
  861. color: #4bffff;
  862. }
  863. span {
  864. display: block;
  865. font-size: 12px;
  866. }
  867. }
  868. }
  869. h3 {
  870. margin-top: 5px;
  871. width: 100%;
  872. }
  873. }
  874. .BOX {
  875. background: transparent;
  876. display: flex;
  877. padding-left: 0;
  878. flex-wrap: wrap;
  879. padding-bottom: 8px;
  880. color: inherit;
  881. border-radius: 0;
  882. margin-bottom: 0;
  883. .centeredh3 {
  884. width: 100%;
  885. display: flex;
  886. justify-content: space-between;
  887. margin-bottom: 5px;
  888. border-bottom: none;
  889. padding-bottom: 0;
  890. span {
  891. font-size: 12px;
  892. padding-right: 10px;
  893. }
  894. }
  895. }
  896. .Tabtab {
  897. font-size: 12px;
  898. }
  899. .cockpit-inbound-panel ::v-deep .el-table__body .el-table__cell {
  900. padding: 0 !important;
  901. }
  902. .cockpit-inbound-panel ::v-deep .el-table__body .el-table__cell .cell {
  903. padding-top: 0 !important;
  904. padding-bottom: 0 !important;
  905. padding-left: var(--cockpit-td-padding-x, 8px) !important;
  906. padding-right: var(--cockpit-td-padding-x, 8px) !important;
  907. }
  908. ::v-deep.el-table--scrollable-y .el-table__body-wrapper {
  909. overflow-y: clip !important;
  910. }
  911. .titleYC:not(.cockpit-unified-table-head) span:nth-child(1) {
  912. margin: 0 70px 0 10px;
  913. display: flex;
  914. justify-content: space-between;
  915. align-items: center;
  916. }
  917. .titleJQ {
  918. font-size: 14px;
  919. background: #214e5d;
  920. padding: 5px 0;
  921. span:nth-child(1) {
  922. margin: 0 15px 0 10px;
  923. }
  924. span:nth-child(2) {
  925. margin: 0 45px 0 30px;
  926. }
  927. }
  928. #Tabtab {
  929. font-size: 12px;
  930. }
  931. ::v-deep.el-table .el-table__cell {
  932. padding: 2px 0 !important;
  933. }
  934. /* 去掉最下面的那一条线 */
  935. .el-table::before {
  936. height: 0px;
  937. }
  938. /* 滚动条样式 */
  939. ::v-deep .el-table__body-wrapper::-webkit-scrollbar-track {
  940. background-color: #004f5f;
  941. }
  942. ::v-deep .el-table__body-wrapper::-webkit-scrollbar {
  943. width: 0px;
  944. opacity: 0.5;
  945. }
  946. ::v-deep .el-table__body-wrapper::-webkit-scrollbar-thumb {
  947. border-radius: 15px;
  948. // background-color: rgba(0, 79, 95, 0.75);
  949. }
  950. // 。。。。。。。。。。。。。。。。。。。。。。。。。。
  951. #Tabtab {
  952. font-size: 12px;
  953. }
  954. ::v-deep.el-table .el-table__cell {
  955. padding: 2px 0 !important;
  956. }
  957. /* 去掉最下面的那一条线 */
  958. .el-table::before {
  959. height: 0px;
  960. }
  961. /* 滚动条样式 */
  962. ::v-deep .el-table__body-wrapper::-webkit-scrollbar-track {
  963. background-color: #004f5f;
  964. }
  965. ::v-deep .el-table__body-wrapper::-webkit-scrollbar {
  966. width: 0px;
  967. opacity: 0.5;
  968. }
  969. ::v-deep .el-table__body-wrapper::-webkit-scrollbar-thumb {
  970. border-radius: 15px;
  971. // background-color: rgba(0, 79, 95, 0.75);
  972. }
  973. .el-aside {
  974. background-color: #e9e9e9;
  975. .el-input {
  976. width: 273px;
  977. margin: 10px 0 0 10px;
  978. }
  979. .windbox {
  980. height: 565px;
  981. overflow: hidden;
  982. overflow-y: auto;
  983. .windlist {
  984. margin: 10px;
  985. padding: 10px;
  986. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
  987. p {
  988. line-height: 20px;
  989. }
  990. margin-bottom: 10px;
  991. background: #fff;
  992. }
  993. }
  994. /* 自定义滚动条样式 */
  995. ::-webkit-scrollbar {
  996. width: 8px;
  997. /* 设置滚动条的宽度 */
  998. }
  999. ::-webkit-scrollbar-thumb {
  1000. background-color: #888;
  1001. /* 滚动条滑块的颜色 */
  1002. border-radius: 10px;
  1003. /* 滚动条滑块的圆角 */
  1004. border: 2px solid #f1f1f1;
  1005. /* 滚动条滑块的边框 */
  1006. }
  1007. ::-webkit-scrollbar-thumb:hover {
  1008. background-color: #555;
  1009. /* 滚动条滑块的悬浮颜色 */
  1010. }
  1011. ::-webkit-scrollbar-track {
  1012. background: #f1f1f1;
  1013. /* 滚动条轨道的颜色 */
  1014. border-radius: 10px;
  1015. /* 滚动条轨道的圆角 */
  1016. }
  1017. }
  1018. .el-main {
  1019. padding-right: 0;
  1020. .inquire {
  1021. display: flex;
  1022. p {
  1023. margin-right: 10px;
  1024. }
  1025. .el-select {
  1026. width: 180px;
  1027. }
  1028. .el-range-editor--small.el-input__inner {
  1029. width: 240px;
  1030. }
  1031. }
  1032. .el-table {
  1033. margin: 20px 0;
  1034. }
  1035. }
  1036. ::v-deep .custom-table .el-table__row {
  1037. height: 40px;
  1038. }
  1039. .fenye {
  1040. margin: 20px auto;
  1041. text-align: center;
  1042. }
  1043. h1 {
  1044. font-size: 24px;
  1045. font-weight: 800;
  1046. margin-left: 10px;
  1047. margin-top: 10px;
  1048. }
  1049. ::v-deep .el-dialog {
  1050. margin-top: 7vh !important;
  1051. }
  1052. </style>