联调二级评估
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
:value="item.transtypeId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<!-- 用户负荷参数维护 -->
|
||||
<el-select
|
||||
v-else-if="item.field == 'harmId'"
|
||||
v-model="form[item.field]"
|
||||
@@ -32,6 +33,96 @@
|
||||
:value="item.harmId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<!-- 冲击负荷参数维护 -->
|
||||
<el-select
|
||||
v-else-if="item.field == 'inpactloadtypeId'"
|
||||
v-model="form[item.field]"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择冲击负荷类型"
|
||||
@change="handleImpactLoadTypeChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in shockList"
|
||||
:key="item.inpactloadtypeId"
|
||||
:label="item.inpactloadtypeName"
|
||||
:value="item.inpactloadtypeId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-else-if="item.field == 'inpactloadStartup'"
|
||||
v-model="form[item.field]"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择启动方式"
|
||||
@change="handleStartupChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="startup in startupOptions"
|
||||
:key="startup.value"
|
||||
:label="startup.label"
|
||||
:value="startup.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-else-if="item.field == 'inpactloadFreq'"
|
||||
v-model="form[item.field]"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择负荷频度"
|
||||
>
|
||||
<el-option label="N≤4次/d" value="01"></el-option>
|
||||
<el-option label="N>4次/d且N≤2次/h" value="02"></el-option>
|
||||
<el-option label="2次/h<N≤10次/h" value="03"></el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-else-if="item.field == 'isIsolationtrans'"
|
||||
v-model="form[item.field]"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择是否隔离变"
|
||||
>
|
||||
<el-option label="是" value="01" />
|
||||
<el-option label="否" value="00" />
|
||||
</el-select>
|
||||
<el-select
|
||||
v-else-if="item.field == 'inpactloadhighScale'"
|
||||
v-model="form[item.field]"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择高压侧电压"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in voltageleveloption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-else-if="item.field == 'inpactloadlowScale'"
|
||||
v-model="form[item.field]"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择低压侧电压"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in voltageleveloption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
|
||||
<el-input-number
|
||||
v-else-if="item.field == 'powerFactor'"
|
||||
v-model="form[item.field]"
|
||||
:min="0"
|
||||
:max="1"
|
||||
:step="0.1"
|
||||
:precision="1"
|
||||
placeholder="请输入功率因数"
|
||||
/>
|
||||
|
||||
<el-input-number
|
||||
v-else-if="
|
||||
@@ -43,8 +134,8 @@
|
||||
item.field == 's'||
|
||||
item.field == 'transhighCapacity'||
|
||||
item.field == 'transImpedance'||
|
||||
item.field == 'nonlinearloadPower'||
|
||||
item.field == 'powerFactor'
|
||||
item.field == 'nonlinearloadPower'
|
||||
|
||||
"
|
||||
style="width: 100%"
|
||||
v-model="form[item.field]"
|
||||
@@ -70,7 +161,9 @@
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<el-input v-else v-model.trim="form[item.field]" placeholder="请输入内容" />
|
||||
|
||||
|
||||
<el-input v-else v-model.trim="form[item.field]" placeholder="请输入内容" :disabled= "item.field == 'inpactloadPower'"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
@@ -99,13 +192,15 @@ import {
|
||||
loadParamAdd,
|
||||
loadParamEdit,
|
||||
shockAdd,
|
||||
shockEdit
|
||||
shockEdit,
|
||||
loadList
|
||||
} from '@/api/advance-boot/assess'
|
||||
import { ElMessage, ElMessageBox, ElDatePicker } from 'element-plus'
|
||||
const emits = defineEmits(['init'])
|
||||
const child: any = ref([])
|
||||
const transformer: any = ref([])
|
||||
const characteristic: any = ref([])
|
||||
const shockList: any = ref([])
|
||||
const form: any = ref({})
|
||||
const dictData = useDictData()
|
||||
//字典获取电压等级
|
||||
@@ -120,7 +215,7 @@ const rules = {
|
||||
capacitorReactance: [{ required: true, message: '请输入电抗率', trigger: 'blur' }],
|
||||
capacitorScale: [{ required: true, message: '请选择电压等级', trigger: 'change' }],
|
||||
windgeneratorName: [{ required: true, message: '请输入风机名称', trigger: 'blur' }],
|
||||
flickerCoeff: [{ required: true, message: '请输入风机闪变系数', trigger: 'blur' }],
|
||||
flickerCoeff: [{ required: true, message: '请输入闪变叠加系数', trigger: 'blur' }],
|
||||
s: [{ required: true, message: '请输入风机额定视在功率', trigger: 'blur' }],
|
||||
loadName: [{ required: true, message: '请输入负荷名称', trigger: 'blur' }],
|
||||
transhighCapacity: [{ required: true, message: '请输入配变容量', trigger: 'blur' }],
|
||||
@@ -130,16 +225,26 @@ const rules = {
|
||||
linevoltageScale: [{ required: true, message: '请选择进线电压', trigger: 'change' }],
|
||||
harmId: [{ required: true, message: '请选择谐波源特性', trigger: 'change' }],
|
||||
translowScale: [{ required: true, message: '请选择配变低压侧电压', trigger: 'change' }],
|
||||
inpactloadtypeId: [{ required: true, message: '请选择冲击负荷类型', trigger: 'change' }],
|
||||
inpactloadStartup: [{ required: true, message: '请选择启动方式', trigger: 'change' }],
|
||||
inpactloadNum:[{ required: true, message: '请输入数量', trigger: 'blur' }],
|
||||
inpactloadPower:[{ required: true, message: '请输入容量率', trigger: 'blur' }],
|
||||
isIsolationtrans:[{ required: true, message: '请选择是否隔离变', trigger: 'change' }],
|
||||
isolationtransImpedance:[{ required: true, message: '请输入隔离变阻抗', trigger: 'blur' }],
|
||||
inpactloadhighScale:[{ required: true, message: '请选择高压侧电压', trigger: 'change' }],
|
||||
inpactloadlowScale:[{ required: true, message: '请选择低压侧电压', trigger: 'change' }],
|
||||
inpactloadFreq:[{ required: true, message: '请选择负荷频度', trigger: 'change' }],
|
||||
|
||||
}
|
||||
|
||||
const formRef = ref()
|
||||
const dialogVisible = ref(false)
|
||||
const title = ref('')
|
||||
|
||||
const open = (row: any) => {
|
||||
console.log('🚀 ~ open ~ row:', row)
|
||||
info()
|
||||
title.value = row.title + `_${row.item.name}`
|
||||
child.value = row.item.child
|
||||
|
||||
if (row.title == '新增') {
|
||||
row.item.child.forEach((item: any) => {
|
||||
form.value[item.field] = ''
|
||||
@@ -149,6 +254,32 @@ const open = (row: any) => {
|
||||
row.item.child.forEach((item: any) => {
|
||||
form.value = JSON.parse(JSON.stringify(row.row))
|
||||
})
|
||||
|
||||
// 如果是冲击负荷类型,需要设置启动方式下拉选项
|
||||
if (form.value.inpactloadtypeId) {
|
||||
// 根据选中的冲击负荷类型ID筛选数据
|
||||
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) => {
|
||||
uniqueStartups.set(item.inpactloadStartup, {
|
||||
label: item.inpactloadStartup,
|
||||
value: item.inpactloadStartup
|
||||
})
|
||||
})
|
||||
|
||||
startupOptions.value = Array.from(uniqueStartups.values())
|
||||
|
||||
// 如果有选项,默认选择第一个
|
||||
if (startupOptions.value.length > 0) {
|
||||
form.value.inpactloadStartup = startupOptions.value[0].value
|
||||
} else {
|
||||
form.value.inpactloadStartup = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dialogVisible.value = true
|
||||
@@ -162,6 +293,72 @@ const info = async () => {
|
||||
characteristicList({}).then((res: any) => {
|
||||
characteristic.value = res.data
|
||||
})
|
||||
loadList({}).then((res: any) => {
|
||||
shockList.value = res.data
|
||||
})
|
||||
}
|
||||
|
||||
// 添加启动方式选项数据
|
||||
const startupOptions = ref<Array<{ label: string; value: string }>>([])
|
||||
// 存储当前冲击负荷类型的选项
|
||||
const currentImpactLoadOptions = ref([])
|
||||
// 处理冲击负荷类型变化
|
||||
const handleImpactLoadTypeChange = (value: any) => {
|
||||
if (value) {
|
||||
// 直接根据选中的冲击负荷类型ID筛选数据
|
||||
currentImpactLoadOptions.value = shockList.value.filter(
|
||||
(item: any) => item.inpactloadtypeId === value
|
||||
)
|
||||
|
||||
// 构建启动方式选项
|
||||
const uniqueStartups = new Map()
|
||||
currentImpactLoadOptions.value.forEach((item: any) => {
|
||||
uniqueStartups.set(item.inpactloadStartup, {
|
||||
label: item.inpactloadStartup,
|
||||
value: item.inpactloadStartup
|
||||
})
|
||||
})
|
||||
|
||||
startupOptions.value = Array.from(uniqueStartups.values())
|
||||
|
||||
// 如果有选项,默认选择第一个
|
||||
if (startupOptions.value.length > 0) {
|
||||
form.value.inpactloadStartup = startupOptions.value[0].value
|
||||
} else {
|
||||
form.value.inpactloadStartup = ''
|
||||
}
|
||||
|
||||
// 清空之前选择的容量
|
||||
form.value.inpactloadPower = null
|
||||
|
||||
// 触发启动方式变化事件,自动设置对应的容量
|
||||
if (startupOptions.value.length > 0) {
|
||||
handleStartupChange(startupOptions.value[0].value)
|
||||
}
|
||||
} else {
|
||||
startupOptions.value = []
|
||||
currentImpactLoadOptions.value = []
|
||||
form.value.inpactloadStartup = ''
|
||||
form.value.inpactloadPower = null
|
||||
}
|
||||
}
|
||||
|
||||
// 处理启动方式变化
|
||||
const handleStartupChange = (value: any) => {
|
||||
if (value && currentImpactLoadOptions.value.length > 0) {
|
||||
// 根据启动方式查找对应的容量倍数
|
||||
const selectedOption = currentImpactLoadOptions.value.find(
|
||||
(item: any) => item.inpactloadStartup === value
|
||||
)
|
||||
if (selectedOption) {
|
||||
// 设置容量为倍数,实际应用中可能需要根据其他参数计算具体容量值
|
||||
form.value.inpactloadPower = selectedOption.inpactloadMultiple
|
||||
} else {
|
||||
form.value.inpactloadPower = null
|
||||
}
|
||||
} else {
|
||||
form.value.inpactloadPower = null
|
||||
}
|
||||
}
|
||||
const submit = async () => {
|
||||
formRef.value.validate(async (valid: any) => {
|
||||
|
||||
Reference in New Issue
Block a user