teacherHome.vue 10 KB

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