微调
This commit is contained in:
@@ -43,6 +43,7 @@ import type { UploadInstance, UploadProps, UploadRawFile, UploadUserFile } from
|
||||
import { genFileId } from 'element-plus'
|
||||
import { deVReportImportSensitive } from '@/api/supervision-boot/userReport/form'
|
||||
import {evaluation} from '@/api/advance-boot/assess'
|
||||
import { Loading } from '@element-plus/icons-vue'
|
||||
|
||||
const fileList = ref<UploadUserFile[]>([])
|
||||
|
||||
@@ -100,7 +101,11 @@ const submit = async () => {
|
||||
formRef.value.validate(async (valid: any) => {
|
||||
if (valid) {
|
||||
try {
|
||||
ElMessage.info('正在评估中...')
|
||||
const loadingMessage = ElMessage({
|
||||
message: '正在评估中',
|
||||
icon: h(Loading),
|
||||
duration: 0 // 不自动关闭
|
||||
})
|
||||
// 调用后端评估接口
|
||||
const formData = new FormData()
|
||||
formData.append('assessId',currentNodeId.value)
|
||||
@@ -111,19 +116,22 @@ const submit = async () => {
|
||||
const response = await evaluation(currentNodeId.value, form.file)
|
||||
|
||||
if (response.data) {
|
||||
loadingMessage.close()
|
||||
ElMessage.success('评估成功!')
|
||||
emit('data-success')
|
||||
} else {
|
||||
loadingMessage.close()
|
||||
ElMessage.error('评估失败!')
|
||||
}
|
||||
eventDataUploadVisible.value = false
|
||||
} catch (error) {
|
||||
loadingMessage.close()
|
||||
ElMessage.error('评估失败,请重试!')
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
ElMessage.error('请选择数据文件')
|
||||
ElMessage.warning('请选择数据文件')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -137,11 +137,10 @@ const exportReport = () => {
|
||||
return
|
||||
}
|
||||
|
||||
// 显示导出中提示
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: '导出中...',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
const loadingMessage = ElMessage({
|
||||
message: '正在导出中',
|
||||
icon: h(Loading),
|
||||
duration: 0 // 不自动关闭
|
||||
})
|
||||
|
||||
exportResult({}, currentNodeId.value).then((res: any) => {
|
||||
@@ -158,11 +157,11 @@ const exportReport = () => {
|
||||
window.URL.revokeObjectURL(url)
|
||||
|
||||
// 关闭加载提示并显示成功消息
|
||||
loading.close()
|
||||
loadingMessage.close()
|
||||
ElMessage.success('导出成功!')
|
||||
}).catch(error => {
|
||||
// 处理导出失败情况
|
||||
loading.close()
|
||||
loadingMessage.close()
|
||||
ElMessage.error('导出失败,请重试!')
|
||||
})
|
||||
}
|
||||
@@ -198,11 +197,11 @@ const assess = async () => {
|
||||
//评估
|
||||
const assess2 = async () => {
|
||||
// 显示导出中提示
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: '评估结果中...',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
const loading = ElMessage({
|
||||
message: '评估结果中',
|
||||
icon: h(Loading),
|
||||
duration: 0 // 不自动关闭
|
||||
})
|
||||
|
||||
userGetInfo({ assessId: currentNodeId.value }).then(res => {
|
||||
// 获取昨天的日期
|
||||
|
||||
Reference in New Issue
Block a user