manageWorkbench.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. <!-- 管理端工作台 -->
  2. <template>
  3. <view class="manage-workbench" :style="{paddingTop:navHeight+'rpx'}">
  4. <nav-bar :title="title"></nav-bar>
  5. <top-warn></top-warn>
  6. <homeConfigurationSlot v-for="(item,index) in homeConfigData" :key="index" :homeConfig="item"></homeConfigurationSlot>
  7. <tab-bar></tab-bar>
  8. </view>
  9. </template>
  10. <script>
  11. import {getSafeWarnList, laboratoryAppletSubList,
  12. systemAppletLayoutSelect,laboratoryAppletGetSubDetailInfo
  13. } from '@/pages/api/index.js'
  14. import {getHomeConfig} from '@/utils/homeConfig'
  15. // #ifdef MP-WEIXIN
  16. import {tabBar} from '@/pages/component/tabBar.vue'
  17. import {topWarn} from '@/pages/component/topWarn.vue'
  18. import {navBar} from '@/pages/component/navbar.vue'
  19. import {homeConfigurationSlot} from '@/pages/component/homeConfigurationSlot'
  20. // #endif
  21. export default {
  22. name: 'manageWorkbench',
  23. // #ifdef MP-WEIXIN
  24. components: {
  25. tabBar,
  26. topWarn,
  27. navBar,
  28. homeConfigurationSlot,
  29. },
  30. // #endif
  31. // #ifdef H5
  32. components: {
  33. "tabBar": () => import('@/pages/component/tabBar.vue'),
  34. "topWarn": () => import('@/pages/component/topWarn.vue'),
  35. "navBar": () => import('@/pages/component/navbar.vue'),
  36. "homeConfigurationSlot": () => import('@/pages/component/homeConfigurationSlot.vue'),
  37. },
  38. // #endif
  39. data() {
  40. return {
  41. homeConfigData: [],
  42. navHeight: uni.getStorageSync('navHeight'),
  43. title: '实验室安全智能监测与控制系统',
  44. //banner图片
  45. homepageBanner: uni.getStorageSync('homepageBanner'),
  46. subject_classData: [],
  47. securityAlertNum: "",
  48. //安全报警
  49. alarmList: [{
  50. subDiyVo:{
  51. levelName:'三大法师的',
  52. name:'111111',
  53. typeName:'sdfasfasd',
  54. subAddrrStr:'111111111111'
  55. },
  56. sensorSet:[
  57. 'voc监测数值异常'
  58. ]
  59. }],
  60. //实验室数据
  61. dataList: [],
  62. fanList: [],//控制记录触发方式
  63. // 查询参数
  64. queryParams: {
  65. page: 1,
  66. pageSize: 20,
  67. },
  68. safeWarnQueryParams:{
  69. page: 1,
  70. pageSize: 20,
  71. count: 0,
  72. groupStatus: 1,
  73. }
  74. }
  75. },
  76. created() {
  77. },
  78. mounted() {
  79. this.systemAppletLayoutSelect();
  80. this.laboratoryAppletSubList();
  81. //this.getSafeWarnList();
  82. },
  83. methods: {
  84. //获取菜单配置
  85. async systemAppletLayoutSelect() {
  86. const {data} = await systemAppletLayoutSelect({module: 'home'})
  87. if (data.code == 200) {
  88. let list = JSON.parse(JSON.stringify(data.data))
  89. for (let i = 0; i < list.length; i++) {
  90. list[i].layout = JSON.parse(list[i].layout);
  91. }
  92. this.$set(this, 'homeConfigData', getHomeConfig(list));
  93. }
  94. },
  95. //获取实验室列表
  96. async laboratoryAppletSubList() {
  97. let self = this;
  98. const {data} = await laboratoryAppletSubList(this.queryParams);
  99. if (data.code == 200) {
  100. this.$set(this,'dataList',data.data.records);
  101. }
  102. },
  103. //获取报警信息列表
  104. async getSafeWarnList() {
  105. const {data} = await getSafeWarnList(this.safeWarnQueryParams);
  106. if (data.code == 200) {
  107. this.alarmList = data.rows;
  108. if (data.rows[0]) {
  109. this.securityAlertNum = data.rows[0].todayHappenCount;
  110. } else {
  111. this.securityAlertNum = 0;
  112. }
  113. }
  114. },
  115. tableButton(type,row){
  116. let self = this;
  117. if(type == 'subDetail'){
  118. //实验室详情
  119. this.laboratoryAppletGetSubDetailInfo(row.infoId)
  120. }
  121. },
  122. //获取实验室详情
  123. async laboratoryAppletGetSubDetailInfo(infoId) {
  124. const {data} = await laboratoryAppletGetSubDetailInfo({infoId:infoId});
  125. if (data.code == 200) {
  126. uni.navigateTo({
  127. url: '/pages_manage/views/laboratory/infoPage?infoData='+encodeURIComponent(JSON.stringify(data.data))
  128. });
  129. }
  130. },
  131. },
  132. beforeDestroy() {
  133. }
  134. }
  135. </script>
  136. <style lang="stylus" scoped>
  137. .manage-workbench {
  138. height: 100%;
  139. width: 100%;
  140. overflow-y: scroll;
  141. box-sizing: border-box;
  142. .top-big-img {
  143. height: 342 rpx;
  144. width: 750 rpx;
  145. }
  146. /*安全报警和我的实验室头部*/
  147. .for-title-p{
  148. border-top-left-radius 20rpx
  149. border-top-right-radius 20rpx
  150. background #fff
  151. padding-left:25rpx;
  152. display flex
  153. margin:0 20rpx;
  154. border-bottom:1rpx solid #e0e0e0;
  155. .left-img{
  156. height:34rpx;
  157. width:34rpx;
  158. margin:22rpx 10rpx 0 0;
  159. }
  160. .name-view{
  161. line-height:77rpx;
  162. font-size:30rpx;
  163. color:#333;
  164. }
  165. .num-view{
  166. width:28rpx;
  167. height:28rpx;
  168. font-size:20rpx;
  169. background:#EE3A3A;
  170. border-radius:50%;
  171. text-align :center;
  172. line-height:24rpx;
  173. color:#fff;
  174. margin:26rpx 0 0 10rpx;
  175. }
  176. .null-view{
  177. flex:1;
  178. }
  179. .right-img{
  180. height:20rpx;
  181. width:10rpx;
  182. margin:28rpx 19rpx 0 0;
  183. }
  184. }
  185. /*我的实验室*/
  186. .for-max-box{
  187. margin:0 20rpx 120rpx;
  188. background: #fff
  189. overflow: hidden
  190. border-bottom-left-radius 20rpx
  191. border-bottom-right-radius 20rpx
  192. .null-img{
  193. display block
  194. width:276rpx;
  195. height:321rpx;
  196. margin:40rpx auto;
  197. }
  198. .for-box:nth-child(1){
  199. border-top:none;
  200. }
  201. .for-box{
  202. border-top:4rpx solid #dedede;
  203. overflow hidden
  204. background #ffffff
  205. margin-bottom:20rpx;
  206. .title-box{
  207. margin:20rpx 20rpx 0;
  208. display flex
  209. view:nth-child(1){
  210. height:40rpx;
  211. line-height:40rpx;
  212. font-size:20rpx;
  213. border-radius:10rpx;
  214. padding:0 20rpx;
  215. color:#fff;
  216. margin-right:20rpx;
  217. }
  218. view:nth-child(2){
  219. line-height:42rpx;
  220. font-size:30rpx;
  221. color:#333;
  222. max-width:600rpx;
  223. flex:1;
  224. }
  225. img{
  226. width:12rpx;
  227. height:20rpx;
  228. margin-top:11rpx;
  229. }
  230. .colorA{
  231. background:#aa2315;
  232. }
  233. .colorB{
  234. background:#ff9b09;
  235. }
  236. .colorC{
  237. background:#3ea3e9;
  238. }
  239. .colorD{
  240. background:#3ea34c;
  241. }
  242. }
  243. .address-box{
  244. margin:20rpx 20rpx;
  245. font-size:26rpx;
  246. color:#999999;
  247. span{
  248. margin-right:60rpx;
  249. }
  250. }
  251. .address-box-two{
  252. display flex
  253. margin:0 20rpx 20rpx 20rpx;
  254. img{
  255. width:28rpx;
  256. height:30rpx;
  257. margin-right:18rpx;
  258. }
  259. view{
  260. line-height:30rpx;
  261. font-size:24rpx;
  262. color:#999999;
  263. }
  264. }
  265. /*安全报警*/
  266. .for-img-box{
  267. border-top:1rpx solid #e0e0e0;
  268. margin:0 20rpx;
  269. .for-img-min-box{
  270. display flex
  271. img{
  272. width:30rpx;
  273. height:27rpx;
  274. margin-top:24rpx;
  275. margin-right:10rpx;
  276. }
  277. view{
  278. line-height:74rpx;
  279. text-align center
  280. font-size:28rpx;
  281. color:#EE3A3A;
  282. }
  283. }
  284. }
  285. .button-view{
  286. margin:0 20rpx;
  287. border-top:1rpx dashed #e0e0e0;
  288. line-height:90rpx;
  289. text-align :center;
  290. font-size:26rpx;
  291. color:#333;
  292. }
  293. }
  294. }
  295. }
  296. </style>