fault-diagnosis.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. <template>
  2. <div class="fault-diagnosis-pop-up-window">
  3. <div class="white font-md">查询条件</div>
  4. <div class="query left mg-b-8">
  5. <div class="query-items">
  6. <div class="query-item">
  7. <div class="lable">风机:</div>
  8. <div class="search-input">
  9. <el-input v-model="value1" placeholder="SG01_53" class="placeholder-left" />
  10. </div>
  11. </div>
  12. <div class="query-item">
  13. <div class="lable">部件类型:</div>
  14. <div class="search-input">
  15. <el-select class="placeholder-left" v-model="value2" multiple placeholder="风机" popper-class="select">
  16. <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
  17. </el-select>
  18. </div>
  19. </div>
  20. <div class="query-item">
  21. <div class="lable">测点类型:</div>
  22. <div class="search-input">
  23. <el-select class="placeholder-left" v-model="value3" multiple placeholder="所有测点" popper-class="select">
  24. <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
  25. </el-select>
  26. </div>
  27. </div>
  28. </div>
  29. <div class="query-actions">
  30. <button class="btn green">重新选择</button>
  31. </div>
  32. </div>
  33. <div class="white font-md mg-t-16">测点选择</div>
  34. <el-checkbox-group v-model="checkList" text-color="#05bb4c" fill="#05bb4c" @change="check">
  35. <el-checkbox class="cb-item" label="C01">转子位置,值为:{{checkValue.C01}}</el-checkbox>
  36. <el-checkbox class="cb-item" label="C02">机舱震动×方向 ,值为:{{checkValue.C02}}</el-checkbox>
  37. <el-checkbox class="cb-item" label="C03">机舱震动×方向 ,值为:{{checkValue.C03}}</el-checkbox>
  38. <el-checkbox class="cb-item" label="C04">机舱震动×方向 ,值为:{{checkValue.C04}}</el-checkbox>
  39. <br>
  40. <el-checkbox class="cb-item" label="C05">风向1,值为:{{checkValue.C05}}</el-checkbox>
  41. <el-checkbox class="cb-item" label="C06">风向1,值为:{{checkValue.C06}}</el-checkbox>
  42. <el-checkbox class="cb-item" label="C07">风向1,值为:{{checkValue.C07}}</el-checkbox>
  43. <el-checkbox class="cb-item" label="C08">风向1,值为:{{checkValue.C08}}</el-checkbox>
  44. <br>
  45. <el-checkbox class="cb-item" label="C09">转子位置,值为:{{checkValue.C09}}</el-checkbox>
  46. <el-checkbox class="cb-item" label="C10">转子位置,值为:{{checkValue.C10}}</el-checkbox>
  47. <el-checkbox class="cb-item" label="C11">转子位置,值为:{{checkValue.C11}}</el-checkbox>
  48. <el-checkbox class="cb-item" label="C12">转子位置,值为:{{checkValue.C12}}</el-checkbox>
  49. </el-checkbox-group>
  50. <div class="time-axis-box">
  51. <div class="time-axis-icon mg-r-16" @click="startAnimate">
  52. <i :class="timeAxisIcon" class="green"></i>
  53. </div>
  54. <div class="time-axis-progress-box">
  55. <div class="time-axis-progress" :style="'width: '+timeAxisProgress+'%;'"></div>
  56. <div class="time-axis-progress-scale" v-for="index of 20" :key="index"></div>
  57. </div>
  58. </div>
  59. <div class="white font-md mg-t-16">风机故障回溯</div>
  60. <div class="fdp-sub-title font-sm">国电电力宁夏新能源集控系统</div>
  61. <multiple-y-line-chart ref="chart" class="fdp-chart" height="32.407vh" :yAxises="yAxis" :list="lineData" :showLegend="true" />
  62. </div>
  63. </template>
  64. <script>
  65. import MultipleYLineChart from "@com/chart/line/multiple-y-line-chart.vue";
  66. export default {
  67. components: {MultipleYLineChart},
  68. data() {
  69. return {
  70. yAxis: [
  71. {
  72. name: '机舱震动x方向',
  73. min: -0.01,
  74. max: 0,
  75. unit: "",
  76. position: "left",
  77. },
  78. {
  79. name: '机舱震动y方向',
  80. min: -0.01,
  81. max: 0,
  82. unit: "",
  83. position: "right",
  84. },
  85. {
  86. name: '机舱震动最大偏移值',
  87. min: 0,
  88. max: 1,
  89. unit: "",
  90. position: "left",
  91. },
  92. {
  93. name: '风速1',
  94. min: 0,
  95. max: 10,
  96. unit: "",
  97. position: "right",
  98. },
  99. {
  100. name: '风速2',
  101. min: 0,
  102. max: 10,
  103. unit: "",
  104. position: "left",
  105. },
  106. ],
  107. lineData: [
  108. {
  109. title: "机舱震动x方向",
  110. yAxisIndex: 0,
  111. value: [
  112. {
  113. text: "-0.003",
  114. value: -0.003,
  115. },
  116. {
  117. text: "-0.002",
  118. value: -0.002,
  119. },
  120. {
  121. text: "-0.003",
  122. value: -0.006,
  123. },
  124. {
  125. text: "-0.003",
  126. value: -0.003,
  127. },
  128. {
  129. text: "-0.002",
  130. value: -0.002,
  131. },
  132. {
  133. text: "-0.003",
  134. value: -0.006,
  135. },
  136. {
  137. text: "-0.003",
  138. value: -0.003,
  139. },
  140. {
  141. text: "-0.002",
  142. value: -0.002,
  143. },
  144. {
  145. text: "-0.003",
  146. value: -0.006,
  147. },
  148. ],
  149. },
  150. {
  151. title: "机舱震动y方向",
  152. yAxisIndex: 1,
  153. value: [
  154. {
  155. text: "-0.01",
  156. value: -0.01,
  157. },
  158. {
  159. text: "-0.005",
  160. value: -0.005,
  161. },
  162. {
  163. text: "-0.008",
  164. value: -0.008,
  165. },
  166. {
  167. text: "-0.01",
  168. value: -0.01,
  169. },
  170. {
  171. text: "-0.005",
  172. value: -0.005,
  173. },
  174. {
  175. text: "-0.008",
  176. value: -0.008,
  177. },
  178. {
  179. text: "-0.01",
  180. value: -0.01,
  181. },
  182. {
  183. text: "-0.005",
  184. value: -0.005,
  185. },
  186. {
  187. text: "-0.008",
  188. value: -0.008,
  189. },
  190. ],
  191. },
  192. {
  193. title: "机舱震动最大偏移值",
  194. yAxisIndex: 2,
  195. value: [
  196. {
  197. text: "1",
  198. value: 1,
  199. },
  200. {
  201. text: "0.05",
  202. value: 0.05,
  203. },
  204. {
  205. text: "0.5",
  206. value: 0.5,
  207. },
  208. {
  209. text: "1",
  210. value: 1,
  211. },
  212. {
  213. text: "0.05",
  214. value: 0.05,
  215. },
  216. {
  217. text: "0.5",
  218. value: 0.5,
  219. },
  220. {
  221. text: "1",
  222. value: 1,
  223. },
  224. {
  225. text: "0.05",
  226. value: 0.05,
  227. },
  228. {
  229. text: "0.5",
  230. value: 0.5,
  231. },
  232. ],
  233. },
  234. {
  235. title: "风速1",
  236. yAxisIndex: 3,
  237. value: [
  238. {
  239. text: "1",
  240. value: 1,
  241. },
  242. {
  243. text: "5",
  244. value: 5,
  245. },
  246. {
  247. text: "3",
  248. value: 1,
  249. },
  250. {
  251. text: "1",
  252. value: 1,
  253. },
  254. {
  255. text: "5",
  256. value: 5,
  257. },
  258. {
  259. text: "3",
  260. value: 1,
  261. },
  262. {
  263. text: "1",
  264. value: 1,
  265. },
  266. {
  267. text: "5",
  268. value: 5,
  269. },
  270. {
  271. text: "3",
  272. value: 1,
  273. },
  274. ],
  275. },
  276. {
  277. title: "风速2",
  278. yAxisIndex: 4,
  279. value: [
  280. {
  281. text: "1",
  282. value: 1,
  283. },
  284. {
  285. text: "2",
  286. value: 2,
  287. },
  288. {
  289. text: "3",
  290. value: 1,
  291. },
  292. {
  293. text: "1",
  294. value: 1,
  295. },
  296. {
  297. text: "2",
  298. value: 2,
  299. },
  300. {
  301. text: "3",
  302. value: 1,
  303. },
  304. {
  305. text: "1",
  306. value: 1,
  307. },
  308. {
  309. text: "2",
  310. value: 2,
  311. },
  312. {
  313. text: "3",
  314. value: 1,
  315. },
  316. ],
  317. },
  318. ],
  319. options: [
  320. {
  321. value: "选项1",
  322. label: "黄金糕",
  323. },
  324. {
  325. value: "选项2",
  326. label: "双皮奶",
  327. },
  328. {
  329. value: "选项3",
  330. label: "蚵仔煎",
  331. },
  332. {
  333. value: "选项4",
  334. label: "龙须面",
  335. },
  336. {
  337. value: "选项5",
  338. label: "北京烤鸭",
  339. },
  340. ],
  341. value1: "",
  342. value2: [],
  343. value3: [],
  344. checkList: ["C01", "C02", "C03", "C04"],
  345. checkValue: {
  346. C01: 223.42,
  347. C02: 0.00,
  348. C03: 0.00,
  349. C04: 0.00,
  350. C05: 203.08,
  351. C06: 203.08,
  352. C07: 203.08,
  353. C08: 203.08,
  354. C09: 223.42,
  355. C10: 223.42,
  356. C11: 223.42,
  357. C12: 223.42,
  358. },
  359. timeAxisIcon: "el-icon-video-play", // el-icon-video-play el-icon-video-pause
  360. timeAxisProgress: 0,
  361. timeAxisAnimate: false,
  362. animationFrameId: null,
  363. start: 0,
  364. end: 10,
  365. temp: null,
  366. temp1: null,
  367. };
  368. },
  369. // 函数
  370. methods: {
  371. startAnimate: function () {
  372. if (this.timeAxisAnimate) {
  373. this.timeAxisIcon = "el-icon-video-play";
  374. if (this.animationFrameId) {
  375. window.cancelAnimationFrame(this.animationFrameId);
  376. }
  377. } else {
  378. this.timeAxisIcon = "el-icon-video-pause";
  379. this.animationFrameId = window.requestAnimationFrame(this.timeAxisAnimation);
  380. }
  381. this.timeAxisAnimate = !this.timeAxisAnimate;
  382. },
  383. endAnimate: function () {
  384. this.timeAxisProgress = 0;
  385. this.timeAxisIcon = "el-icon-video-play";
  386. this.timeAxisAnimate = false;
  387. this.start = 0;
  388. this.end = 10;
  389. this.$refs.chart.datazoom(this.start, this.end);
  390. if (this.animationFrameId) {
  391. window.cancelAnimationFrame(this.animationFrameId);
  392. }
  393. this.animationFrameId = null;
  394. },
  395. timeAxisAnimation: function () {
  396. this.timeAxisProgress += 0.2;
  397. if (Math.abs(this.timeAxisProgress - parseInt(this.timeAxisProgress)) <= 0.1) {
  398. this.checkValue.C01 = (Math.random() * 250 + 200).toFixed(2);
  399. this.checkValue.C02 = (Math.random() * 100).toFixed(2);
  400. this.checkValue.C03 = (Math.random() * 100).toFixed(2);
  401. this.checkValue.C04 = (Math.random() * 100).toFixed(2);
  402. this.checkValue.C05 = (Math.random() * 250 + 200).toFixed(2);
  403. this.checkValue.C06 = (Math.random() * 250 + 200).toFixed(2);
  404. this.checkValue.C07 = (Math.random() * 250 + 200).toFixed(2);
  405. this.checkValue.C08 = (Math.random() * 250 + 200).toFixed(2);
  406. this.checkValue.C09 = (Math.random() * 250 + 200).toFixed(2);
  407. this.checkValue.C10 = (Math.random() * 250 + 200).toFixed(2);
  408. this.checkValue.C11 = (Math.random() * 250 + 200).toFixed(2);
  409. this.checkValue.C12 = (Math.random() * 250 + 200).toFixed(2);
  410. }
  411. this.start += 0.2;
  412. this.end += 0.2;
  413. this.$refs.chart.datazoom(this.start, this.end);
  414. if (this.timeAxisProgress < 100) {
  415. this.animationFrameId = window.requestAnimationFrame(this.timeAxisAnimation);
  416. } else {
  417. this.endAnimate();
  418. }
  419. },
  420. check: function () {
  421. if (this.temp) {
  422. this.lineData.splice(4, 0, this.temp);
  423. this.yAxis.splice(4, 0, this.temp1);
  424. this.temp = null;
  425. this.temp1 = null;
  426. } else {
  427. this.temp = this.lineData[4];
  428. this.temp1 = this.yAxis[4];
  429. this.lineData.splice(4, 1);
  430. this.yAxis.splice(4, 1);
  431. }
  432. this.$refs.chart.reload();
  433. },
  434. },
  435. };
  436. </script>
  437. <style lang="less">
  438. .fault-diagnosis-pop-up-window {
  439. width: 100%;
  440. .time-axis-box {
  441. margin: 16px auto;
  442. display: flex;
  443. width: 256px;
  444. .time-axis-icon {
  445. font-size: 30px;
  446. line-height: 1;
  447. cursor: pointer;
  448. }
  449. .time-axis-progress-box {
  450. width: 200px;
  451. height: 30px;
  452. display: flex;
  453. position: relative;
  454. .time-axis-progress {
  455. position: absolute;
  456. height: 100%;
  457. left: 0;
  458. top: 0;
  459. background: fade(@green, 60);
  460. transition: all .1s;
  461. }
  462. .time-axis-progress-scale {
  463. width: 10px;
  464. height: 100%;
  465. border: 1px solid @green;
  466. +.time-axis-progress-scale {
  467. border-left: none;
  468. }
  469. }
  470. }
  471. }
  472. .fdp-sub-title {
  473. color: #a8b2b5;
  474. margin: 2px 0 16px 0;
  475. }
  476. .cb-item {
  477. margin-top: 12px;
  478. width: 240px;
  479. }
  480. .fdp-chart {
  481. width: 100%;
  482. height: 32.407vh;
  483. }
  484. }
  485. </style>