Add user-friendly loading feedback for all AI/long-running operations
- Discovery: show '搜索中约需30-60秒' message, auto-save to history, timeout hint - Discovery extract/outreach: show '正在分析网站/生成文案' loading message - Translate: inline '翻译中...' placeholder while waiting - Marketing: inline 'AI 生成中...' placeholder, success feedback - Quotations AI: inline progress text + ElMessage.info during generation - Analytics: add v-loading skeleton with '加载数据分析中...' - Notifications: add v-loading skeleton with '加载通知中...' - Followup: wire up '扫描跟进提醒' button with AI progress indicator
This commit is contained in:
@@ -70,30 +70,43 @@ const extractResult = ref('')
|
||||
async function doTranslate() {
|
||||
if (!form.value.text.trim()) return
|
||||
loading.value = true
|
||||
result.value = '翻译中...'
|
||||
try {
|
||||
const res = await translate(form.value)
|
||||
result.value = res.data?.translated_text || res.translated_text || ''
|
||||
} catch { ElMessage.error('翻译失败') }
|
||||
} catch {
|
||||
result.value = ''
|
||||
ElMessage.error('翻译失败')
|
||||
}
|
||||
finally { loading.value = false }
|
||||
}
|
||||
|
||||
async function getReply() {
|
||||
if (!replyInquiry.value.trim()) return
|
||||
replyLoading.value = true
|
||||
suggestions.value = [{ content: '生成中...', tone: '处理中' }]
|
||||
try {
|
||||
const res = await translateReply({ text: replyInquiry.value })
|
||||
suggestions.value = res.data?.suggestions || res.suggestions || []
|
||||
} catch { ElMessage.error('生成建议失败') }
|
||||
if (!suggestions.length) ElMessage.info('未生成建议,请尝试修改询盘内容')
|
||||
} catch {
|
||||
suggestions.value = []
|
||||
ElMessage.error('生成建议失败')
|
||||
}
|
||||
finally { replyLoading.value = false }
|
||||
}
|
||||
|
||||
async function doExtract() {
|
||||
if (!extractText.value.trim()) return
|
||||
extractLoading.value = true
|
||||
extractResult.value = '提取中...'
|
||||
try {
|
||||
const res = await extractInfo({ text: extractText.value })
|
||||
extractResult.value = JSON.stringify(res.data || res, null, 2)
|
||||
} catch { ElMessage.error('提取失败') }
|
||||
} catch {
|
||||
extractResult.value = ''
|
||||
ElMessage.error('提取失败')
|
||||
}
|
||||
finally { extractLoading.value = false }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user