infoPage.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. <!-- 实验室详情 -->
  2. <template>
  3. <view class="infoPage">
  4. <view class="title">
  5. <view class="title-t">
  6. <view :style="'border:1rpx solid '+newData.levelColor+';color:'+newData.levelColor+';'">
  7. {{newData.levelName}}
  8. </view>
  9. <view>{{newData.subName}}</view>
  10. </view>
  11. <view class="title-m">
  12. <view v-for="(item,index) in newData.labClassTypeList" :key="index">{{item.typeName}}</view>
  13. </view>
  14. <view class="title-m1">
  15. <img src="@/pages_manage/images/icon_xq_xy.png">
  16. <view>{{newData.deptName}}</view>
  17. </view>
  18. <view class="title-b">
  19. <img src="@/pages_manage/images/icon_14.png">
  20. <view>{{newData.buildName}}{{newData.floorName}}{{newData.subName}}{{ newData.roomNum}}</view>
  21. </view>
  22. </view>
  23. <view class="tab-btn">
  24. <view :class="currentIndex==index?'color-B':''" v-for="(item,index) in tabData" :key="index"
  25. @click="tabFun(index)">{{item}}</view>
  26. </view>
  27. <!-- 物联控制 -->
  28. <iotControl v-if="pageType == 2" :subjectData="subjectData"></iotControl>
  29. <!-- 安全信息牌 -->
  30. <safetyCard v-if="pageType == 3" :subjectData="subjectData"></safetyCard>
  31. <!-- 进出记录 -->
  32. <accessRecord v-if="pageType == 4" :subjectData="subjectData"></accessRecord>
  33. <!-- 语音广播弹窗 -->
  34. <voiceBroadcast v-if="broadcastPage" :subjectData="subjectData"></voiceBroadcast>
  35. <!-- 空调弹窗 -->
  36. <airConditioning v-if="conditioningPage" :airConditioningData="airConditioningData"></airConditioning>
  37. </view>
  38. </template>
  39. <script>
  40. import {
  41. iotControl
  42. } from '@/pages_manage/views/laboratory/iotControl.vue'
  43. import {
  44. safetyCard
  45. } from '@/pages_manage/views/laboratory/safetyCard.vue'
  46. import {
  47. accessRecord
  48. } from '@/pages_manage/views/laboratory/accessRecord.vue'
  49. import {
  50. voiceBroadcast
  51. } from '@/pages_manage/views/laboratory/voiceBroadcast.vue'
  52. import {
  53. airConditioning
  54. } from '@/pages_manage/views/laboratory/airConditioning.vue'
  55. export default {
  56. name: 'infoPage',
  57. components: {
  58. iotControl,
  59. safetyCard,
  60. accessRecord,
  61. voiceBroadcast,
  62. airConditioning,
  63. },
  64. data() {
  65. return {
  66. newData: {},
  67. tabData: ['物联控制', '安全信息牌', '进出记录'],
  68. currentIndex: 0,
  69. pageType: 2,
  70. //语音广播弹窗
  71. broadcastPage: false,
  72. //空调弹窗
  73. conditioningPage: false,
  74. // 查询参数
  75. queryParams: {
  76. page: 1,
  77. pageSize: 20,
  78. },
  79. subjectData: null,
  80. // 空调弹窗
  81. airConditioningData: null,
  82. }
  83. },
  84. // 父页面
  85. onReachBottom() {
  86. uni.$emit('onReachBottom') // 设置监听事件
  87. },
  88. onPullDownRefresh() {
  89. uni.$emit('onPullDownRefresh') // 设置监听事件
  90. },
  91. onLoad(option) {
  92. this.$set(this, 'newData', JSON.parse(decodeURIComponent(option.infoData)));
  93. this.$set(this, 'subjectData', JSON.parse(decodeURIComponent(option.infoData)));
  94. },
  95. created() {
  96. },
  97. mounted() {
  98. },
  99. methods: {
  100. tabFun(index) {
  101. this.$set(this, 'currentIndex', index);
  102. if (index == 0) {
  103. //物联控制
  104. this.$set(this, 'pageType', 2);
  105. } else if (index == 1) {
  106. //安全信息牌
  107. this.$set(this, 'pageType', 3);
  108. } else if (index == 2) {
  109. //进出记录
  110. this.$set(this, 'pageType', 4);
  111. }
  112. },
  113. buttonClick(type, row) {
  114. let self = this;
  115. if (type == 'subDetail') {
  116. //实验室详情
  117. } else if (type == 'broadcastOpen') {
  118. //语音弹窗开启
  119. this.$set(this, 'broadcastPage', true);
  120. } else if (type == 'broadcastClose') {
  121. //语音弹窗关闭
  122. this.$set(this, 'broadcastPage', false);
  123. } else if (type == 'conditioningOpen') {
  124. //空调弹窗开启
  125. this.$set(this, 'airConditioningData', row);
  126. this.$set(this, 'conditioningPage', true);
  127. } else if (type == 'conditioningClose') {
  128. //空调弹窗关闭
  129. this.$set(this, 'conditioningPage', false);
  130. } else if (type == 'back') {
  131. this.$set(this, 'pageType', 2);
  132. }
  133. },
  134. },
  135. }
  136. </script>
  137. <style lang="stylus" scoped>
  138. .infoPage {
  139. height: 100%;
  140. display flex;
  141. flex-direction column;
  142. .title {
  143. height: auto;
  144. background: #FFFFFF;
  145. padding: 0 20rpx;
  146. box-sizing: border-box;
  147. .title-t {
  148. display: flex;
  149. justify-content: flex-start;
  150. align-items: center;
  151. padding: 28rpx 0 20rpx 0;
  152. box-sizing: border-box;
  153. >view:nth-of-type(1) {
  154. background: #fff;
  155. margin-right: 20rpx;
  156. border-radius: 8px;
  157. padding: 6rpx 16rpx;
  158. box-sizing: border-box;
  159. }
  160. >view:nth-of-type(2) {
  161. font-family: PingFang SC;
  162. font-weight: 500;
  163. font-size: 30rpx;
  164. color: #333333;
  165. line-height: 36rpx;
  166. }
  167. }
  168. .title-m {
  169. display: flex;
  170. justify-content: flex-start;
  171. flex-wrap: wrap;
  172. >view {
  173. display: inline-block;
  174. font-family: PingFang SC;
  175. font-weight: 500;
  176. font-size: 24rpx;
  177. color: #0183FA;
  178. background: rgba(1, 131, 250, 0.2);
  179. border-radius: 18rpx;
  180. padding: 6rpx 12rpx;
  181. box-sizing: border-box;
  182. margin-right: 12rpx;
  183. margin-bottom: 20rpx;
  184. }
  185. }
  186. .title-m1 {
  187. display: flex;
  188. justify-content: flex-start;
  189. margin: 0rpx 0 20rpx 0;
  190. >img {
  191. width: 30rpx;
  192. height: 27rpx;
  193. margin-right: 12rpx;
  194. }
  195. >view {
  196. font-family: PingFang SC;
  197. font-weight: 500;
  198. font-size: 26rpx;
  199. color: #666666;
  200. line-height: 30rpx;
  201. }
  202. }
  203. .title-b {
  204. display: flex;
  205. justify-content: flex-start;
  206. margin-bottom: 22rpx;
  207. >img {
  208. width: 30rpx;
  209. height: 27rpx;
  210. margin-right: 12rpx;
  211. }
  212. >view {
  213. font-family: PingFang SC;
  214. font-weight: 500;
  215. font-size: 26rpx;
  216. color: #666666;
  217. line-height: 30rpx;
  218. }
  219. }
  220. }
  221. .tab-btn {
  222. width: 750rpx;
  223. height: 80rpx;
  224. border: 1px solid #E0E0E0;
  225. background: #fff;
  226. display: flex;
  227. justify-content: flex-start;
  228. margin-top: 20rpx;
  229. >view {
  230. width: 250rpx;
  231. height: 80rpx;
  232. font-family: PingFang SC;
  233. font-weight: 500;
  234. font-size: 32rpx;
  235. color: #222222;
  236. line-height: 80rpx;
  237. text-align: center;
  238. border-right: 1px solid #E0E0E0;
  239. }
  240. .color-B {
  241. width: 250rpx;
  242. height: 80rpx;
  243. font-family: PingFang SC;
  244. font-weight: 500;
  245. font-size: 32rpx;
  246. color: #FFFFFF;
  247. line-height: 80rpx;
  248. text-align: center;
  249. background: #0183FA;
  250. }
  251. }
  252. }
  253. </style>