right.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <template>
  2. <el-aside class="right">
  3. <div class="right_top">
  4. <div class="title">
  5. <div class="text">物联设备统计</div>
  6. </div>
  7. <div class="content">
  8. <div class="logo">
  9. <span>{{ equipmentTotal.total }}</span>
  10. <img class="animate" src="../assets/img/d1_1.png" alt="">
  11. <img src="../assets/img/d1_2.png" alt="">
  12. <span><b>总数</b>(个)</span>
  13. </div>
  14. <div class="list">
  15. <div class="item_r">
  16. <img src="../assets/img/d2.png" alt="">
  17. <div class="percent">
  18. 在线&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ equipmentTotal.online }}
  19. <span>(个)</span>
  20. </div>
  21. </div>
  22. <div class="item_r">
  23. <img src="../assets/img/d3.png" alt="">
  24. <div class="percent">
  25. 离线&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {{ equipmentTotal.underline }}
  26. <span>(个)</span>
  27. </div>
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. <div class="right_center">
  33. <div class="title">
  34. <div class="text">物联设备类型统计</div>
  35. </div>
  36. <div class="contentwrap">
  37. <div class="count" v-for="(item, index) in interDevice" :key="index">
  38. <CircleProgress :target-value="item.number" :color="item.color" text-position="top">
  39. <img :src="'src/assets/img/' + item.icon + '.png'" alt="">
  40. </CircleProgress>
  41. <div class="text">{{ item.text }}</div>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="right_bottom">
  46. <div class="title">
  47. <div class="text">智慧教室实时监控</div>
  48. </div>
  49. <div class="monitorContent">
  50. <el-carousel class="monitor">
  51. <el-carousel-item v-for="(item, index) in carouselData" :key="index">
  52. <div class="interactclass">
  53. <div class="room" v-for="(item, index) in item.activeMonitor.array" :key="index">
  54. <span>{{ item.title }}</span>
  55. <img :src="'src/assets/img/' + 'rb2' + '.png'" alt="" @click="lookVideo(item.src)">
  56. </div>
  57. </div>
  58. <p>{{ item.activeMonitor.title }}</p>
  59. <div class="interactclass">
  60. <div class="room" v-for="(item, index) in item.activeMonitor.array" :key="index">
  61. <span>{{ item.title }}</span>
  62. <img :src="'src/assets/img/' + 'rb2' + '.png'" alt="" @click="lookVideo(item.src)">
  63. </div>
  64. </div>
  65. </el-carousel-item>
  66. </el-carousel>
  67. </div>
  68. </div>
  69. </el-aside>
  70. <!-- 视频播放弹框 -->
  71. <el-dialog class="videoDialog" v-model="videoDialog" title="互动教师1" width="60%" align="center" top="4%">
  72. <videoPlay v-bind="videoData" @play="onPlay" />
  73. </el-dialog>
  74. </template>
  75. <script >
  76. import { reactive, onMounted, ref, } from 'vue';
  77. import { ElCarousel, ElCarouselItem } from "element-plus";
  78. import "vue3-video-play/dist/style.css";
  79. import { videoPlay } from "vue3-video-play";
  80. import CircleProgress from './CircleProgress.vue';
  81. import { getDevice } from '../request/api';
  82. export default ({
  83. name: 'Histogram',
  84. components: { videoPlay, ElCarousel, ElCarouselItem, CircleProgress },
  85. setup() {
  86. // 视频数据
  87. const videoData = reactive({
  88. width: "100%", //播放器高度
  89. height: "100%", //播放器高度
  90. color: "red", //主题色
  91. title: "互动教室", //视频名称
  92. src: "https://cdn.jsdelivr.net/gh/xdlumia/files/video-play/IronMan.mp4", //视频源
  93. muted: false, //静音
  94. webFullScreen: false,
  95. // speedRate: ["0.75", "1.0", "1.25", "1.5", "2.0"], //播放倍速
  96. autoPlay: false, //自动播放
  97. loop: false, //循环播放
  98. mirror: false, //镜像画面
  99. ligthOff: false, //关灯模式
  100. volume: 0.3, //默认音量大小
  101. control: true, //是否显示控制
  102. currentTime: 0,//跳转到固定播放时间
  103. controlBtns: [
  104. "audioTrack",
  105. "quality",
  106. "speedRate",
  107. "volume",
  108. "setting",
  109. "pip",
  110. "pageFullScreen",
  111. "fullScreen",
  112. ], //显示所有按钮,
  113. });
  114. //视频播放弹框
  115. const videoDialog = ref(false)
  116. // 播放视频
  117. const lookVideo = function (src) {
  118. videoDialog.value = true;
  119. // console.log("点击了播放视频", 12312312, "播放路径", src)
  120. videoData.src = src
  121. }
  122. // 播放视频
  123. const onPlay = function () {
  124. console.log("播放视频")
  125. }
  126. // 物联设备
  127. let equipmentTotal = ref({})
  128. //智慧教室实时监控---数据
  129. // const carouselData = ref([
  130. // {
  131. // activeMonitor: {
  132. // title: "多屏互动教室",
  133. // array: [
  134. // {
  135. // title: "互动教室22",
  136. // poster: 'rb1',
  137. // src: '',
  138. // },
  139. // {
  140. // title: "互动教室22",
  141. // poster: 'rb2',
  142. // src: '',
  143. // }
  144. // ]
  145. // },
  146. // wisdomMonitor:
  147. // {
  148. // title: "多屏智慧教室",
  149. // array: [
  150. // {
  151. // title: "智慧教室11",
  152. // poster: 'rb1',
  153. // src: '',
  154. // },
  155. // {
  156. // title: "智慧教室11",
  157. // poster: 'rb2',
  158. // src: '',
  159. // }
  160. // ]
  161. // }
  162. // },
  163. // {
  164. // activeMonitor: {
  165. // title: "多屏互动教室",
  166. // array: [
  167. // {
  168. // title: "互动教室33",
  169. // poster: 'rb1',
  170. // src: '',
  171. // },
  172. // {
  173. // title: "互动教室33",
  174. // poster: 'rb2',
  175. // src: '',
  176. // }
  177. // ]
  178. // },
  179. // wisdomMonitor:
  180. // {
  181. // title: "多屏智慧教室",
  182. // array: [
  183. // {
  184. // title: "智慧教室22",
  185. // poster: 'rb1',
  186. // src: '',
  187. // },
  188. // {
  189. // title: "智慧教室22",
  190. // poster: 'rb2',
  191. // src: '',
  192. // }
  193. // ]
  194. // }
  195. // }
  196. // ]);
  197. // 物联设备类型统计
  198. let interDevice = ref([])
  199. // 智慧教室
  200. let carouselData = ref([])
  201. //获取页面数据
  202. const getDeviceData = async () => {
  203. let res = await getDevice()
  204. if (res.code !== 200) {
  205. ElMessage.error("数据请求出错");
  206. }
  207. let { category, monitor, status } = res.data
  208. // 物联设备类型数据
  209. interDevice.value = category;
  210. // 互动教室
  211. carouselData.value = monitor
  212. //物联设备统计
  213. equipmentTotal.value = status
  214. }
  215. onMounted(() => {
  216. getDeviceData()
  217. })
  218. return {
  219. interDevice,
  220. videoData,
  221. onPlay,
  222. videoDialog,
  223. lookVideo,
  224. carouselData,
  225. equipmentTotal
  226. }
  227. },
  228. })
  229. </script>
  230. <style scoped lang="scss">
  231. @import '../assets/css/right.scss';
  232. </style>
  233. <style lang="scss">
  234. .videoDialog {
  235. .el-dialog__header {
  236. height: 49px;
  237. line-height: 49px;
  238. padding: 0;
  239. background-color: #1B67D9;
  240. margin-right: 0;
  241. .el-dialog__title {
  242. color: #FFF;
  243. font-family: Inter;
  244. }
  245. .el-dialog__headerbtn {
  246. top: 0px;
  247. i {
  248. color: #fff;
  249. font-size: 20px;
  250. font-weight: bold;
  251. }
  252. }
  253. }
  254. .el-dialog__body {
  255. padding: 0 !important;
  256. }
  257. }
  258. </style>