优化配置Cron

This commit is contained in:
marvzhang
2020-02-24 11:02:41 +08:00
parent 326045eb95
commit 297f0d73dd
3 changed files with 82 additions and 23 deletions

View File

@@ -6,6 +6,10 @@
z-index: 1;
}
.cron-wrapper {
margin-bottom: 10px;
}
.el-tabs {
box-shadow: none;
}
@@ -41,7 +45,14 @@
</style>
<template>
<div id="change-crontab">
<!-- <el-button class="language" type="text" @click="i18n=(i18n==='en'?'cn':'en')">{{i18n}}</el-button>-->
<div class="cron-wrapper">
<label>
{{$t('Cron Expression')}}:
</label>
<el-tag type="success" size="small">
{{cron}}
</el-tag>
</div>
<el-tabs type="border-card">
<el-tab-pane>
<span slot="label"><i class="el-icon-date"></i> {{text.Minutes.name}}</span>
@@ -388,9 +399,6 @@ export default {
}
},
methods: {
getValue () {
return this.cron
},
change () {
this.$emit('change', this.cron)
this.close()
@@ -398,6 +406,22 @@ export default {
close () {
this.$emit('close')
},
submit () {
if (!this.validate()) {
this.$message.error(this.$t('Cron expression is invalid'))
return false
}
this.$emit('submit', this.cron)
return true
},
validate () {
if (!this.minutesText) return false
if (!this.hoursText) return false
if (!this.daysText) return false
if (!this.monthsText) return false
if (!this.weeksText) return false
return true
},
updateCronItem (key, value) {
if (value === undefined) {
this[key].cronEvery = '0'