This commit is contained in:
sjl
2025-09-03 19:30:29 +08:00
parent 8b20307a14
commit 0067b63536
4 changed files with 46 additions and 38 deletions

View File

@@ -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('请选择数据文件')
}
}

View File

@@ -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 => {
// 获取昨天的日期

View File

@@ -242,8 +242,8 @@ const formRef = ref()
const dialogVisible = ref(false)
const title = ref('')
const open = (row: any) => {
info()
const open = async (row: any) => {
await info() // 等待数据加载完成
title.value = row.title + `_${row.item.name}`
child.value = row.item.child
if (row.title == '新增') {
@@ -262,7 +262,6 @@ const open = (row: any) => {
currentImpactLoadOptions.value = shockList.value.filter(
(item: any) => item.inpactloadtypeId === form.value.inpactloadtypeId
)
console.log('🚀 ~ open ~ currentImpactLoadOptions:', currentImpactLoadOptions.value)
// 构建启动方式选项
const uniqueStartups = new Map()
currentImpactLoadOptions.value.forEach((item: any) => {
@@ -285,18 +284,22 @@ const open = (row: any) => {
dialogVisible.value = true
}
const info = async () => {
// 获取变压器参数字典列表
transformerList({}).then((res: any) => {
transformer.value = res.data
})
// 谐波源特特性
characteristicList({}).then((res: any) => {
characteristic.value = res.data
})
loadList({}).then((res: any) => {
shockList.value = res.data
})
try {
// 使用 Promise.all 并行执行请求以提高性能
const [transformerRes, characteristicRes, shockRes] = await Promise.all([
transformerList({}),
characteristicList({}),
loadList({})
])
transformer.value = transformerRes.data
characteristic.value = characteristicRes.data
shockList.value = shockRes.data
} catch (error) {
console.error('加载数据失败:', error)
}
}
// 添加启动方式选项数据

View File

@@ -403,7 +403,7 @@ const typeId = ref(null)
// 过滤数据
const formatter = (row: any) => {
// 检查数据是否已加载完成
if (!row.cellValue && row.cellValue !== 0) {
if (!row.cellValue && row.cellValue !== 0 && row.column.field !='inpactloadStartup') {
return ''; // 数据未加载时返回空字符串
}
@@ -421,8 +421,7 @@ const formatter = (row: any) => {
}else if(row.column.field =='inpactloadStartup'){
const found = shockRef.value.find((item: any) => item.inpactloadtypeId == typeId.value)
return found.inpactloadStartup
}
else if(row.column.field == 'isIsolationtrans'){
}else if(row.column.field == 'isIsolationtrans'){
return row.cellValue == '01' ? '是' : '否'
}else if(row.column.field =='inpactloadFreq'){
if(row.cellValue == '01'){
@@ -432,8 +431,7 @@ const formatter = (row: any) => {
}else{
return '2次/h<N≤10次/h'
}
}
else if (row.column.field == 'harmId') {
}else if (row.column.field == 'harmId') {
const found = characteristic.value.find((item: any) => item.harmId == row.cellValue)
if(found){
return found.harmName