|
@@ -1,8 +1,8 @@
|
|
|
|
|
|
<template>
|
|
<template>
|
|
<div class="vue3-cron-div">
|
|
<div class="vue3-cron-div">
|
|
- <el-button class="language" type="text" >
|
|
|
|
- </el-button>
|
|
|
|
|
|
+ <el-button class="language" type="text">
|
|
|
|
+ </el-button>
|
|
<el-tabs type="border-card">
|
|
<el-tabs type="border-card">
|
|
<el-tab-pane>
|
|
<el-tab-pane>
|
|
<template #label>
|
|
<template #label>
|
|
@@ -25,7 +25,7 @@
|
|
<el-select size="small" multiple v-model="state.second.specificSpecific">
|
|
<el-select size="small" multiple v-model="state.second.specificSpecific">
|
|
<el-option v-for="(val, index) in 60" :key="index" :value="val - 1">{{
|
|
<el-option v-for="(val, index) in 60" :key="index" :value="val - 1">{{
|
|
val - 1
|
|
val - 1
|
|
- }}</el-option>
|
|
|
|
|
|
+ }}</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-radio>
|
|
</el-radio>
|
|
</el-row>
|
|
</el-row>
|
|
@@ -60,7 +60,7 @@
|
|
<el-select size="small" multiple v-model="state.minute.specificSpecific">
|
|
<el-select size="small" multiple v-model="state.minute.specificSpecific">
|
|
<el-option v-for="(val, index) in 60" :key="index" :value="val - 1">{{
|
|
<el-option v-for="(val, index) in 60" :key="index" :value="val - 1">{{
|
|
val - 1
|
|
val - 1
|
|
- }}</el-option>
|
|
|
|
|
|
+ }}</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-radio>
|
|
</el-radio>
|
|
</el-row>
|
|
</el-row>
|
|
@@ -95,7 +95,7 @@
|
|
<el-select size="small" multiple v-model="state.hour.specificSpecific">
|
|
<el-select size="small" multiple v-model="state.hour.specificSpecific">
|
|
<el-option v-for="(val, index) in 24" :key="index" :value="val - 1">{{
|
|
<el-option v-for="(val, index) in 24" :key="index" :value="val - 1">{{
|
|
val - 1
|
|
val - 1
|
|
- }}</el-option>
|
|
|
|
|
|
+ }}</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-radio>
|
|
</el-radio>
|
|
</el-row>
|
|
</el-row>
|
|
@@ -217,7 +217,7 @@
|
|
</el-row>
|
|
</el-row>
|
|
</div>
|
|
</div>
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
- <el-tab-pane>
|
|
|
|
|
|
+ <!-- <el-tab-pane>
|
|
<template #label>
|
|
<template #label>
|
|
<span><i class="el-icon-date"></i> {{ state.text.Year.name }}</span>
|
|
<span><i class="el-icon-date"></i> {{ state.text.Year.name }}</span>
|
|
</template>
|
|
</template>
|
|
@@ -247,14 +247,14 @@
|
|
</el-radio>
|
|
</el-radio>
|
|
</el-row>
|
|
</el-row>
|
|
</div>
|
|
</div>
|
|
- </el-tab-pane>
|
|
|
|
|
|
+ </el-tab-pane> -->
|
|
</el-tabs>
|
|
</el-tabs>
|
|
<div class="bottom">
|
|
<div class="bottom">
|
|
<div class="value" style="margin: 10px;">
|
|
<div class="value" style="margin: 10px;">
|
|
<span> cron预览: </span>
|
|
<span> cron预览: </span>
|
|
<el-tag type="primary">
|
|
<el-tag type="primary">
|
|
{{ state.cron }}
|
|
{{ state.cron }}
|
|
- </el-tag> <span>{秒数} {分钟} {小时} {日期} {月份} {?} {年份}</span>
|
|
|
|
|
|
+ </el-tag> <span>{秒数} {分钟} {小时} {日期} {月份} {?}</span>
|
|
</div>
|
|
</div>
|
|
<div class="buttonDiv" style="text-align: right;">
|
|
<div class="buttonDiv" style="text-align: right;">
|
|
<el-button type="primary" size="mini" @click.stop="handleChange">{{ state.text.Save }}</el-button>
|
|
<el-button type="primary" size="mini" @click.stop="handleChange">{{ state.text.Save }}</el-button>
|
|
@@ -329,14 +329,14 @@ export default defineComponent({
|
|
rangeEnd: 0,
|
|
rangeEnd: 0,
|
|
specificSpecific: []
|
|
specificSpecific: []
|
|
},
|
|
},
|
|
- year: {
|
|
|
|
- cronEvery: '1',
|
|
|
|
- incrementStart: 2017,
|
|
|
|
- incrementIncrement: 1,
|
|
|
|
- rangeStart: 0,
|
|
|
|
- rangeEnd: 0,
|
|
|
|
- specificSpecific: []
|
|
|
|
- },
|
|
|
|
|
|
+ // year: {
|
|
|
|
+ // cronEvery: '1',
|
|
|
|
+ // incrementStart: 2017,
|
|
|
|
+ // incrementIncrement: 1,
|
|
|
|
+ // rangeStart: 0,
|
|
|
|
+ // rangeEnd: 0,
|
|
|
|
+ // specificSpecific: []
|
|
|
|
+ // },
|
|
output: {
|
|
output: {
|
|
second: '',
|
|
second: '',
|
|
minute: '',
|
|
minute: '',
|
|
@@ -344,7 +344,7 @@ export default defineComponent({
|
|
day: '',
|
|
day: '',
|
|
month: '',
|
|
month: '',
|
|
Week: '',
|
|
Week: '',
|
|
- year: ''
|
|
|
|
|
|
+ // year: ''
|
|
},
|
|
},
|
|
text: computed(() => Language[state.language || 'cn']),
|
|
text: computed(() => Language[state.language || 'cn']),
|
|
secondsText: computed(() => {
|
|
secondsText: computed(() => {
|
|
@@ -504,32 +504,32 @@ export default defineComponent({
|
|
}
|
|
}
|
|
return months;
|
|
return months;
|
|
}),
|
|
}),
|
|
- yearsText: computed(() => {
|
|
|
|
- let years = '';
|
|
|
|
- let cronEvery = state.year.cronEvery;
|
|
|
|
- switch (cronEvery.toString()) {
|
|
|
|
- case '1':
|
|
|
|
- years = '*';
|
|
|
|
- break;
|
|
|
|
- case '2':
|
|
|
|
- years = state.year.incrementStart + '/' + state.year.incrementIncrement;
|
|
|
|
- break;
|
|
|
|
- case '3':
|
|
|
|
- state.year.specificSpecific.map(val => {
|
|
|
|
- years += val + ',';
|
|
|
|
- });
|
|
|
|
- years = years.slice(0, -1);
|
|
|
|
- break;
|
|
|
|
- case '4':
|
|
|
|
- years = state.year.rangeStart + '-' + state.year.rangeEnd;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- return years;
|
|
|
|
- }),
|
|
|
|
|
|
+ // yearsText: computed(() => {
|
|
|
|
+ // let years = '';
|
|
|
|
+ // let cronEvery = state.year.cronEvery;
|
|
|
|
+ // switch (cronEvery.toString()) {
|
|
|
|
+ // case '1':
|
|
|
|
+ // years = '*';
|
|
|
|
+ // break;
|
|
|
|
+ // case '2':
|
|
|
|
+ // years = state.year.incrementStart + '/' + state.year.incrementIncrement;
|
|
|
|
+ // break;
|
|
|
|
+ // case '3':
|
|
|
|
+ // state.year.specificSpecific.map(val => {
|
|
|
|
+ // years += val + ',';
|
|
|
|
+ // });
|
|
|
|
+ // years = years.slice(0, -1);
|
|
|
|
+ // break;
|
|
|
|
+ // case '4':
|
|
|
|
+ // years = state.year.rangeStart + '-' + state.year.rangeEnd;
|
|
|
|
+ // break;
|
|
|
|
+ // }
|
|
|
|
+ // return years;
|
|
|
|
+ // }),
|
|
cron: computed(() => {
|
|
cron: computed(() => {
|
|
|
|
|
|
let cron = `${state.secondsText || '*'} ${state.minutesText || '*'} ${state.hoursText || '*'} ${state.daysText || '*'
|
|
let cron = `${state.secondsText || '*'} ${state.minutesText || '*'} ${state.hoursText || '*'} ${state.daysText || '*'
|
|
- } ${state.monthsText || '*'} ${state.weeksText || '?'} ${state.yearsText || '*'}`;
|
|
|
|
|
|
+ } ${state.monthsText || '*'} ${state.weeksText || '?'}`;
|
|
|
|
|
|
return cron
|
|
return cron
|
|
})
|
|
})
|