index.vue 5.2 KB

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