checkProjectSelectTab.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view class="wrap">
  3. <page-nav :desc="desc" :title="title"></page-nav>
  4. <!-- <view class="list-wrap"> -->
  5. <!-- <u-cell-group title-bg-color="rgb(243, 244, 246)" :title="getGroupTitle(item)" -->
  6. <!-- v-for="(item, index) in projectList" :key="index"> -->
  7. <!-- <u-cell-item :titleStyle="{fontWeight: 500}" @click="openPage(item1)" :title="getFieldTitle(item1)"
  8. v-for="(item1, index1) in projectList" :key="index1">
  9. <image slot="icon" class="u-cell-icon" :src="getIcon('cell')" mode="widthFix"></image>
  10. </u-cell-item> -->
  11. <!-- </u-cell-group> -->
  12. <!-- </view> -->
  13. <view class="container">
  14. <uni-list>
  15. <uni-list-item @click="openPage(item)" :clickable="true" showArrow :title="getFieldTitle(item)"
  16. v-for="(item, index) in projectList" :key="index" :thumb="getIcon('cell')" thumb-size="sm">
  17. <!-- <template v-slot:body>
  18. <image slot="icon" class="u-cell-icon" :src="getIcon('cell')" mode="widthFix"></image>
  19. <view @click="openPage(item)">
  20. <text>{{getFieldTitle(item)}}</text>
  21. </view>
  22. </template>
  23. <template v-slot:footer>
  24. <uni-icons type="right" size="20" style="color: #969799;"></uni-icons>
  25. </template> -->
  26. </uni-list-item>
  27. </uni-list>
  28. </view>
  29. <u-gap height="70"></u-gap>
  30. </view>
  31. </template>
  32. <script>
  33. import pageNav from '@/components/page-nav/page-nav.vue';
  34. import http from '@/http/api.js'
  35. export default {
  36. components: {
  37. pageNav
  38. },
  39. onLoad(option) {
  40. const current = 1;
  41. const size = 1000;
  42. // let projectList = {};
  43. // projectList['groupName'] = '项目列表';
  44. var list = [];
  45. http.request({
  46. url: '/blade-business/report/projectInfo/listByUserId',
  47. method: 'GET',
  48. params: {
  49. current,
  50. size
  51. }
  52. }).then(res => {
  53. console.log(res.data)
  54. if (res.data != null && res.data.length > 0) {
  55. for (let i in res.data) {
  56. var projectInfo = {
  57. id: res.data[i].id,
  58. title: '' + res.data[i].projectName
  59. };
  60. list.push(projectInfo);
  61. }
  62. }
  63. }).catch(err => {
  64. console.log(err)
  65. })
  66. // projectList['list'] = list;
  67. this.projectList = list;
  68. },
  69. data() {
  70. return {
  71. projectList: [],
  72. title: '开始检查',
  73. desc: '',
  74. model: '0'
  75. }
  76. },
  77. computed: {
  78. getIcon() {
  79. return path => {
  80. return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
  81. }
  82. },
  83. },
  84. onShow() {
  85. uni.setNavigationBarTitle({
  86. title: "开始检查"
  87. });
  88. },
  89. created() {
  90. },
  91. methods: {
  92. openPage(item) {
  93. const basePath = '/pages/checkReport/addCheckReport';
  94. const path = basePath + '?id=' + item.id;
  95. this.$u.route({
  96. url: path
  97. })
  98. },
  99. getGroupTitle(item) {
  100. return item.groupName
  101. },
  102. getFieldTitle(item) {
  103. return item.title
  104. }
  105. }
  106. }
  107. </script>
  108. <style>
  109. /* page {
  110. background-color: rgb(240, 242, 244);
  111. } */
  112. </style>
  113. <style lang="scss" scoped>
  114. .u-cell-icon {
  115. width: 36rpx;
  116. height: 36rpx;
  117. margin-right: 8rpx;
  118. }
  119. </style>