index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <div class="mainContentBox">
  3. <div class="header">
  4. <ScanCodeInput
  5. v-model="inputValueC"
  6. placeholder="请扫码或输入当前用户信息,按回车键确认"
  7. style="width: 550px"
  8. @keyup.enter="handleSubmit"
  9. />
  10. <div v-if="userInfo" class="info">
  11. 当前检验用户:{{ userInfo?.userName }}
  12. </div>
  13. </div>
  14. <div class="bottom-container">
  15. <el-tabs
  16. v-model="activeName"
  17. class="demo-tabs"
  18. type="card"
  19. @tab-click="handleClick"
  20. >
  21. <el-tab-pane
  22. v-if="store.scanInfo.firstCheck == 1"
  23. label="首检"
  24. name="first"
  25. >
  26. <FirstCheck :user-name="userInfo?.userName" />
  27. </el-tab-pane>
  28. <el-tab-pane
  29. v-if="store.scanInfo.inspection == 0"
  30. label="巡检"
  31. name="second"
  32. >
  33. <RollCheck :user-name="userInfo?.userName" />
  34. </el-tab-pane>
  35. </el-tabs>
  36. </div>
  37. </div>
  38. </template>
  39. <script lang="ts" setup>
  40. import ScanCodeInput from "@/components/ScanCodeInput/index.vue";
  41. import { useProcessStore } from "@/store";
  42. import { checkUserLogin } from "@/api/prosteps/dianjian";
  43. import FirstCheck from "./first-check.vue";
  44. import RollCheck from "./roll-check.vue";
  45. const store = useProcessStore();
  46. const inputValueC = ref("");
  47. const userInfo = ref<any>(null);
  48. const handleSubmit = async () => {
  49. console.log(inputValueC.value);
  50. let res: any = await checkUserLogin(inputValueC.value);
  51. userInfo.value = res.data;
  52. };
  53. onMounted(() => {
  54. inputValueC.value = "";
  55. console.log("mounted");
  56. });
  57. const activeName = ref("first");
  58. const handleClick = (tab: any, event: Event) => {
  59. console.log(tab, event);
  60. };
  61. </script>
  62. <style lang="scss" scoped>
  63. .header {
  64. height: 60px;
  65. display: flex;
  66. align-items: center;
  67. justify-content: start;
  68. //border: 1px solid #ccc;
  69. .info {
  70. margin-left: 20px;
  71. font-size: 16px;
  72. color: #666;
  73. font-weight: bold;
  74. }
  75. }
  76. .bottom-container {
  77. margin-top: 10px;
  78. height: calc(100% - 70px);
  79. //border: 1px solid #ccc;
  80. }
  81. :deep(.el-tabs--card > .el-tabs__header .el-tabs__nav) {
  82. background: rgba(0, 0, 0, 0.1);
  83. border-radius: 16px 16px 16px 16px;
  84. overflow: hidden;
  85. border: 0;
  86. }
  87. :deep(.el-tabs--card > .el-tabs__header) {
  88. height: 80px;
  89. border: 0;
  90. overflow: hidden;
  91. border-radius: 16px 16px 16px 16px;
  92. }
  93. :deep(.el-tabs--card > .el-tabs__header .el-tabs__item) {
  94. width: 290px;
  95. height: 80px;
  96. border-radius: 0;
  97. font-weight: 500;
  98. font-size: 24px;
  99. overflow: hidden;
  100. background: transparent;
  101. border-color: transparent;
  102. }
  103. :deep(.el-tabs--card > .el-tabs__header .el-tabs__item.is-active) {
  104. background: white;
  105. border-radius: 16px 16px 16px 16px;
  106. border-color: transparent;
  107. overflow: hidden;
  108. }
  109. </style>