safetyInspect.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. console.log(3333)
  40. uni.removeStorageSync('First')
  41. this.$refs.child.getList()
  42. },
  43. mounted(){
  44. },
  45. methods: {
  46. //顶部tab点击
  47. tabClick(index) {
  48. this.curTab = index;
  49. this.pageType=index;
  50. },
  51. }
  52. }
  53. </script>
  54. <style lang="stylus" scoped>
  55. #safetyInspect {
  56. height: 100%;
  57. width: 100%;
  58. flex :1;
  59. display flex;
  60. flex-direction column
  61. overflow hidden
  62. .tabTitle{
  63. display flex;
  64. width:100%;
  65. height: 100rpx;
  66. background: #fff;
  67. margin-bottom 16rpx;
  68. .tabTitle_li{
  69. width:146rpx;
  70. text-align center;
  71. .tabTitle_text{
  72. display: inline-block;
  73. font-size: 28rpx;
  74. font-family: PingFang SC;
  75. font-weight: 500;
  76. color: #333333;
  77. line-height: 70rpx;
  78. &.on{
  79. color:#0183FA;
  80. }
  81. }
  82. .tabTitle_across{
  83. width: 80rpx;
  84. height: 5rpx;
  85. background: #0183FA;
  86. border-radius: 3rpx;
  87. margin-left 34rpx;
  88. display none;
  89. &.on{
  90. display block;
  91. }
  92. }
  93. }
  94. }
  95. }
  96. </style>