home.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761
  1. <template>
  2. <div class="container">
  3. <div class="header">
  4. <img src="../assets/img/head.png" alt="" />
  5. </div>
  6. <el-container>
  7. <el-aside width="412px" class="left">
  8. <div class="title">
  9. <div class="text">教室分类统计</div>
  10. </div>
  11. <div class="content">
  12. <div id="myChart" :style="{ width: '200px', height: '200px' }"></div>
  13. <div class="list">
  14. <div class="item"> <span></span> <span>基础型</span> <span>40%</span></div>
  15. <div class="item"> <span></span><span>扩展型</span><span>30%</span></div>
  16. <div class="item"> <span></span><span>其他</span><span>35%</span></div>
  17. </div>
  18. </div>
  19. <div class="title">
  20. <div class="text">本周课程统计</div>
  21. </div>
  22. <div class="content">
  23. <div class="count" v-for="(item, index) in classCount" :key="index">
  24. <el-progress type="circle" :percentage="25" :color="item.color">
  25. <img :src="'src/assets/img/' + item.imgnumber + '.png'" alt="">
  26. </el-progress>
  27. <div class="number"><span> {{ item.number }}</span>(节)</div>
  28. <div class="text">{{ item.text }}</div>
  29. </div>
  30. </div>
  31. <div class="title">
  32. <div class="text">智慧教室使用明细</div>
  33. </div>
  34. <div class="content">
  35. <div class="table">
  36. <ul class="th">
  37. <li>教室</li>
  38. <li>使用状态</li>
  39. <li class="long">实到/应到人数</li>
  40. <li>到课率</li>
  41. <li>操作</li>
  42. </ul>
  43. <el-scrollbar height="400px">
  44. <ul v-for="item in classRoom">
  45. <li>
  46. {{ item.class }}
  47. </li>
  48. <li>{{ item.status }}</li>
  49. <li>{{ item.people }}</li>
  50. <li>{{ item.percentage }}</li>
  51. <li>
  52. <el-button size="small" class="look" @click="handleRoom">操作</el-button>
  53. </li>
  54. </ul>
  55. </el-scrollbar>
  56. </div>
  57. </div>
  58. </el-aside>
  59. <el-aside width="412px" class="right">
  60. <div class="title">
  61. <div class="text">物联设备统计</div>
  62. </div>
  63. <div class="content">
  64. <div class="img">
  65. <span>120</span>
  66. <img src="../assets/img/d1.png" alt="">
  67. <span>总数(个)</span>
  68. </div>
  69. <div class="list">
  70. <div class="item_r">
  71. <img src="../assets/img/d2.png" alt="">
  72. <div class="percent">
  73. 在线&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 40
  74. <span>(个)</span>
  75. </div>
  76. </div>
  77. <div class="item_r">
  78. <img src="../assets/img/d3.png" alt="">
  79. <div class="percent">
  80. 离线&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 71
  81. <span>(个)</span>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. <div class="title">
  87. <div class="text">物联设备类型统计</div>
  88. </div>
  89. <div class="contentwrap">
  90. <div class="count" v-for="(item, index) in interDevice" :key="index">
  91. <div class="number"><span> {{ item.number }}</span>(节)</div>
  92. <el-progress type="circle" :percentage="100" :color="item.color">
  93. <img :src="'src/assets/img/' + item.icon + '.png'" alt="">
  94. </el-progress>
  95. <div class="text">{{ item.text }}</div>
  96. </div>
  97. </div>
  98. <div class="title">
  99. <div class="text">智慧教室实时监控</div>
  100. </div>
  101. <div class="content">
  102. <div class="monitor">
  103. <p>多屏互动教室</p>
  104. <div class="interactclass">
  105. <div class="room"><span>互动教室1</span>
  106. <img src="../assets/img/rb1.png" alt="">
  107. </div>
  108. <div class="room"><span>互动教室2</span>
  109. <img src="../assets/img/rb2.png" alt="">
  110. </div>
  111. </div>
  112. <p>多屏智慧教室</p>
  113. <div class="interactclass">
  114. <div class="room"><span>智慧教室1</span>
  115. <img src="../assets/img/rb1.png" alt="">
  116. </div>
  117. <div class="room"><span>智慧教室2</span>
  118. <img src="../assets/img/rb2.png" alt="">
  119. </div>
  120. </div>
  121. <el-pagination layout="prev, pager, next" :total="50" />
  122. </div>
  123. </div>
  124. </el-aside>
  125. </el-container>
  126. <el-dialog v-model="centerDialogVisible" title="Warning" width="30%" align-center>
  127. <span>Open the dialog from the center from the screen</span>
  128. <template #footer>
  129. <span class="dialog-footer">
  130. <el-button @click="centerDialogVisible = false">Cancel</el-button>
  131. <el-button type="primary" @click="centerDialogVisible = false">
  132. Confirm
  133. </el-button>
  134. </span>
  135. </template>
  136. </el-dialog>
  137. </div>
  138. </template>
  139. <script>
  140. import * as echarts from "echarts";
  141. import { toRefs, reactive, onMounted, ref } from 'vue';
  142. import { ElScrollbar, ElPagination, ElDialog } from "element-plus";
  143. export default ({
  144. name: 'Histogram',
  145. components: { ElScrollbar, ElPagination, ElDialog },
  146. setup() {
  147. const pieData = reactive([{
  148. value: 1048,
  149. name: '基础型'
  150. },
  151. {
  152. value: 735,
  153. name: '扩展型'
  154. },
  155. {
  156. value: 580,
  157. name: '其他'
  158. }])
  159. const classPie = reactive({
  160. option: {
  161. color: ['#4ED2E4', '#5E91F6', '#67F0A8'],
  162. tooltip: {
  163. trigger: 'item'
  164. },
  165. grid: {
  166. x: '10',
  167. y: '234'
  168. },
  169. series: [{
  170. type: 'pie',
  171. radius: ['40%', '60%'],
  172. avoidLabelOverlap: false,
  173. label: {
  174. show: true,
  175. position: 'center',
  176. color: '#fff',
  177. formatter: () => { // 格式化要展示的文本
  178. return `总计\n\n1430间`
  179. },
  180. // formatter: '{total|' + 200 + '}' + '\n\r' + '{active|共发布活动}',
  181. // 等着获取了数据在给样式
  182. rich: {
  183. total: {
  184. fontSize: 35,
  185. fontFamily: "微软雅黑",
  186. color: '#454c5c'
  187. },
  188. active: {
  189. fontFamily: "微软雅黑",
  190. fontSize: 16,
  191. color: '#6c7a89',
  192. lineHeight: 30,
  193. },
  194. }
  195. },
  196. // emphasis: {
  197. // label: {
  198. // show: true,
  199. // fontSize: 40,
  200. // fontWeight: 'bold'
  201. // }
  202. // },
  203. labelLine: {
  204. show: false
  205. },
  206. data: pieData
  207. }]
  208. },
  209. })
  210. const initeCharts = () => {
  211. let myChart = echarts.init(document.getElementById('myChart'))
  212. // 绘制图表
  213. myChart.setOption(classPie.option)
  214. }
  215. // 本周课程统计数据
  216. const classCount = ref([
  217. {
  218. number: 112,
  219. text: '应上课程',
  220. imgnumber: "1",
  221. color: '#f56c6c',
  222. percentage: 20
  223. },
  224. {
  225. number: 473,
  226. text: '实上课程',
  227. imgnumber: "2",
  228. color: '#e6a23c'
  229. },
  230. {
  231. number: 1352,
  232. text: '应到学生数',
  233. imgnumber: "3",
  234. color: '#5cb87a',
  235. },
  236. {
  237. number: 2532,
  238. text: '实到学生数',
  239. imgnumber: "4",
  240. color: '#1989fa',
  241. }
  242. ])
  243. // 智慧教室使用数据
  244. const classRoom = ref([
  245. {
  246. class: '法医实验室',
  247. status: '在用',
  248. people: '35/40',
  249. percentage: '50%',
  250. },
  251. {
  252. class: '法医实验室',
  253. status: '在用',
  254. people: '35/40',
  255. percentage: '50%',
  256. },
  257. {
  258. class: '法医实验室',
  259. status: '在用',
  260. people: '35/40',
  261. percentage: '50%',
  262. },
  263. {
  264. class: '法医实验室',
  265. status: '在用',
  266. people: '35/40',
  267. percentage: '50%',
  268. },
  269. {
  270. class: '法医实验室',
  271. status: '在用',
  272. people: '35/40',
  273. percentage: '50%',
  274. },
  275. {
  276. class: '法医实验室',
  277. status: '在用',
  278. people: '35/40',
  279. percentage: '50%',
  280. },
  281. {
  282. class: '法医实验室',
  283. status: '在用',
  284. people: '35/40',
  285. percentage: '50%',
  286. },
  287. {
  288. class: '法医实验室',
  289. status: '在用',
  290. people: '35/40',
  291. percentage: '50%',
  292. },
  293. {
  294. class: '法医实验室',
  295. status: '在用',
  296. people: '35/40',
  297. percentage: '50%',
  298. },
  299. {
  300. class: '法医实验室',
  301. status: '在用',
  302. people: '35/40',
  303. percentage: '50%',
  304. },
  305. {
  306. class: '法医实验室',
  307. status: '在用',
  308. people: '35/40',
  309. percentage: '50%',
  310. },
  311. {
  312. class: '法医实验室',
  313. status: '在用',
  314. people: '35/40',
  315. percentage: '50%',
  316. },
  317. ])
  318. // 物联设备类型统计
  319. const interDevice = ref([
  320. {
  321. number: 98,
  322. color: "#63ABFF",
  323. icon: 'r1',
  324. text: "显示系统"
  325. },
  326. {
  327. number: 185,
  328. color: "#63FFC7",
  329. icon: 'r2',
  330. text: "控制设备"
  331. },
  332. {
  333. number: 58,
  334. color: "#918EFF",
  335. icon: 'r3',
  336. text: "音频设备"
  337. },
  338. {
  339. number: 68,
  340. color: "#00C8E3",
  341. icon: 'r4',
  342. text: "录播设备"
  343. },
  344. {
  345. number: 189,
  346. color: "#FFBB54",
  347. icon: 'r5',
  348. text: "环境设备"
  349. },
  350. {
  351. number: 98,
  352. color: "#00CF78",
  353. icon: 'r6',
  354. text: "安全管理"
  355. },
  356. ])
  357. // 位置弹框
  358. let centerDialogVisible = ref(false)
  359. const handleRoom = function () {
  360. console.log("查看当前教室使用情况", 'adsfasdfasdfa')
  361. centerDialogVisible.value = true
  362. }
  363. onMounted(() => {
  364. initeCharts()
  365. })
  366. return {
  367. ...toRefs(classPie),
  368. classCount,
  369. classRoom,
  370. centerDialogVisible,
  371. interDevice,
  372. handleRoom
  373. }
  374. },
  375. })
  376. </script>
  377. <style lang="scss">
  378. .container {
  379. margin: 0;
  380. padding: 0;
  381. overflow: hidden;
  382. .header {
  383. position: absolute;
  384. z-index: 555;
  385. margin-bottom: 20px;
  386. height: 80px;
  387. width: 100%;
  388. top: 22px;
  389. img {
  390. width: 100%;
  391. height: 100%;
  392. }
  393. }
  394. }
  395. .el-container {
  396. position: absolute;
  397. top: 40px;
  398. left: 0;
  399. z-index: 300;
  400. // border: 3px solid darkgreen;
  401. width: calc(100% - 30px);
  402. margin: 20px;
  403. padding-left: 12px;
  404. padding-top: 30px;
  405. height: 888px;
  406. overflow: hidden;
  407. color: #FFF;
  408. font-size: 14px;
  409. display: flex;
  410. justify-content: space-between;
  411. .left,
  412. .right {
  413. flex-shrink: 0;
  414. border-radius: 2px;
  415. background: rgba(125, 125, 125, 0.17);
  416. backdrop-filter: blur(30.5px);
  417. overflow: hidden;
  418. }
  419. .title {
  420. width: 380px;
  421. height: 32px;
  422. flex-shrink: 0;
  423. background: linear-gradient(90deg, rgba(255, 255, 255, 0.17) 2.49%, rgba(255, 255, 255, 0.00) 98.69%);
  424. ;
  425. line-height: 32px;
  426. .text {
  427. color: #FFF;
  428. font-family: PingFang SC;
  429. font-size: 14px;
  430. padding-left: 18px;
  431. letter-spacing: 1px;
  432. }
  433. }
  434. // 教室分类统计
  435. .content {
  436. display: flex;
  437. justify-content: space-between;
  438. width: 100%;
  439. overflow: hidden;
  440. .list {
  441. display: flex;
  442. flex-direction: column;
  443. justify-content: center;
  444. width: 200px;
  445. .item {
  446. width: 150px;
  447. display: flex;
  448. justify-content: space-between;
  449. align-items: center;
  450. margin: 10px;
  451. padding-bottom: 6px;
  452. border-bottom: 1px dotted rgba(255, 255, 255, 0.33);
  453. font-size: 14px;
  454. span {
  455. &:first-child {
  456. width: 8px;
  457. height: 8px;
  458. border-radius: 4px;
  459. background-color: firebrick;
  460. }
  461. &:nth-child(2n) {
  462. display: inline-block;
  463. text-align: left;
  464. width: 50px;
  465. // border: 2px solid darkcyan;
  466. margin-left: -40px;
  467. }
  468. }
  469. }
  470. }
  471. }
  472. // 本周课程统计
  473. .content {
  474. justify-content: space-evenly;
  475. .count {
  476. display: flex;
  477. flex-direction: column;
  478. align-items: center;
  479. width: 70px;
  480. height: 107px;
  481. text-align: center;
  482. justify-content: space-around;
  483. margin: 30px 0;
  484. padding: 20px;
  485. .el-progress-circle {
  486. width: 56px !important;
  487. height: 56px !important;
  488. .el-progress-circle__track {
  489. stroke: rgba(255, 255, 255, 0.2);
  490. }
  491. .el-progress__text {
  492. margin-top: 5px;
  493. }
  494. }
  495. .number {
  496. margin-top: 10px;
  497. margin-bottom: 5px;
  498. font-size: 12px;
  499. span {
  500. font-size: 14px;
  501. font-weight: bold;
  502. }
  503. }
  504. .text {
  505. font-size: 12px;
  506. line-height: 20px;
  507. width: 60px;
  508. }
  509. }
  510. }
  511. //智慧教室使用情况
  512. .content {
  513. // display: flex;
  514. // padding-right: 10px;
  515. // padding: 0;
  516. // border: 2px solid firebrick;
  517. .table {
  518. width: 100%;
  519. padding: 10px 10px;
  520. .th {
  521. font-weight: 700;
  522. display: flex;
  523. width: 100%;
  524. li {
  525. .long {
  526. width: 120px;
  527. border: 1px solid purple;
  528. }
  529. // &:nth-child()
  530. // width: 130px;
  531. //
  532. // text-align: center !important;
  533. }
  534. }
  535. ul {
  536. display: flex;
  537. list-style: none;
  538. height: 40px;
  539. line-height: 40px;
  540. font-size: 12px;
  541. border-bottom: 1px dotted #fff;
  542. padding: 0;
  543. &:last-child {
  544. margin-bottom: 10px;
  545. }
  546. li {
  547. display: flex;
  548. width: 100%;
  549. align-items: center;
  550. justify-content: space-around
  551. }
  552. }
  553. .el-button {
  554. background-color: #5F7BDC;
  555. color: #fff;
  556. border: none;
  557. }
  558. }
  559. }
  560. // 物联设备统计
  561. .content {
  562. .img {
  563. // border: 2px solid firebrick;
  564. display: flex;
  565. flex-direction: column;
  566. align-items: center;
  567. padding: 20px 10px;
  568. span {
  569. &:first-child {
  570. font-size: 18px;
  571. font-weight: bold;
  572. }
  573. &:last-child {
  574. margin-top: 10px;
  575. font-size: 16px;
  576. }
  577. }
  578. }
  579. .list {
  580. .item_r {
  581. display: flex;
  582. align-items: center;
  583. width: 100%;
  584. margin-bottom: 10px;
  585. // border: 1px solid forestgreen;
  586. img {
  587. border-bottom: none;
  588. }
  589. .percent {
  590. width: 120px;
  591. border-bottom: 1px solid rgba(255, 255, 255, .73);
  592. margin: 10px;
  593. padding-bottom: 10px;
  594. font-size: 16px;
  595. span {
  596. font-size: 12px;
  597. color: #fff;
  598. opacity: .76;
  599. }
  600. }
  601. }
  602. }
  603. }
  604. // 物联设备类型统计
  605. .contentwrap {
  606. display: flex;
  607. flex-wrap: wrap;
  608. .count {
  609. display: flex;
  610. flex-direction: column;
  611. align-items: center;
  612. padding: 10px;
  613. text-align: center;
  614. width: 110px;
  615. .el-progress-circle {
  616. width: 54.6px !important;
  617. height: 54.6px !important;
  618. .el-progress-circle__track {
  619. stroke: rgba(255, 255, 255, 0.2);
  620. }
  621. margin: 5px 0;
  622. }
  623. .number {
  624. font-size: 12px;
  625. span {
  626. font-size: 14px;
  627. font-weight: bold;
  628. }
  629. }
  630. .text {
  631. width: 60px;
  632. }
  633. }
  634. }
  635. // 智慧教室实时监控
  636. .monitor {
  637. display: flex;
  638. flex-direction: column;
  639. width: 100%;
  640. height: 350px;
  641. background: rgba(0, 0, 0, 0.2);
  642. padding: 10px;
  643. // border: 1px solid fuchsia;
  644. p {
  645. margin-left: 5px;
  646. margin-top: 5px;
  647. }
  648. .interactclass {
  649. display: flex;
  650. justify-content: space-around;
  651. .room {
  652. position: relative;
  653. width: 170px;
  654. height: 94px;
  655. // background: saddlebrown;
  656. margin-top: 10px;
  657. span {
  658. position: absolute;
  659. top: 0;
  660. left: 0;
  661. }
  662. }
  663. }
  664. .el-pagination {
  665. justify-content: center;
  666. --el-pagination-bg-color: 'tranparent';
  667. --el-pagination-text-color: '#fff'
  668. }
  669. .el-pagination button:disabled {
  670. background: none;
  671. color: '#fff';
  672. }
  673. .el-pagination button:hover {
  674. color: '#fff';
  675. }
  676. .el-pager li {
  677. color: #fff;
  678. }
  679. }
  680. }
  681. </style>