index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <template>
  2. <view class="container">
  3. <!-- 顶部导航 -->
  4. <view class="header">
  5. <view class="header-left">
  6. <text class="app-title">沅陵系统管理</text>
  7. </view>
  8. <view class="header-right">
  9. <uni-icons type="notification" size="24" color="#333" class="notification-icon"/>
  10. <view class="avatar"></view>
  11. </view>
  12. </view>
  13. <!-- 主要功能区域 -->
  14. <scroll-view class="content" scroll-y>
  15. <view class="main-functions">
  16. <!-- 事件中心卡片 -->
  17. <view class="function-card event-center" @click="toEventList">
  18. <view class="card-content">
  19. <image class="card-image" :src="eventCenterImage" mode="aspectFill" />
  20. <view class="card-info">
  21. <text class="card-title">事件中心</text>
  22. <text class="card-desc">当前有 3 个待处理事件</text>
  23. </view>
  24. </view>
  25. <uni-icons type="right" size="20" color="#666"/>
  26. </view>
  27. <!-- 灯杆控制卡片 -->
  28. <view class="function-card pole-control" @click="toPoleList">
  29. <view class="card-content">
  30. <image class="card-image" :src="poleControlImage" mode="aspectFill" />
  31. <view class="card-info">
  32. <text class="card-title">灯杆控制</text>
  33. <text class="card-desc">设备运行正常</text>
  34. </view>
  35. </view>
  36. <uni-icons type="right" size="20" color="#666"/>
  37. </view>
  38. </view>
  39. <!-- 状态概览 -->
  40. <view class="status-overview">
  41. <view class="status-item">
  42. <text class="status-value">358</text>
  43. <text class="status-label">在线设备</text>
  44. </view>
  45. <view class="status-item">
  46. <text class="status-value">3</text>
  47. <text class="status-label">待处理告警</text>
  48. </view>
  49. <view class="status-item">
  50. <text class="status-value">98%</text>
  51. <text class="status-label">设备在线率</text>
  52. </view>
  53. </view>
  54. </scroll-view>
  55. </view>
  56. </template>
  57. <script lang="ts" setup>
  58. import { ref } from 'vue';
  59. const toEventList = () => {
  60. uni.navigateTo({
  61. url:"/pages/eventList/index"
  62. })
  63. }
  64. const toPoleList = () => {
  65. uni.navigateTo({
  66. url:"/pages/poleList/index"
  67. })
  68. }
  69. const eventCenterImage = ref('https://ai-public.mastergo.com/ai/img_res/c17e4608f5722aa86a58cc8c7a35eccf.jpg');
  70. const poleControlImage = ref('https://ai-public.mastergo.com/ai/img_res/4dc77feb78b19b69c2ac630128735a8b.jpg');
  71. </script>
  72. <style>
  73. page {
  74. height: 100%;
  75. }
  76. .container {
  77. display: flex;
  78. flex-direction: column;
  79. height: 100%;
  80. background-color: #F5F6FA;
  81. /* width: 700rpx; */
  82. /* width: 90vw; */
  83. }
  84. .header {
  85. display: flex;
  86. justify-content: space-between;
  87. align-items: center;
  88. padding: 20rpx 32rpx;
  89. background-color: #FFFFFF;
  90. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  91. flex-shrink: 0;
  92. }
  93. .header-left {
  94. display: flex;
  95. align-items: center;
  96. }
  97. .app-title {
  98. font-size: 18px;
  99. font-weight: 600;
  100. color: #333333;
  101. }
  102. .header-right {
  103. display: flex;
  104. align-items: center;
  105. gap: 24rpx;
  106. }
  107. .notification-icon {
  108. width: 24px;
  109. height: 24px;
  110. }
  111. .avatar {
  112. width: 64rpx;
  113. height: 64rpx;
  114. border-radius: 32rpx;
  115. background-color: #E0E5F2;
  116. }
  117. .content {
  118. flex: 1;
  119. overflow: auto;
  120. padding: 32rpx;
  121. width: 700rpx;
  122. }
  123. .main-functions {
  124. display: flex;
  125. flex-direction: column;
  126. gap: 24rpx;
  127. margin-bottom: 32rpx;
  128. }
  129. .function-card {
  130. display: flex;
  131. justify-content: space-between;
  132. align-items: center;
  133. padding: 32rpx;
  134. background-color: #FFFFFF;
  135. border-radius: 16rpx;
  136. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  137. }
  138. .card-content {
  139. display: flex;
  140. align-items: center;
  141. gap: 24rpx;
  142. }
  143. .card-image {
  144. width: 96rpx;
  145. height: 96rpx;
  146. border-radius: 16rpx;
  147. }
  148. .card-info {
  149. display: flex;
  150. flex-direction: column;
  151. gap: 8rpx;
  152. }
  153. .card-title {
  154. font-size: 16px;
  155. font-weight: 600;
  156. color: #333333;
  157. }
  158. .card-desc {
  159. font-size: 14px;
  160. color: #666666;
  161. }
  162. .event-center {
  163. border-left: 8rpx solid #FF4D4F;
  164. }
  165. .pole-control {
  166. border-left: 8rpx solid #2B5DE0;
  167. }
  168. .status-overview {
  169. display: grid;
  170. grid-template-columns: repeat(3, 1fr);
  171. gap: 24rpx;
  172. background-color: #FFFFFF;
  173. padding: 32rpx;
  174. border-radius: 16rpx;
  175. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  176. }
  177. .status-item {
  178. display: flex;
  179. flex-direction: column;
  180. align-items: center;
  181. gap: 8rpx;
  182. }
  183. .status-value {
  184. font-size: 24px;
  185. font-weight: 600;
  186. color: #333333;
  187. }
  188. .status-label {
  189. font-size: 14px;
  190. color: #666666;
  191. }
  192. .tab-bar {
  193. display: flex;
  194. justify-content: space-around;
  195. padding: 16rpx 0;
  196. background-color: #FFFFFF;
  197. box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
  198. flex-shrink: 0;
  199. }
  200. .tab-item {
  201. display: flex;
  202. flex-direction: column;
  203. align-items: center;
  204. gap: 4rpx;
  205. }
  206. .tab-text {
  207. font-size: 12px;
  208. color: #666666;
  209. }
  210. .active .tab-text {
  211. color: #2B5DE0;
  212. }
  213. </style>