bim.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <view>
  3. <mescroll-empty :option="option" v-if="list.length === 0"></mescroll-empty>
  4. <view class="data-house-list" v-else>
  5. <view class="data-house-item" v-for="(item,index) in list" :key="item.id" @click="clickBim(item)">
  6. <image class="image"
  7. src="https://assets.api.uizard.io/api/cdn/stream/c05650d2-192b-4a56-ae97-05638f53804c.png"
  8. mode="aspectFill"></image>
  9. <view class=" content">
  10. <view class="title">{{item.name}}</view>
  11. <view class="sub">
  12. <text>位置:</text><text>{{item.projectItemName}}</text>-<text>{{item.projectItemTargetName}}</text>
  13. </view>
  14. <view class="sub"><text>上传人:</text><text>{{item.createUserName}}</text></view>
  15. </view>
  16. <view class="hui-table-tag">
  17. <view class="hui-tag success" v-if="item.status === 2">转换成功</view>
  18. <view class="hui-tag warning" v-if="item.status === 1">转换中</view>
  19. <view class="hui-tag info" v-if="item.status === 0">等待转换</view>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. import {
  27. getBimList
  28. } from '@/request/api/bim.js'
  29. export default {
  30. data() {
  31. return {
  32. option: {
  33. tip: '暂无模型数据'
  34. },
  35. list: [],
  36. }
  37. },
  38. onLoad() {
  39. this.init();
  40. uni.$on('reloadData', () => {
  41. this.mescroll.resetUpScroll();
  42. })
  43. },
  44. onShow() {},
  45. methods: {
  46. init() {
  47. getBimList(this.$store.getters.project.id).then(res => {
  48. if (res.code === 200) {
  49. this.list = res.data;
  50. }
  51. })
  52. },
  53. clickBim(item) {
  54. if (item.status === 1) return this.$toast('模型转换中');
  55. if (item.status === 0) return this.$toast('该模型暂未转换');
  56. this.$navigateTo('/pages/bimShow/bimShow?title=' + item.name + '&fileId=' + item.bimfaceInfo.fileId +
  57. '&type=model&showType=1');
  58. }
  59. }
  60. }
  61. </script>
  62. <style lang="scss">
  63. .data-house-list {
  64. padding: 30rpx;
  65. .data-house-item {
  66. height: 200rpx;
  67. background: #fff;
  68. display: flex;
  69. align-items: center;
  70. border-radius: 16rpx;
  71. box-shadow: 0px 1px 12px rgba(3, 3, 3, 0.08);
  72. padding: 0 30rpx;
  73. margin-bottom: 30rpx;
  74. position: relative;
  75. }
  76. .hui-table-tag {
  77. position: absolute;
  78. bottom: 30rpx;
  79. right: 30rpx;
  80. }
  81. .image {
  82. width: 200rpx;
  83. height: 140rpx;
  84. border-radius: 8rpx;
  85. }
  86. .content {
  87. margin-left: 20rpx;
  88. flex: 1;
  89. width: 0;
  90. overflow: hidden;
  91. }
  92. .title {
  93. font-size: 32rpx;
  94. font-weight: 600;
  95. margin-bottom: 10rpx;
  96. overflow: hidden;
  97. white-space: nowrap;
  98. text-overflow: ellipsis;
  99. }
  100. .sub {
  101. font-weight: 300;
  102. font-size: 24rpx;
  103. margin-top: 10rpx;
  104. color: $uni-secondary-color;
  105. }
  106. .const {
  107. display: flex;
  108. align-items: center;
  109. .const-item {
  110. display: flex;
  111. align-items: center;
  112. color: $uni-secondary-color;
  113. margin-right: 20rpx;
  114. }
  115. .text {
  116. margin-left: 6rpx;
  117. }
  118. }
  119. }
  120. </style>