fix(测试计划): 第一次设置定时任务不自动开启状态

This commit is contained in:
limin-fit2 2022-03-01 18:03:49 +08:00 committed by 刘瑞斌
parent 52c5ae233b
commit 8b0a682514
3 changed files with 24 additions and 17 deletions

View File

@ -123,7 +123,7 @@ export default {
dialogVisible: false,
schedule: {
value: "",
enable: true
enable: false
},
scheduleTaskType: "",
testId: String,
@ -227,7 +227,7 @@ export default {
} else {
this.schedule = {
value: '',
enable: true
enable: false
};
}
});
@ -235,6 +235,10 @@ export default {
crontabFill(value, resultList) {
//
this.form.cronValue = value;
//
if (!this.schedule.id){
this.schedule.enable = true;
}
this.$refs.crontabResult.resultList = resultList;
this.$refs['from'].validate();
},
@ -251,7 +255,6 @@ export default {
if (valid) {
this.intervalShortValidate();
let formCronValue = this.form.cronValue;
// this.schedule.enable = true;
this.schedule.value = formCronValue;
this.saveSchedule();
this.dialogVisible = false;
@ -354,5 +357,7 @@ export default {
.el-form-item {
margin-bottom: 10px;
}
>>> .el-form-item__error {
margin-left: 148px;
}
</style>

View File

@ -31,13 +31,8 @@
</el-form-item>
<el-form-item :label="$t('commons.schedule_cron_title')"
prop="cronValue">
<el-row>
<el-col :span="18">
<el-input :disabled="isReadOnly" v-model="form.cronValue" class="inp"
:placeholder="$t('schedule.please_input_cron_expression')"/>
</el-col>
</el-row>
<el-input :disabled="isReadOnly" v-model="form.cronValue" class="inp"
:placeholder="$t('schedule.please_input_cron_expression')"/>
</el-form-item>
<el-form-item>
<el-link :disabled="isReadOnly" type="primary" @click="showCronDialog">
@ -189,6 +184,9 @@ export default {
} else if (!customValidate.pass) {
callback(new Error(customValidate.info));
} else {
if (!this.schedule.id){
this.schedule.enable = true;
}
callback();
}
};
@ -199,7 +197,7 @@ export default {
dialogVisible: false,
schedule: {
value: "",
enable: true,
enable: false,
},
scheduleTaskType: "",
testId: String,
@ -309,7 +307,7 @@ export default {
} else {
this.schedule = {
value: '',
enable: true
enable: false
};
}
});
@ -317,6 +315,10 @@ export default {
crontabFill(value, resultList) {
//
this.form.cronValue = value;
//
if (!this.schedule.id){
this.schedule.enable = true;
}
this.$refs.crontabResult.resultList = resultList;
this.$refs['from'].validate();
},
@ -333,7 +335,6 @@ export default {
if (valid) {
this.intervalShortValidate();
let formCronValue = this.form.cronValue;
// this.schedule.enable = true;
this.schedule.value = formCronValue;
this.saveSchedule();
this.dialogVisible = false;
@ -433,7 +434,7 @@ export default {
<style scoped>
.inp {
width: 50%;
width: 40%;
margin-right: 20px;
}
@ -449,4 +450,7 @@ export default {
.ms-mode-div {
margin-top: 10px;
}
>>> .el-form-item__error {
margin-left: 148px;
}
</style>

View File

@ -48,7 +48,6 @@
prop="createUser"
:field="item"
:fields-width="fieldsWidth"
sortable
:label="$t('commons.create_user')"
min-width="200px">
</ms-table-column>
@ -221,7 +220,6 @@
prop="passRate"
:field="item"
:fields-width="fieldsWidth"
sortable
:label="$t('commons.pass_rate')"
min-width="120px">
</ms-table-column>