<!-- 点检判定 -->
<template>
  <el-scrollbar :height="tableHeight">
    <avue-crud ref="crudRef2" :data="tableData" :option="option" />
  </el-scrollbar>
</template>
<script setup>
import { processBrazePage } from "@/api/braze";
import { useProcessStore } from "@/store";
import { collectData, tableDatas } from "@/api/process/traceability";
import { useDictionaryStore } from "@/store";
const dictS = useDictionaryStore();
const store = useProcessStore();
const tableData = ref([]);
const tableHeight = ref(null);
const setTableHeight = () => {
  tableHeight.value =
    Number(document.getElementById("tabBox").offsetHeight) - 110;
};
const option = {
  addBtn: false,
  selection: false,
  viewBtn: false,
  editBtn: false,
  delBtn: false,
  menu: false,
  column: [
    {
      label: "工序名称",
      prop: "operationName",
    },
    {
      label: "钎焊编码",
      prop: "brazeCode",
    },
    {
      label: "钎焊名称",
      prop: "brazeName",
    },
    {
      label: "起始端",
      prop: "lineStart",
    },
    {
      label: "结束端",
      prop: "lineEnd",
    },
    {
      label: "线径",
      prop: "wireDiameter",
      hide: true,
    },
    {
      label: "长度",
      prop: "length",
      hide: true,
    },
    {
      label: "操作人",
      prop: "updator",
    },
    {
      label: "操作时间",
      prop: "updated",
    },
  ],
};
const refreshTra = (row) => {
  const data = {
    seqNo: store.useSeqNo,
    workOrderCode: store.odersData.workOrderCode,
  };
  dataList(data);
};
defineExpose({ refreshTra });

onMounted(() => {
  refreshTra();
  setTableHeight();
});

const dataList = (data) => {
  processBrazePage(data).then((res) => {
    tableData.value = res.data.records;
  });
};
</script>
