<!-- 表格里的管理弹出框 -->
<template>
  <div>
    <el-dialog v-model="props.diaShow" :before-close="handleClose" width="1200px" draggable>
      <template #default>

        <div class="tabBox" style="margin-top: 10px">
          <el-table :data="tableData" border stripe height="calc(90vh - 180px)">
            <el-table-column type="index" width="50" label="序号" />
            <el-table-column property="name" label="检查内容" show-overflow-tooltip />
            <el-table-column property="status" label="检查状态" show-overflow-tooltip />
            <el-table-column property="type" label="整改状态" show-overflow-tooltip />
            <el-table-column property="yhNote" label="隐患说明" show-overflow-tooltip />
          </el-table>
        </div>

      </template>
      <template #title>
        <div>隐患检查日志清单</div>
      </template>
      <template #footer>
        <div @click="handleClose">
          <el-button type="primary">
            <el-icon>
              <Close />
            </el-icon>
            <span>关闭</span>
          </el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>

<script setup>
// 引入
import {
  ref,
  onMounted,
  defineProps,
  defineEmits,
  getCurrentInstance,
  watch
} from "vue";
import { getApi, deleteApi, putApi, postApi } from "@/api/tobAcco_api.js";
import { ElMessage } from "element-plus";
const { proxy } = getCurrentInstance();

const { D_DBZ_YHDJ, D_BZ_SF, NSFBXSCTP, NJCXLY, NYHBZ } = proxy.$dict(
  "D_DBZ_YHDJ",
  "D_BZ_SF",
  "NSFBXSCTP",
  "NJCXLY",
  "NYHBZ"
);
const emits = defineEmits(["changeVi2"]);
const tableData = ref([]);
// 数据
const props = defineProps({
  diaShow: {
    type: Boolean,
    default: true
  },
  rowid: {
    type: Object,
    default: {}
  },

});
// watch(
//     () => props.rowid,
//     (val) => {
//         getPcxData(props.rowid.id);
//     }
// )


onMounted(() => {
  getPcxData(props.rowid.id);
});
// 关闭
const handleClose = () => {
  emits("changeVi2", false);
};
// 获取日志清单列表
const getPcxData = (id) => {
  getApi({ logid: id }, "/mosty-jcgl/userChecklog/getCarPitfallList").then((res) => {
    tableData.value = res;
  });
};

</script>

<style lang="scss" scoped>
// ::v-deep .el-dialog__body {
//   height: 550px !important;
// }

::v-deep .el-dialog {
  margin-top: 5vh !important;
}

.newAdd {
  margin-top: 6px;
  position: absolute;
  right: 20px;
}

.el-table {
  border-left: 1px solid green;
  border-right: 1px solid green;

  height: 100%;
}

.fenye {
  top: 100%;
}

::v-deep .el-dialog__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 40px;
}
</style>
