RunningState.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666
  1. <template>
  2. <div class="running-state-module">
  3. <common-title title="程序运行状态"></common-title>
  4. <div class="visualization-common-border box">
  5. <!-- 左边 -->
  6. <div class="le">
  7. <div class="itemHead">
  8. <div class="lee"></div>
  9. <div class="cee">全部</div>
  10. <div class="rii">内部</div>
  11. </div>
  12. <div class="item">
  13. <div class="lee">循环设定值</div>
  14. <div class="cee">0</div>
  15. <div class="rii">0</div>
  16. </div>
  17. <div class="item">
  18. <div class="lee">循环运行值</div>
  19. <div class="cee">0</div>
  20. <div class="rii">0</div>
  21. </div>
  22. <div class="itemHead">
  23. <div class="lee"></div>
  24. <div class="cee">起始</div>
  25. <div class="rii">目标</div>
  26. </div>
  27. <div class="item">
  28. <div class="lee">温度</div>
  29. <div class="cee">0</div>
  30. <div class="rii">0</div>
  31. </div>
  32. <div class="item">
  33. <div class="lee">湿度</div>
  34. <div class="cee">0</div>
  35. <div class="rii">0</div>
  36. </div>
  37. <div class="item">
  38. <div class="lee">辐射强度</div>
  39. <div class="cee">0</div>
  40. <div class="rii">0</div>
  41. </div>
  42. <div style="width: 100%; height: 12%; margin-bottom: 4.5px; display: flex;">
  43. <div style="width: 45%; height: 100%; font-size: 11px; color: #0CB8FF; display: flex; align-items: center; justify-content: center;">预计结束时间:</div>
  44. <div style="width: 60%; height: 100%; font-size: 8px; color: #FEFFFE; display: flex; align-items: center; justify-content: center;">2023年12月13日08时30分</div>
  45. </div>
  46. </div>
  47. <!-- 中间 -->
  48. <div class="ce">
  49. <div class="itemHead">
  50. <div class="leece">内部循环</div>
  51. <div class="ceece">起始段</div>
  52. <div class="ceecee">结束段</div>
  53. <div class="riice">次数</div>
  54. </div>
  55. <div class="item">
  56. <div class="leece">1</div>
  57. <div class="ceece">0</div>
  58. <div class="ceecee">0</div>
  59. <div class="riice">0</div>
  60. </div>
  61. <div class="item">
  62. <div class="leece">2</div>
  63. <div class="ceece">0</div>
  64. <div class="ceecee">0</div>
  65. <div class="riice">0</div>
  66. </div>
  67. <div class="item">
  68. <div class="leece">3</div>
  69. <div class="ceece">0</div>
  70. <div class="ceecee">0</div>
  71. <div class="riice">0</div>
  72. </div>
  73. <div class="item">
  74. <div class="leece">4</div>
  75. <div class="ceece">0</div>
  76. <div class="ceecee">0</div>
  77. <div class="riice">0</div>
  78. </div>
  79. <div class="itemHead">
  80. <div class="leece">总运行</div>
  81. <div class="ceece"></div>
  82. <div class="ceecee"></div>
  83. <div class="riice"></div>
  84. </div>
  85. <div class="item">
  86. <div class="leece">运行段数</div>
  87. <div class="ceece">0</div>
  88. <div class="ceecee"></div>
  89. <div class="riice"></div>
  90. </div>
  91. <div class="item">
  92. <div class="leece">设定段数</div>
  93. <div class="ceece">0</div>
  94. <div class="ceecee"></div>
  95. <div class="riice"></div>
  96. </div>
  97. </div>
  98. <!-- 右边 -->
  99. <div class="ri">
  100. <div class="itemHead">
  101. <div class="leeri">当前</div>
  102. <div class="riiri"></div>
  103. </div>
  104. <div class="item">
  105. <div class="leeri">运行程序号</div>
  106. <div class="riiri">0</div>
  107. </div>
  108. <div class="item">
  109. <div class="leeri">运行段号</div>
  110. <div class="riiri">0</div>
  111. </div>
  112. <div class="item">
  113. <div class="leeri">运行时间</div>
  114. <div class="riiri">0min</div>
  115. </div>
  116. <div class="item">
  117. <div class="leeri">剩余时间</div>
  118. <div class="riiri">0min</div>
  119. </div>
  120. <div class="item">
  121. <div class="leeri">总时间</div>
  122. <div class="riiri">0min</div>
  123. </div>
  124. <div class="echarts">
  125. <div style="width: 30%; height: 100%; font-size: 12px; color: #0CB8FF; display: flex; align-items: center; padding-left:1%;">进度:</div>
  126. <div style="width: 55%; height: 100%;" ref="zhuzhuang"></div>
  127. <div style="width: 10%; height: 100%; font-size: 9px; color: #FEFFFE; display: flex; align-items: center; justify-content: center; padding-top:2%">80%</div>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. </template>
  133. <script>
  134. import commonTitle from '../components/commonTitle.vue'
  135. import * as echarts from 'echarts';
  136. export default {
  137. components: { commonTitle },
  138. name: '',
  139. data () {
  140. return {
  141. }
  142. },
  143. created () {
  144. },
  145. mounted () {
  146. this.drawzhuzhuang() //绘制进度条
  147. // echarts自适应
  148. window.addEventListener("resize", () =>{
  149. this.zhuChart.resize();
  150. });
  151. },
  152. methods: {
  153. drawzhuzhuang(){
  154. var chartDom = this.$refs.zhuzhuang
  155. this.zhuChart = echarts.init(chartDom);
  156. var option;
  157. const CubeLeft = echarts.graphic.extendShape({
  158. shape: {
  159. x: 0,
  160. y: 0
  161. },
  162. buildPath: function(ctx, shape) {
  163. console.log(ctx,shape);
  164. const yAxisPoint = shape.yAxisPoint
  165. const c0 = [shape.x, shape.y]
  166. const c1 = [shape.x + 9, shape.y - 9]
  167. const c2 = [yAxisPoint[0] + 9, yAxisPoint[1] - 9]
  168. const c3 = [yAxisPoint[0], yAxisPoint[1]]
  169. ctx.moveTo(c0[0], c0[1]).lineTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).closePath()
  170. }
  171. })
  172. const CubeRight = echarts.graphic.extendShape({
  173. shape: {
  174. x: 0,
  175. y: 0
  176. },
  177. buildPath: function(ctx, shape) {
  178. const yAxisPoint = shape.yAxisPoint
  179. const c1 = [shape.x, shape.y]
  180. const c2 = [yAxisPoint[0], yAxisPoint[1]]
  181. const c3 = [yAxisPoint[0] + 9, yAxisPoint[1] + 18]
  182. const c4 = [shape.x + 9, shape.y + 18]
  183. ctx.moveTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).lineTo(c4[0], c4[1]).closePath()
  184. }
  185. })
  186. const CubeTop = echarts.graphic.extendShape({
  187. shape: {
  188. x: 0,
  189. y: 0
  190. },
  191. buildPath: function(ctx, shape) {
  192. const c1 = [shape.x, shape.y]
  193. const c2 = [shape.x + 9, shape.y + 18]
  194. const c3 = [shape.x + 18, shape.y + 9]
  195. const c4 = [shape.x + 9, shape.y - 9]
  196. ctx.moveTo(c1[0], c1[1]).lineTo(c2[0], c2[1]).lineTo(c3[0], c3[1]).lineTo(c4[0], c4[1]).closePath()
  197. }
  198. })
  199. echarts.graphic.registerShape('CubeLeft', CubeLeft)
  200. echarts.graphic.registerShape('CubeRight', CubeRight)
  201. echarts.graphic.registerShape('CubeTop', CubeTop)
  202. const MAX = [6000]
  203. const VALUE = [5000]
  204. const NAMES = ['进度'];
  205. option = {
  206. // backgroundColor: "#010d3a",
  207. // title: {
  208. // text: '',
  209. // top: 32,
  210. // left: 18,
  211. // textStyle: {
  212. // color: '#00F6FF',
  213. // fontSize: 24
  214. // }
  215. // },
  216. grid: {
  217. // left: 10,
  218. // right: 10,
  219. bottom: '10',
  220. top: 10,
  221. // containLabel: true
  222. },
  223. yAxis: {
  224. type: 'category',
  225. data: NAMES,
  226. axisLine: {
  227. show: false,
  228. lineStyle: {
  229. color: 'white'
  230. }
  231. },
  232. offset: 20,
  233. axisTick: {
  234. show: false,
  235. length: 9,
  236. alignWithLabel: true,
  237. lineStyle: {
  238. color: '#7DFFFD'
  239. }
  240. },
  241. axisLabel: {
  242. fontSize: 10
  243. }
  244. },
  245. xAxis: {
  246. type: 'value',
  247. axisLine: {
  248. show: false,
  249. lineStyle: {
  250. color: 'white'
  251. }
  252. },
  253. splitLine: {
  254. show: false
  255. },
  256. axisTick: {
  257. show: false
  258. },
  259. axisLabel: {
  260. show:false,
  261. fontSize: 16
  262. },
  263. boundaryGap: ['20%', '20%']
  264. },
  265. series: [{
  266. type: 'custom',
  267. renderItem: function(params, api) {
  268. const location = api.coord([api.value(0), api.value(1)])
  269. return {
  270. type: 'group',
  271. children: [{
  272. type: 'CubeLeft',
  273. shape: {
  274. api,
  275. xValue: api.value(0),
  276. yValue: api.value(1),
  277. x: location[0],
  278. y: location[1],
  279. yAxisPoint: api.coord([0,api.value(1)])
  280. },
  281. style: {
  282. fill: 'rgba(7,29,97,.6)'
  283. }
  284. }, {
  285. type: 'CubeRight',
  286. shape: {
  287. api,
  288. xValue: api.value(0),
  289. yValue: api.value(1),
  290. x: location[0],
  291. y: location[1],
  292. yAxisPoint: api.coord([0,api.value(1)])
  293. },
  294. style: {
  295. fill: 'rgba(10,35,108,.7)'
  296. }
  297. }, {
  298. type: 'CubeTop',
  299. shape: {
  300. api,
  301. xValue: api.value(0),
  302. yValue: api.value(1),
  303. x: location[0],
  304. y: location[1],
  305. yAxisPoint: api.coord([0,api.value(1)])
  306. },
  307. style: {
  308. fill: 'rgba(11,42,106,.8)'
  309. }
  310. }]
  311. }
  312. },
  313. data: MAX
  314. },
  315. {
  316. type: 'custom',
  317. renderItem: (params, api) => {
  318. const location = api.coord([api.value(0), api.value(1)])
  319. return {
  320. type: 'group',
  321. children: [{
  322. type: 'CubeLeft',
  323. shape: {
  324. api,
  325. xValue: api.value(0),
  326. yValue: api.value(1),
  327. x: location[0],
  328. y: location[1],
  329. yAxisPoint: api.coord([0,api.value(1)])
  330. },
  331. style: {
  332. fill: new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
  333. offset: 0,
  334. color: '#3B80E2'
  335. },
  336. {
  337. offset: 1,
  338. color: '#49BEE5'
  339. }
  340. ])
  341. }
  342. }, {
  343. type: 'CubeRight',
  344. shape: {
  345. api,
  346. xValue: api.value(0),
  347. yValue: api.value(1),
  348. x: location[0],
  349. y: location[1],
  350. yAxisPoint: api.coord([0,api.value(1)])
  351. },
  352. style: {
  353. fill: new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
  354. offset: 0,
  355. color: '#3B80E2'
  356. },
  357. {
  358. offset: 1,
  359. color: '#49BEE5'
  360. }
  361. ])
  362. }
  363. }, {
  364. type: 'CubeTop',
  365. shape: {
  366. api,
  367. xValue: api.value(0),
  368. yValue: api.value(1),
  369. x: location[0],
  370. y: location[1],
  371. yAxisPoint: api.coord([0,api.value(1)])
  372. },
  373. style: {
  374. fill: new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
  375. offset: 0,
  376. color: '#3B80E2'
  377. },
  378. {
  379. offset: 1,
  380. color: '#49BEE5'
  381. }
  382. ])
  383. }
  384. }]
  385. }
  386. },
  387. data: VALUE
  388. },
  389. {
  390. type: 'bar',
  391. label: {
  392. normal: {
  393. show: true,
  394. position: 'right',
  395. formatter: (e) => {
  396. switch (e.name) {
  397. case '10kV线路':
  398. return VALUE[0]
  399. case '公用配变':
  400. return VALUE[1]
  401. case '35kV主变':
  402. return VALUE[2]
  403. case '水':
  404. }
  405. },
  406. fontSize: 16,
  407. color: '#fff',
  408. offset: [25, 4]
  409. }
  410. },
  411. itemStyle: {
  412. color: 'transparent'
  413. },
  414. data: MAX
  415. }]
  416. }
  417. option && this.zhuChart.setOption(option);
  418. }
  419. // drawzhuzhuang(){
  420. // var chartDom = this.$refs.zhuzhuang
  421. // this.zhuChart = echarts.init(chartDom);
  422. // var option;
  423. // option = {
  424. // grid: {
  425. // left: '0',
  426. // // right: '1%',
  427. // bottom: '58',
  428. // // top: '1%',
  429. // // 左侧文字显示
  430. // // containLabel: true,
  431. // },
  432. // xAxis: {
  433. // show: false,
  434. // type: 'value',
  435. // max: 100,
  436. // },
  437. // yAxis: [
  438. // {
  439. // type: 'category',
  440. // inverse: false,
  441. // axisLabel: {
  442. // show: true,
  443. // textStyle: {
  444. // fontSize: '8',
  445. // color: '#03fcfe',
  446. // },
  447. // },
  448. // splitLine: {
  449. // show: false,
  450. // },
  451. // axisTick: {
  452. // show: false,
  453. // },
  454. // axisLine: {
  455. // show: false,
  456. // },
  457. // },
  458. // {
  459. // type: 'category',
  460. // inverse: true,
  461. // axisTick: 'none',
  462. // axisLine: 'none',
  463. // show: true,
  464. // data: [80],
  465. // },
  466. // ],
  467. // series: [
  468. // {
  469. // type: 'bar',
  470. // showBackground: true,
  471. // backgroundStyle: {
  472. // color: 'rgba(180, 180, 180, 0.2)',
  473. // borderRadius:30
  474. // },
  475. // // 百分数显示
  476. // // label:{
  477. // // show:true,
  478. // // position:'right',
  479. // // formatter:'{@score}%',
  480. // // textStyle: {
  481. // // color: '#03fcfe',
  482. // // fontSize: '8',
  483. // // },
  484. // // },
  485. // itemStyle: {
  486. // normal: {
  487. // barBorderRadius: 10,
  488. // color: new echarts.graphic.LinearGradient(1, 0, 0, 0, [
  489. // {
  490. // offset: 0,
  491. // color: '#1badf9',
  492. // },
  493. // {
  494. // offset: 1,
  495. // color: '#03fcfe',
  496. // },
  497. // ]),
  498. // },
  499. // },
  500. // barWidth: 10,
  501. // data: [80],
  502. // },
  503. // ],
  504. // };
  505. // option && this.zhuChart.setOption(option);
  506. // },
  507. }
  508. }
  509. </script>
  510. <style scoped>
  511. @import '~@/assets/less/uStyle.less';
  512. </style>
  513. <style lang="less" scoped>
  514. .running-state-module{
  515. width: 100%;
  516. height: 100%;
  517. }
  518. .box {
  519. // border: 1px solid rgb(255, 255, 255);
  520. display: flex;
  521. /* row (默认值) : 主轴为水平万向,起点在左端。*/
  522. flex-direction: row;
  523. }
  524. .le {
  525. height: 93%;
  526. width: 37%;
  527. margin: 2% 0% 2% 2%;
  528. // border: 1px solid rgb(255, 255, 255);
  529. }
  530. .ce{
  531. height: 93%;
  532. width: 37%;
  533. margin: 2% 0% 2% 2%;
  534. // border: 1px solid rgb(255, 255, 255);
  535. }
  536. .ri{
  537. height: 93%;
  538. width: 24%;
  539. margin: 2%;
  540. // border: 1px solid rgb(255, 255, 255);
  541. }
  542. .itemHead{
  543. width: 100%;
  544. height: 10%;
  545. // border: 1px solid rgb(255, 255, 255);
  546. margin-bottom: 4.5px;
  547. background-color: #094F8D;
  548. color: #0CB8FE;
  549. padding-left: 2%;
  550. border-radius: 2px;
  551. display: flex;
  552. align-items: center;
  553. }
  554. .item{
  555. width: 100%;
  556. height: 10%;
  557. // border: 1px solid rgb(255, 255, 255);
  558. margin-bottom: 4.5px;
  559. background-color: #072A54;
  560. color: #FEFFFE;
  561. padding-left: 2%;
  562. border-radius: 2px;
  563. display: flex;
  564. flex-direction: row;
  565. align-items: center;
  566. }
  567. // 左
  568. .lee{
  569. width: 40%;
  570. height: 100%;
  571. font-size: 12px;
  572. // border: 1px solid rgb(255, 255, 255);
  573. color: #0CB8FF;
  574. display: flex;
  575. align-items: center;
  576. }
  577. .cee{
  578. width: 30%;
  579. height: 100%;
  580. font-size: 12px;
  581. // border: 1px solid rgb(255, 255, 255);
  582. display: flex;
  583. align-items: center;
  584. justify-content: center;
  585. }
  586. .rii{
  587. width: 30%;
  588. height: 100%;
  589. font-size: 12px;
  590. // border: 1px solid rgb(255, 255, 255);
  591. display: flex;
  592. align-items: center;
  593. justify-content: center;
  594. }
  595. // 中
  596. .leece{
  597. width: 33%;
  598. height: 100%;
  599. font-size: 12px;
  600. // border: 1px solid rgb(255, 255, 255);
  601. color: #0CB8FF;
  602. display: flex;
  603. align-items: center;
  604. justify-content: center;
  605. }
  606. .ceece{
  607. width: 24%;
  608. height: 100%;
  609. font-size: 12px;
  610. // border: 1px solid rgb(255, 255, 255);
  611. display: flex;
  612. align-items: center;
  613. justify-content: center;
  614. }
  615. .ceecee{
  616. width: 24%;
  617. height: 100%;
  618. font-size: 12px;
  619. // border: 1px solid rgb(255, 255, 255);
  620. display: flex;
  621. align-items: center;
  622. justify-content: center;
  623. }
  624. // 右
  625. .riice{
  626. width: 19%;
  627. height: 100%;
  628. font-size: 12px;
  629. // border: 1px solid rgb(255, 255, 255);
  630. display: flex;
  631. align-items: center;
  632. justify-content: center;
  633. }
  634. .leeri{
  635. width: 65%;
  636. height: 100%;
  637. font-size: 12px;
  638. // border: 1px solid rgb(255, 255, 255);
  639. color: #0CB8FF;
  640. display: flex;
  641. align-items: center;
  642. }
  643. .riiri{
  644. width: 35%;
  645. height: 100%;
  646. font-size: 12px;
  647. // border: 1px solid rgb(255, 255, 255);
  648. display: flex;
  649. align-items: center;
  650. justify-content: center;
  651. }
  652. // echarts
  653. .echarts{
  654. width: 100%;
  655. height: 15%;
  656. margin-top: 5%;
  657. // border: 1px solid rgb(255, 255, 255);
  658. display: flex;
  659. }
  660. </style>