teacherHome.vue 13 KB

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