teacherHome.vue 9.9 KB

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