<template>
  <el-form
    ref="form"
    :model="caseFile"
    label-width="90px"
    class="camera-from dispatch-file-from jm-file-upload"
  >
    <el-form-item label="排版：" class="mandatory">
      <el-radio-group v-model="exportInfo.paperType">
        <el-radio value="four">4联卡纸</el-radio>
        <el-radio value="a4">A4纸</el-radio>
        <el-radio value="a3">A3纸</el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item label="格式：" class="mandatory">
      <el-radio-group v-model="exportInfo.fileType">
        <el-radio value="pdf">pdf</el-radio>
        <el-radio value="jpg">jpg</el-radio>
      </el-radio-group>
    </el-form-item>
  </el-form>
</template>

<script setup lang="ts">
import { maxFileSize } from "@/constant/caseFile";
import { useUpload } from "@/hook/upload";
import { ElMessage } from "element-plus";
import { computed, ref, watchEffect, onMounted } from "vue";
import { addCaseScenes } from "./quisk";
import { QuiskExpose } from "@/helper/mount";
import { updateSelectByTreeFileLists } from "@/store/case";

const props = defineProps<{
  showPagesRef: any;
  title: string
}>();
const exportInfo = ref({
  paperType: "four",
  fileType: "pdf",
})
onMounted(async () => {
});

defineExpose<QuiskExpose>({
  async submit() {
    if (!props.showPagesRef) {
      ElMessage.error("加载异常，请刷新浏览器");
      throw "加载异常，请刷新浏览器";
    }else{
      await props.showPagesRef.exportToPDF(exportInfo.value.paperType,props.title, exportInfo.value.fileType)
    }
  },
});
</script>

<style scoped lang="scss">
.upload-demo {
  overflow: hidden;
}

.file {
  display: flex;
  justify-content: space-between;
  align-items: center;
  > div {
    display: flex;
    align-items: center;
  }

  .name {
    margin-left: 10px;
  }
}
.jm-file-upload {
  // .mtk {
  //   position: absolute;
  //   right: 0;
  //   top: 0;
  // }
}
</style>
