diff --git a/webui/src/components/ParameterForm.vue b/webui/src/components/ParameterForm.vue index e5f53ed..4812b90 100644 --- a/webui/src/components/ParameterForm.vue +++ b/webui/src/components/ParameterForm.vue @@ -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() } }