123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513 |
- <!-- 学生端工作台 -->
- <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="big-icon-button-box">
- <view class="left-box">
- <img class="left-top-img" @click="goNull" src="@/images/basicsModules/img_bg_cjcx.png">
- <img class="left-bottom-img" @click="goPage('meViolation')" src="@/images/basicsModules/img_bg_wgjl.png">
- </view>
- <img class="right-img" @click="goNull" src="@/images/basicsModules/img_bg_jfmx.png">
- </view>
- <view class="bottom-max-box">
- <view class="bottom-title">
- <img src="@/images/basicsModules/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 '@/api/basicsModules/index.js'
- import { tabBar } from '@/components/tabBar.vue'
- import { navBar } from '@/component/navbar.vue'
- import { homeConfigurationSlot } from '@/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/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;
- },
- //页面跳转
- goPage(type){
- if(type == 'meViolation'){//我的违规
- uni.navigateTo({
- url: '/pages_student/workbench/meViolation',
- });
- }else if(type == 'photoInspection'){//离开检查
- this.outSubjectPhoto();
- }else if(type == 'resultInquiry'){//成绩查询
- uni.navigateTo({
- url: '/pages_student/workbench/resultInquiry',
- });
- }else if(type == 'casuallyPat'){//随手拍
- uni.navigateTo({
- url: '/pages/casuallyPat',//随手拍
- });
- }else if(type == 'safeAccess'){//安全准入
- uni.navigateTo({
- url: '/pages_student/workbench/safeAccess/safeAccess',
- });
- }else if(type == 'examList'){//在线考试
- uni.navigateTo({
- url: '/pages_student/workbench/exam/examList',
- });
- }else if(type == 'grading'){
- uni.navigateTo({
- url: '/pages_student/gradingControl/gradingControl',//分级管控
- });
- }else if(type == 'safetyInspect'){//安全检查
- this.getGentleIdentifier();
- // uni.navigateTo({
- // url: '/pages_manage/workbench/problemRectification/rectifyList',//安全检查
- // });
- }else if(type == 'gas'){//气瓶管理
- uni.navigateTo({
- url: '/pages_student/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/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/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/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>
|