reports.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <view class="pageContainer">
  3. <scroll-view scroll-y="true" class="scroll-Y">
  4. <view class="list" v-for="(item,index) in list" @click="viewHandle(item)">
  5. <view class="name">{{item.name}}</view>
  6. <image class="arrowIcon" src="../../static/list-open.png" ></image>
  7. </view>
  8. </scroll-view>
  9. </view>
  10. </template>
  11. <script>
  12. import { networkType } from '../../utils/requestUrl.js';
  13. export default {
  14. data() {
  15. return {
  16. list: [{
  17. name: '报表一',
  18. url: ''
  19. },
  20. {
  21. name: '报表一',
  22. url: ''
  23. }
  24. ]
  25. };
  26. },
  27. onLoad() {
  28. this.getList(`${networkType}`);
  29. },
  30. methods:{
  31. /**
  32. * @param {
  33. url:string;
  34. name:string;
  35. } reportDetail
  36. */
  37. viewHandle(reportDetail){
  38. uni.navigateTo({
  39. url: '/pages/reportPage/reportPage?url='+reportDetail.url
  40. });
  41. },
  42. /**
  43. * @param {string} networkType 网络环境(0. 内网,1.外网)
  44. */
  45. getList(networkType){
  46. this.$store.dispatch({
  47. type: 'reports/commActions',
  48. payload: {
  49. key: 'getReportList',
  50. data:{
  51. networkType:networkType
  52. }
  53. }
  54. }).then(res=>{
  55. this.list = res.map(t=>({
  56. name:t.name,
  57. url:t.url
  58. }))
  59. })
  60. }
  61. }
  62. }
  63. </script>
  64. <style lang="less" scoped>
  65. .pageContainer {
  66. display: flex;
  67. width: 100%;
  68. height: 100vh;
  69. .scroll-Y {
  70. .list {
  71. display: flex;
  72. flex-direction: row;
  73. align-items: center;
  74. justify-content:space-between;
  75. width: 100%;
  76. height: 100rpx;
  77. padding: 30rpx 30rpx;
  78. border-bottom: 1rpx solid #CCCCCC;
  79. background-color: #FFFFFF;
  80. .name {
  81. font-size:27rpx;
  82. }
  83. .arrowIcon {
  84. display:none;
  85. width:25rpx;
  86. height: 18rpx;
  87. transform:rotate(-90deg);
  88. }
  89. &:last-child {
  90. border-bottom: 0;
  91. }
  92. }
  93. }
  94. }
  95. </style>