infoPage.vue 6.0 KB

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