<template><a-modal v-model:open="visible" title="段落测试" :footer="null" width="680px"><a-steps :current="step" style="margin-bottom:24px"><a-step title="上传附件" /><a-step title="处理中" /><a-step title="查看结果" /></a-steps><div v-if="step===0"><a-upload-dragger :beforeUpload="(f: File)=>{uploadFile=f;step=1;return false}"><p class="ant-upload-drag-icon"><file-add-outlined /></p><p class="ant-upload-text">点击上传参考文件</p></a-upload-dragger></div><div v-if="step===1" style="text-align:center;padding:40px"><a-spin size="large" /><p style="margin-top:16px;color:#666">正在解析文件 → 请求 AI 模型...</p></div><div v-if="step===2"><div style="background:#f0f0ff;padding:16px;border-left:3px solid #5b5bd6;border-radius:4px"><p>AI 生成结果预览：</p><p>{{result}}</p></div></div></a-modal></template>
<script setup lang="ts">
import { ref, watch } from "vue";
import { FileAddOutlined } from "@ant-design/icons-vue";
const props = defineProps<{open:boolean}>()
const emit = defineEmits<{close:[]}>()
const visible = ref(false)
const step = ref(0)
const uploadFile = ref<File|null>(null)
const result = ref("这是 AI 生成的示例内容...")
watch(()=>props.open,v=>{visible.value=v;if(v){step.value=0;uploadFile.value=null}})
watch(visible,v=>{if(!v)emit('close')})
</script>
