basefacility.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <template>
  2. <view>
  3. <view class="status_bar"></view>
  4. <view class="" style="position: relative;top: 44px;">
  5. <view style="position: fixed;z-index: 100;">
  6. <uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" title="基地设备"></uni-nav-bar>
  7. </view>
  8. <view class="ass_list">
  9. <view class="equipment" v-for="(items,indexs) in assignments" :key="items.id" v-if="tishiTF">
  10. <view class="equipment_top">
  11. <image :src="items.src" mode="" class="equipment_top_img"></image>
  12. <span class="equipment_top_name">{{items.type_name}}</span>
  13. </view>
  14. <view class="equipment_bot">
  15. <p class="equipment_bot_id">设备ID:{{items.d_id}}</p>
  16. <p class="equipment_bot_name">设备名称:{{items.device_id}}</p>
  17. <view class="equipment_state">在线</view>
  18. </view>
  19. </view>
  20. <view class="tishi" v-if="!tishiTF">
  21. 暂无数据
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. data() {
  30. return {
  31. base_id: "",
  32. assignments: [],
  33. images: [{
  34. <<<<<<< HEAD
  35. path: "../../static/image/fourMoodBase/1.png",
  36. id: 3
  37. }, {
  38. path: "../../static/image/fourMoodBase/5.png",
  39. id: 5
  40. }, {
  41. path: "../../static/image/fourMoodBase/2.png",
  42. id: 6
  43. }, {
  44. path: "../../static/image/fourMoodBase/4.png",
  45. =======
  46. path: "../../static/image/fourMoodBase/cbd.png",
  47. id: 3
  48. }, {
  49. path: "../../static/image/fourMoodBase/qxz.png",
  50. id: 5
  51. }, {
  52. path: "../../static/image/fourMoodBase/jk.png",
  53. id: 6
  54. }, {
  55. path: "../../static/image/fourMoodBase/bzy.png",
  56. >>>>>>> a42ee056f94476589573c3821db9815e9f9872e2
  57. id: 7
  58. }],
  59. tishiTF: false
  60. }
  61. },
  62. methods: {
  63. async ybase(id) { //获取分布位置
  64. const res = await this.$myRequest({
  65. url: '/api/api_gateway?method=base.bases.base_map_list',
  66. data: {
  67. base_id: id
  68. }
  69. })
  70. this.assignments = res
  71. console.log(this.assignments)
  72. for (var i = 0; i < this.images.length; i++) {
  73. for (var j = 0; j < this.assignments.length; j++) {
  74. if (this.assignments[j].equip_type == this.images[i].id) {
  75. this.assignments[j].src = this.images[i].path
  76. }
  77. }
  78. }
  79. if (this.assignments.length == 0) {
  80. this.tishiTF = false
  81. } else {
  82. this.tishiTF = true
  83. }
  84. },
  85. clickLeft() {
  86. uni.navigateBack({
  87. delta: 1
  88. })
  89. }
  90. },
  91. onLoad(option) {
  92. this.base_id = option.id
  93. this.ybase(option.id)
  94. },
  95. }
  96. </script>
  97. <style lang="scss">
  98. .ass_list {
  99. position: absolute;
  100. top: 54px;
  101. width: 100%;
  102. margin-bottom: 40px;
  103. .tishi {
  104. width: 100%;
  105. text-align: center;
  106. height: 100rpx;
  107. line-height: 100rpx;
  108. font-size: 36rpx;
  109. }
  110. .equipment {
  111. width: 90%;
  112. margin: 20rpx auto;
  113. box-shadow: 0 0 10rpx #bcb9ca;
  114. padding: 20rpx 30rpx;
  115. box-sizing: border-box;
  116. .equipment_top {
  117. height: 60rpx;
  118. width: 100%;
  119. border-bottom: 1px solid #dfe5ec;
  120. position: relative;
  121. .equipment_top_img {
  122. width: 40rpx;
  123. height: 40rpx;
  124. position: absolute;
  125. }
  126. .equipment_top_name {
  127. font-size: 24rpx;
  128. margin-left: 60rpx;
  129. }
  130. }
  131. .equipment_bot {
  132. padding: 30rpx 0;
  133. position: relative;
  134. .equipment_bot_id {
  135. font-weight: 700;
  136. font-size: 15px;
  137. margin-bottom: 16rpx;
  138. }
  139. .equipment_bot_name {
  140. font-size: 12px;
  141. }
  142. .equipment_state {
  143. position: absolute;
  144. top: 20rpx;
  145. right: 0;
  146. width: 100rpx;
  147. height: 100rpx;
  148. text-align: center;
  149. line-height: 100rpx;
  150. color: #42b983;
  151. }
  152. }
  153. }
  154. }
  155. </style>