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

        <!-- <div class="tabBox"> -->
        <div class="tabBox" style="margin-top: 48px">
          <el-table :data="tableData" border stripe>
            <el-table-column type="index" width="50" label="序号" />
            <el-table-column property="ssdw" label="单位" />
            <el-table-column property="ypccs" label="应排查次数" />
            <el-table-column property="ypccs" label="已排查次数" />
            <el-table-column property="pcsl" label="排查次数" />
            <el-table-column property="ypcsl" label="应排查数量" />
            <el-table-column property="yipcsl" label="已排查数量" />
            <el-table-column property="slpc" label="数量排查" />
            <el-table-column property="fxyhsl" label="发现隐患数量" />
            <el-table-column property="yzgyhsl" label="已整改隐患数量" />
            <el-table-column property="wzgyhsl" label="未整改隐患数量" />
            <el-table-column property="yhzgl" label="隐患整改率" />
            <el-table-column property="yjsj" label="统计时间" />

            <!-- <el-table-column label="操作">
              <template #default="scope">
                <span class="operate" @click="handleEdit(scope.row)" style="color: yellowgreen">清单</span>
              </template>
</el-table-column> -->
          </el-table>
          <div class="fenye">
            <el-pagination class="pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange"
              :current-page="listQuery.page" :page-sizes="[2, 5, 10, 20]" :page-size="listQuery.size"
              layout="total, prev, pager, next, sizes, jumper" :total="total"></el-pagination>
          </div>
        </div>

      </template>
      <template #title>
        <div>隐患台账统计</div>
        <div @click="handleClose">
          <el-button type="primary">
            <el-icon>
              <Close />
            </el-icon>
          </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";
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 props = defineProps({
  yhtzShow: {
    type: Boolean,
    default: true
  },


});

const emits = defineEmits(["changeVi2"]);
const tableData = ref([
  {
    id: '124578987541',
    ssdw: '红花岗区烟草专卖局（分公司）',
    ypccs: '10',
    ypccs: '0',
    pcsl: '0',
    ypcsl: '0',
    yipcsl: '0',
    slpc: '0',
    fxyhsl: '0',
    yzgyhsl: '0',
    wzgyhsl: '0',
    yhzgl: '0',
    yjsj: '0',
  }
]);
// 分页
const listQuery = ref({
  pageNum: 1,
  pageSize: 20
});
const InnerForm = ref({});
const total = ref(0);
const Showrzqd = ref(false);
// 控制"序号"
const innerStatus = ref(false);
const xqId = ref("");

// 关闭
const handleClose = () => {
  emits("changeVi2", false);
};
// 修改子组件的值
const changeShow = (val) => {
  Showrzqd.value = val;
  getPcxData(props.listId);

};
//点击清单
function handleEdit(row) {
  Showrzqd.value = true;
  xqId.value = row.id;
}

// 获取排查项列表
const getPcxData = (id) => {
  // getApi({ id: id }, "/mosty-jcgl/checkLib/getPcxList").then((res) => {
  //   
  //   tableData.value = res;
  // });
};

onMounted(() => {
  getPcxData(props.listId);
});
</script>

<style lang="scss" scoped>
::v-deep .el-dialog__body {
  height: 550px !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>