<script setup lang="ts">
import { getSeqInInfo } from "@/views/flow/common/CheckTopInfos/utils";
import { useCommonStoreHook, useDictionaryStore } from "@/store";
import { useScreenshot } from "@/views/base/craftManagement/route/screenshot";
import { useLayout } from "@/hooks/useLayout";
import {getExcelData} from "@/api/apply";
import ExcelDataBbox from "@/views/base/apply/excelDataBbox.vue";



const props = defineProps({
  row: {
    type: Object,
    required: true,
  },
});
const dialog8 = reactive({
  title: "表单列表",
  visible: false,
});

onMounted(async () => {

});
const showProList = ref([]);
const showProExcel = async (id) => {
  const { data, code } = await getExcelData(id);
  showProList.value = data;
  dialog8.visible = true;
};
const excelShow = ref(false);
const ExDataObj = ref({});
const toShowExcel = (item) => {
  ExDataObj.value = item;
  excelShow.value = true;
};
const { capture } = useScreenshot();
const { layout } = useLayout();
const { dicts } = useDictionaryStore();
</script>

<template>
  <div class="box">

    <el-button
        type="success"
        style="margin-bottom: 10px"
        @click="showProExcel(props.row.businessId)"
    >查看表格数据</el-button
    >
  </div>
  <el-dialog
      v-model="dialog8.visible"
      :title="dialog8.title"
      width="950px"
      @close="dialog8.visible = false"
  >
    <el-card
        style="cursor: pointer; font-size: 20px"
        shadow="always"
        :key="index"
        @click="toShowExcel(item)"
        v-for="(item, index) in showProList"
    >{{ item.formName }}</el-card
    >
  </el-dialog>

  <el-dialog
      v-model="excelShow"
      title="详情"
      @close="excelShow = false"
      append-to-body
      fullscreen
      destroy-on-close
  >
    <ExcelDataBbox :data="ExDataObj" @close="excelShow = false" />
  </el-dialog>
</template>

<style>
.cell-item {
  display: flex;
  align-items: center;
}
</style>
