update pollDrawingDetail

This commit is contained in:
XIE7654
2025-07-22 14:35:20 +08:00
parent 04ee6bf0e0
commit 890487e5b1

View File

@@ -109,7 +109,7 @@ async function handleDraw() {
// 轮询获取图片详情 // 轮询获取图片详情
const pollDrawingDetail = async (id: number) => { const pollDrawingDetail = async (id: number) => {
fetchDrawingDetail(id).then((res) => { fetchDrawingDetail(id).then((res) => {
if (res && res.status === 'RUNNING') { if (res && res.data.status === 'RUNNING') {
setTimeout(() => pollDrawingDetail(id), 5000); setTimeout(() => pollDrawingDetail(id), 5000);
} }
}); });
@@ -124,9 +124,7 @@ async function fetchDrawingList(pageNum = 1, pageSize = 9) {
total.value = res.total; total.value = res.total;
// 检查每个 item 的状态 // 检查每个 item 的状态
for (const item of res.items) { for (const item of res.items) {
if (item.status === 'PENDING') { if (item.status === 'PENDING' || item.status === 'RUNNING') {
fetchDrawingDetail(item.id);
} else if (item.status === 'RUNNING') {
pollDrawingDetail(item.id); pollDrawingDetail(item.id);
} }
} }
@@ -170,7 +168,7 @@ onMounted(() => {
<Form.Item label="画画描述"> <Form.Item label="画画描述">
<Input.TextArea <Input.TextArea
v-model:value="form.prompt" v-model:value="form.prompt"
:autosize="true" :auto-size="true"
placeholder="请输入画面描述" placeholder="请输入画面描述"
/> />
</Form.Item> </Form.Item>