修改测试bug

This commit is contained in:
guanj
2025-07-10 16:32:49 +08:00
parent 226031a451
commit 2f5ab61e9c
57 changed files with 1962 additions and 1143 deletions

View File

@@ -43,11 +43,16 @@ import { useDictData } from '@/stores/dictData'
import {
assessTransformerParamList,
transformerList,
characteristicList,
assessTransformerParamDelete,
capacitorList,
capacitorDelete,
windPowerList,
windPowerDelete
windPowerDelete,
loadParamList,
loadParamDelete,
shockList,
shockDelete
} from '@/api/advance-boot/assess'
import { defaultAttribute } from '@/components/table/defaultAttribute'
import { ElMessage, ElMessageBox, ElDatePicker } from 'element-plus'
@@ -58,6 +63,7 @@ const dictData = useDictData()
//字典获取电压等级
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
const transformer: any = ref([])
const characteristic: any = ref([])
const addformRef = ref()
const xTableRef = ref()
@@ -118,15 +124,15 @@ const column: any = ref([
child: [
{
title: '风机名称',
field: 'name'
field: 'windgeneratorName'
},
{
title: '风机闪变系数',
field: 'name1'
title: '闪变系数',
field: 'flickerCoeff'
},
{
title: '风机额定视在功率',
field: 'name2'
title: '额定视在功率(kVA)',
field: 's'
}
]
},
@@ -137,88 +143,82 @@ const column: any = ref([
key: 'loadList',
child: [
{
title: '配电窒名称',
field: 'name'
title: '负荷名称',
field: 'loadName'
},
{
title: '进线电压',
field: 'name1'
field: 'linevoltageScale'
},
{
title: '配变容量(kVA)',
field: 'name2'
field: 'transhighCapacity'
},
{
title: '配电变压器阻抗(%)',
field: 'name3'
field: 'transImpedance'
},
{
title: '谐波源特性',
field: 'name4'
field: 'harmId'
},
{
title: '配变低压侧电压',
field: 'name5'
field: 'translowScale'
},
{
title: '非线性负荷功率(kW)',
field: 'name6'
field: 'nonlinearloadPower'
},
{
title: '功率因',
field: 'name7'
title: '功率因',
field: 'powerFactor'
}
]
},
{
loading: false,
name: '冲击负荷',
name: '冲击负荷',
key: 'impactList',
child: [
{
title: '冲击负荷类型',
field: 'name'
},
{
title: '冲击负荷功率(MVA)',
field: 'name1'
field: 'inpactloadtypeId'
},
{
title: '数量',
field: 'name2'
field: 'inpactloadNum'
},
{
title: '启动方式',
field: 'name3'
title: '容量',
field: 'inpactloadPower'
},
{
title: '启动容量倍数',
field: 'name4'
},
{
title: '冲击负荷高压侧电压',
field: 'name5'
},
{
title: '有无隔离变',
field: 'name6'
title: '是否隔离变',
field: 'isIsolationtrans'
},
{
title: '隔离变阻抗(%)',
field: 'name7'
field: 'isolationtransImpedance'
},
{
title: '高压侧电压',
field: 'inpactloadhighScale'
},
{
title: '低压侧电压',
field: 'name8'
field: 'inpactloadlowScale'
},
{
title: '负荷频度选择',
field: 'name9'
title: '负荷频度',
field: 'inpactloadFreq'
},
{
title: '闪变叠加系数',
field: 'name10'
field: 'flickerCoeff'
}
]
}
@@ -250,34 +250,48 @@ const deleteFform = (item: any, i: any) => {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
}).then(async () => {
if (i == 0) {
assessTransformerParamDelete(xTableRef.value[i].getCheckboxRecords().map(item => item.transId)).then(
await assessTransformerParamDelete(xTableRef.value[i].getCheckboxRecords().map(item => item.transId)).then(
res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
info(i)
}
)
} else if (i == 1) {
capacitorDelete(xTableRef.value[i].getCheckboxRecords().map(item => item.capacitorId)).then(res => {
await capacitorDelete(xTableRef.value[i].getCheckboxRecords().map(item => item.capacitorId)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
info(i)
})
} else if (i == 2) {
windPowerDelete(xTableRef.value[i].getCheckboxRecords().map(item => item.windgeneratorId)).then(res => {
await windPowerDelete(xTableRef.value[i].getCheckboxRecords().map(item => item.windgeneratorId)).then(
res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
}
)
} else if (i == 3) {
await loadParamDelete(xTableRef.value[i].getCheckboxRecords().map(item => item.loadId)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
})
} else if (i == 4) {
await shockDelete(xTableRef.value[i].getCheckboxRecords().map(item => item.inpactloadId)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
info(i)
})
}
info(i)
})
}
// 编辑
@@ -288,18 +302,6 @@ const edit = (item: any, row: any) => {
row: row
})
}
// 过滤数据
const formatter = (row: any) => {
if (row.column.field == 'transtypeId') {
const found = transformer.value.find((item: any) => item.transtypeId == row.cellValue)
return found.transtypeName || '' // 使用可选链并提供默认值
} else if (row.column.field == 'capacitorScale') {
const found = voltageleveloption.find((item: any) => item.id == row.cellValue)
return found.name || ''
} else {
return row.cellValue
}
}
const info = async (i: number) => {
column.value[i].loading = true
@@ -310,30 +312,65 @@ const info = async (i: number) => {
dataList.value.transformerList = res.data
})
} else if (i == 1) {
// 电容器参数维护
await capacitorList({ assessId: props.assessId }).then(res => {
dataList.value.capacitorList = res.data
})
} else if (i == 2) {
// 风电参数
await windPowerList({ assessId: props.assessId }).then(res => {
dataList.value.windPowerList = res.data
})
} else if (i == 3) {
// 用户负荷参数
await loadParamList({ assessId: props.assessId }).then(res => {
dataList.value.loadList = res.data
})
} else if (i == 4) {
// 冲击性负荷
await shockList({ assessId: props.assessId }).then(res => {
dataList.value.impactList = res.data
})
}
column.value[i].loading = false
}
// 过滤数据
const formatter = (row: any) => {
if (row.column.field == 'transtypeId') {
const found = transformer.value.find((item: any) => item.transtypeId == row.cellValue)
return found.transtypeName || '' // 使用可选链并提供默认值
} else if (row.column.field == 'harmId') {
const found = characteristic.value.find((item: any) => item.harmId == row.cellValue)
return found.harmName || '' // 使用可选链并提供默认值
} else if (
row.column.field == 'capacitorScale' ||
row.column.field == 'linevoltageScale' ||
row.column.field == 'translowScale'
) {
const found = voltageleveloption.find((item: any) => item.id == row.cellValue)
return found.name || ''
} else {
return row.cellValue
}
}
// 字典
const dictionary = () => {
// 获取变压器参数字典列表
transformerList({}).then((res: any) => {
transformer.value = res.data
})
// 谐波源特特性
characteristicList({}).then((res: any) => {
characteristic.value = res.data
})
}
onMounted(async () => {
await dictionary()
info(0) // 变压器参数维护
info(1) // 变压器参数维护
info(2) // 变压器参数维护
// info(3) // 变压器参数维护
info(1) // 电容器参数维护
info(2) // 风电参数
info(3) // 用户负荷
info(4) // 冲击性负荷
})
</script>
<style lang="scss" scoped></style>