teacherHome.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. <!-- 教师首页 -->
  2. <template>
  3. <view class="teacherHome">
  4. <dataBoard v-if="pageType == 1" style="display: flex;flex-direction:column;flex:1;"></dataBoard>
  5. <view class="home-page" v-if="pageType == 2">
  6. <nav-bar :title="title" :background="background"></nav-bar>
  7. <view class="top-back-img" :style="{top:navHeight+'rpx'}">
  8. <!-- <view class="position-data-button" @click="goPage('dataBoard')" v-if="dataPageType">数据看板</view> -->
  9. <img class="position-data-button" @click="goPage('dataBoard')" v-if="dataPageType" src="@/pages/images/newImage/icon_sy_sjmb@1x.png">
  10. <img class="position-img" :src="rectangleLogo">
  11. </view>
  12. <view class="button-one-box">
  13. <view class="button-min" @click="goPage('securityCheck')">
  14. <img class="button-img" src="@/pages/images/newImage/icon_sy_aqjc@1x.png">
  15. <view class="button-name">安全检查</view>
  16. </view>
  17. <view class="button-min" @click="goPage('securityExamination')">
  18. <img class="button-img" src="@/pages/images/newImage/icon_sy_aqks@1x.png">
  19. <view class="button-name">安全考试</view>
  20. </view>
  21. <view class="button-min" @click="goPage('securityAdmittance')">
  22. <img class="button-img" src="@/pages/images/newImage/icon_sy_aqzr@1x.png">
  23. <view class="button-name">安全准入</view>
  24. </view>
  25. <view class="button-min" @click="goPage('hierarchicalControl')">
  26. <img class="button-img" src="@/pages/images/newImage/icon_sy_fjgk@1x.png">
  27. <view class="button-name">分级管控</view>
  28. </view>
  29. <view class="button-min" @click="goPage('securityResponsibility')">
  30. <img class="button-img" src="@/pages/images/newImage/icon_sy_aqzrr@1x.png">
  31. <view class="button-name">安全责任</view>
  32. </view>
  33. <view class="button-min" @click="goPage('deviceManagement')">
  34. <img class="button-img" src="@/pages/images/newImage/icon_sy_sbgl@1x.png">
  35. <view class="button-name">设备管理</view>
  36. </view>
  37. <view class="button-min" @click="goPage('emergencyDisposal')">
  38. <img class="button-img" src="@/pages/images/newImage/icon_sy_yjcz@1x.png">
  39. <view class="button-name">应急处置</view>
  40. </view>
  41. <view class="button-min" @click="goPage('cageSiteManagement')">
  42. <img class="button-img" src="@/pages/images/newImage/icon_sy_lwgl@1x.png">
  43. <view class="button-name">笼位管理</view>
  44. </view>
  45. </view>
  46. <topWarn></topWarn>
  47. <view class="button-two-box">
  48. <view class="button-big-box" @click="goPage('snapshot')"
  49. style="background-color: #DFF0FF;margin-right:20rpx;">
  50. <img src="@/pages/images/newImage/icon_sy_ssp@1x.png">
  51. <view class="button-min-box">
  52. <view>随手拍</view>
  53. <view>发现隐患</view>
  54. </view>
  55. </view>
  56. <view class="button-big-box" @click="goPage('remoteDoorOpening')" style="background-color: #D6EBDA;">
  57. <img src="@/pages/images/newImage/img_sy_yckm@1x.png">
  58. <view class="button-min-box">
  59. <view>远程开门</view>
  60. <view>立即开门</view>
  61. </view>
  62. </view>
  63. </view>
  64. <view class="button-three-box">
  65. <view class="button-big-box" @click="goPage()">
  66. <img src="@/pages/images/newImage/img_bg_hxpgk@1x.png">
  67. <view class="button-min-box">
  68. <view>化学品智能管控</view>
  69. <view>申购审批丨使用台账丨实验室库存</view>
  70. </view>
  71. </view>
  72. </view>
  73. <img class="scan_btn" @click.stop="saoCode" src="@/pages/images/icon_xyxc_sm.png" />
  74. <tab-bar></tab-bar>
  75. </view>
  76. </view>
  77. </template>
  78. <script>
  79. import {
  80. pageRestrictVerify
  81. } from '@/utils/index'
  82. import {
  83. tabBar
  84. } from '@/pages/component/tabBar.vue'
  85. import {
  86. navBar
  87. } from '@/pages/component/navbar.vue'
  88. import {
  89. topWarn
  90. } from '@/pages/component/topWarn.vue'
  91. import {
  92. dataBoard
  93. } from '@/pages/views/dataBoard/dataBoard.vue'
  94. export default {
  95. name: "teacherHome",
  96. components: {
  97. tabBar,
  98. navBar,
  99. topWarn,
  100. dataBoard,
  101. },
  102. data() {
  103. return {
  104. pageType: 2,
  105. navHeight: uni.getStorageSync('navHeight'),
  106. dataPageType: false,
  107. title: '实验室安全智慧化管控系统',
  108. background: '#0183FA',
  109. rectangleLogo: uni.getStorageSync('rectangleLogo'),
  110. identityData:uni.getStorageSync('identityData'),
  111. }
  112. },
  113. created() {
  114. if (pageRestrictVerify('dataBoard')) {
  115. this.dataPageType = true;
  116. if (!uni.getStorageSync('dataBoardType')) {
  117. this.pageType = 1;
  118. uni.setStorageSync('dataBoardType', true);
  119. }
  120. }
  121. },
  122. mounted() {
  123. },
  124. methods: {
  125. goHome() {
  126. this.pageType = 2;
  127. },
  128. goPage(type) {
  129. if (!type) {
  130. uni.showToast({
  131. title: '暂未开放',
  132. icon: "none",
  133. mask: true,
  134. duration: 2000
  135. });
  136. return
  137. }
  138. if (!pageRestrictVerify(type)) {
  139. uni.showToast({
  140. title: '没有相关权限,请联系管理员',
  141. icon: "none",
  142. mask: true,
  143. duration: 2000
  144. });
  145. return
  146. }
  147. if (type == 'dataBoard') {
  148. //数据看板
  149. this.pageType = 1;
  150. } else if (type == 'securityCheck') {
  151. //安全检查
  152. uni.navigateTo({
  153. url: "/pages_safetyCheck/views/safetyCheck",
  154. });
  155. /* if(this.identityData){
  156. uni.navigateTo({
  157. url: "/pages_safetyCheck/views/safetyCheck",
  158. });
  159. }else{
  160. uni.showToast({
  161. mask: true,
  162. icon: "none",
  163. position: "center",
  164. title: '您不是校/院级管理员或督导组成员,无法使用该功能.',
  165. duration: 2000
  166. });
  167. } */
  168. } else if (type == 'securityExamination') {
  169. //安全考试
  170. uni.navigateTo({
  171. url: "/pages_basics/views/deviceCageSitePage?pageType=3",
  172. });
  173. } else if (type == 'securityAdmittance') {
  174. //安全准入
  175. uni.navigateTo({
  176. url: "/pages_manage/views/accessQualification/accessQualification",
  177. });
  178. } else if (type == 'hierarchicalControl') {
  179. //分级管控
  180. uni.navigateTo({
  181. url: "/pages_basics/views/gradingControl/gradingControl",
  182. });
  183. } else if (type == 'securityResponsibility') {
  184. //安全责任
  185. } else if (type == 'deviceManagement') {
  186. //设备管理
  187. uni.navigateTo({
  188. url: "/pages_basics/views/deviceCageSitePage?pageType=1",
  189. });
  190. } else if (type == 'emergencyDisposal') {
  191. //应急处置
  192. // uni.navigateTo({
  193. // url: "/pages_manage/views/emergencyEvacuationBig",
  194. // });
  195. uni.navigateTo({
  196. url: "/pages_manage/views/emergencyEvacuationSubList",
  197. });
  198. } else if (type == 'cageSiteManagement') {
  199. //笼位管理
  200. uni.navigateTo({
  201. url: "/pages_basics/views/deviceCageSitePage?pageType=2",
  202. });
  203. } else if (type == 'snapshot') {
  204. //随手拍
  205. uni.navigateTo({
  206. url: "/pages_safetyCheck/views/snapshotManage/snapshotList",
  207. });
  208. /* uni.navigateTo({
  209. url: "/pages_safetyExamine/views/snapshotManage/snapshotAdd",
  210. }); */
  211. } else if (type == 'remoteDoorOpening') {
  212. //远程开门
  213. uni.navigateTo({
  214. url: "/pages_manage/views/accessControl/remoteOpen",
  215. });
  216. } else if (type == 'chemicalsManagement') {
  217. //化学品管控
  218. }
  219. },
  220. /* 扫一扫*/
  221. saoCode() {
  222. let self = this;
  223. uni.scanCode({
  224. onlyFromCamera: true,
  225. success: function(res) {
  226. let list = res.result.split("?")[1].split("&");
  227. let codeData = {};
  228. list.forEach((item) => {
  229. codeData[item.split("=")[0]] = item.split("=")[1];
  230. })
  231. if (codeData.type == 1 || codeData.type == 2 || codeData.type == 3 || codeData.type ==
  232. 5 || codeData.type == 7 ||
  233. codeData.type == 8 || codeData.type == 9 || codeData.type == 10 ||
  234. codeData.type == 11 || codeData.type == 12) {
  235. uni.reLaunch({
  236. url: '/pages/views/saoCode/saoCode?q=' + encodeURIComponent(res.result)
  237. });
  238. } else {
  239. uni.showToast({
  240. mask: true,
  241. icon: "none",
  242. position: "center",
  243. title: '请扫描正确的小程序二维码',
  244. duration: 2000
  245. });
  246. }
  247. }
  248. });
  249. },
  250. }
  251. }
  252. </script>
  253. <style lang="stylus" scoped>
  254. .teacherHome {
  255. flex: 1;
  256. display: flex;
  257. flex-direction: column;
  258. overflow: hidden;
  259. .data-board {
  260. flex: 1;
  261. display: flex;
  262. flex-direction: column;
  263. overflow: hidden;
  264. }
  265. .home-page {
  266. flex: 1;
  267. display: flex;
  268. flex-direction: column;
  269. overflow-y: scroll;
  270. overflow-x: hidden;
  271. .top-page-title {
  272. text-align: center;
  273. font-size: 28rpx;
  274. background-color: #0183FA;
  275. color: #fff;
  276. }
  277. .top-back-img {
  278. position: absolute;
  279. top: 0;
  280. left: 0;
  281. width: 750rpx;
  282. height: 539rpx;
  283. background: url("@/pages/images/newImage/img_sy_bg@1x.png");
  284. background-size 100%;
  285. background-repeat: no-repeat;
  286. .position-img {
  287. z-index: 5;
  288. position: absolute;
  289. left: 0;
  290. top: 10rpx;
  291. width: 400rpx;
  292. height: 88rpx;
  293. }
  294. .position-data-button {
  295. z-index: 5;
  296. position: fixed;
  297. right: 0;
  298. top: 180rpx;
  299. width: 130rpx;
  300. height: 109rpx;
  301. /* line-height: 50rpx;
  302. background-color: #0183fa;
  303. color: #fff;
  304. font-size: 28rpx;
  305. text-align: center;
  306. border-top-left-radius: 30rpx;
  307. border-bottom-left-radius: 30rpx; */
  308. }
  309. }
  310. .button-one-box {
  311. z-index: 5;
  312. background: #fff;
  313. width: 690rpx;
  314. border-radius: 20rpx;
  315. padding: 13px 0 20px;
  316. overflow: hidden;
  317. margin: 490rpx 30rpx 0;
  318. .button-min {
  319. display: inline-block;
  320. overflow: hidden;
  321. width: 172rpx;
  322. height: 123rpx;
  323. margin-top: 23rpx;
  324. .button-img {
  325. display: block;
  326. width: 80rpx;
  327. height: 80rpx;
  328. margin: 0 auto;
  329. }
  330. .button-name {
  331. margin-top: 15rpx;
  332. height: 28rpx;
  333. line-height: 28rpx;
  334. font-size: 28rpx;
  335. text-align: center;
  336. color: #333;
  337. }
  338. }
  339. }
  340. .button-two-box {
  341. z-index: 5;
  342. width: 690rpx;
  343. height: 120rpx;
  344. display: flex;
  345. margin: 20rpx 30rpx 0;
  346. .button-big-box {
  347. width: 335rpx;
  348. display: flex;
  349. border-radius: 20rpx;
  350. img {
  351. display: block;
  352. margin: 20rpx 31rpx 0 36rpx;
  353. height: 80rpx;
  354. width: 80rpx;
  355. }
  356. .button-min-box {
  357. view:nth-child(1) {
  358. line-height: 32rpx;
  359. height: 32rpx;
  360. font-size: 32rpx;
  361. color: #333;
  362. margin: 20rpx 0 18rpx;
  363. }
  364. view:nth-child(2) {
  365. line-height: 28rpx;
  366. height: 28rpx;
  367. font-size: 28rpx;
  368. color: #999;
  369. }
  370. }
  371. }
  372. }
  373. .button-three-box {
  374. z-index: 5;
  375. width: 690rpx;
  376. height: 150rpx;
  377. margin: 20rpx 30rpx 0;
  378. .button-big-box {
  379. border-radius: 20rpx;
  380. background-color: #FFF0DD;
  381. display: flex;
  382. img {
  383. display: block;
  384. width: 134rpx;
  385. height: 104rpx;
  386. margin: 23rpx 34rpx 0 30rpx;
  387. }
  388. .button-min-box {
  389. view:nth-child(1) {
  390. line-height: 30rpx;
  391. height: 30rpx;
  392. font-size: 30rpx;
  393. color: #FF8C00;
  394. margin: 27rpx 0 15rpx;
  395. }
  396. view:nth-child(2) {
  397. line-height: 26rpx;
  398. height: 26rpx;
  399. font-size: 26rpx;
  400. color: #666666;
  401. }
  402. }
  403. }
  404. }
  405. .scan_btn {
  406. z-index: 10;
  407. position: fixed;
  408. bottom: 210rpx;
  409. right: 0rpx;
  410. width: 140rpx;
  411. height: 140rpx;
  412. }
  413. }
  414. }
  415. </style>