refactor(@vben/common-ui): 优化文档生成和下载逻辑
This commit is contained in:
parent
80831aa367
commit
4518ef74eb
@ -134,13 +134,10 @@ const startFetching = async () => {
|
|||||||
|
|
||||||
if (answer && isDocxURL(answer)) {
|
if (answer && isDocxURL(answer)) {
|
||||||
filename.value = extractDocxFilename(answer);
|
filename.value = extractDocxFilename(answer);
|
||||||
}
|
|
||||||
|
|
||||||
fetchResult.value = `/static/${filename.value}`;
|
|
||||||
resultItems.value.push({
|
resultItems.value.push({
|
||||||
key: resultItems.value.length + 1,
|
key: resultItems.value.length + 1,
|
||||||
role: 'ai',
|
role: 'ai',
|
||||||
content: res.answer,
|
content: '文档已生成',
|
||||||
footer: h(Flex, null, [
|
footer: h(Flex, null, [
|
||||||
h(
|
h(
|
||||||
Button,
|
Button,
|
||||||
@ -175,6 +172,15 @@ const startFetching = async () => {
|
|||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
resultItems.value.push({
|
||||||
|
key: resultItems.value.length + 1,
|
||||||
|
role: 'ai',
|
||||||
|
content: res.answer,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
fetchResult.value = `/static/${filename.value}`;
|
||||||
// resultItems.value.push({
|
// resultItems.value.push({
|
||||||
// key: resultItems.value.length + 1,
|
// key: resultItems.value.length + 1,
|
||||||
// role: 'ai',
|
// role: 'ai',
|
||||||
|
Loading…
Reference in New Issue
Block a user