traceability.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <el-table :data="tableData" id="tableStyle" :height="tableHeight" border>
  3. <el-table-column prop="operationName" label="工序名称" />
  4. <el-table-column prop="workSection" label="工段" />
  5. <el-table-column prop="currentState" label="状态" />
  6. <el-table-column prop="realStartWhen" label="开始时间" />
  7. <el-table-column prop="realEndWhen" label="结束时间" />
  8. <el-table-column prop="creator" label="操作人" />
  9. <el-table-column prop="standardWorktime" label="工时" />
  10. <el-table-column prop="operationSort" label="工步" />
  11. <template #empty>
  12. <div class="empty">
  13. <Empty />
  14. </div>
  15. </template>
  16. </el-table>
  17. <Pagination position="right" :page="page" :limit="limit" :total="total" @pagination="getPagination" />
  18. </template>
  19. <script lang="ts" setup>
  20. import { useProcessStore } from "@/store";
  21. import { getInfo } from "@/api/process/traceability";
  22. const store = useProcessStore();
  23. const page = ref(1);
  24. const limit = ref(10);
  25. const total = ref(10);
  26. const tableData = ref([]);
  27. const tableHeight = ref(null);
  28. //动态控制表格高度
  29. const setTableHeight = () => {
  30. tableHeight.value =
  31. Number(document.getElementById("tabBox").offsetHeight) - 60;
  32. };
  33. const getPagination = async () => {
  34. const { data } = await getInfo({
  35. pageNo: page.value,
  36. pageSize: limit.value,
  37. seqNo: store.useSeqNo,
  38. });
  39. total.value = data.totalCount;
  40. tableData.value = data.records;
  41. };
  42. onMounted(() => {
  43. getPagination();
  44. setTableHeight();
  45. });
  46. </script>
  47. <style lang="scss" scoped></style>