|
@@ -1,510 +0,0 @@
|
|
-<!-- 学生端工作台 -->
|
|
|
|
-<template>
|
|
|
|
- <view class="user-workbench" :style="{paddingTop:navHeight+'rpx'}">
|
|
|
|
- <nav-bar :title="title"></nav-bar>
|
|
|
|
- <img class="top-big-img" :src="homepageBanner">
|
|
|
|
-
|
|
|
|
- <homeConfigurationSlot v-for="(item,index) in homeConfigData" :key="index" :homeConfig="item"></homeConfigurationSlot>
|
|
|
|
-
|
|
|
|
- <view class="bottom-max-box">
|
|
|
|
- <view class="bottom-title" @click="meCertificateClick()">
|
|
|
|
- <img src="@/pages/images/icon_sy_wdzs.png">
|
|
|
|
- <view>我的证书</view>
|
|
|
|
- </view>
|
|
|
|
- <view class="bottom-big-box">
|
|
|
|
- <view class="bottom-for-box" v-for="(item,index) in dataList" :key="index">
|
|
|
|
- <view class="bottom-top-box">{{item.certTitle}}</view>
|
|
|
|
- <view class="bottom-bottom-box">
|
|
|
|
- <view class="bottom-right-box">{{item.createTime}}获得</view>
|
|
|
|
- <view class="bottom-right-box">到期时间:{{item.expirationTime}}</view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <view class="null-view" v-if="!dataList[0]">暂无数据</view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <tab-bar></tab-bar>
|
|
|
|
- </view>
|
|
|
|
-</template>
|
|
|
|
-
|
|
|
|
-<script>
|
|
|
|
-import { myViolationCount,queryMyCert,outSubjectPhoto,gradingControl,getGentleIdentifier,systemAppletLayoutSelect} from '@/pages/api/index.js'
|
|
|
|
-import { tabBar } from '@/pages/component/tabBar.vue'
|
|
|
|
-import { navBar } from '@/pages/component/navbar.vue'
|
|
|
|
-import { homeConfigurationSlot } from '@/pages/component/homeConfigurationSlot'
|
|
|
|
-import { getHomeConfig } from '@/utils/homeConfig'
|
|
|
|
-export default {
|
|
|
|
- components: {
|
|
|
|
- tabBar,
|
|
|
|
- navBar,
|
|
|
|
- homeConfigurationSlot,
|
|
|
|
- },
|
|
|
|
- data() {
|
|
|
|
- return {
|
|
|
|
- homeConfigData: [],
|
|
|
|
- navHeight: uni.getStorageSync('navHeight'),
|
|
|
|
- title:'实验室安全智能监测与控制系统',
|
|
|
|
- hintType:false,
|
|
|
|
- dataList:[],
|
|
|
|
- violationData:{},
|
|
|
|
- gradingCount:0,
|
|
|
|
- homepageBanner:uni.getStorageSync('homepageBanner'),
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- created() {
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- mounted(){
|
|
|
|
- this.systemAppletLayoutSelect();
|
|
|
|
- this.myViolationCount();
|
|
|
|
- this.getGrading();
|
|
|
|
-
|
|
|
|
- this.queryMyCert();
|
|
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
- //获取菜单配置
|
|
|
|
- async systemAppletLayoutSelect() {
|
|
|
|
- const {data} = await systemAppletLayoutSelect({module:'home'})
|
|
|
|
- if(data.code == 200){
|
|
|
|
- let list = JSON.parse(JSON.stringify(data.data))
|
|
|
|
- for(let i=0;i<list.length;i++){
|
|
|
|
- list[i].layout = JSON.parse(list[i].layout);
|
|
|
|
- }
|
|
|
|
- this.$set(this,'homeConfigData',getHomeConfig(list));
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- //获取分级管控未完成总数
|
|
|
|
- async getGrading(){
|
|
|
|
- let obj = {
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- const {data} = await gradingControl(obj)
|
|
|
|
- if(data.code==200){
|
|
|
|
- this.gradingCount=data.count;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- //暂无提示
|
|
|
|
- goNull(){
|
|
|
|
- uni.showToast({
|
|
|
|
- title: '暂未开放',
|
|
|
|
- mask:true,
|
|
|
|
- icon:"none",
|
|
|
|
- duration: 2000
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- //调用摄像头
|
|
|
|
- saoCode(){
|
|
|
|
- uni.scanCode({
|
|
|
|
- onlyFromCamera: true,
|
|
|
|
- success: function (res) {
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url: '/pages_student/views/mine/codeSuccess?q='+encodeURIComponent(JSON.stringify(res.result))
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- // 查询违规记录列表 (用户端)
|
|
|
|
- async myViolationCount(){
|
|
|
|
- let self = this;
|
|
|
|
- let {data} = await myViolationCount()
|
|
|
|
- if(data.code == 200){
|
|
|
|
- this.violationData = data.data;
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- // 查询证书列表 (用户端)
|
|
|
|
- async queryMyCert(){
|
|
|
|
- let self = this;
|
|
|
|
- let {data} = await queryMyCert({})
|
|
|
|
- if(data.code == 200){
|
|
|
|
- let list = [];
|
|
|
|
- for(let i=0;i<data.rows.length;i++){
|
|
|
|
- let timeOne = (new Date(data.rows[i].createTime)).getTime();
|
|
|
|
- let timeTwo = (new Date(data.rows[i].expirationTime)).getTime();
|
|
|
|
- data.rows[i].createTime = self.formatDate(timeOne);
|
|
|
|
- data.rows[i].expirationTime = self.formatDate(timeTwo);
|
|
|
|
- }
|
|
|
|
- this.dataList = data.rows;
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- formatDate(date) {
|
|
|
|
- let newDate = new Date(date);
|
|
|
|
- let YY = newDate.getFullYear() + '-';
|
|
|
|
- let MM = (newDate.getMonth() + 1 < 10 ? '0' + (newDate.getMonth() + 1) : newDate.getMonth() + 1) + '-';
|
|
|
|
- let DD = (newDate.getDate() < 10 ? '0' + (newDate.getDate()) : newDate.getDate());
|
|
|
|
- return YY + MM + DD;
|
|
|
|
- },
|
|
|
|
- meCertificateClick(){
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url: '/pages_student/views/meCertificate',
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- //页面跳转
|
|
|
|
- goPage(type){
|
|
|
|
- if(type == 'meViolation'){//我的违规
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url: '/pages_student/views/views/workbench/meViolation',
|
|
|
|
- });
|
|
|
|
- }else if(type == 'photoInspection'){//离开检查
|
|
|
|
- this.outSubjectPhoto();
|
|
|
|
- }else if(type == 'resultInquiry'){//成绩查询
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url: '/pages_student/views/workbench/resultInquiry',
|
|
|
|
- });
|
|
|
|
- }else if(type == 'casuallyPat'){//随手拍
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url: '/pages/views/casuallyPat',//随手拍
|
|
|
|
- });
|
|
|
|
- }else if(type == 'safeAccess'){//安全准入
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url: '/pages_student/views/views/workbench/safeAccess/safeAccess',
|
|
|
|
- });
|
|
|
|
- }else if(type == 'examList'){//在线考试
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url: '/pages_student/views/workbench/exam/examList',
|
|
|
|
- });
|
|
|
|
- }else if(type == 'grading'){
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url: '/pages_student/views/gradingControl/gradingControl',//分级管控
|
|
|
|
- });
|
|
|
|
- }else if(type == 'safetyInspect'){//安全检查
|
|
|
|
-
|
|
|
|
- this.getGentleIdentifier();
|
|
|
|
- // uni.navigateTo({
|
|
|
|
- // url: '/pages_manage/views/workbench/problemRectification/rectifyList',//安全检查
|
|
|
|
- // });
|
|
|
|
-
|
|
|
|
- }else if(type == 'gas'){//气瓶管理
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url: '/pages_student/views/gasManage/gasManage',
|
|
|
|
- });
|
|
|
|
- }else if(type == 'none'){
|
|
|
|
- uni.showToast({
|
|
|
|
- title: '暂未开放',
|
|
|
|
- icon:"none",
|
|
|
|
- mask:true,
|
|
|
|
- duration: 2000
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- //获取拍照检查配置
|
|
|
|
- async outSubjectPhoto(){
|
|
|
|
- const {data} = await outSubjectPhoto();
|
|
|
|
- if(data.code == 200){
|
|
|
|
- if(data.data == null){
|
|
|
|
- //需要检查(重新填写)
|
|
|
|
- let obj = {
|
|
|
|
- sub:"实验室照片",
|
|
|
|
- subUrl:"",
|
|
|
|
- garbage:"垃圾桶清理后照片",
|
|
|
|
- garbageUrl:"",
|
|
|
|
- dangerous:"使用危险设备照片(选填)",
|
|
|
|
- dangerousUrl:"",
|
|
|
|
- sourceRisk:"危险源设备使用登记本照片(选填)",
|
|
|
|
- sourceRiskUrl:"",
|
|
|
|
- };
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url: '/pages_student/views/workbench/photoInspection?newData='+encodeURIComponent(JSON.stringify(obj)),
|
|
|
|
- });
|
|
|
|
- }else if(data.data == false){
|
|
|
|
- //不需要检查
|
|
|
|
- uni.showToast({
|
|
|
|
- title: '暂无检查数据',
|
|
|
|
- icon:"none",
|
|
|
|
- mask:true,
|
|
|
|
- duration: 2000
|
|
|
|
- });
|
|
|
|
- }else{
|
|
|
|
- //需要检查(修改内容)
|
|
|
|
- let obj = {
|
|
|
|
- id:data.data.id,
|
|
|
|
- sub:"实验室照片",
|
|
|
|
- subUrl:data.data.subUrl,
|
|
|
|
- garbage:"垃圾桶清理后照片",
|
|
|
|
- garbageUrl:data.data.garbageUrl,
|
|
|
|
- dangerous:"使用危险设备照片(选填)",
|
|
|
|
- dangerousUrl:data.data.dangerousUrl,
|
|
|
|
- sourceRisk:"危险源设备使用登记本照片(选填)",
|
|
|
|
- sourceRiskUrl:data.data.sourceRiskUrl,
|
|
|
|
- };
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url: '/pages_student/views/workbench/photoInspection?newData='+encodeURIComponent(JSON.stringify(obj)),
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- //获取用户身份标识"adminGentle": false, 管理员身份 "rectifyGentle": false, 整改身份"applyGentle": false 检查者身份
|
|
|
|
- async getGentleIdentifier(){
|
|
|
|
- let self = this;
|
|
|
|
- const {data} = await getGentleIdentifier();
|
|
|
|
- if(data.code==200){
|
|
|
|
- let pageType = null
|
|
|
|
- // 如果是管理员 检查者和整改者
|
|
|
|
- if(data.data.adminGentle && (data.data.applyGentle || data.data.myApplyGentle) && data.data.rectifyGentle){
|
|
|
|
- pageType=1
|
|
|
|
- }else if(data.data.adminGentle && (data.data.applyGentle || data.data.myApplyGentle) && !data.data.rectifyGentle){
|
|
|
|
- pageType=1
|
|
|
|
- }else if(data.data.adminGentle && !data.data.applyGentle && data.data.rectifyGentle){
|
|
|
|
- pageType=1
|
|
|
|
- }else if(!data.data.adminGentle && (data.data.applyGentle || data.data.myApplyGentle) && data.data.rectifyGentle){
|
|
|
|
- pageType=2
|
|
|
|
- }else if(data.data.adminGentle && !data.data.applyGentle && !data.data.rectifyGentle){
|
|
|
|
- pageType=1
|
|
|
|
- }else if(!data.data.adminGentle && (data.data.applyGentle || data.data.myApplyGentle) && !data.data.rectifyGentle){
|
|
|
|
- pageType=2
|
|
|
|
- }else if(!data.data.adminGentle && !data.data.applyGentle && data.data.rectifyGentle){
|
|
|
|
- pageType=3
|
|
|
|
- }
|
|
|
|
- uni.setStorageSync('gentleIdentifier',pageType)
|
|
|
|
- uni.setStorageSync('gentleIdentifierData',data.data)
|
|
|
|
- if(pageType){
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url: '/pages/views/safetyExamineWorkbench',
|
|
|
|
- });
|
|
|
|
- }else{
|
|
|
|
- uni.showToast({
|
|
|
|
- title: '没有相关权限',
|
|
|
|
- icon:"none",
|
|
|
|
- mask:true,
|
|
|
|
- duration: 2000
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-</script>
|
|
|
|
-
|
|
|
|
-<style lang="stylus" scoped>
|
|
|
|
-.user-workbench{
|
|
|
|
- height:100%;
|
|
|
|
- flex:1;
|
|
|
|
- box-sizing: border-box;
|
|
|
|
- .top-big-img{
|
|
|
|
- height:342rpx;
|
|
|
|
- width:750rpx;
|
|
|
|
- background :#ffffff;
|
|
|
|
- }
|
|
|
|
- .min-icon-button-box{
|
|
|
|
- display flex;
|
|
|
|
- justify-content: flex-start;
|
|
|
|
- flex-wrap: wrap;
|
|
|
|
- width:710rpx;
|
|
|
|
- margin:20rpx;
|
|
|
|
- background :#ffffff;
|
|
|
|
- border-radius:20rpx;
|
|
|
|
- padding-bottom: 20rpx;
|
|
|
|
- view{
|
|
|
|
- width: 176rpx;
|
|
|
|
- img{
|
|
|
|
- height:75rpx;
|
|
|
|
- width:75rpx;
|
|
|
|
- margin:30rpx auto 10rpx;
|
|
|
|
- }
|
|
|
|
- view{
|
|
|
|
- text-align center
|
|
|
|
- font-size:24rpx;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- /* 分级管控 */
|
|
|
|
- .grading{
|
|
|
|
- width :712rpx;
|
|
|
|
- height :80rpx;
|
|
|
|
- background: #FFFFFF;
|
|
|
|
- border-radius: 20rpx;
|
|
|
|
- margin-left:20rpx;
|
|
|
|
- margin-bottom :20rpx;
|
|
|
|
- display:flex;
|
|
|
|
- justify-content :flex-start;
|
|
|
|
- align-items :center;
|
|
|
|
- .grading_l{
|
|
|
|
- width :34rpx;
|
|
|
|
- height :34rpx;
|
|
|
|
- margin-left:16rpx;
|
|
|
|
- }
|
|
|
|
- .grading_c{
|
|
|
|
- font-size: 28rpx;
|
|
|
|
- font-family: PingFang SC;
|
|
|
|
- font-weight: 500;
|
|
|
|
- color: #333333;
|
|
|
|
- margin-left:16rpx;
|
|
|
|
- }
|
|
|
|
- .grading_r{
|
|
|
|
- width :504rpx;
|
|
|
|
- height :80rpx;
|
|
|
|
- font-size: 26rpx;
|
|
|
|
- font-family: PingFang SC;
|
|
|
|
- font-weight: 500;
|
|
|
|
- color: #EE3A3A;
|
|
|
|
- display :flex;
|
|
|
|
- justify-content :flex-end;
|
|
|
|
- align-items: center;
|
|
|
|
- >img{
|
|
|
|
- width: 20rpx;
|
|
|
|
- height: 20rpx;
|
|
|
|
- margin-left :20rpx;
|
|
|
|
- margin-top :8rpx;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .big-icon-button-box{
|
|
|
|
- width:710rpx;
|
|
|
|
- height:354rpx;
|
|
|
|
- margin:0 20rpx 20rpx;
|
|
|
|
- background :#ffffff;
|
|
|
|
- border-radius:20rpx;
|
|
|
|
- display flex
|
|
|
|
- .left-box{
|
|
|
|
- width:310rpx;
|
|
|
|
- height:310rpx;
|
|
|
|
- margin:22rpx 10rpx 22rpx 15rpx;
|
|
|
|
- .left-top-img{
|
|
|
|
- width:310rpx;
|
|
|
|
- height:150rpx;
|
|
|
|
- margin-bottom:14rpx;
|
|
|
|
- }
|
|
|
|
- .left-bottom-img{
|
|
|
|
- width:310rpx;
|
|
|
|
- height:150rpx;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- .right-img{
|
|
|
|
- width:362rpx;
|
|
|
|
- height:310rpx;
|
|
|
|
- margin:22rpx 13rpx 22rpx 0;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- .top-max-box{
|
|
|
|
- height:119rpx;
|
|
|
|
- background #fff
|
|
|
|
- overflow hidden
|
|
|
|
- .top-big-box{
|
|
|
|
- height:60rpx;
|
|
|
|
- width:649rpx;
|
|
|
|
- background: #F5F5F5;
|
|
|
|
- border-radius: 30px;
|
|
|
|
- margin:30rpx auto;
|
|
|
|
- padding:0 30rpx;
|
|
|
|
- }
|
|
|
|
- .top-big-one-type{
|
|
|
|
- color:#F95F5F;
|
|
|
|
- line-height:60rpx;
|
|
|
|
- font-size: 26rpx;
|
|
|
|
- }
|
|
|
|
- .top-big-two-type{
|
|
|
|
- line-height:60rpx;
|
|
|
|
- font-size: 26rpx;
|
|
|
|
- display flex
|
|
|
|
- .left-view{
|
|
|
|
- flex:1;
|
|
|
|
- display flex
|
|
|
|
- color:#333;
|
|
|
|
- .left-min-view{
|
|
|
|
- color:#e45656;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- .left-button-view{
|
|
|
|
- color:#0183fa;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- .button-max-box{
|
|
|
|
- /*height:446rpx;*/
|
|
|
|
- background #fff
|
|
|
|
- margin-bottom:20rpx;
|
|
|
|
- .button-title{
|
|
|
|
- line-height:100rpx;
|
|
|
|
- border-bottom:1rpx solid #E0E0E0;
|
|
|
|
- padding-left:20rpx;
|
|
|
|
- }
|
|
|
|
- .button-max-box{
|
|
|
|
- /*height:345rpx;*/
|
|
|
|
- .button-min-box{
|
|
|
|
- width:250rpx;
|
|
|
|
- height:172rpx;
|
|
|
|
- display inline-block
|
|
|
|
- img{
|
|
|
|
- width:80rpx;
|
|
|
|
- height:80rpx;
|
|
|
|
- margin:34rpx auto 0;
|
|
|
|
- }
|
|
|
|
- view{
|
|
|
|
- line-height:50rpx;
|
|
|
|
- text-align center;
|
|
|
|
- font-size:28rpx;
|
|
|
|
- color: #333;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- .bottom-max-box{
|
|
|
|
- flex:1;
|
|
|
|
- background #fff
|
|
|
|
- margin:0 20rpx 100rpx;
|
|
|
|
- border-radius:20rpx;
|
|
|
|
- display flex
|
|
|
|
- flex-direction column
|
|
|
|
- overflow-y hidden
|
|
|
|
- .bottom-title{
|
|
|
|
- display flex
|
|
|
|
- border-bottom:1rpx solid #E0E0E0;
|
|
|
|
- img{
|
|
|
|
- width:34rpx;
|
|
|
|
- height:34rpx;
|
|
|
|
- margin:35rpx 16rpx 0 10rpx;
|
|
|
|
- }
|
|
|
|
- view{
|
|
|
|
- line-height:100rpx;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- .bottom-big-box{
|
|
|
|
- flex:1;
|
|
|
|
- overflow-y scroll
|
|
|
|
- .bottom-for-box:nth-child(1){
|
|
|
|
- border:none;
|
|
|
|
- }
|
|
|
|
- .bottom-for-box{
|
|
|
|
- height:154rpx;
|
|
|
|
- margin:0 20rpx;
|
|
|
|
- border-top:1rpx solid #E0E0E0;
|
|
|
|
- overflow hidden
|
|
|
|
- .bottom-top-box{
|
|
|
|
- font-size:28rpx;
|
|
|
|
- line-height:28rpx;
|
|
|
|
- color:#333;
|
|
|
|
- display:block;
|
|
|
|
- overflow:hidden;
|
|
|
|
- text-overflow:ellipsis;
|
|
|
|
- white-space:nowrap;
|
|
|
|
- margin:36rpx 0 30rpx;
|
|
|
|
- }
|
|
|
|
- .bottom-bottom-box{
|
|
|
|
- display flex
|
|
|
|
- view{
|
|
|
|
- flex:1;
|
|
|
|
- line-height:48rpx;
|
|
|
|
- font-size: 28rpx;
|
|
|
|
- color: #999999;
|
|
|
|
- display:block;
|
|
|
|
- overflow:hidden;
|
|
|
|
- text-overflow:ellipsis;
|
|
|
|
- white-space:nowrap;
|
|
|
|
- }
|
|
|
|
- view:nth-child(2){
|
|
|
|
- text-align right
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- .null-view{
|
|
|
|
- text-align center;
|
|
|
|
- color:#999;
|
|
|
|
- line-height:80rpx;
|
|
|
|
- font-size:28rpx;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-</style>
|
|
|