substation.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <view>
  3. <view class="switch">
  4. <view class="img">
  5. <image src="./img/top.png" mode="widthFix"></image>
  6. </view>
  7. <view class="content" v-if="data">
  8. <view class="item" v-for="(item,index) in data.switch" :key="index">
  9. <view class="box" :style="{backgroundColor: item.value?'#00FD05':''}"></view>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="table">
  14. <view class="title">
  15. <view class="icon">
  16. <image src="./icon/canshu.png" mode=""></image>
  17. </view>
  18. <view class="text">运行参数</view>
  19. </view>
  20. <uni-table border emptyText="暂无更多数据">
  21. <!-- <uni-tr>
  22. <uni-th align="center" style="vertical-align: middle;">·</uni-th>
  23. <uni-th align="center" style="vertical-align: middle;" v-for="(item,index) in data.power_parameter">{{item.label}}</uni-th>
  24. </uni-tr>
  25. <uni-tr v-for="(item,index) in data.power_parameter[0].data">
  26. <uni-td align="center" style="vertical-align: middle;">{{item.label}}</uni-td>
  27. <template v-for="(item_2,index_2) in data.power_parameter">
  28. <template v-for="(item_3,index_3) in item_2.data" v-if="index_3 == 0">
  29. <uni-td align="center" style="vertical-align: middle;">{{item_3.value}}</uni-td>
  30. </template>
  31. </template>
  32. </uni-tr> -->
  33. <uni-tr>
  34. <uni-th align="center" style="vertical-align: middle;">·</uni-th>
  35. <uni-th align="center" style="vertical-align: middle;" v-for="(item,index) in data.power_parameter_new[0].data" :key="index">{{item}}</uni-th>
  36. </uni-tr>
  37. <uni-tr v-for="(item,index) in data.power_parameter_new.slice(1)" :key="index">
  38. <uni-td align="center" style="vertical-align: middle;">{{item.label}}</uni-td>
  39. <uni-td align="center" style="vertical-align: middle;" v-for="(item_2,index_2) in item.data">{{item_2}}</uni-td>
  40. </uni-tr>
  41. </uni-table>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. export default {
  47. data() {
  48. return {
  49. mine_code: "",
  50. system_type: "",
  51. // 数据刷新定时器
  52. data_timer: {},
  53. data: null
  54. }
  55. },
  56. onLoad(option) {
  57. uni.setNavigationBarTitle({
  58. title: option.name
  59. })
  60. this.mine_code = option.mine_code
  61. this.system_type = option.system_type
  62. this.get_data()
  63. // this.data_timer = setInterval(()=>{
  64. // this.get_data()
  65. // },5000)
  66. },
  67. onUnload() {
  68. clearInterval(this.data_timer)
  69. },
  70. methods: {
  71. get_data() {
  72. if (this.mine_code == "jinfeng") {
  73. this.$api.opcdata_getTurboData({
  74. mine_code: this.mine_code,
  75. system_type: this.system_type
  76. }).then((res) => {
  77. this.data = res.data.sys_point
  78. console.log(this.data.power_parameter_new.slice(1))
  79. })
  80. } else {
  81. this.$api.unified_automation_system({
  82. mine_code: this.mine_code,
  83. system_type: this.system_type
  84. }).then((res) => {
  85. this.data = res.data
  86. })
  87. }
  88. }
  89. }
  90. }
  91. </script>
  92. <style lang="scss">
  93. page {
  94. background-color: #0B163B;
  95. box-sizing: border-box;
  96. padding: 30rpx 10rpx;
  97. }
  98. .switch {
  99. position: relative;
  100. .img {
  101. text-align: center;
  102. image {
  103. width: 640rpx;
  104. }
  105. }
  106. .content {
  107. .item {
  108. position: absolute;
  109. top: 168rpx;
  110. left: 50rpx;
  111. .box {
  112. width: 34rpx;
  113. height: 82rpx;
  114. background-color: red;
  115. }
  116. }
  117. .item:nth-child(2) {
  118. left: 100rpx;
  119. }
  120. .item:nth-child(3) {
  121. left: 148rpx;
  122. }
  123. .item:nth-child(4) {
  124. left: 200rpx;
  125. }
  126. .item:nth-child(5) {
  127. left: 262rpx;
  128. }
  129. .item:nth-child(6) {
  130. left: 326rpx;
  131. }
  132. .item:nth-child(7) {
  133. left: 390rpx;
  134. }
  135. .item:nth-child(8) {
  136. left: 454rpx;
  137. }
  138. .item:nth-child(9) {
  139. left: 534rpx;
  140. }
  141. .item:nth-child(10) {
  142. left: 590rpx;
  143. }
  144. .item:nth-child(11) {
  145. left: 648rpx;
  146. }
  147. }
  148. }
  149. .table {
  150. margin-top: 30rpx;
  151. .title {
  152. margin: 30rpx auto;
  153. display: flex;
  154. justify-content: center;
  155. align-items: center;
  156. width: 230rpx;
  157. height: 60rpx;
  158. background-image: url(./icon/border.png);
  159. background-size: 100% 100%;
  160. background-repeat: no-repeat;
  161. .icon {
  162. margin-right: 10rpx;
  163. image {
  164. width: 30rpx;
  165. height: 30rpx;
  166. }
  167. }
  168. .text {
  169. color: #00FFF6;
  170. font-size: 30rpx;
  171. }
  172. }
  173. /deep/.uni-table {
  174. background-color: #06102B;
  175. min-width: 2600rpx !important;
  176. .uni-table-th {
  177. color: #3271A4;
  178. }
  179. .uni-table-tr {
  180. .uni-table-th:first-child {
  181. position: fixed;
  182. width: 140rpx;
  183. background-color: #06102B;
  184. }
  185. .uni-table-td:first-child {
  186. color: #3271A4;
  187. position: fixed;
  188. width: 140rpx;
  189. background-color: #06102B;
  190. }
  191. .uni-table-th:nth-child(2) {
  192. padding-left: 140rpx;
  193. }
  194. .uni-table-td:nth-child(2) {
  195. padding-left: 140rpx;
  196. }
  197. }
  198. .uni-table-td {
  199. color: #EDE20D;
  200. width: 240rpx;
  201. }
  202. .table--border {
  203. border-color: #3271A4;
  204. }
  205. }
  206. /deep/.table--border {
  207. border-color: #3271A4;
  208. }
  209. }
  210. </style>