safetyInspect.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <!--检查记录-->
  2. <template>
  3. <view id="safetyInspect">
  4. <view class="tabTitle" v-if="userType==1">
  5. <view class="tabTitle_li" @tap="tabClick(index)" :key="index" v-for="(item,index) in tabText">
  6. <view :class="{on:curTab==index}" class="tabTitle_text">{{item}}</view>
  7. <view :class="{on:curTab==index}" class="tabTitle_across"></view>
  8. </view>
  9. </view>
  10. <inspection-records ref="child" v-if="pageType==0" style="display: flex;flex: 1;overflow-y: auto;"></inspection-records>
  11. <rectify-list ref="child" v-if="pageType==1" style="display: flex;flex: 1;overflow-y: auto;"></rectify-list>
  12. </view>
  13. </template>
  14. <script>
  15. import { inspectionRecords } from '@/pages_manage/workbench/securityCheck/inspectionRecords.vue'
  16. import { rectifyList } from '@/pages_manage/workbench/problemRectification/rectifyList'
  17. export default {
  18. components: {
  19. inspectionRecords,
  20. rectifyList,
  21. },
  22. name: "safetyInspect",
  23. data() {
  24. return {
  25. userType:uni.getStorageSync('userType'),
  26. pageType:0,
  27. curTab:0,
  28. tabText:['检查记录','问题整改',],
  29. }
  30. },
  31. onLoad() {
  32. //判断如果是学生端进入只显示问题整改
  33. if(this.userType==2){
  34. this.pageType=1
  35. }
  36. },
  37. onShow() {
  38. this.dataList=[];
  39. uni.removeStorageSync('First')
  40. this.$refs.child.getList()
  41. },
  42. mounted(){
  43. },
  44. methods: {
  45. //顶部tab点击
  46. tabClick(index) {
  47. this.curTab = index;
  48. this.pageType=index;
  49. },
  50. }
  51. }
  52. </script>
  53. <style lang="stylus" scoped>
  54. #safetyInspect {
  55. height: 100%;
  56. width: 100%;
  57. flex :1;
  58. display flex;
  59. flex-direction column
  60. overflow hidden
  61. .tabTitle{
  62. display flex;
  63. width:100%;
  64. height: 100rpx;
  65. background: #fff;
  66. margin-bottom 16rpx;
  67. .tabTitle_li{
  68. width:146rpx;
  69. text-align center;
  70. .tabTitle_text{
  71. display: inline-block;
  72. font-size: 28rpx;
  73. font-family: PingFang SC;
  74. font-weight: 500;
  75. color: #333333;
  76. line-height: 70rpx;
  77. &.on{
  78. color:#0183FA;
  79. }
  80. }
  81. .tabTitle_across{
  82. width: 80rpx;
  83. height: 5rpx;
  84. background: #0183FA;
  85. border-radius: 3rpx;
  86. margin-left 34rpx;
  87. display none;
  88. &.on{
  89. display block;
  90. }
  91. }
  92. }
  93. }
  94. }
  95. </style>