index.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <view id="equipmentInformation">
  3. <view class="top-table-button-box">
  4. <view :class="checkType == 1?'checkButton':''" @click="checkButton(1)">设备信息</view>
  5. <view :class="checkType == 2?'checkButton':''" @click="checkButton(2)">使用记录</view>
  6. </view>
  7. <view class="bottom-flex">
  8. <infoPage :equipmentId="equipmentId" v-if="checkType == 1"></infoPage>
  9. <listPage :equipmentId="equipmentId" v-if="checkType == 2"></listPage>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. import {
  15. demo1,
  16. } from '@/pages_equipmentUtilization/api/index.js'
  17. import {
  18. infoPage
  19. } from './infoPage.vue'
  20. import {
  21. listPage
  22. } from './listPage.vue'
  23. export default {
  24. components: {
  25. infoPage,
  26. listPage
  27. },
  28. data() {
  29. return {
  30. checkType:1,
  31. equipmentId:'',
  32. }
  33. },
  34. onLoad(option) {
  35. this.$set(this,'equipmentId',option.id);
  36. },
  37. onShow() {
  38. },
  39. mounted() {
  40. },
  41. methods: {
  42. checkButton(type){
  43. if(this.checkType != type){
  44. this.$set(this,'checkType',type);
  45. }
  46. },
  47. },
  48. }
  49. </script>
  50. <style lang="stylus" scoped>
  51. #equipmentInformation {
  52. height: 100%;
  53. flex:1;
  54. display:flex;
  55. overflow: hidden;
  56. flex-direction:column;
  57. .top-table-button-box{
  58. display: flex;
  59. border-bottom: 1rpx solid #0183FA;
  60. background-color: #fff;
  61. view{
  62. font-weigth:700;
  63. flex: 1;
  64. text-align: center;
  65. line-height:80rpx;
  66. }
  67. .checkButton{
  68. color:#0183FA;
  69. }
  70. }
  71. .bottom-flex{
  72. flex: 1;
  73. overflow: hidden;
  74. }
  75. }
  76. </style>