index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <div class="app-container dataStatistics">
  3. <div class="title-box">
  4. <div :class="pageType == 1?'checkTitle':''" @click="checkTitleButton(1)">
  5. <p>按实验室</p>
  6. <p></p>
  7. </div>
  8. <div :class="pageType == 2?'checkTitle':''" @click="checkTitleButton(2)">
  9. <p>按安全隐患</p>
  10. <p></p>
  11. </div>
  12. <div :class="pageType == 3?'checkTitle':''" @click="checkTitleButton(3)">
  13. <p>按检查指标</p>
  14. <p></p>
  15. </div>
  16. </div>
  17. <laboratoryStatistics v-if="pageType == 1"></laboratoryStatistics>
  18. <safetyHazardStatistics v-if="pageType == 2"></safetyHazardStatistics>
  19. <checkIndexStatistics v-if="pageType == 3" :propsData="propsData"></checkIndexStatistics>
  20. </div>
  21. </template>
  22. <script>
  23. import laboratoryStatistics from './laboratoryStatistics.vue'
  24. import safetyHazardStatistics from './safetyHazardStatistics.vue'
  25. import checkIndexStatistics from './checkIndexStatistics.vue'
  26. export default {
  27. name: 'index',
  28. components: {
  29. laboratoryStatistics,
  30. safetyHazardStatistics,
  31. checkIndexStatistics
  32. },
  33. data(){
  34. return{
  35. pageType:1,
  36. propsData:{
  37. jumpType:false,
  38. }
  39. }
  40. },
  41. created(){
  42. if(this.$route.query.type){
  43. this.$set(this,'pageType',3);
  44. }
  45. },
  46. mounted(){
  47. },
  48. methods:{
  49. checkTitleButton(type){
  50. if(this.pageType != type){
  51. this.$set(this,'pageType',type);
  52. }
  53. }
  54. }
  55. }
  56. </script>
  57. <style scoped lang="scss">
  58. .dataStatistics{
  59. flex:1;
  60. display: flex;
  61. flex-direction: column;
  62. overflow: hidden;
  63. *{
  64. font-weight: 500;
  65. }
  66. .title-box{
  67. display: flex;
  68. height:80px;
  69. border-bottom:1px solid #d8d8d8;
  70. padding:0 40px;
  71. div{
  72. height:80px;
  73. margin-right:80px;
  74. cursor: pointer;
  75. p:nth-child(1){
  76. width:80px;
  77. font-size:16px;
  78. text-align: center;
  79. color:#333;
  80. line-height:40px;
  81. height:40px;
  82. margin-top:20px;
  83. }
  84. p:nth-child(2){
  85. width:60px;
  86. height: 4px;
  87. border-radius:4px;
  88. margin:0 10px;
  89. }
  90. }
  91. .checkTitle{
  92. p:nth-child(1){
  93. color:#0045AF;
  94. }
  95. p:nth-child(2){
  96. background-color: #0045AF;
  97. }
  98. }
  99. }
  100. }
  101. </style>