|
@@ -247,12 +247,20 @@ export default {
|
|
|
// 需求4:切换步进方案策略时,出现锁定时间弹窗
|
|
// 需求4:切换步进方案策略时,出现锁定时间弹窗
|
|
|
if (newVal === 'step') {
|
|
if (newVal === 'step') {
|
|
|
this.showLockTime = true;
|
|
this.showLockTime = true;
|
|
|
|
|
+ this.syncLocktimeByStage();
|
|
|
} else {
|
|
} else {
|
|
|
this.showLockTime = false;
|
|
this.showLockTime = false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 模拟需求1:根据不同模式,切换对应的控制方案数据 (Mock 逻辑)
|
|
// 模拟需求1:根据不同模式,切换对应的控制方案数据 (Mock 逻辑)
|
|
|
this.updateSchemeDataByMethod(newVal);
|
|
this.updateSchemeDataByMethod(newVal);
|
|
|
|
|
+ },
|
|
|
|
|
+ // 步进模式下切换阶段时,更新锁定时间选项并重新显示面板
|
|
|
|
|
+ currentStage() {
|
|
|
|
|
+ if (this.currentMethod === 'step') {
|
|
|
|
|
+ this.showLockTime = true;
|
|
|
|
|
+ this.syncLocktimeByStage();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
@@ -267,6 +275,18 @@ export default {
|
|
|
if (this._ro) this._ro.disconnect();
|
|
if (this._ro) this._ro.disconnect();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ // 根据当前选中阶段同步锁定时间选项
|
|
|
|
|
+ syncLocktimeByStage() {
|
|
|
|
|
+ const stage = this.currentStageList.find(s => s.value === this.currentStage);
|
|
|
|
|
+ if (stage && stage.locktimeOptions) {
|
|
|
|
|
+ this.locktimeOptions = stage.locktimeOptions;
|
|
|
|
|
+ // 如果当前值不在新选项中,重置为第一个
|
|
|
|
|
+ const hasValue = this.locktimeOptions.some(o => o.value === this.currentLocktime);
|
|
|
|
|
+ if (!hasValue) {
|
|
|
|
|
+ this.currentLocktime = this.locktimeOptions[0]?.value || null;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
stagePercent(time) {
|
|
stagePercent(time) {
|
|
|
const total = this.currentStageList.reduce((s, item) => s + (item.time || 0), 0);
|
|
const total = this.currentStageList.reduce((s, item) => s + (item.time || 0), 0);
|
|
|
if (!total) return '0%';
|
|
if (!total) return '0%';
|
|
@@ -482,6 +502,7 @@ export default {
|
|
|
scheme: this.currentScheme,
|
|
scheme: this.currentScheme,
|
|
|
stages: this.currentMethod === 'temp' ? this.currentStageList : null,
|
|
stages: this.currentMethod === 'temp' ? this.currentStageList : null,
|
|
|
lockConfig: this.currentMethod === 'step' ? {
|
|
lockConfig: this.currentMethod === 'step' ? {
|
|
|
|
|
+ stage: this.currentStage,
|
|
|
type: this.lockTimeType,
|
|
type: this.lockTimeType,
|
|
|
time: this.lockTimeType === 'timer' ? this.currentLocktime : null
|
|
time: this.lockTimeType === 'timer' ? this.currentLocktime : null
|
|
|
} : null
|
|
} : null
|