index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <template>
  2. <div id="index">
  3. <el-row>
  4. <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
  5. <div class="head">
  6. <h1 class="head_1">大数据可视化系统数据分析通用模版</h1>
  7. <div class="head_2" id="showTime">{{ formattedTime }}</div>
  8. </div>
  9. <div class="center">
  10. <ul class="clearfix">
  11. <li>
  12. <div class="boxall" style="height: calc(40% - 0.15rem)">
  13. <div class="titleall">模块标题</div>
  14. <div class="list">
  15. <div class="list_1" v-for="i in listOne" :key="i.value">
  16. <h2>{{ i.value }}</h2>
  17. <span>{{ i.label }}</span>
  18. </div>
  19. </div>
  20. <div class="boxfoot"></div>
  21. </div>
  22. </li>
  23. </ul>
  24. </div>
  25. <div class="bottom">下</div>
  26. </el-col>
  27. </el-row>
  28. </div>
  29. </template>
  30. <script setup>
  31. // 加载中
  32. const loading = ref(false)
  33. // 时间
  34. const formattedTime = ref('')
  35. const listOne = ref([
  36. { value: '1824', label: '华东地区' },
  37. { value: '1920', label: '华南地区' },
  38. { value: '19%', label: '华西地区' },
  39. { value: '1824', label: '华北地区' }
  40. ])
  41. // 请求
  42. onMounted(async () => {
  43. loading.value = true
  44. await updateTime()
  45. loading.value = false
  46. })
  47. // 创建一个函数来格式化时间并更新状态
  48. const updateTime = () => {
  49. const now = new Date()
  50. const options = {
  51. year: 'numeric',
  52. month: '2-digit',
  53. day: '2-digit',
  54. hour: '2-digit',
  55. minute: '2-digit',
  56. second: '2-digit',
  57. hour12: false
  58. }
  59. formattedTime.value = now.toLocaleString('zh-CN', options)
  60. }
  61. const timer = setInterval(updateTime, 1000)
  62. onMounted(() => {
  63. timer // 开始计时器
  64. })
  65. onBeforeUnmount(() => {
  66. clearInterval(timer) // 组件卸载前清除计时器
  67. })
  68. </script>
  69. <style scoped lang="scss">
  70. .main {
  71. height: 100vh;
  72. background: url('./images/bg.jpg') no-repeat center center;
  73. background-size: 100% 100%;
  74. padding: 0px;
  75. margin: 0px;
  76. color: #222;
  77. font-family: '微软雅黑';
  78. @font-face {
  79. font-family: electronicFont;
  80. src: url(./font/DS-DIGIT.TTF);
  81. }
  82. a:hover {
  83. color: #06c;
  84. text-decoration: none !important;
  85. }
  86. .head {
  87. position: relative;
  88. height: 4.5rem;
  89. background: url('./images/head_bg.png') no-repeat center center;
  90. background-size: 100% 100%;
  91. .head_1 {
  92. color: #fff;
  93. text-align: center;
  94. font-size: 2.5rem;
  95. line-height: 2.5rem;
  96. }
  97. .head_2 {
  98. position: absolute;
  99. right: 1rem;
  100. top: 0;
  101. line-height: 1.5rem;
  102. color: rgba(255, 255, 255, 0.7);
  103. font-size: 1.5rem;
  104. padding-right: 0.5rem;
  105. font-family: electronicFont;
  106. }
  107. }
  108. .center {
  109. .titleall {
  110. font-size: 1.2rem;
  111. color: #fff;
  112. line-height: 1.2rem;
  113. padding: 0 0 1rem 0;
  114. border-bottom: 1px dotted rgba(255, 255, 255, 0.2);
  115. }
  116. .boxall {
  117. border: 1px solid rgba(25, 186, 139, 0.17);
  118. padding: 1rem;
  119. background: rgba(255, 255, 255, 0.04) url('./images/line.png');
  120. background-size: 100% auto;
  121. position: relative;
  122. margin-bottom: 0.15rem;
  123. z-index: 10;
  124. .list {
  125. display: flex;
  126. align-items: center;
  127. .list_1 {
  128. position: relative;
  129. width: 20rem;
  130. display: flex;
  131. flex-direction: column;
  132. align-items: center;
  133. margin: 0 0 0.5rem 0;
  134. h2 {
  135. margin: 1rem 0;
  136. font-size: 1.9rem;
  137. color: #46b8ff;
  138. padding-bottom: 0.2rem;
  139. }
  140. span {
  141. font-size: 1.2rem;
  142. color: #fff;
  143. opacity: 0.5;
  144. }
  145. }
  146. .list_1:before {
  147. position: absolute;
  148. content: '';
  149. height: 25%;
  150. width: 0.1rem;
  151. background: rgba(255, 255, 255, 0.1);
  152. right: 0;
  153. top: 25%;
  154. }
  155. .list_1:last-child:before {
  156. width: 0;
  157. }
  158. }
  159. .boxfoot {
  160. position: absolute;
  161. bottom: 0;
  162. width: 100%;
  163. left: 0;
  164. }
  165. }
  166. .boxall:before,
  167. .boxfoot:before {
  168. border-left: 2px solid #02a6b5;
  169. left: 0;
  170. }
  171. .boxall:before {
  172. position: absolute;
  173. width: 0.7rem;
  174. height: 0.7rem;
  175. content: '';
  176. border-top: 2px solid #02a6b5;
  177. top: 0;
  178. }
  179. .boxall:after,
  180. .boxfoot:after {
  181. border-right: 2px solid #02a6b5;
  182. right: 0;
  183. }
  184. .boxall:before,
  185. .boxall:after {
  186. position: absolute;
  187. width: 0.7rem;
  188. height: 0.7rem;
  189. content: '';
  190. border-top: 2px solid #02a6b5;
  191. top: 0;
  192. }
  193. .boxfoot:before,
  194. .boxfoot:after {
  195. position: absolute;
  196. width: 0.7rem;
  197. height: 0.7rem;
  198. content: '';
  199. border-bottom: 2px solid #02a6b5;
  200. bottom: 0;
  201. }
  202. .boxall:before,
  203. .boxfoot:before {
  204. border-left: 2px solid #02a6b5;
  205. left: 0;
  206. }
  207. }
  208. .center > ul > li {
  209. float: left;
  210. padding: 0 0.1rem;
  211. height: 100%;
  212. width: 30%;
  213. }
  214. }
  215. </style>