leftdata.vue 14 KB

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