index.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 infoPage from './infoPage'
  18. import listPage from './listPage'
  19. export default {
  20. components: {
  21. infoPage,
  22. listPage
  23. },
  24. data() {
  25. return {
  26. checkType:1,
  27. equipmentId:'',
  28. }
  29. },
  30. onLoad(option) {
  31. this.$set(this,'equipmentId',option.id);
  32. },
  33. onShow() {
  34. },
  35. mounted() {
  36. },
  37. methods: {
  38. checkButton(type){
  39. if(this.checkType != type){
  40. this.$set(this,'checkType',type);
  41. }
  42. },
  43. },
  44. }
  45. </script>
  46. <style lang="stylus" scoped>
  47. #equipmentInformation {
  48. height: 100%;
  49. flex:1;
  50. display:flex;
  51. overflow: hidden;
  52. flex-direction:column;
  53. .top-table-button-box{
  54. display: flex;
  55. border-bottom: 1rpx solid #0183FA;
  56. background-color: #fff;
  57. view{
  58. font-weigth:700;
  59. flex: 1;
  60. text-align: center;
  61. line-height:80rpx;
  62. }
  63. .checkButton{
  64. color:#0183FA;
  65. }
  66. }
  67. .bottom-flex{
  68. flex: 1;
  69. overflow: hidden;
  70. }
  71. }
  72. </style>