100.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  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;">Maintain large screen display platform of system data</div>
  10. </div>
  11. </div>
  12. <div class="content">
  13. <div class="content-left">
  14. <div class="content-left-top">
  15. <div style="padding:20px;display: flex; justify-content: space-between; position: relative;">
  16. <div>维修单数</div>
  17. <div
  18. style="text-align:center; width: 106px;height: 27px;background: #091E64;border-radius: 14px; font-size: 18px;color: #A2ABCD;">最近6个月</div>
  19. <div
  20. style="z-index: 999; text-align:center; width: 176px;height: 29px;background: #04154D;position: absolute;top:60px;left:50%;transform: translateX(-50%);font-size: 18px;color: #BBCFE8;">总数:1234</div>
  21. </div>
  22. <div id="chart1"></div>
  23. <div style="padding:0 20px;font-size: 18px;font-weight: 400;">
  24. <div style="padding-bottom:10px; font-size: 18px;font-weight: 400;color:#B9BFD6;">故障排行榜</div>
  25. <thead>
  26. <tr style="display: flex;justify-content: space-around;width: 483px;height: 26px;font-weight: 400">
  27. <th class="list-header discolor" v-for="col in columns" :key="col.key">{{ col.title }}</th>
  28. </tr>
  29. </thead>
  30. <tbody>
  31. <tr :class="{discolor: i%2}" v-for="(list,i) in data1" :key="i" style="display: flex;justify-content: space-around;">
  32. <td class="list-header" style=" color: #B9BFD6;box-shadow:none; font-size: 14px;font-weight: 400;">{{ list.type }}</td>
  33. <td class="list-header" style="color: #B9BFD6;box-shadow:none; font-size: 16px;font-weight: 400;">{{ list.num }}</td>
  34. <td class="list-header" style="color: #B9BFD6;box-shadow:none; font-size: 16px;font-weight: 400;">{{ list.sb }}</td>
  35. <td class="list-header" style="color: #B9BFD6;box-shadow:none;font-size: 16px;font-weight: 400;">{{ list.fee }}</td>
  36. </tr>
  37. </tbody>
  38. </div>
  39. </div>
  40. <div class="content-left-bottom">
  41. <div style="padding-bottom: 20px; font-size: 24px;font-weight: 800;color: #24D1F0;">维修通知</div>
  42. <div
  43. class="demo-infinite-container"
  44. >
  45. <a-list :split="false" size="small" :data-source="information">
  46. <a-list-item style="color:#B9BFD6 " slot="renderItem" slot-scope="item">
  47. <a-list-item-meta>
  48. <div slot="title" style="color:#B9BFD6 " :href="item.href">
  49. <span style="display: inline-block; width: 10px;height: 10px;background: #AB1AE1;border-radius: 50%;"></span>
  50. {{ item.name }}
  51. </div>
  52. </a-list-item-meta>
  53. <div>
  54. {{ item.time }}
  55. </div>
  56. </a-list-item>
  57. </a-list>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="content-middle">
  62. <div class="content-middle-top">
  63. <div style="padding:20px;display: flex; justify-content: space-between; position: relative;">
  64. <div style="display: flex">维修费用统计 &nbsp;
  65. <div style="display:flex;justify-content: space-between; position: relative;">
  66. <span class="card-num">1</span>
  67. <span class="card-num">2</span>
  68. <span class="card-num">3</span>
  69. <span class="card-num">4</span>
  70. <span class="card-num">5</span>
  71. <span class="card-num">6</span>
  72. </div>
  73. </div>
  74. <div
  75. style="text-align:center; width: 106px;height: 27px;background: #091E64;border-radius: 14px; font-size: 18px;color: #A2ABCD;">最近1年</div>
  76. </div>
  77. <div id="chart2"></div>
  78. </div>
  79. <div class="content-middle-bottom">
  80. <div style="padding-bottom: 20px; font-size: 24px;font-weight: 800;color: #24D1F0;">维保核心数据</div>
  81. <div class="middle-bottom-tag">
  82. <a-row type="flex">
  83. <a-col :span="6" class="border-bottom">
  84. <div class="middle-bottom-tag-list border-right">
  85. <div style="font-size: 16px;color: #B9BFD6;"><my-icon style="color:#24D1F0" type="icon-youjiantou" />&nbsp;维修单数</div>
  86. <div>2400</div>
  87. </div>
  88. </a-col>
  89. <a-col :span="6" class="border-bottom">
  90. <div class="middle-bottom-tag-list border-right">
  91. <div style="font-size: 16px;color: #B9BFD6;"><my-icon style="color:#9C24F0" type="icon-youjiantou" />&nbsp;维修费用</div>
  92. <div>2400</div>
  93. </div>
  94. </a-col>
  95. <a-col :span="6" class="border-bottom">
  96. <div class="middle-bottom-tag-list border-right">
  97. <div style="font-size: 16px;color: #B9BFD6;"><my-icon style="color:#0E33BC" type="icon-youjiantou" />&nbsp;内部单数</div>
  98. <div>2400</div>
  99. </div>
  100. </a-col>
  101. <a-col :span="6" class="border-bottom">
  102. <div class="middle-bottom-tag-list border-right">
  103. <div style="font-size: 16px;color: #B9BFD6;"><my-icon style="color:#F0DF24" type="icon-youjiantou" />&nbsp;内部费用</div>
  104. <div>2400</div>
  105. </div>
  106. </a-col>
  107. <a-col :span="6" class="border-bottom">
  108. <div class="middle-bottom-tag-list border-right">
  109. <div style="font-size: 16px;color: #B9BFD6;"><my-icon style="color:#24D1F0" type="icon-youjiantou" />&nbsp;委外单数</div>
  110. <div>2400</div>
  111. </div>
  112. </a-col>
  113. <a-col :span="6" class="border-bottom">
  114. <div class="middle-bottom-tag-list border-right">
  115. <div style="font-size: 16px;color: #B9BFD6;"><my-icon style="color:#9C24F0" type="icon-youjiantou" />&nbsp;委外费用</div>
  116. <div>2400</div>
  117. </div>
  118. </a-col>
  119. <a-col :span="6" class="border-bottom">
  120. <div class="middle-bottom-tag-list border-right">
  121. <div style="font-size: 16px;color: #B9BFD6;"><my-icon style="color:#0E33BC" type="icon-youjiantou" />&nbsp;保养任务</div>
  122. <div>2400</div>
  123. </div>
  124. </a-col>
  125. <a-col :span="6" class="border-bottom">
  126. <div class="middle-bottom-tag-list border-right">
  127. <div style="font-size: 16px;color: #B9BFD6;"><my-icon style="color:#F0DF24" type="icon-youjiantou" />&nbsp;延迟任务</div>
  128. <div>2400</div>
  129. </div>
  130. </a-col>
  131. </a-row>
  132. </div>
  133. <div style="padding-top:10px; font-size: 24px;font-weight: 800;color: #24D1F0;">维修费用类别</div>
  134. <div id="chart3"></div>
  135. </div>
  136. </div>
  137. <div class="content-right">
  138. <div class="content-right-top">
  139. <div style="padding-bottom: 20px; font-size: 24px;font-weight: 800;color: #24D1F0;">保养统计</div>
  140. <div id="chart4"></div>
  141. </div>
  142. <div class="content-right-bottom">
  143. <div style="padding-bottom: 20px; font-size: 24px;font-weight: 800;color: #24D1F0;">保养通知</div>
  144. <div
  145. class="demo-infinite-container"
  146. style="height:80%"
  147. >
  148. <a-list :split="false" size="small" :data-source="information">
  149. <a-list-item style="color:#B9BFD6 " slot="renderItem" slot-scope="item">
  150. <a-list-item-meta>
  151. <div slot="title" style="color:#B9BFD6 " :href="item.href">
  152. <span style="display: inline-block; width: 10px;height: 10px;background: #AB1AE1;border-radius: 50%;"></span>
  153. {{ item.name }}
  154. </div>
  155. </a-list-item-meta>
  156. <div>
  157. {{ item.time }}
  158. </div>
  159. </a-list-item>
  160. </a-list>
  161. </div>
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. </template>
  167. <script>
  168. import { Chart, registerTheme } from '@antv/g2'
  169. export default {
  170. data () {
  171. return {
  172. information: [
  173. {
  174. name: '项目管理通知',
  175. time: '2022-4-7'
  176. },
  177. {
  178. name: '项目管理通知',
  179. time: '2022-4-7'
  180. },
  181. {
  182. name: '项目管理通知',
  183. time: '2022-4-7'
  184. },
  185. {
  186. name: '项目管理通知',
  187. time: '2022-4-7'
  188. }, {
  189. name: '项目管理通知',
  190. time: '2022-4-7'
  191. },
  192. {
  193. name: '项目管理通知',
  194. time: '2022-4-7'
  195. },
  196. {
  197. name: '项目管理通知',
  198. time: '2022-4-7'
  199. }, {
  200. name: '项目管理通知',
  201. time: '2022-4-7'
  202. },
  203. {
  204. name: '项目管理通知',
  205. time: '2022-4-7'
  206. }
  207. ],
  208. columns: [
  209. {
  210. title: '故障类别',
  211. key: 'type'
  212. },
  213. {
  214. title: '维修单数',
  215. key: 'num'
  216. },
  217. {
  218. title: '设备',
  219. key: 'sb'
  220. },
  221. {
  222. title: '维修费用',
  223. key: 'fee'
  224. }
  225. ],
  226. data1: [
  227. {
  228. type: '发动机启动困难',
  229. num: 19,
  230. sb: 3,
  231. fee: 2222
  232. },
  233. {
  234. type: '发动机启动困难',
  235. num: 19,
  236. sb: 3,
  237. fee: 2222
  238. },
  239. {
  240. type: '发动机启动困难',
  241. num: 19,
  242. sb: 3,
  243. fee: 2222
  244. },
  245. {
  246. type: '发动机启动困难',
  247. num: 19,
  248. sb: 3,
  249. fee: 2222
  250. },
  251. {
  252. type: '发动机启动困难',
  253. num: 19,
  254. sb: 3,
  255. fee: 2222
  256. },
  257. {
  258. type: '发动机启动困难',
  259. num: 19,
  260. sb: 3,
  261. fee: 2222
  262. }
  263. ],
  264. chart1: [
  265. { day: 1, percent: 60 },
  266. { day: 2, percent: 40 },
  267. { day: 3, percent: 50 },
  268. { day: 4, percent: 60 },
  269. { day: 5, percent: 70 },
  270. { day: 6, percent: 60 }
  271. ],
  272. chart2: [
  273. { day: 1, percent: 60 },
  274. { day: 2, percent: 40 },
  275. { day: 3, percent: 50 },
  276. { day: 4, percent: 60 },
  277. { day: 5, percent: 70 },
  278. { day: 6, percent: 60 },
  279. { day: 7, percent: 60 },
  280. { day: 8, percent: 40 },
  281. { day: 9, percent: 50 },
  282. { day: 10, percent: 60 },
  283. { day: 11, percent: 70 },
  284. { day: 12, percent: 60 }
  285. ],
  286. chart3: [
  287. { day: '维修-配件', percent: 60 },
  288. { day: '维修-人工', percent: 40 },
  289. { day: '备件费用', percent: 50 },
  290. { day: '维护保养费用', percent: 60 },
  291. { day: '改造费用', percent: 70 },
  292. { day: '委外费用', percent: 60 }
  293. ],
  294. chart4: [
  295. { day: '一级', percent: 30, value: 300 },
  296. { day: '二级', percent: 20, value: 200 },
  297. { day: '三级', percent: 50, value: 500 }
  298. ]
  299. }
  300. },
  301. mounted () {
  302. this.getChart()
  303. },
  304. methods: {
  305. getChart () {
  306. this.getChart1('chart1', this.chart1)
  307. this.getChart2('chart2', this.chart2)
  308. this.getChart3('chart3', this.chart3)
  309. this.getChart4('chart4', this.chart4)
  310. },
  311. getChart1 (id, data) {
  312. const chart = new Chart({
  313. container: id,
  314. width: 470,
  315. height: 220,
  316. appendPadding: [0, 0, 0, 20]
  317. })
  318. chart.data(data)
  319. chart.scale({
  320. day: {
  321. min: 1
  322. },
  323. percent: {
  324. min: 0,
  325. range: [0, 1]
  326. }
  327. })
  328. chart.axis('percent', {
  329. tickLine: null,
  330. title: {
  331. style: {
  332. fill: '#01D4F9',
  333. fontSize: 14
  334. },
  335. grid: null,
  336. offset: -10,
  337. autoRotate: false,
  338. position: 'end',
  339. text: '单数(个)'
  340. }
  341. })
  342. chart.axis('day', {
  343. title: {
  344. style: {
  345. fill: '#01D4F9',
  346. fontSize: 14
  347. },
  348. grid: null,
  349. autoRotate: false,
  350. position: 'end',
  351. text: '日期(月)'
  352. }
  353. })
  354. chart.tooltip({
  355. showCrosshairs: true,
  356. shared: true
  357. })
  358. chart.line().position('day*percent').shape('smooth')
  359. chart.point().position('day*percent')
  360. chart.theme({ 'styleSheet': { 'brandColor': '#F5942B ' } })
  361. chart.render()
  362. },
  363. getChart2 (id, data) {
  364. const chart = new Chart({
  365. container: id,
  366. width: 730,
  367. height: 350,
  368. appendPadding: [0, 0, 0, 20]
  369. })
  370. chart.data(data)
  371. chart.scale({
  372. day: {
  373. min: 1,
  374. tickCount: 12
  375. },
  376. percent: {
  377. min: 0,
  378. range: [0, 1]
  379. }
  380. })
  381. chart.axis('percent', {
  382. tickLine: null,
  383. title: {
  384. style: {
  385. fill: '#01D4F9',
  386. fontSize: 14
  387. },
  388. grid: null,
  389. offset: -10,
  390. autoRotate: false,
  391. position: 'end',
  392. text: '金额(元)'
  393. }
  394. })
  395. chart.tooltip({
  396. showCrosshairs: true,
  397. shared: true
  398. })
  399. // chart.line().position('day*percent').shape('smooth')
  400. chart.area().position('day*percent').shape('smooth')
  401. // chart.theme({ 'styleSheet': { 'brandColor': '#031655 ' } })
  402. chart.render()
  403. },
  404. getChart3 (id, data) {
  405. registerTheme('myTheme', {
  406. columnWidthRatio: 0.1,
  407. colors10: ['#0091F1', '#FDB628', '#00E4EC', '#EB6F49', '#9C24F0 ', '#00FF00', '#9661BC', '#F6903D', '#008685', '#F08BB4']
  408. })
  409. const chart = new Chart({
  410. container: id,
  411. width: 700,
  412. height: 150
  413. })
  414. chart.data(data)
  415. chart.scale({
  416. percent: {
  417. nice: true,
  418. range: [0, 1]
  419. }
  420. })
  421. chart.legend(false)
  422. chart.tooltip({
  423. showCrosshairs: true,
  424. shared: true
  425. })
  426. chart.interaction('active-region')
  427. .interval()
  428. .position('day*percent')
  429. .color('day')
  430. chart.theme('myTheme')
  431. chart.render()
  432. },
  433. getChart4 (id, data) {
  434. registerTheme('myTheme', {
  435. columnWidthRatio: 0.1,
  436. colors10: ['#0091F1', '#FDB628', '#00E4EC', '#EB6F49', '#9C24F0 ', '#00FF00', '#9661BC', '#F6903D', '#008685', '#F08BB4']
  437. })
  438. const chart = new Chart({
  439. container: id,
  440. autoFit: true,
  441. height: 300
  442. })
  443. chart.data(data)
  444. chart.scale('percent', {
  445. formatter: (val) => {
  446. val = val * 100 + '%'
  447. return val
  448. }
  449. })
  450. chart.coordinate('theta', {
  451. radius: 0.75,
  452. innerRadius: 0.8
  453. })
  454. chart.tooltip({
  455. showTitle: false,
  456. showMarkers: false,
  457. itemTpl: '<li class="g2-tooltip-list-item"><span style="background-color:{color};" class="g2-tooltip-marker"></span>{name}: {value}</li>'
  458. })
  459. // 辅助文本
  460. chart
  461. .annotation()
  462. .text({
  463. position: ['50%', '50%'],
  464. content: '1000',
  465. style: {
  466. fontSize: 20,
  467. fill: '#8c8c8c',
  468. textAlign: 'center'
  469. }
  470. })
  471. chart
  472. .interval()
  473. .adjust('stack')
  474. .position('percent')
  475. .color('day')
  476. .label('percent', (percent) => {
  477. return {
  478. content: (data) => {
  479. return percent + '%\n' + data.value
  480. }
  481. }
  482. })
  483. .tooltip('day*percent', (item, percent) => {
  484. percent = percent + '%'
  485. return {
  486. name: item,
  487. value: percent
  488. }
  489. })
  490. chart.interaction('element-active')
  491. chart.theme('myTheme')
  492. chart.render()
  493. }
  494. }
  495. }
  496. </script>
  497. <style lang="less" scoped>
  498. .view-container {
  499. width:1920px;
  500. height:1080px;
  501. background-color: RGBA(0, 7, 73, 0.8);
  502. padding:30px 41px;
  503. }
  504. .view-container::after {
  505. content: "";
  506. width:1920px;
  507. height:1080px;
  508. background: url(../../assets/bgView.png);
  509. top: 0;
  510. left: 0;
  511. bottom: 0;
  512. right: 0;
  513. position: absolute;
  514. z-index: -1;
  515. }
  516. .title{
  517. text-align: center;
  518. font-size: 28px;
  519. font-family: Microsoft YaHei;
  520. font-weight: bold;
  521. color: #BDE4FF;
  522. padding-bottom: 38px;
  523. .text{
  524. padding-top: 10px;
  525. }
  526. }
  527. .content{
  528. width: 100%;
  529. height: 919px;
  530. display: flex;
  531. justify-content: space-between;
  532. }
  533. .content-left{
  534. font-size: 24px;
  535. font-family: Microsoft YaHei;
  536. font-weight: 400;
  537. color: #24D1F0;
  538. width: 522px;
  539. height: 919px;
  540. .content-left-top{
  541. background: #000D39;
  542. border: 4px solid #02044B;
  543. width: 522px;
  544. height: 543px;
  545. margin-bottom:14px;
  546. }
  547. .content-left-bottom{
  548. background: #000D39;
  549. border: 4px solid #02044B;
  550. width: 522px;
  551. height: 362px;
  552. padding:20px;
  553. overflow: hidden;
  554. }
  555. }
  556. .content-middle{
  557. font-size: 24px;
  558. font-family: Microsoft YaHei;
  559. font-weight: 400;
  560. color: #24D1F0;
  561. width: 762px;
  562. height: 919px;
  563. .content-middle-top{
  564. background: #000D39;
  565. border: 4px solid #02044B;
  566. width: 762px;
  567. height: 445px;
  568. margin-bottom:14px;
  569. }
  570. .content-middle-bottom{
  571. background: #000D39;
  572. border: 4px solid #02044B;
  573. width: 762px;
  574. height: 458px;
  575. padding:20px;
  576. .middle-bottom-tag{
  577. width: 695px;
  578. height: 172px;
  579. background: #030E44;
  580. .middle-bottom-tag-list{
  581. height: 51px;
  582. margin:17px auto;
  583. display:flex;
  584. flex-direction: column;
  585. align-items: center;
  586. justify-content: center;
  587. }
  588. .border-right{
  589. border-right: 2px solid #07164C;
  590. }
  591. .border-bottom{
  592. border-bottom: 2px solid #07164C;
  593. }
  594. }
  595. }
  596. }
  597. .content-right{
  598. width: 513px;
  599. height: 919px;
  600. .content-right-top{
  601. background: #000D39;
  602. border: 4px solid #02044B;
  603. width: 513px;
  604. height: 445px;
  605. margin-bottom:14px;
  606. padding:20px;
  607. }
  608. .content-right-bottom{
  609. background: #000D39;
  610. border: 4px solid #02044B;
  611. width: 513px;
  612. height: 457px;
  613. padding:20px;
  614. overflow: hidden;
  615. }
  616. }
  617. .discolor{
  618. background: #04154D;
  619. }
  620. .list-header{
  621. width: 25%;
  622. text-align: center;
  623. }
  624. .card-num{
  625. padding: 0 5px;
  626. font-size: 24px;
  627. margin-right: 5px;
  628. font-family: Microsoft YaHei;
  629. font-weight: bold;
  630. color: #000D39;
  631. background:#24D1F0;
  632. }
  633. .demo-infinite-container {
  634. overflow: auto;
  635. height: 240px;
  636. }
  637. ::-webkit-scrollbar { width: 0; height: 0; color: transparent; }
  638. </style>