index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  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. <!-- 可视化菜单控制卡片 -->
  39. <view class="function-card viual-control" @click="toVisualControl">
  40. <view class="card-content">
  41. <image class="card-image" :src="VisualControl" mode="aspectFill" />
  42. <view class="card-info">
  43. <text class="card-title">模块控制</text>
  44. <text class="card-desc">设备运行正常</text>
  45. </view>
  46. </view>
  47. <uni-icons type="right" size="20" color="#666"/>
  48. </view>
  49. </view>
  50. <!-- 状态概览 -->
  51. <view class="status-overview">
  52. <view class="status-item">
  53. <text class="status-value">358</text>
  54. <text class="status-label">在线设备</text>
  55. </view>
  56. <view class="status-item">
  57. <text class="status-value">3</text>
  58. <text class="status-label">待处理告警</text>
  59. </view>
  60. <view class="status-item">
  61. <text class="status-value">98%</text>
  62. <text class="status-label">设备在线率</text>
  63. </view>
  64. </view>
  65. </scroll-view>
  66. </view>
  67. </template>
  68. <script lang="ts" setup>
  69. import {ref} from 'vue';
  70. const toEventList = () => {
  71. uni.navigateTo({
  72. url:"/pages/eventList/index"
  73. })
  74. }
  75. const toPoleList = () => {
  76. uni.navigateTo({
  77. url:"/pages/poleList/index"
  78. })
  79. }
  80. const toVisualControl = () => {
  81. console.log(1112)
  82. uni.navigateTo({
  83. url:"/pages/VisualControl/index"
  84. })
  85. }
  86. const eventCenterImage = ref('../../static/viualControlImg/sjzx.png');
  87. const poleControlImage = ref('../../static/viualControlImg/dgkz.png');
  88. const VisualControl = ref('../../static/viualControlImg/mkkz.png');
  89. </script>
  90. <style>
  91. page {
  92. height: 100%;
  93. }
  94. .container {
  95. display: flex;
  96. flex-direction: column;
  97. height: 100%;
  98. background-color: #F5F6FA;
  99. /* width: 700rpx; */
  100. /* width: 90vw; */
  101. }
  102. .header {
  103. display: flex;
  104. justify-content: space-between;
  105. align-items: center;
  106. padding: 20rpx 32rpx;
  107. background-color: #FFFFFF;
  108. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  109. flex-shrink: 0;
  110. }
  111. .header-left {
  112. display: flex;
  113. align-items: center;
  114. }
  115. .app-title {
  116. font-size: 18px;
  117. font-weight: 600;
  118. color: #333333;
  119. }
  120. .header-right {
  121. display: flex;
  122. align-items: center;
  123. gap: 24rpx;
  124. }
  125. .notification-icon {
  126. width: 24px;
  127. height: 24px;
  128. }
  129. .avatar {
  130. width: 64rpx;
  131. height: 64rpx;
  132. border-radius: 32rpx;
  133. background-color: #E0E5F2;
  134. }
  135. .content {
  136. flex: 1;
  137. overflow: auto;
  138. padding: 32rpx;
  139. width: 700rpx;
  140. }
  141. .main-functions {
  142. display: flex;
  143. flex-direction: column;
  144. gap: 24rpx;
  145. margin-bottom: 32rpx;
  146. }
  147. .function-card {
  148. display: flex;
  149. justify-content: space-between;
  150. align-items: center;
  151. padding: 32rpx;
  152. background-color: #FFFFFF;
  153. border-radius: 16rpx;
  154. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  155. }
  156. .card-content {
  157. display: flex;
  158. align-items: center;
  159. gap: 24rpx;
  160. }
  161. .card-image {
  162. width: 96rpx;
  163. height: 96rpx;
  164. border-radius: 16rpx;
  165. }
  166. .card-info {
  167. display: flex;
  168. flex-direction: column;
  169. gap: 8rpx;
  170. }
  171. .card-title {
  172. font-size: 16px;
  173. font-weight: 600;
  174. color: #333333;
  175. }
  176. .card-desc {
  177. font-size: 14px;
  178. color: #666666;
  179. }
  180. .event-center {
  181. border-left: 8rpx solid #FF4D4F;
  182. }
  183. .pole-control {
  184. border-left: 8rpx solid #2B5DE0;
  185. }
  186. .viual-control {
  187. border-left: 8rpx solid #66b890;
  188. }
  189. .status-overview {
  190. display: grid;
  191. grid-template-columns: repeat(3, 1fr);
  192. gap: 24rpx;
  193. background-color: #FFFFFF;
  194. padding: 32rpx;
  195. border-radius: 16rpx;
  196. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  197. }
  198. .status-item {
  199. display: flex;
  200. flex-direction: column;
  201. align-items: center;
  202. gap: 8rpx;
  203. }
  204. .status-value {
  205. font-size: 24px;
  206. font-weight: 600;
  207. color: #333333;
  208. }
  209. .status-label {
  210. font-size: 14px;
  211. color: #666666;
  212. }
  213. .tab-bar {
  214. display: flex;
  215. justify-content: space-around;
  216. padding: 16rpx 0;
  217. background-color: #FFFFFF;
  218. box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
  219. flex-shrink: 0;
  220. }
  221. .tab-item {
  222. display: flex;
  223. flex-direction: column;
  224. align-items: center;
  225. gap: 4rpx;
  226. }
  227. .tab-text {
  228. font-size: 12px;
  229. color: #666666;
  230. }
  231. .active .tab-text {
  232. color: #2B5DE0;
  233. }
  234. </style>