index.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never" v-loading="loading">
  4. <div class="switch">
  5. <div class="switch_left">
  6. <ul>
  7. <li
  8. v-for="item in tabOptions"
  9. :key="item.key"
  10. :class="{ active: activeComp == item.key }"
  11. @click="handleClick(item)"
  12. >
  13. {{ item.name }}
  14. </li>
  15. </ul>
  16. </div>
  17. <!-- <div class="right" style="padding: 10px">
  18. <el-button @click="$router.go(-1)">返回</el-button>
  19. </div> -->
  20. </div>
  21. <div class="main">
  22. <div v-if="activeComp == 'point'">
  23. <InspectionPoint ref="InspectionPoint" :ruleType="String(1)" />
  24. </div>
  25. <div v-if="activeComp == 'anmac'">
  26. <Maintenance />
  27. </div>
  28. <div v-if="activeComp == 'warehouseInventory'">
  29. <WarehouseInventory />
  30. </div>
  31. <div v-if="activeComp == 'measuringSubmit'">
  32. <MeasuringSubmit />
  33. </div>
  34. <div v-if="activeComp == 'runtimeConfiguration'">
  35. <!-- 共用巡点检页面 -->
  36. <InspectionPoint2 ref="InspectionPoint2" :ruleType="String(5)"
  37. /></div>
  38. </div>
  39. </el-card>
  40. </div>
  41. </template>
  42. <script>
  43. import InspectionPoint from '../inspectionPoint';
  44. import InspectionPoint2 from '../inspectionPoint';
  45. import MeasuringSubmit from '../measuringSubmit';
  46. import Maintenance from '../maintenance';
  47. import WarehouseInventory from '../warehouseInventory';
  48. export default {
  49. components: {
  50. InspectionPoint,
  51. InspectionPoint2,
  52. MeasuringSubmit,
  53. Maintenance,
  54. WarehouseInventory
  55. },
  56. data() {
  57. return {
  58. activeComp: 'point',
  59. tabOptions: [
  60. { key: 'point', name: '巡点检配置' },
  61. { key: 'anmac', name: '保养配置' },
  62. { key: 'warehouseInventory', name: '仓库盘点配置' },
  63. { key: 'measuringSubmit', name: '量具送检配置' },
  64. { key: 'runtimeConfiguration', name: '运行记录配置' }
  65. ],
  66. // 加载状态
  67. loading: false
  68. };
  69. },
  70. mounted() {
  71. console.log(this.$route.query);
  72. switch (this.$route.query.title) {
  73. case '巡检点':
  74. this.activeComp = 'point';
  75. break;
  76. case '保养':
  77. this.activeComp = 'anmac';
  78. break;
  79. case '量具送检':
  80. this.activeComp = 'measuringSubmit';
  81. break;
  82. case '仓库盘点配置':
  83. this.activeComp = 'warehouseInventory';
  84. break;
  85. case '运行记录配置':
  86. this.activeComp = 'runtimeConfiguration';
  87. break;
  88. default:
  89. break;
  90. }
  91. },
  92. methods: {
  93. handleClick(val) {
  94. this.activeComp = val.key;
  95. this.$forceUpdate();
  96. }
  97. }
  98. };
  99. </script>
  100. <style lang="scss" scoped>
  101. ::v-deep .el-card__body {
  102. padding-top: 0;
  103. padding-left: 0;
  104. }
  105. .main {
  106. padding-left: 17px;
  107. .plan {
  108. padding-top: 15px;
  109. }
  110. }
  111. </style>