leftdata.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. <template>
  2. <div class="backbone">
  3. <div class="BOXYI">
  4. <h3>待办任务</h3>
  5. <div class="BOXsan">
  6. <div class="YC02" @click="getwgl">
  7. <strong class="texyellow">
  8. {{ onrelevance ? onrelevance : 0 }}</strong
  9. >
  10. <span>未分析任务</span>
  11. </div>
  12. <div class="YC02" @click="getwfx">
  13. <strong class="textred"> {{ abnormal ? abnormal : 0 }}</strong>
  14. <span>失败任务</span>
  15. </div>
  16. <div class="YC03" @click="getpd">
  17. <strong class="textred"> {{ queueNumber ? queueNumber : 0 }}</strong>
  18. <span>排队任务数</span>
  19. </div>
  20. </div>
  21. <el-dialog title="未分析任务统计表" :visible.sync="glShow" width="45%">
  22. <!-- 外部容器设置最大高度和滚动条 -->
  23. <div style="max-height: 400px; overflow-y: auto">
  24. <el-table :data="glData" style="width: 100%">
  25. <el-table-column
  26. prop="fieldName"
  27. label="风场名称"
  28. width="180"
  29. ></el-table-column>
  30. <el-table-column
  31. prop="analysisName"
  32. label="分析名称"
  33. ></el-table-column>
  34. <el-table-column
  35. prop="createTime"
  36. label="创建时间"
  37. width="180"
  38. ></el-table-column>
  39. <el-table-column fixed="right" label="操作" width="100">
  40. <template slot-scope="scope">
  41. <el-button
  42. @click="handleClick(scope.row)"
  43. type="text"
  44. size="small"
  45. >编辑</el-button
  46. >
  47. </template>
  48. </el-table-column>
  49. </el-table>
  50. </div>
  51. </el-dialog>
  52. <el-dialog title="分析失败统计表" :visible.sync="YCShow" width="45%">
  53. <div style="max-height: 400px; overflow-y: auto">
  54. <el-table :data="FXData" style="width: 100%">
  55. <el-table-column prop="fieldName" label="风场名称" width="180">
  56. </el-table-column>
  57. <el-table-column prop="analysisName" label="分析名称" >
  58. </el-table-column>
  59. <el-table-column prop="createTime" label="创建时间" width="180">
  60. </el-table-column>
  61. <el-table-column fixed="right" label="操作" width="100">
  62. <template slot-scope="scope">
  63. <el-button
  64. @click="YChandleClick(scope.row)"
  65. type="text"
  66. size="small"
  67. >编辑</el-button
  68. >
  69. </template>
  70. </el-table-column>
  71. </el-table>
  72. </div>
  73. </el-dialog>
  74. <el-dialog title="排队任务统计表" :visible.sync="PdShow" width="45%">
  75. <div style="max-height: 400px; overflow-y: auto">
  76. <el-table :data="PdData" style="width: 100%">
  77. <el-table-column prop="fieldName" label="风场名称" width="180">
  78. </el-table-column>
  79. <el-table-column prop="analysisName" label="分析名称" >
  80. </el-table-column>
  81. <el-table-column prop="createTime" label="创建时间" width="180">
  82. </el-table-column>
  83. <el-table-column fixed="right" label="操作" width="100">
  84. <template slot-scope="scope">
  85. <el-button @click="PDClick(scope.row)" type="text" size="small"
  86. >编辑</el-button
  87. >
  88. </template>
  89. </el-table-column>
  90. </el-table>
  91. </div>
  92. </el-dialog>
  93. </div>
  94. <!-- 入库信息 -->
  95. <div class="BOX">
  96. <h3 class="centeredh3">
  97. 入库数据
  98. <span>
  99. <span style="cursor: pointer" @click="importdata">导入数据</span>
  100. <span style="cursor: pointer" @click="more">更多</span>
  101. </span>
  102. </h3>
  103. <div>
  104. <p class="titleYC"><span>风场名称</span><span>入库时间</span></p>
  105. <tabroll
  106. :table-data="tableData"
  107. :shujuloading="shujuloading"
  108. :columns="YCtableColumns"
  109. :column-widths="YCcolumnWidths"
  110. :max-height="140"
  111. ></tabroll>
  112. <!-- <el-table
  113. :data="tableData"
  114. :max-height="maxHeight"
  115. ref="shujuscroll_Table"
  116. strip
  117. id="Tabtab"
  118. show-overflow-tooltip
  119. :header-cell-style="{ backgroundColor: 'red' }"
  120. >
  121. <el-table-column
  122. prop="windFarmName"
  123. label="风场名称"
  124. width="130"
  125. show-overflow-tooltip
  126. >
  127. </el-table-column>
  128. <el-table-column
  129. prop="createTime"
  130. label="时间"
  131. width="150"
  132. show-overflow-tooltip
  133. >
  134. </el-table-column>
  135. </el-table> -->
  136. </div>
  137. </div>
  138. <el-dialog title="入库信息" width="70%" :visible.sync="dialogTableVisible">
  139. <el-button size="small" @click="importdata">导入数据</el-button>
  140. <el-table :data="gridData" style="max-height: 400px; overflow: auto">
  141. <el-table-column
  142. property="windFarmName"
  143. label="风场名称"
  144. show-overflow-tooltip
  145. width="150px"
  146. ></el-table-column>
  147. <el-table-column
  148. property="minuteTimeAreaList"
  149. label="SCADA分钟级"
  150. show-overflow-tooltip
  151. ></el-table-column>
  152. <el-table-column
  153. property="secondTimeAreaList"
  154. label="SCADA秒级"
  155. show-overflow-tooltip
  156. ></el-table-column>
  157. <el-table-column
  158. property="faultTimeAreaList"
  159. label="故障数据"
  160. show-overflow-tooltip
  161. ></el-table-column>
  162. <el-table-column
  163. property="warnTimeAreaList"
  164. label="报警数据"
  165. show-overflow-tooltip
  166. ></el-table-column>
  167. <el-table-column
  168. property="vibrationTimeAreaList"
  169. label="振动数据"
  170. show-overflow-tooltip
  171. ></el-table-column>
  172. </el-table>
  173. </el-dialog>
  174. </div>
  175. </template>
  176. <script>
  177. import {
  178. queryWaitTask,
  179. getAnalysisResultStateList,
  180. getAnalysisResultErrStateList,
  181. analysisResultList,
  182. } from "@/api/ledger.js";
  183. import axios from "axios";
  184. import Tabroll from "./tabroll.vue";
  185. export default {
  186. // props: {
  187. // maplistArr: {
  188. // type: Object,
  189. // default: () => ({}),
  190. // },
  191. // defaultdata: {
  192. // type: Object,
  193. // default: () => ({}),
  194. // },
  195. // },
  196. components: {
  197. Tabroll,
  198. },
  199. data() {
  200. return {
  201. onrelevance: "",
  202. abnormal: "",
  203. queueNumber: "",
  204. glShow: false,
  205. YCShow: false,
  206. PdShow: false,
  207. dialogTableVisible: false,
  208. glData: [],
  209. FXData: [],
  210. PdData: [],
  211. tableData: [],
  212. maxHeight: "200",
  213. gridData: [],
  214. shujuloading: false,
  215. YCtableColumns: [{ prop: "windFarmName" }, { prop: "createTime" }],
  216. YCcolumnWidths: {
  217. windFarmName: 130,
  218. createTime: 150,
  219. },
  220. };
  221. },
  222. created() {
  223. this.getbacklog();
  224. this.ruku();
  225. },
  226. mounted() {},
  227. methods: {
  228. getbacklog() {
  229. queryWaitTask().then((res) => {
  230. this.abnormal = res.data.errCount;
  231. this.onrelevance = res.data.uncorrelatedCount;
  232. this.queueNumber = res.data.queueNumber;
  233. });
  234. },
  235. getwgl() {
  236. const arr = {
  237. pageSize: 999,
  238. analysisState: -1,
  239. };
  240. analysisResultList(arr).then((res) => {
  241. this.glData = res.data.list;
  242. this.glShow = true;
  243. });
  244. },
  245. getwfx() {
  246. analysisResultList({ errState: 1 }).then((res) => {
  247. this.FXData = res.data.list;
  248. this.YCShow = true;
  249. });
  250. },
  251. getpd() {
  252. analysisResultList({ analysisState: "10" }).then((res) => {
  253. this.PdData = res.data.list;
  254. this.PdShow = true;
  255. });
  256. },
  257. PDClick(row) {
  258. const fieldName = row.fieldName; // 获取当前行的 fieldName 数据
  259. const analysisState = "10";
  260. // 打开新窗口
  261. const newWindow = window.open(
  262. "/home/performance/assetssMag?id=195",
  263. "_blank"
  264. );
  265. // 等待窗口加载完成后发送消息
  266. newWindow.onload = () => {
  267. newWindow.postMessage({ fieldName, analysisState }, "*");
  268. };
  269. },
  270. handleClick(row) {
  271. const fieldName = row.fieldName; // 获取当前行的 fieldName 数据
  272. const analysisState = -1;
  273. // 打开新窗口
  274. const newWindow = window.open(
  275. "/home/performance/assetssMag?id=195",
  276. "_blank"
  277. );
  278. // 等待窗口加载完成后发送消息
  279. newWindow.onload = () => {
  280. newWindow.postMessage({ fieldName, analysisState }, "*");
  281. };
  282. },
  283. YChandleClick(row) {
  284. const fieldName = row.fieldName; // 获取当前行的 fieldName 数据
  285. const errState = 1;
  286. const analysisState = 30;
  287. // 打开新窗口
  288. const newWindow = window.open(
  289. "/home/performance/assetssMag?id=195",
  290. "_blank"
  291. );
  292. // 等待窗口加载完成后发送消息
  293. newWindow.onload = () => {
  294. newWindow.postMessage({ fieldName, errState ,analysisState}, "*");
  295. };
  296. },
  297. more() {
  298. this.dialogTableVisible = true;
  299. axios
  300. .post(`/ETLapi/dataTransfer/pltIndexMore`)
  301. .then((res) => {
  302. if (res.data.code === 200) {
  303. this.gridData = res.data.datas.map((item) => {
  304. // 合并数组中的元素,用 '/' 分隔
  305. if (
  306. item.secondTimeAreaList &&
  307. item.secondTimeAreaList.length > 0
  308. ) {
  309. item.secondTimeAreaList = [item.secondTimeAreaList.join(" / ")];
  310. }
  311. if (item.faultTimeAreaList && item.faultTimeAreaList.length > 0) {
  312. item.faultTimeAreaList = [item.faultTimeAreaList.join(" / ")];
  313. }
  314. if (
  315. item.minuteTimeAreaList &&
  316. item.minuteTimeAreaList.length > 0
  317. ) {
  318. item.minuteTimeAreaList = [item.minuteTimeAreaList.join(" / ")];
  319. }
  320. if (
  321. item.vibrationTimeAreaList &&
  322. item.vibrationTimeAreaList.length > 0
  323. ) {
  324. item.vibrationTimeAreaList = [
  325. item.vibrationTimeAreaList.join(" / "),
  326. ];
  327. }
  328. if (item.warnTimeAreaList && item.warnTimeAreaList.length > 0) {
  329. item.warnTimeAreaList = [item.warnTimeAreaList.join(" / ")];
  330. }
  331. return item;
  332. });
  333. }
  334. if (res.data.code === 500) {
  335. this.$message.error(res.data.message);
  336. }
  337. })
  338. .catch((error) => {
  339. console.error("Error fetching data:", error);
  340. });
  341. },
  342. importdata() {
  343. window.open(this.$router.resolve({ path: "/transition" }).href, "_blank");
  344. },
  345. ruku() {
  346. axios
  347. .post(`/ETLapi/dataTransfer/recentlyImportedSuccessful5Data`)
  348. .then((res) => {
  349. if (res.data.code === 200) {
  350. this.tableData = res.data.datas;
  351. }
  352. if (res.data.code === 500) {
  353. this.$message.error(res.data.message);
  354. }
  355. })
  356. .catch((error) => {
  357. console.error("Error fetching data:", error);
  358. });
  359. },
  360. },
  361. };
  362. </script>
  363. <style lang="scss" scoped>
  364. .backbone {
  365. width: 300px;
  366. color: #fff;
  367. border-radius: 5px;
  368. // padding: 20px;
  369. }
  370. .BOXYI {
  371. background: rgba(0, 79, 95, 0.8);
  372. display: flex;
  373. flex-wrap: wrap;
  374. padding-left: 10px;
  375. padding-right: 10px;
  376. padding-bottom: 15px;
  377. color: #fff;
  378. border-radius: 5px;
  379. margin-bottom: 10px;
  380. .BOXsan {
  381. width: 100%;
  382. display: flex;
  383. justify-content: space-around;
  384. .YC01 {
  385. width: 154px;
  386. height: 60px;
  387. background-image: url("../../../../assets/001.png");
  388. background-size: 154px 60px;
  389. background-repeat: no-repeat;
  390. background-position: center;
  391. margin-top: 15px;
  392. text-align: center;
  393. strong {
  394. display: block;
  395. font-size: 26px;
  396. color: #4bffff;
  397. }
  398. span {
  399. display: block;
  400. font-size: 12px;
  401. }
  402. }
  403. .YC02 {
  404. width: 70px;
  405. height: 60px;
  406. background-image: url("../../../../assets/002.png");
  407. background-size: 70px 60px;
  408. background-repeat: no-repeat;
  409. background-position: center;
  410. margin-top: 15px;
  411. text-align: center;
  412. cursor: pointer;
  413. .textred {
  414. color: #d9001b;
  415. }
  416. .texyellow {
  417. color: #facd91;
  418. }
  419. strong {
  420. display: block;
  421. font-size: 26px;
  422. color: #4bffff;
  423. }
  424. span {
  425. display: block;
  426. font-size: 12px;
  427. }
  428. }
  429. .YC03 {
  430. width: 70px;
  431. height: 60px;
  432. background-image: url("../../../../assets/002.png");
  433. background-size: 70px 60px;
  434. background-repeat: no-repeat;
  435. background-position: center;
  436. margin-top: 15px;
  437. text-align: center;
  438. cursor: pointer;
  439. .textred {
  440. color: #d9001b;
  441. }
  442. .texyellow {
  443. color: #facd91;
  444. }
  445. strong {
  446. display: block;
  447. font-size: 26px;
  448. color: #4bffff;
  449. }
  450. span {
  451. display: block;
  452. font-size: 12px;
  453. }
  454. }
  455. }
  456. h3 {
  457. margin-top: 5px;
  458. width: 100%;
  459. }
  460. }
  461. .BOX {
  462. background: rgba(0, 79, 95, 0.8);
  463. display: flex;
  464. padding-left: 10px;
  465. flex-wrap: wrap;
  466. padding-bottom: 15px;
  467. color: #fff;
  468. border-radius: 5px;
  469. margin-bottom: 10px;
  470. h3 {
  471. margin-top: 5px;
  472. }
  473. .centeredh3 {
  474. width: 100%;
  475. display: flex;
  476. justify-content: space-between;
  477. margin-bottom: 5px;
  478. span {
  479. font-size: 12px;
  480. padding-right: 10px;
  481. }
  482. }
  483. }
  484. .Tabtab {
  485. font-size: 12px;
  486. }
  487. ::v-deep.el-table__cell {
  488. padding: 2px 0 !important;
  489. }
  490. ::v-deep.el-table .el-table__cell {
  491. padding: 2px 0 !important;
  492. }
  493. ::v-deep.el-table--scrollable-y .el-table__body-wrapper {
  494. overflow-y: clip !important;
  495. }
  496. .titleYC {
  497. font-size: 14px;
  498. background: #214e5d;
  499. padding: 5px 0;
  500. span:nth-child(1) {
  501. margin: 0 70px 0 10px;
  502. }
  503. }
  504. .titleJQ {
  505. font-size: 14px;
  506. background: #214e5d;
  507. padding: 5px 0;
  508. span:nth-child(1) {
  509. margin: 0 15px 0 10px;
  510. }
  511. span:nth-child(2) {
  512. margin: 0 45px 0 30px;
  513. }
  514. }
  515. #Tabtab {
  516. font-size: 12px;
  517. }
  518. ::v-deep.el-table .el-table__cell {
  519. padding: 2px 0 !important;
  520. }
  521. /* 去掉最下面的那一条线 */
  522. .el-table::before {
  523. height: 0px;
  524. }
  525. /* 滚动条样式 */
  526. ::v-deep .el-table__body-wrapper::-webkit-scrollbar-track {
  527. background-color: #004f5f;
  528. }
  529. ::v-deep .el-table__body-wrapper::-webkit-scrollbar {
  530. width: 0px;
  531. opacity: 0.5;
  532. }
  533. ::v-deep .el-table__body-wrapper::-webkit-scrollbar-thumb {
  534. border-radius: 15px;
  535. // background-color: rgba(0, 79, 95, 0.75);
  536. }
  537. // 。。。。。。。。。。。。。。。。。。。。。。。。。。
  538. #Tabtab {
  539. font-size: 12px;
  540. }
  541. ::v-deep.el-table .el-table__cell {
  542. padding: 2px 0 !important;
  543. }
  544. /* 去掉最下面的那一条线 */
  545. .el-table::before {
  546. height: 0px;
  547. }
  548. /* 滚动条样式 */
  549. ::v-deep .el-table__body-wrapper::-webkit-scrollbar-track {
  550. background-color: #004f5f;
  551. }
  552. ::v-deep .el-table__body-wrapper::-webkit-scrollbar {
  553. width: 0px;
  554. opacity: 0.5;
  555. }
  556. ::v-deep .el-table__body-wrapper::-webkit-scrollbar-thumb {
  557. border-radius: 15px;
  558. // background-color: rgba(0, 79, 95, 0.75);
  559. }
  560. </style>