feat: 同步调整导线参数数组操作
This commit is contained in:
@@ -350,29 +350,40 @@ const voltageOptions = [
|
||||
]
|
||||
|
||||
// 数组操作函数(最多3条导线,即数组最多4个元素:1地线+3导线)
|
||||
// 两个数组同步增减
|
||||
const addHArm = () => {
|
||||
if (params.parameter.h_arm.length < 4) {
|
||||
const last = params.parameter.h_arm[params.parameter.h_arm.length - 1] || 100
|
||||
params.parameter.h_arm.push(last - 20)
|
||||
// 同步增加 gc_x
|
||||
const lastX = params.parameter.gc_x[params.parameter.gc_x.length - 1] || 10
|
||||
params.parameter.gc_x.push(lastX)
|
||||
}
|
||||
}
|
||||
|
||||
const removeHArm = () => {
|
||||
if (params.parameter.h_arm.length > 2) {
|
||||
params.parameter.h_arm.pop()
|
||||
// 同步删除 gc_x
|
||||
params.parameter.gc_x.pop()
|
||||
}
|
||||
}
|
||||
|
||||
const addGcX = () => {
|
||||
if (params.parameter.gc_x.length < 4) {
|
||||
const last = params.parameter.gc_x[params.parameter.gc_x.length - 1] || 10
|
||||
params.parameter.gc_x.push(last)
|
||||
const lastX = params.parameter.gc_x[params.parameter.gc_x.length - 1] || 10
|
||||
params.parameter.gc_x.push(lastX)
|
||||
// 同步增加 h_arm
|
||||
const last = params.parameter.h_arm[params.parameter.h_arm.length - 1] || 100
|
||||
params.parameter.h_arm.push(last - 20)
|
||||
}
|
||||
}
|
||||
|
||||
const removeGcX = () => {
|
||||
if (params.parameter.gc_x.length > 2) {
|
||||
params.parameter.gc_x.pop()
|
||||
// 同步删除 h_arm
|
||||
params.parameter.h_arm.pop()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user