schoolRight.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. <template>
  2. <div class="container">
  3. <!-- 标题区域 -->
  4. <div class="title">
  5. <div class="title_text">校园安全</div>
  6. <div class="title_sub">Campus security</div>
  7. </div>
  8. <!-- 内容区域 -->
  9. <div class="content">
  10. <div class="sub_title">安全设施监控情况</div>
  11. <div class="device">
  12. <div class="device_box">
  13. <div class="box_img">
  14. <div class="box_num" ref="deviceDom">{{ deviceNum }}</div>
  15. </div>
  16. 监控摄像头
  17. </div>
  18. <div class="device_box">
  19. <div class="box_img">
  20. <div class="box_num" ref="deviceDom2">{{ deviceNum2 }}</div>
  21. </div>
  22. 报警器/监控器
  23. </div>
  24. <div class="device_box">
  25. <div class="box_img">
  26. <div class="box_num" ref="deviceDom3">{{ deviceNum3 }}</div>
  27. </div>
  28. 消防设施
  29. </div>
  30. </div>
  31. <div class="sub_title">预警推送</div>
  32. <div class="form">
  33. <el-table :data="tableData">
  34. <el-table-column label="序号" align="center" width="40">
  35. <template #default="scope">
  36. <div class="order">{{ scope.$index + 1 }}</div>
  37. </template>
  38. </el-table-column>
  39. <el-table-column
  40. prop="name"
  41. label="姓名"
  42. align="center"
  43. width="50"
  44. show-overflow-tooltip
  45. />
  46. <el-table-column prop="time" label="时间" align="center" width="55" />
  47. <el-table-column
  48. prop="type"
  49. label="类别"
  50. align="center"
  51. width="62"
  52. show-overflow-tooltip
  53. />
  54. <el-table-column
  55. prop="section"
  56. label="部门"
  57. align="center"
  58. width="62"
  59. />
  60. <el-table-column
  61. prop="address"
  62. label="地点"
  63. align="center"
  64. width="71"
  65. show-overflow-tooltip
  66. />
  67. <el-table-column label="状态" align="center" width="62">
  68. <template #default="{ row }">
  69. <div v-if="row.status === 0">未处理</div>
  70. <div class="red" v-if="row.status === 1">已推送</div>
  71. <div class="green" v-if="row.status === 2">已处理</div>
  72. </template>
  73. </el-table-column>
  74. </el-table>
  75. </div>
  76. <div class="sub_title">
  77. 实时监控画面
  78. <span class="more" @click="handleCheckMore">查看更多 ></span>
  79. </div>
  80. <div class="video">
  81. <div class="video_box" v-for="(item, index) in 4" :key="index">
  82. <img
  83. src="https://materials.cdn.bcebos.com/images/107505592/68889f5dbf4bd8d8ef0cd11f98b5adea.jpeg"
  84. />
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. </template>
  90. <script setup lang="ts">
  91. import { ref, onMounted } from "vue";
  92. import { useRouter } from "vue-router";
  93. import { countUpNum } from "@/utils/countUpNum";
  94. const deviceNum = ref(100);
  95. const deviceNum2 = ref(150);
  96. const deviceNum3 = ref(10);
  97. const deviceDom = ref();
  98. const deviceDom2 = ref();
  99. const deviceDom3 = ref();
  100. const tableData = [
  101. {
  102. name: "张三",
  103. time: "18:22",
  104. type: "打架打架打架",
  105. section: "八年级",
  106. address: "教学楼教学楼教学楼",
  107. status: 0,
  108. },
  109. {
  110. name: "李四",
  111. time: "18:22",
  112. type: "打架",
  113. section: "八年级",
  114. address: "教学楼",
  115. status: 1,
  116. },
  117. {
  118. name: "王五",
  119. time: "18:22",
  120. type: "打架",
  121. section: "八年级",
  122. address: "教学楼",
  123. status: 2,
  124. },
  125. {
  126. name: "老刘",
  127. time: "18:22",
  128. type: "打架打架打架",
  129. section: "八年级",
  130. address: "教学楼教学楼教学楼",
  131. status: 0,
  132. },
  133. {
  134. name: "胜七",
  135. time: "18:22",
  136. type: "打架",
  137. section: "八年级",
  138. address: "教学楼",
  139. status: 1,
  140. },
  141. {
  142. name: "王八",
  143. time: "18:22",
  144. type: "打架",
  145. section: "八年级",
  146. address: "教学楼",
  147. status: 2,
  148. },
  149. {
  150. name: "何九",
  151. time: "18:22",
  152. type: "打架打架打架",
  153. section: "八年级",
  154. address: "教学楼教学楼教学楼",
  155. status: 0,
  156. },
  157. ];
  158. const router = useRouter();
  159. onMounted(() => {
  160. getCountUpNum();
  161. });
  162. // 查看更多按钮回调
  163. const handleCheckMore = () => {
  164. router.push("/more");
  165. };
  166. const getCountUpNum = () => {
  167. countUpNum(deviceDom.value, deviceNum.value);
  168. countUpNum(deviceDom2.value, deviceNum2.value);
  169. countUpNum(deviceDom3.value, deviceNum3.value);
  170. };
  171. </script>
  172. <style lang="scss" scoped>
  173. .container {
  174. width: 435px;
  175. height: 951px;
  176. color: #fff;
  177. background-image: url(@/assets/images/box-bg.png);
  178. .title {
  179. display: flex;
  180. align-items: center;
  181. width: 430px;
  182. height: 47px;
  183. font-family: "庞门正道标题体";
  184. background-image: url(@/assets/images/title-bg.png);
  185. background-size: 100% 100%;
  186. .title_text {
  187. margin-left: 38px;
  188. font-size: 20px;
  189. text-shadow: 0px 0px 9px #158eff;
  190. }
  191. .title_sub {
  192. margin-left: 19px;
  193. font-size: 12px;
  194. color: #215a8e;
  195. }
  196. }
  197. .content {
  198. padding: 20px 19px 0 14px;
  199. height: 904px;
  200. .sub_title {
  201. display: flex;
  202. padding-left: 28px;
  203. height: 35px;
  204. line-height: 18px;
  205. color: #abd6ff;
  206. font-weight: bold;
  207. background-image: url(@/assets/images/title-bg2.png);
  208. background-size: 100% 100%;
  209. .more {
  210. margin-left: auto;
  211. font-size: 12px;
  212. cursor: pointer;
  213. }
  214. }
  215. .device {
  216. display: flex;
  217. justify-content: space-evenly;
  218. align-items: center;
  219. height: 130px;
  220. .device_box {
  221. display: flex;
  222. flex-direction: column;
  223. align-items: center;
  224. font-size: 14px;
  225. .box_img {
  226. margin-bottom: 5px;
  227. width: 80px;
  228. height: 48px;
  229. font-size: 19px;
  230. font-weight: bold;
  231. text-align: center;
  232. background-image: url(@/assets/images/device.png);
  233. background-size: 100% 100%;
  234. .box_num {
  235. animation: float 3s linear infinite;
  236. }
  237. }
  238. }
  239. }
  240. .form {
  241. margin: 26px 0;
  242. height: 274px;
  243. overflow: hidden;
  244. .order {
  245. margin: auto;
  246. width: 24px;
  247. height: 16px;
  248. line-height: 16px;
  249. text-align: center;
  250. color: #ffeb3b;
  251. background-color: rgba(255, 235, 59, 0.3);
  252. }
  253. .red {
  254. color: #ff6b6b;
  255. }
  256. .green {
  257. color: #40f7eb;
  258. }
  259. }
  260. .video {
  261. display: flex;
  262. flex-wrap: wrap;
  263. justify-content: space-between;
  264. align-content: space-evenly;
  265. padding-top: 24px;
  266. height: 320px;
  267. .video_box {
  268. width: 198px;
  269. height: 134px;
  270. border-radius: 5px;
  271. img {
  272. width: 100%;
  273. border-radius: 5px;
  274. }
  275. }
  276. }
  277. }
  278. }
  279. /*最外层透明*/
  280. .form ::v-deep(.el-table),
  281. .form ::v-deep(.el-table__expanded-cell) {
  282. background-color: transparent;
  283. color: white;
  284. border: none;
  285. }
  286. /* 表格内背景颜色 */
  287. .form ::v-deep(.el-table th),
  288. .form ::v-deep(.el-table tr),
  289. .form ::v-deep(.el-table td),
  290. ::v-deep(.el-table th.el-table__cell.is-leaf) {
  291. background-color: transparent !important;
  292. color: white;
  293. font-size: 12px;
  294. border-color: rgba(255, 255, 255, 0.1);
  295. height: 40px;
  296. }
  297. // 表格底部白线清除
  298. ::v-deep(.el-table__inner-wrapper::before) {
  299. height: 0;
  300. }
  301. // 修改表头背景颜色
  302. ::v-deep(.el-table__header) {
  303. background-color: rgba(58, 126, 199, 0.5);
  304. }
  305. // 清除表格默认padding
  306. ::v-deep(.el-table .cell) {
  307. padding: 0;
  308. }
  309. // 动画滚动
  310. ::v-deep(.el-scrollbar__view) {
  311. animation: run 12s linear infinite;
  312. }
  313. </style>