infoPage.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  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?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?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 ref="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. getIotControlData(){
  101. this.$refs['iotControl'].iotAppHardwareFindByType();
  102. },
  103. tabFun(index) {
  104. this.$set(this, 'currentIndex', index);
  105. if (index == 0) {
  106. //物联控制
  107. this.$set(this, 'pageType', 2);
  108. } else if (index == 1) {
  109. //安全信息牌
  110. this.$set(this, 'pageType', 3);
  111. } else if (index == 2) {
  112. //进出记录
  113. this.$set(this, 'pageType', 4);
  114. }
  115. },
  116. buttonClick(type, row) {
  117. let self = this;
  118. if (type == 'subDetail') {
  119. //实验室详情
  120. } else if (type == 'broadcastOpen') {
  121. //语音弹窗开启
  122. this.$set(this, 'broadcastPage', true);
  123. } else if (type == 'broadcastClose') {
  124. //语音弹窗关闭
  125. this.$set(this, 'broadcastPage', false);
  126. } else if (type == 'conditioningOpen') {
  127. //空调弹窗开启
  128. this.$set(this, 'airConditioningData', row);
  129. this.$set(this, 'conditioningPage', true);
  130. } else if (type == 'conditioningClose') {
  131. //空调弹窗关闭
  132. this.$set(this, 'conditioningPage', false);
  133. } else if (type == 'back') {
  134. this.$set(this, 'pageType', 2);
  135. }
  136. },
  137. },
  138. }
  139. </script>
  140. <style lang="stylus" scoped>
  141. .infoPage {
  142. height: 100%;
  143. display flex;
  144. flex-direction column;
  145. .title {
  146. height: auto;
  147. background: #FFFFFF;
  148. padding: 0 20rpx;
  149. box-sizing: border-box;
  150. .title-t {
  151. display: flex;
  152. justify-content: flex-start;
  153. align-items: center;
  154. padding: 28rpx 0 20rpx 0;
  155. box-sizing: border-box;
  156. >view:nth-of-type(1) {
  157. background: #fff;
  158. margin-right: 20rpx;
  159. border-radius: 8px;
  160. padding: 6rpx 16rpx;
  161. box-sizing: border-box;
  162. }
  163. >view:nth-of-type(2) {
  164. font-family: PingFang SC;
  165. font-weight: 500;
  166. font-size: 30rpx;
  167. color: #333333;
  168. line-height: 36rpx;
  169. }
  170. }
  171. .title-m {
  172. display: flex;
  173. justify-content: flex-start;
  174. flex-wrap: wrap;
  175. >view {
  176. display: inline-block;
  177. font-family: PingFang SC;
  178. font-weight: 500;
  179. font-size: 24rpx;
  180. color: #0183FA;
  181. background: rgba(1, 131, 250, 0.2);
  182. border-radius: 18rpx;
  183. padding: 6rpx 12rpx;
  184. box-sizing: border-box;
  185. margin-right: 12rpx;
  186. margin-bottom: 20rpx;
  187. }
  188. }
  189. .title-m1 {
  190. display: flex;
  191. justify-content: flex-start;
  192. margin: 0rpx 0 20rpx 0;
  193. >img {
  194. width: 30rpx;
  195. height: 27rpx;
  196. margin-right: 12rpx;
  197. }
  198. >view {
  199. font-family: PingFang SC;
  200. font-weight: 500;
  201. font-size: 26rpx;
  202. color: #666666;
  203. line-height: 30rpx;
  204. }
  205. }
  206. .title-b {
  207. display: flex;
  208. justify-content: flex-start;
  209. margin-bottom: 22rpx;
  210. >img {
  211. width: 30rpx;
  212. height: 27rpx;
  213. margin-right: 12rpx;
  214. }
  215. >view {
  216. font-family: PingFang SC;
  217. font-weight: 500;
  218. font-size: 26rpx;
  219. color: #666666;
  220. line-height: 30rpx;
  221. }
  222. }
  223. }
  224. .tab-btn {
  225. width: 750rpx;
  226. height: 80rpx;
  227. border: 1px solid #E0E0E0;
  228. background: #fff;
  229. display: flex;
  230. justify-content: flex-start;
  231. margin-top: 20rpx;
  232. >view {
  233. width: 250rpx;
  234. height: 80rpx;
  235. font-family: PingFang SC;
  236. font-weight: 500;
  237. font-size: 32rpx;
  238. color: #222222;
  239. line-height: 80rpx;
  240. text-align: center;
  241. border-right: 1px solid #E0E0E0;
  242. }
  243. .color-B {
  244. width: 250rpx;
  245. height: 80rpx;
  246. font-family: PingFang SC;
  247. font-weight: 500;
  248. font-size: 32rpx;
  249. color: #FFFFFF;
  250. line-height: 80rpx;
  251. text-align: center;
  252. background: #0183FA;
  253. }
  254. }
  255. }
  256. </style>