stationIndex.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. <template>
  2. <view class="report">
  3. <view class="box-bg">
  4. <uni-nav-bar :fixed="true" dark left-icon="left" background-color='#202246' :title="stationName"
  5. @clickLeft="back" />
  6. </view>
  7. <view class="report_main">
  8. <view class="report_DataAll" v-for="(item,index) in reportProgressData" :key="index">
  9. <view class="report_Data flex justify-between">
  10. <view class="report_Data_1 flex">
  11. <image src="../../static/jnImage/indexPage/windIcon.png" mode=""></image>
  12. <text>{{item.inPower}}</text>
  13. </view>
  14. <view class="report_Data_2">
  15. <text>{{item.name}}</text>
  16. </view>
  17. <view class="report_Data_3">
  18. <text>{{item.allPower}}</text>
  19. </view>
  20. </view>
  21. <view class="report_Data_msg">
  22. <view class="show_msg" :style="showProgress(item)">
  23. </view>
  24. </view>
  25. </view>
  26. <view class="yearTab">
  27. <text v-for="(item,index) in yearData" :key="index" @click="changeYearTab(item)"
  28. :style="item.showColor ? 'background: #4287FF;color:#fff': ''">{{item.nameZN}}</text>
  29. </view>
  30. <view class="reportTable">
  31. <uni-table ref="table" border emptyText="暂无更多数据" width="100%">
  32. <uni-tr>
  33. <uni-th align="center">性能指标</uni-th>
  34. <uni-th width="45" align="center">数据</uni-th>
  35. <uni-th width="45" align="center">数据</uni-th>
  36. <uni-th width="45" align="center">数据</uni-th>
  37. </uni-tr>
  38. <uni-tr v-for="(item, index) in tableData" :key="index">
  39. <uni-td>{{ item.name }}</uni-td>
  40. <uni-td align="center">{{ item.data1 }}</uni-td>
  41. <uni-td align="center">{{ item.data2 }}</uni-td>
  42. <uni-td align="center">{{ item.data3 }}</uni-td>
  43. </uni-tr>
  44. </uni-table>
  45. </view>
  46. </view>
  47. <station-bar ref="stationBar"></station-bar>
  48. </view>
  49. </template>
  50. <script>
  51. import stationBar from '../common/stationTab.vue'
  52. export default {
  53. onLoad: function() {
  54. this.stationName = uni.getStorageSync('stationName')
  55. },
  56. components: {
  57. stationName: '',
  58. stationBar
  59. },
  60. data() {
  61. return {
  62. stationName: '',
  63. reportProgressData: [],
  64. yearTab: 'day',
  65. yearData: [],
  66. tableData: []
  67. }
  68. },
  69. created() {
  70. this.tableData = [{
  71. name: '指标一',
  72. data1: '2.8',
  73. data2: '3.6',
  74. data3: '4.8'
  75. },
  76. {
  77. name: '指标二',
  78. data1: '2.8',
  79. data2: '3.6',
  80. data3: '4.8'
  81. },
  82. {
  83. name: '指标三',
  84. data1: '2.8',
  85. data2: '3.6',
  86. data3: '4.8'
  87. },
  88. ]
  89. this.reportProgressData = [{
  90. inPower: '961万kWh',
  91. allPower: '1865万kWh',
  92. progress: '70%',
  93. name: '年发电量'
  94. },
  95. {
  96. inPower: '171天',
  97. allPower: '365天',
  98. progress: '56%',
  99. name: '日历进度'
  100. },
  101. {
  102. inPower: '日历进程',
  103. allPower: '年发电量',
  104. progress: '65%',
  105. name: '完成度'
  106. },
  107. ]
  108. this.yearData = [{
  109. nameZN: '日简报',
  110. nameEN: 'day',
  111. showColor: true
  112. },
  113. {
  114. nameZN: '月简报',
  115. nameEN: 'month',
  116. showColor: false
  117. },
  118. {
  119. nameZN: '年简报',
  120. nameEN: 'year',
  121. showColor: false
  122. }
  123. ]
  124. },
  125. mounted() {
  126. this.$refs.stationBar.showTab = '数据简报'
  127. },
  128. methods: {
  129. back() {
  130. this.$tab.switchTab('/pages/report/index')
  131. },
  132. showProgress(item) {
  133. return `width: ${item.progress};`
  134. },
  135. changeMsg() {
  136. this.$tab.navigateTo('/pages/common/messagePage')
  137. },
  138. changeStation() {
  139. this.$tab.navigateTo('/pages/common/stationListPage')
  140. },
  141. changeYearTab(item) {
  142. this.yearData.forEach(it => {
  143. it.showColor = false
  144. if (it.nameEN === item.nameEN) {
  145. item.showColor = true
  146. this.yearTab = it.nameEN
  147. }
  148. })
  149. },
  150. }
  151. }
  152. </script>
  153. <style lang="scss">
  154. page {
  155. background-color: #202246;
  156. }
  157. .report {
  158. width: 100vw;
  159. background: url('../../static/jnImage/loginPage/windBack.png'), url('../../static/jnImage/loginPage/backWav.png');
  160. background-repeat: no-repeat, repeat;
  161. background-size: 100% 260px, 100% 5px;
  162. .box-bg {
  163. width: 100vw;
  164. padding: 5px 0;
  165. }
  166. .report_main {
  167. padding: 0 20px;
  168. .report_DataAll {
  169. margin-top: 10px;
  170. .report_Data {
  171. .report_Data_1 {
  172. image {
  173. width: 18px;
  174. height: 18px;
  175. }
  176. text {
  177. margin-left: 5px;
  178. font-size: 28upx;
  179. color: #A49EAC;
  180. position: relative;
  181. top: 0px;
  182. }
  183. }
  184. .report_Data_2 {
  185. text {
  186. font-size: 32upx;
  187. color: #A49EAC;
  188. }
  189. }
  190. .report_Data_3 {
  191. text {
  192. font-size: 28upx;
  193. color: #A49EAC;
  194. }
  195. }
  196. }
  197. .report_Data_msg {
  198. width: 100%;
  199. height: 20px;
  200. border-radius: 5px;
  201. background: #0B143E;
  202. .show_msg {
  203. height: 20px;
  204. background: #00BC6F;
  205. border-radius: 5px 0 0 5px;
  206. }
  207. }
  208. }
  209. .yearTab {
  210. width: 99%;
  211. height: 30px;
  212. border-radius: 5px;
  213. background: #0B143E;
  214. margin-top: 20px;
  215. text {
  216. display: inline-block;
  217. width: 33%;
  218. height: 30px;
  219. text-align: center;
  220. color: #4287FF;
  221. line-height: 30px;
  222. }
  223. text:nth-of-type(1) {
  224. border-radius: 5px 0 0 5px;
  225. }
  226. text:nth-of-type(3) {
  227. border-radius: 0 5px 5px 0;
  228. }
  229. }
  230. .reportTable {
  231. width: 100%;
  232. margin-top: 10px;
  233. .table--border {
  234. border: 1px solid rgba(255, 255, 255, 0.3);
  235. }
  236. .uni-table {
  237. background-color: rgba(255, 255, 255, 0);
  238. .uni-table-tr {
  239. .table--border {
  240. border: 1px solid rgba(255, 255, 255, 0.3);
  241. }
  242. .uni-table-th {
  243. background-color: #2E336D;
  244. }
  245. .uni-table-th,
  246. .uni-table-td {
  247. color: #fff;
  248. font-size: 26upx;
  249. }
  250. .uni-table-th:nth-of-type(1) {
  251. background-color: #6C4B9E;
  252. }
  253. }
  254. .uni-table-tr:hover {
  255. background-color: rgba(255, 255, 255, 0);
  256. }
  257. }
  258. }
  259. }
  260. }
  261. </style>