微调
This commit is contained in:
@@ -43,6 +43,7 @@ import type { UploadInstance, UploadProps, UploadRawFile, UploadUserFile } from
|
|||||||
import { genFileId } from 'element-plus'
|
import { genFileId } from 'element-plus'
|
||||||
import { deVReportImportSensitive } from '@/api/supervision-boot/userReport/form'
|
import { deVReportImportSensitive } from '@/api/supervision-boot/userReport/form'
|
||||||
import {evaluation} from '@/api/advance-boot/assess'
|
import {evaluation} from '@/api/advance-boot/assess'
|
||||||
|
import { Loading } from '@element-plus/icons-vue'
|
||||||
|
|
||||||
const fileList = ref<UploadUserFile[]>([])
|
const fileList = ref<UploadUserFile[]>([])
|
||||||
|
|
||||||
@@ -100,7 +101,11 @@ const submit = async () => {
|
|||||||
formRef.value.validate(async (valid: any) => {
|
formRef.value.validate(async (valid: any) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
try {
|
try {
|
||||||
ElMessage.info('正在评估中...')
|
const loadingMessage = ElMessage({
|
||||||
|
message: '正在评估中',
|
||||||
|
icon: h(Loading),
|
||||||
|
duration: 0 // 不自动关闭
|
||||||
|
})
|
||||||
// 调用后端评估接口
|
// 调用后端评估接口
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
formData.append('assessId',currentNodeId.value)
|
formData.append('assessId',currentNodeId.value)
|
||||||
@@ -111,19 +116,22 @@ const submit = async () => {
|
|||||||
const response = await evaluation(currentNodeId.value, form.file)
|
const response = await evaluation(currentNodeId.value, form.file)
|
||||||
|
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
|
loadingMessage.close()
|
||||||
ElMessage.success('评估成功!')
|
ElMessage.success('评估成功!')
|
||||||
emit('data-success')
|
emit('data-success')
|
||||||
} else {
|
} else {
|
||||||
|
loadingMessage.close()
|
||||||
ElMessage.error('评估失败!')
|
ElMessage.error('评估失败!')
|
||||||
}
|
}
|
||||||
eventDataUploadVisible.value = false
|
eventDataUploadVisible.value = false
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
loadingMessage.close()
|
||||||
ElMessage.error('评估失败,请重试!')
|
ElMessage.error('评估失败,请重试!')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error('请选择数据文件')
|
ElMessage.warning('请选择数据文件')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -137,11 +137,10 @@ const exportReport = () => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示导出中提示
|
const loadingMessage = ElMessage({
|
||||||
const loading = ElLoading.service({
|
message: '正在导出中',
|
||||||
lock: true,
|
icon: h(Loading),
|
||||||
text: '导出中...',
|
duration: 0 // 不自动关闭
|
||||||
background: 'rgba(0, 0, 0, 0.7)'
|
|
||||||
})
|
})
|
||||||
|
|
||||||
exportResult({}, currentNodeId.value).then((res: any) => {
|
exportResult({}, currentNodeId.value).then((res: any) => {
|
||||||
@@ -158,11 +157,11 @@ const exportReport = () => {
|
|||||||
window.URL.revokeObjectURL(url)
|
window.URL.revokeObjectURL(url)
|
||||||
|
|
||||||
// 关闭加载提示并显示成功消息
|
// 关闭加载提示并显示成功消息
|
||||||
loading.close()
|
loadingMessage.close()
|
||||||
ElMessage.success('导出成功!')
|
ElMessage.success('导出成功!')
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
// 处理导出失败情况
|
// 处理导出失败情况
|
||||||
loading.close()
|
loadingMessage.close()
|
||||||
ElMessage.error('导出失败,请重试!')
|
ElMessage.error('导出失败,请重试!')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -198,11 +197,11 @@ const assess = async () => {
|
|||||||
//评估
|
//评估
|
||||||
const assess2 = async () => {
|
const assess2 = async () => {
|
||||||
// 显示导出中提示
|
// 显示导出中提示
|
||||||
const loading = ElLoading.service({
|
const loading = ElMessage({
|
||||||
lock: true,
|
message: '评估结果中',
|
||||||
text: '评估结果中...',
|
icon: h(Loading),
|
||||||
background: 'rgba(0, 0, 0, 0.7)'
|
duration: 0 // 不自动关闭
|
||||||
});
|
})
|
||||||
|
|
||||||
userGetInfo({ assessId: currentNodeId.value }).then(res => {
|
userGetInfo({ assessId: currentNodeId.value }).then(res => {
|
||||||
// 获取昨天的日期
|
// 获取昨天的日期
|
||||||
|
|||||||
@@ -242,8 +242,8 @@ const formRef = ref()
|
|||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
const title = ref('')
|
const title = ref('')
|
||||||
|
|
||||||
const open = (row: any) => {
|
const open = async (row: any) => {
|
||||||
info()
|
await info() // 等待数据加载完成
|
||||||
title.value = row.title + `_${row.item.name}`
|
title.value = row.title + `_${row.item.name}`
|
||||||
child.value = row.item.child
|
child.value = row.item.child
|
||||||
if (row.title == '新增') {
|
if (row.title == '新增') {
|
||||||
@@ -256,13 +256,12 @@ const open = (row: any) => {
|
|||||||
form.value = JSON.parse(JSON.stringify(row.row))
|
form.value = JSON.parse(JSON.stringify(row.row))
|
||||||
})
|
})
|
||||||
|
|
||||||
// 如果是冲击负荷类型,需要设置启动方式下拉选项
|
// 如果是冲击负荷类型,需要设置启动方式下拉选项
|
||||||
if (form.value.inpactloadtypeId) {
|
if (form.value.inpactloadtypeId) {
|
||||||
// 根据选中的冲击负荷类型ID筛选数据
|
// 根据选中的冲击负荷类型ID筛选数据
|
||||||
currentImpactLoadOptions.value = shockList.value.filter(
|
currentImpactLoadOptions.value = shockList.value.filter(
|
||||||
(item: any) => item.inpactloadtypeId === form.value.inpactloadtypeId
|
(item: any) => item.inpactloadtypeId === form.value.inpactloadtypeId
|
||||||
)
|
)
|
||||||
console.log('🚀 ~ open ~ currentImpactLoadOptions:', currentImpactLoadOptions.value)
|
|
||||||
// 构建启动方式选项
|
// 构建启动方式选项
|
||||||
const uniqueStartups = new Map()
|
const uniqueStartups = new Map()
|
||||||
currentImpactLoadOptions.value.forEach((item: any) => {
|
currentImpactLoadOptions.value.forEach((item: any) => {
|
||||||
@@ -274,29 +273,33 @@ const open = (row: any) => {
|
|||||||
|
|
||||||
startupOptions.value = Array.from(uniqueStartups.values())
|
startupOptions.value = Array.from(uniqueStartups.values())
|
||||||
|
|
||||||
// 如果有选项,默认选择第一个
|
// 如果有选项,默认选择第一个
|
||||||
if (startupOptions.value.length > 0) {
|
if (startupOptions.value.length > 0) {
|
||||||
form.value.inpactloadStartup = startupOptions.value[0].value
|
form.value.inpactloadStartup = startupOptions.value[0].value
|
||||||
} else {
|
} else {
|
||||||
form.value.inpactloadStartup = ''
|
form.value.inpactloadStartup = ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const info = async () => {
|
const info = async () => {
|
||||||
// 获取变压器参数字典列表
|
try {
|
||||||
transformerList({}).then((res: any) => {
|
// 使用 Promise.all 并行执行请求以提高性能
|
||||||
transformer.value = res.data
|
const [transformerRes, characteristicRes, shockRes] = await Promise.all([
|
||||||
})
|
transformerList({}),
|
||||||
// 谐波源特特性
|
characteristicList({}),
|
||||||
characteristicList({}).then((res: any) => {
|
loadList({})
|
||||||
characteristic.value = res.data
|
])
|
||||||
})
|
|
||||||
loadList({}).then((res: any) => {
|
transformer.value = transformerRes.data
|
||||||
shockList.value = res.data
|
characteristic.value = characteristicRes.data
|
||||||
})
|
shockList.value = shockRes.data
|
||||||
|
} catch (error) {
|
||||||
|
console.error('加载数据失败:', error)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加启动方式选项数据
|
// 添加启动方式选项数据
|
||||||
|
|||||||
@@ -403,7 +403,7 @@ const typeId = ref(null)
|
|||||||
// 过滤数据
|
// 过滤数据
|
||||||
const formatter = (row: any) => {
|
const formatter = (row: any) => {
|
||||||
// 检查数据是否已加载完成
|
// 检查数据是否已加载完成
|
||||||
if (!row.cellValue && row.cellValue !== 0) {
|
if (!row.cellValue && row.cellValue !== 0 && row.column.field !='inpactloadStartup') {
|
||||||
return ''; // 数据未加载时返回空字符串
|
return ''; // 数据未加载时返回空字符串
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -421,8 +421,7 @@ const formatter = (row: any) => {
|
|||||||
}else if(row.column.field =='inpactloadStartup'){
|
}else if(row.column.field =='inpactloadStartup'){
|
||||||
const found = shockRef.value.find((item: any) => item.inpactloadtypeId == typeId.value)
|
const found = shockRef.value.find((item: any) => item.inpactloadtypeId == typeId.value)
|
||||||
return found.inpactloadStartup
|
return found.inpactloadStartup
|
||||||
}
|
}else if(row.column.field == 'isIsolationtrans'){
|
||||||
else if(row.column.field == 'isIsolationtrans'){
|
|
||||||
return row.cellValue == '01' ? '是' : '否'
|
return row.cellValue == '01' ? '是' : '否'
|
||||||
}else if(row.column.field =='inpactloadFreq'){
|
}else if(row.column.field =='inpactloadFreq'){
|
||||||
if(row.cellValue == '01'){
|
if(row.cellValue == '01'){
|
||||||
@@ -432,8 +431,7 @@ const formatter = (row: any) => {
|
|||||||
}else{
|
}else{
|
||||||
return '2次/h<N≤10次/h'
|
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)
|
const found = characteristic.value.find((item: any) => item.harmId == row.cellValue)
|
||||||
if(found){
|
if(found){
|
||||||
return found.harmName
|
return found.harmName
|
||||||
|
|||||||
Reference in New Issue
Block a user