22.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  1. <template>
  2. <div class="view-container">
  3. <div class="title">
  4. <div style="position: absolute;">
  5. <img src="@/assets/22title.png" alt="">
  6. </div>
  7. <div class="text">
  8. <div> 设备管理系统数据大屏展示平台</div>
  9. <div style="font-size: 15px;color: #A7DBFF;">Equipment management system data large screen display platform</div>
  10. </div>
  11. </div>
  12. <div class="main">
  13. <a-row :gutter="16">
  14. <a-col :span="8">
  15. <div class="box">
  16. <div class="box-title">
  17. <div></div>
  18. <div class="box-title-text">
  19. <span style="padding: 0 40px;">
  20. 故障月统计
  21. </span>
  22. </div>
  23. <div></div>
  24. </div>
  25. <div class="box-chart" >
  26. <div id="chart1"></div>
  27. </div>
  28. </div>
  29. <div class="box" style="height:452px;">
  30. <div class="box-title">
  31. <div></div>
  32. <div class="box-title-text">
  33. <span style="padding: 0 40px;">
  34. 保养率月统计
  35. </span>
  36. </div>
  37. <div></div>
  38. </div>
  39. <div class="box-chart" >
  40. <div id="chart2"></div>
  41. </div>
  42. </div>
  43. </a-col>
  44. <a-col :span="8">
  45. <div class="box" style="height:886px;">
  46. <div class="box-title">
  47. <div></div>
  48. <div class="box-title-text">
  49. <span style="padding: 0 40px;">
  50. 设备指标
  51. </span>
  52. </div>
  53. <div></div>
  54. </div>
  55. <div class="box-chart2" >
  56. <div style="display:flex;justify-content: space-between; position: relative;">
  57. <span class="card-num">1</span>
  58. <span class="card-num">2</span>
  59. <span class="card-num">3</span>
  60. <span class="card-num">4</span>
  61. <span class="card-num">5</span>
  62. <span class="card-num">6</span>
  63. <span style=" position: absolute; bottom:-15px;right:-30px;color: #CDFBFF;line-height: 73px;font-size: 23px;">个</span>
  64. </div>
  65. <div>
  66. <a-row type="flex" justify="space-between">
  67. <a-col :span="8" class="box-middle-sum">
  68. <div style="font-size:14px;">OEE</div>
  69. <div style="font-size:22px;">55%</div>
  70. </a-col>
  71. <a-col :span="8" class="box-middle-sum">
  72. <div style="font-size:14px;">故障率</div>
  73. <div style="font-size:22px;">55%</div>
  74. </a-col>
  75. <a-col :span="8" class="box-middle-sum">
  76. <div style="font-size:14px;">MTTR</div>
  77. <div style="font-size:22px;">55min</div>
  78. </a-col>
  79. <a-col :span="8" class="box-middle-sum">
  80. <div style="font-size:14px;">MTBF</div>
  81. <div style="font-size:22px;">55h</div>
  82. </a-col>
  83. <a-col :span="8" class="box-middle-sum">
  84. <div style="font-size:14px;">保养完成率</div>
  85. <div style="font-size:22px;">55%</div>
  86. </a-col>
  87. <a-col :span="8" class="box-middle-sum">
  88. <div style="font-size:14px;">严重事故</div>
  89. <div style="font-size:22px;">5</div>
  90. </a-col>
  91. </a-row>
  92. </div>
  93. <div id="chart3"></div>
  94. </div>
  95. </div>
  96. </a-col>
  97. <a-col :span="8">
  98. <div class="box">
  99. <div class="box-title">
  100. <div></div>
  101. <div class="box-title-text">
  102. <span style="padding: 0 40px;">
  103. 三率指标
  104. </span>
  105. </div>
  106. <div></div>
  107. </div>
  108. <div class="box-chart" >
  109. <div id="chart4"></div>
  110. <div style="font-size:17px; color:rgba(0, 190, 189, 1); display:flex;justify-content: space-around;">
  111. <span>完成率</span>
  112. <span>待修率</span>
  113. <span>故障率</span>
  114. </div>
  115. </div>
  116. </div>
  117. <div class="box" style="height:452px;">
  118. <div class="box-title">
  119. <div></div>
  120. <div class="box-title-text">
  121. <span style="padding: 0 40px;">
  122. 设备费用排行
  123. </span>
  124. </div>
  125. <div></div>
  126. </div>
  127. <div class="box-chart" >
  128. <a-list item-layout="horizontal" :data-source="list1">
  129. <a-list-item slot="renderItem" slot-scope="item" class="list">
  130. <a-list-item-metas>
  131. <span slot="title"> <my-icon type="icon-lingxing" /> {{ item.title }}</span>
  132. </a-list-item-metas>
  133. <div>{{ item.time }}</div>
  134. </a-list-item>
  135. </a-list>
  136. </div>
  137. </div>
  138. </a-col>
  139. </a-row>
  140. </div>
  141. </div>
  142. </template>
  143. <script>
  144. import { Chart, registerTheme } from '@antv/g2'
  145. export default {
  146. data () {
  147. return {
  148. chart1: [
  149. { name: 'A', year: '2019', value: 3 },
  150. { name: 'B', year: '2019', value: 5 },
  151. { name: 'C', year: '2019', value: 21 },
  152. { name: 'D', year: '2019', value: 12 },
  153. { name: 'A', year: '2020', value: 15 },
  154. { name: 'B', year: '2020', value: 12 },
  155. { name: 'C', year: '2020', value: 13 },
  156. { name: 'D', year: '2020', value: 12 },
  157. { name: 'A', year: '2021', value: 12 },
  158. { name: 'B', year: '2021', value: 13 },
  159. { name: 'C', year: '2021', value: 11 },
  160. { name: 'D', year: '2021', value: 12 },
  161. { name: 'A', year: '2022', value: 17 },
  162. { name: 'B', year: '2022', value: 12 },
  163. { name: 'C', year: '2022', value: 11 },
  164. { name: 'D', year: '2022', value: 15 }
  165. ],
  166. chart2: [
  167. { name: 'A', year: '2019', value: 3 },
  168. { name: 'B', year: '2019', value: 5 },
  169. { name: 'C', year: '2019', value: 21 },
  170. { name: 'D', year: '2019', value: 12 },
  171. { name: 'A', year: '2020', value: 5 },
  172. { name: 'B', year: '2020', value: 1 },
  173. { name: 'C', year: '2020', value: 13 },
  174. { name: 'D', year: '2020', value: 12 },
  175. { name: 'A', year: '2021', value: 2 },
  176. { name: 'B', year: '2021', value: 13 },
  177. { name: 'C', year: '2021', value: 11 },
  178. { name: 'D', year: '2021', value: 12 },
  179. { name: 'A', year: '2022', value: 7 },
  180. { name: 'B', year: '2022', value: 12 },
  181. { name: 'C', year: '2022', value: 1 },
  182. { name: 'D', year: '2022', value: 15 }
  183. ],
  184. chart3: [
  185. { year: '2001', population: 54.8 },
  186. { year: '2002', population: 38 },
  187. { year: '2003', population: 5.7 },
  188. { year: '2004', population: 30.7 },
  189. { year: '2005', population: 25.8 },
  190. { year: '2006', population: 11.7 }
  191. ],
  192. chart4: [
  193. { type: '完好率', value: 90 },
  194. { type: '待修率', value: 5 },
  195. { type: '故障率', value: 5 }
  196. ],
  197. list1: [
  198. { title: '武汉市xxx餐饮集团有限公司',
  199. time: '2017-08-08' },
  200. { title: '武汉市xxx餐饮集团有限公司',
  201. time: '2017-08-08' },
  202. { title: '武汉市xxx餐饮集团有限公司',
  203. time: '2017-08-08' },
  204. { title: '武汉市xxx餐饮集团有限公司',
  205. time: '2017-08-08' },
  206. { title: '武汉市xxx餐饮集团有限公司',
  207. time: '2017-08-08' },
  208. { title: '武汉市xxx餐饮集团有限公司',
  209. time: '2017-08-08' }
  210. ]
  211. }
  212. },
  213. mounted () {
  214. this.getChart()
  215. },
  216. methods: {
  217. getChart () {
  218. this.getChart1('chart1', this.chart1)
  219. this.getChart2('chart2', this.chart2)
  220. this.getChart3('chart3', this.chart3)
  221. this.getChart4('chart4', this.chart4)
  222. },
  223. getChart1 (id, data) {
  224. registerTheme('myTheme', {
  225. columnWidthRatio: 0.2,
  226. colors10: ['#0091F1', '#00E4EC', '#FDB628', '#EB6F49', '#00D98B', '#8256E8 ', '#9661BC', '#F6903D', '#008685', '#F08BB4']
  227. })
  228. const chart = new Chart({
  229. container: id,
  230. autoFit: true,
  231. height: 300
  232. })
  233. chart.data(data)
  234. chart.scale('value', {
  235. nice: true,
  236. range: [0, 1]
  237. })
  238. chart.tooltip({
  239. shared: true,
  240. showMarkers: false
  241. })
  242. chart.legend('year', {
  243. itemName: {
  244. style: {
  245. fill: '#03D3D3 ',
  246. fontSize: 14
  247. }
  248. }
  249. })
  250. chart
  251. .interval()
  252. .position('year*value')
  253. .color('name')
  254. .adjust('stack')
  255. chart.interaction('active-region')
  256. chart.theme('myTheme')
  257. chart.render()
  258. },
  259. getChart2 (id, data) {
  260. const chart = new Chart({
  261. container: id,
  262. autoFit: true,
  263. height: 300
  264. })
  265. chart.data(data)
  266. chart.scale({
  267. year: {
  268. range: [0, 1]
  269. },
  270. value: {
  271. nice: true
  272. }
  273. })
  274. chart.legend('name', {
  275. position: 'bottom',
  276. offsetY: 10,
  277. itemName: {
  278. style: {
  279. fill: '#03D3D3 ',
  280. fontSize: 14
  281. }
  282. }
  283. })
  284. chart.tooltip({
  285. shared: true,
  286. showCrosshairs: true
  287. })
  288. chart.axis('value', {
  289. label: {
  290. formatter: (val) => {
  291. return val
  292. }
  293. }
  294. })
  295. chart
  296. .line()
  297. .position('year*value')
  298. .color('name')
  299. .shape('smooth')
  300. chart.theme({ 'styleSheet': { 'brandColor': '# ', 'paletteQualitative10': ['#0091F1', '#00E4EC', '#FDB628', '#EB6F49', '#00D98B', '#8256E8 ', '#9661BC', '#F6903D', '#008685', '#F08BB4', '#F08BB4'], 'paletteQualitative20': ['#5B8FF9', '#CDDDFD', '#61DDAA', '#CDF3E4', '#65789B', '#CED4DE', '#F6BD16', '#FCEBB9', '#7262fd', '#D3CEFD', '#78D3F8', '#D3EEF9', '#9661BC', '#DECFEA', '#F6903D', '#FFE0C7', '#008685', '#BBDEDE', '#F08BB4', '#FFE0ED'] } })
  301. chart.render()
  302. },
  303. getChart3 (id, data) {
  304. registerTheme('myTheme', {
  305. columnWidthRatio: 0.2,
  306. colors10: ['#0091F1', '#00E4EC', '#FDB628', '#EB6F49', '#00D98B', '#8256E8 ', '#9661BC', '#F6903D', '#008685', '#F08BB4']
  307. })
  308. const chart = new Chart({
  309. container: id,
  310. autoFit: true,
  311. height: 400,
  312. padding: [50, 0, 20, 0]
  313. })
  314. chart.data(data)
  315. chart.coordinate('polar', {
  316. innerRadius: 0.2
  317. })
  318. chart.legend('year', {
  319. position: 'bottom',
  320. offsetY: 10,
  321. itemName: {
  322. style: {
  323. fill: '#03D3D3 ',
  324. fontSize: 14
  325. }
  326. }
  327. })
  328. chart.axis(false)
  329. chart.tooltip({
  330. showMarkers: false
  331. })
  332. chart.interaction('element-highlight')
  333. chart
  334. .interval()
  335. .position('year*population')
  336. .color('year')
  337. .style({
  338. lineWidth: 1,
  339. stroke: '#fff'
  340. }).label('population', {
  341. style: {
  342. fill: '#03D3D3',
  343. fontSize: 16
  344. },
  345. layout: {
  346. type: 'fixed-overlap'
  347. },
  348. offset: 30,
  349. content: (data) => {
  350. return `${data.population}个`
  351. }
  352. })
  353. chart.theme('myTheme')
  354. chart.render()
  355. },
  356. getChart4 (id, data) {
  357. const chart = new Chart({
  358. container: id,
  359. autoFit: true,
  360. height: 250
  361. })
  362. chart.data(data)
  363. chart.legend(false)
  364. chart.tooltip({
  365. showMarkers: false
  366. })
  367. chart.facet('rect', {
  368. fields: ['type'],
  369. padding: 20,
  370. showTitle: false,
  371. eachView: (view, facet) => {
  372. const data = facet.data
  373. let color
  374. if (data[0].type === '完好率') {
  375. color = 'RGBA(13, 212, 219, 1)'
  376. } else if (data[0].type === '待修率') {
  377. color = 'RGBA(40, 254, 8, 1)'
  378. } else {
  379. color = 'RGBA(255, 0, 0, 1)'
  380. }
  381. data.push({ type: '其他', value: 100 - data[0].value })
  382. view.data(data)
  383. view.coordinate('theta', {
  384. radius: 0.8,
  385. innerRadius: 0.9
  386. })
  387. view
  388. .interval()
  389. .adjust('stack')
  390. .position('value')
  391. .color('type', [color, 'RGBA(20, 60, 145, 1)'])
  392. .style({
  393. opacity: 1
  394. })
  395. view.annotation().text({
  396. position: ['50%', '50%'],
  397. content: data[0].value + '%',
  398. style: {
  399. fontSize: 25,
  400. fill: 'RGBA(13, 212, 219, 1)',
  401. fontWeight: 500,
  402. textAlign: 'center'
  403. }
  404. })
  405. view.interaction('element-active')
  406. }
  407. })
  408. chart.render()
  409. }
  410. }
  411. }
  412. </script>
  413. <style lang="less" scoped>
  414. .view-container {
  415. width:1920px;
  416. height:1080px;
  417. background-color: RGBA(0, 7, 73, 0.8);
  418. padding:35px 21px;
  419. }
  420. .view-container::after {
  421. content: "";
  422. width:1920px;
  423. height:1080px;
  424. background: url(../../assets/bgView.png);
  425. top: 0;
  426. left: 0;
  427. bottom: 0;
  428. right: 0;
  429. position: absolute;
  430. z-index: -1;
  431. }
  432. .title{
  433. height: 89px;
  434. position: relative;
  435. .text{
  436. height: 26px;
  437. font-size: 27px;
  438. display:flex;
  439. flex-direction: column;
  440. align-items: center;
  441. padding-top: 30px;
  442. font-family: Microsoft YaHei;
  443. font-weight: bold;
  444. color: #BDE4FF;
  445. line-height: 25px;
  446. }
  447. }
  448. .main{
  449. padding-top:35px;
  450. .box{
  451. width: 609px;
  452. height: 404px;
  453. background: rgba(3, 129, 255, 0.05);
  454. border: 1px solid #0096FF;
  455. box-shadow: 0px 0px 30px 0px rgba(0, 128, 202, 0.8) inset;
  456. border-radius: 5px;
  457. margin-bottom: 30px;;
  458. .box-title{
  459. display: flex;
  460. justify-content: space-between;
  461. font-size: 22px;
  462. font-family: Microsoft YaHei;
  463. font-weight: bold;
  464. color: #A7DBFF;
  465. line-height: 25px;
  466. .box-title-text{
  467. position: relative;
  468. z-index: 999;
  469. padding-bottom: 7px;;
  470. }
  471. .box-title-text::before{
  472. content: '';
  473. position: absolute;
  474. top:0;left:0;right:0;bottom:0;
  475. z-index: -1;
  476. background-color: rgb(46, 37, 77);
  477. border: 1px solid #0096FF;
  478. border-top: none;
  479. box-shadow: 0px 29px 30px 0px rgba(0, 128, 202, 0.3);
  480. transform: perspective(.5em) rotateX(-3deg);
  481. }
  482. }
  483. .box-chart{
  484. padding: 20px;
  485. .list{
  486. padding: 22px 16px;
  487. background:RGBA(12, 38, 70, 0.5);
  488. color:rgba(0, 190, 189, 1);
  489. border-bottom:1px solid RGBA(21, 72, 62, 1);
  490. }
  491. }
  492. .box-chart2{
  493. padding: 70px;
  494. .box-middle-sum{
  495. display: flex;
  496. flex-direction: column;
  497. align-items: center;
  498. justify-content: center;
  499. margin-top:30px;
  500. color: #00FFFF;
  501. width: 117px;
  502. height: 74px;
  503. background: rgba(28, 45, 104, 0.24);
  504. border: 2px solid #4574D6;
  505. border-radius: 20px;
  506. box-shadow: 0px 0px 30px 0px RGBA(28, 59, 138, 1) inset;
  507. }
  508. #chart3{
  509. padding-top:20px;
  510. }
  511. }
  512. .card-num{
  513. padding:15px;
  514. font-size: 55px;
  515. font-family: Microsoft YaHei;
  516. font-weight: bold;
  517. color: #CDFBFF;
  518. line-height: 73px;
  519. background:linear-gradient(#00EDFE,#006DC5);
  520. border-radius: 3px;
  521. }
  522. }
  523. }
  524. </style>