substation.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <view>
  3. <view class="top">
  4. <image src="./icon/top.png" mode="widthFix"></image>
  5. </view>
  6. <view class="total">
  7. <view class="title">分站总数</view>
  8. <view class="num">
  9. <text>{{total}}</text>个
  10. </view>
  11. </view>
  12. <view class="section">
  13. <view class="title">
  14. <view class="line"></view>
  15. <view class="text">分站信息列表</view>
  16. </view>
  17. <view class="table">
  18. <uni-table emptyText="暂无更多数据">
  19. <uni-tr>
  20. <uni-th align="center">编号</uni-th>
  21. <uni-th align="center">状态</uni-th>
  22. </uni-tr>
  23. <uni-tr v-for="(item,index) in table" :key="index">
  24. <uni-td style="text-align: center;vertical-align: middle;">{{item.site_num}}</uni-td>
  25. <uni-td style="text-align: center;vertical-align: middle;">
  26. <view class="state">
  27. <image src="./icon/icon_1.png" mode="widthFix" v-if="item.site_status == '通讯正常'"></image>
  28. <image src="./icon/icon_2.png" mode="widthFix" v-if="item.site_status == '通迅故障'"></image>
  29. <text>{{item.site_status}}</text>
  30. </view>
  31. </uni-td>
  32. </uni-tr>
  33. </uni-table>
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import "@/common/time.js"
  40. export default {
  41. data() {
  42. return {
  43. total: 0,
  44. single: "",
  45. chartData_1: {},
  46. chartData_2: {},
  47. table: [],
  48. opts_1: {
  49. color: ["#FF7C7C", "#FCC524"],
  50. legend: {},
  51. extra: {
  52. column: {
  53. width: 15,
  54. }
  55. }
  56. },
  57. opts_2: {
  58. color: ["#00A1E9"],
  59. legend: {
  60. show: false
  61. },
  62. extra: {
  63. column: {
  64. width: 25,
  65. }
  66. }
  67. }
  68. };
  69. },
  70. onLoad() {
  71. console.log()
  72. // 获取今天的日期
  73. this.single = new Date().format("yyyy-MM-dd");
  74. this.getServerData()
  75. },
  76. methods: {
  77. getServerData() {
  78. setTimeout(() => {
  79. uni.showLoading({
  80. mask: true
  81. })
  82. this.$api.getSiteCurrInfoList({
  83. mine_code: "zaoquan",
  84. }).then((res) => {
  85. uni.hideLoading()
  86. console.log(res)
  87. this.total = res.data.total
  88. this.table = res.data.list
  89. })
  90. }, 10);
  91. },
  92. }
  93. }
  94. </script>
  95. <style lang="scss">
  96. page {
  97. background-color: #F5F6F8;
  98. }
  99. .top {
  100. margin-top: -60rpx;
  101. image {
  102. width: 750rpx;
  103. }
  104. }
  105. .total {
  106. position: relative;
  107. z-index: 1;
  108. margin: -200rpx auto 60rpx;
  109. width: 440rpx;
  110. height: 80rpx;
  111. background: rgba(0, 161, 233, 0.3);
  112. border: 2rpx solid #FFFFFF;
  113. border-radius: 40px;
  114. display: flex;
  115. align-items: center;
  116. justify-content: center;
  117. font-weight: 700;
  118. color: #fff;
  119. .title {
  120. margin-right: 20rpx;
  121. }
  122. .num {
  123. text {
  124. font-size: 42rpx;
  125. }
  126. }
  127. }
  128. .section {
  129. position: relative;
  130. z-index: 1;
  131. margin: 0rpx auto 30rpx;
  132. width: 680rpx;
  133. min-height: 400rpx;
  134. background: #FFFFFF;
  135. border-radius: 30rpx;
  136. box-sizing: border-box;
  137. padding: 20rpx;
  138. box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
  139. .title {
  140. height: 60rpx;
  141. line-height: 60rpx;
  142. font-size: 30rpx;
  143. font-weight: 700;
  144. display: flex;
  145. align-items: center;
  146. .line {
  147. width: 8rpx;
  148. height: 30rpx;
  149. background-color: #00A1E9;
  150. border-radius: 20rpx;
  151. margin-right: 10rpx;
  152. }
  153. .text {}
  154. }
  155. .table {
  156. margin: 20rpx 0;
  157. .state{
  158. display: flex;
  159. align-items: center;
  160. justify-content: center;
  161. image{
  162. margin-right: 10rpx;
  163. width: 34rpx;
  164. height: 34rpx;
  165. }
  166. }
  167. /deep/.uni-table-tr {
  168. background-color: #F2FAFE;
  169. }
  170. /deep/.uni-table-th {
  171. border: none;
  172. background-color: #fff;
  173. }
  174. /deep/.uni-table-td {
  175. color: #000;
  176. font-size: 28rpx;
  177. font-weight: 700;
  178. padding: 30rpx 0;
  179. border-bottom: 8rpx solid #fff;
  180. }
  181. /deep/.table--border {
  182. border: none;
  183. }
  184. }
  185. }
  186. </style>