1、重置功能,解决需要多次重置回复到原始状态(选择条件(0 0 0 0 0 1-2 ),需要点击3次重置,才能重置到( * * * * ?)
2、删除表达式自动填充功能,每一项都需要用户自行填写,不支持自动修改
This commit is contained in:
parent
7acb128111
commit
cfdd623179
@ -1,180 +1,184 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form size="small">
|
<el-form size="small">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="1">
|
<el-radio v-model='radioValue' :label="1">
|
||||||
日,允许的通配符[, - * / L M]
|
日,允许的通配符[, - * / L M]
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="2">
|
<el-radio v-model='radioValue' :label="2">
|
||||||
不指定
|
不指定
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="3">
|
<el-radio v-model='radioValue' :label="3">
|
||||||
周期从
|
周期从
|
||||||
<el-input-number v-model='cycle01' :min="0" :max="31"/>
|
<el-input-number v-model='cycle01' :min="0" :max="31"/>
|
||||||
-
|
-
|
||||||
<el-input-number v-model='cycle02' :min="0" :max="31"/>
|
<el-input-number v-model='cycle02' :min="0" :max="31"/>
|
||||||
日
|
日
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="4">
|
<el-radio v-model='radioValue' :label="4">
|
||||||
从
|
从
|
||||||
<el-input-number v-model='average01' :min="0" :max="31"/>
|
<el-input-number v-model='average01' :min="0" :max="31"/>
|
||||||
号开始,每
|
号开始,每
|
||||||
<el-input-number v-model='average02' :min="0" :max="31"/>
|
<el-input-number v-model='average02' :min="0" :max="31"/>
|
||||||
日执行一次
|
日执行一次
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="5">
|
<el-radio v-model='radioValue' :label="5">
|
||||||
每月
|
每月
|
||||||
<el-input-number v-model='workday' :min="0" :max="31"/>
|
<el-input-number v-model='workday' :min="0" :max="31"/>
|
||||||
号最近的那个工作日
|
号最近的那个工作日
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="6">
|
<el-radio v-model='radioValue' :label="6">
|
||||||
本月最后一天
|
本月最后一天
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="7">
|
<el-radio v-model='radioValue' :label="7">
|
||||||
指定
|
指定
|
||||||
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
|
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%"
|
||||||
<el-option v-for="item in 31" :key="item" :value="item">{{ item }}</el-option>
|
@change="selectChange">
|
||||||
</el-select>
|
<el-option v-for="item in 31" :key="item" :value="item">{{ item }}</el-option>
|
||||||
</el-radio>
|
</el-select>
|
||||||
</el-form-item>
|
</el-radio>
|
||||||
</el-form>
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
radioValue: 1,
|
radioValue: 1,
|
||||||
workday: 1,
|
workday: 1,
|
||||||
cycle01: 1,
|
cycle01: 1,
|
||||||
cycle02: 2,
|
cycle02: 2,
|
||||||
average01: 1,
|
average01: 1,
|
||||||
average02: 1,
|
average02: 1,
|
||||||
checkboxList: [],
|
checkboxList: [],
|
||||||
checkNum: this.$options.propsData.check
|
checkNum: this.$options.propsData.check
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
name: 'crontab-day',
|
name: 'crontab-day',
|
||||||
props: ['check', 'cron'],
|
props: ['check', 'cron'],
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
selectChange() {
|
||||||
this.workday = 1
|
this.radioValue = 7
|
||||||
this.cycle01 = 1
|
},
|
||||||
this.cycle02 = 2
|
init() {
|
||||||
this.average01 = 1
|
this.workday = 1
|
||||||
this.average02 = 1
|
this.cycle01 = 1
|
||||||
this.checkboxList = []
|
this.cycle02 = 2
|
||||||
},
|
this.average01 = 1
|
||||||
// 单选按钮值变化时
|
this.average02 = 1
|
||||||
radioChange() {
|
this.checkboxList = []
|
||||||
('day rachange');
|
},
|
||||||
if (this.radioValue === 1) {
|
// 单选按钮值变化时
|
||||||
this.$emit('update', 'day', '*', 'day');
|
radioChange() {
|
||||||
}
|
('day rachange');
|
||||||
|
if (this.radioValue === 1) {
|
||||||
|
this.$emit('update', 'day', '*', 'day');
|
||||||
|
}
|
||||||
|
|
||||||
switch (this.radioValue) {
|
switch (this.radioValue) {
|
||||||
case 2:
|
case 2:
|
||||||
this.$emit('update', 'day', '?');
|
this.$emit('update', 'day', '?');
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
this.$emit('update', 'day', this.cycle01 + '-' + this.cycle02);
|
this.$emit('update', 'day', this.cycle01 + '-' + this.cycle02);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
this.$emit('update', 'day', this.average01 + '/' + this.average02);
|
this.$emit('update', 'day', this.average01 + '/' + this.average02);
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
this.$emit('update', 'day', this.workday + 'W');
|
this.$emit('update', 'day', this.workday + 'W');
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
this.$emit('update', 'day', 'L');
|
this.$emit('update', 'day', 'L');
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
this.$emit('update', 'day', this.checkboxString);
|
this.$emit('update', 'day', this.checkboxString);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
('day rachange end');
|
('day rachange end');
|
||||||
},
|
},
|
||||||
// 周期两个值变化时
|
// 周期两个值变化时
|
||||||
cycleChange() {
|
cycleChange() {
|
||||||
if (this.radioValue == '3') {
|
if (this.radioValue == '3') {
|
||||||
this.$emit('update', 'day', this.cycleTotal);
|
this.$emit('update', 'day', this.cycleTotal);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 平均两个值变化时
|
// 平均两个值变化时
|
||||||
averageChange() {
|
averageChange() {
|
||||||
if (this.radioValue == '4') {
|
if (this.radioValue == '4') {
|
||||||
this.$emit('update', 'day', this.averageTotal);
|
this.$emit('update', 'day', this.averageTotal);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 最近工作日值变化时
|
// 最近工作日值变化时
|
||||||
workdayChange() {
|
workdayChange() {
|
||||||
if (this.radioValue == '5') {
|
if (this.radioValue == '5') {
|
||||||
this.$emit('update', 'day', this.workday + 'W');
|
this.$emit('update', 'day', this.workday + 'W');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// checkbox值变化时
|
// checkbox值变化时
|
||||||
checkboxChange() {
|
checkboxChange() {
|
||||||
if (this.radioValue == '7') {
|
if (this.radioValue == '7') {
|
||||||
this.$emit('update', 'day', this.checkboxString);
|
this.$emit('update', 'day', this.checkboxString);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 父组件传递的week发生变化触发
|
// 父组件传递的week发生变化触发
|
||||||
weekChange() {
|
weekChange() {
|
||||||
//判断week值与day不能同时为“?”
|
//判断week值与day不能同时为“?”
|
||||||
if (this.cron.week == '?' && this.radioValue == '2') {
|
if (this.cron.week == '?' && this.radioValue == '2') {
|
||||||
this.radioValue = '1';
|
this.radioValue = '1';
|
||||||
} else if (this.cron.week !== '?' && this.radioValue != '2') {
|
} else if (this.cron.week !== '?' && this.radioValue != '2') {
|
||||||
this.radioValue = '2';
|
this.radioValue = '2';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
"radioValue": "radioChange",
|
"radioValue": "radioChange",
|
||||||
'cycleTotal': 'cycleChange',
|
'cycleTotal': 'cycleChange',
|
||||||
'averageTotal': 'averageChange',
|
'averageTotal': 'averageChange',
|
||||||
'workdayCheck': 'workdayChange',
|
'workdayCheck': 'workdayChange',
|
||||||
'checkboxString': 'checkboxChange',
|
'checkboxString': 'checkboxChange',
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
// 计算两个周期值
|
// 计算两个周期值
|
||||||
cycleTotal: function () {
|
cycleTotal: function () {
|
||||||
this.cycle01 = this.checkNum(this.cycle01, 1, 31)
|
this.cycle01 = this.checkNum(this.cycle01, 1, 31)
|
||||||
this.cycle02 = this.checkNum(this.cycle02, 1, 31)
|
this.cycle02 = this.checkNum(this.cycle02, 1, 31)
|
||||||
return this.cycle01 + '-' + this.cycle02;
|
return this.cycle01 + '-' + this.cycle02;
|
||||||
},
|
},
|
||||||
// 计算平均用到的值
|
// 计算平均用到的值
|
||||||
averageTotal: function () {
|
averageTotal: function () {
|
||||||
this.average01 = this.checkNum(this.average01, 1, 31)
|
this.average01 = this.checkNum(this.average01, 1, 31)
|
||||||
this.average02 = this.checkNum(this.average02, 1, 31)
|
this.average02 = this.checkNum(this.average02, 1, 31)
|
||||||
return this.average01 + '/' + this.average02;
|
return this.average01 + '/' + this.average02;
|
||||||
},
|
},
|
||||||
// 计算工作日格式
|
// 计算工作日格式
|
||||||
workdayCheck: function () {
|
workdayCheck: function () {
|
||||||
this.workday = this.checkNum(this.workday, 1, 31)
|
this.workday = this.checkNum(this.workday, 1, 31)
|
||||||
return this.workday;
|
return this.workday;
|
||||||
},
|
},
|
||||||
// 计算勾选的checkbox值合集
|
// 计算勾选的checkbox值合集
|
||||||
checkboxString: function () {
|
checkboxString: function () {
|
||||||
let str = this.checkboxList.join();
|
let str = this.checkboxList.join();
|
||||||
return str == '' ? '*' : str;
|
return str == '' ? '*' : str;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,125 +1,129 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form size="small">
|
<el-form size="small">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="1">
|
<el-radio v-model='radioValue' :label="1">
|
||||||
小时,允许的通配符[, - * /]
|
小时,允许的通配符[, - * /]
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="2">
|
<el-radio v-model='radioValue' :label="2">
|
||||||
周期从
|
周期从
|
||||||
<el-input-number v-model='cycle01' :min="0" :max="60"/>
|
<el-input-number v-model='cycle01' :min="0" :max="60"/>
|
||||||
-
|
-
|
||||||
<el-input-number v-model='cycle02' :min="0" :max="60"/>
|
<el-input-number v-model='cycle02' :min="0" :max="60"/>
|
||||||
小时
|
小时
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="3">
|
<el-radio v-model='radioValue' :label="3">
|
||||||
从
|
从
|
||||||
<el-input-number v-model='average01' :min="0" :max="60"/>
|
<el-input-number v-model='average01' :min="0" :max="60"/>
|
||||||
小时开始,每
|
小时开始,每
|
||||||
<el-input-number v-model='average02' :min="0" :max="60"/>
|
<el-input-number v-model='average02' :min="0" :max="60"/>
|
||||||
小时执行一次
|
小时执行一次
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="4">
|
<el-radio v-model='radioValue' :label="4">
|
||||||
指定
|
指定
|
||||||
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
|
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%"
|
||||||
<el-option v-for="item in 60" :key="item" :value="item-1">{{ item - 1 }}</el-option>
|
@change="selectChange">
|
||||||
</el-select>
|
<el-option v-for="item in 60" :key="item" :value="item-1">{{ item - 1 }}</el-option>
|
||||||
</el-radio>
|
</el-select>
|
||||||
</el-form-item>
|
</el-radio>
|
||||||
</el-form>
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
radioValue: 1,
|
radioValue: 1,
|
||||||
cycle01: 0,
|
cycle01: 0,
|
||||||
cycle02: 1,
|
cycle02: 1,
|
||||||
average01: 0,
|
average01: 0,
|
||||||
average02: 1,
|
average02: 1,
|
||||||
checkboxList: [],
|
checkboxList: [],
|
||||||
checkNum: this.$options.propsData.check
|
checkNum: this.$options.propsData.check
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
name: 'crontab-hour',
|
name: 'crontab-hour',
|
||||||
props: ['check', 'cron'],
|
props: ['check', 'cron'],
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
selectChange() {
|
||||||
this.cycle01 = 0
|
this.radioValue = 4
|
||||||
this.cycle02 = 1
|
},
|
||||||
this.average01 = 0
|
init() {
|
||||||
this.average02 = 1
|
this.cycle01 = 0
|
||||||
this.checkboxList = []
|
this.cycle02 = 1
|
||||||
},
|
this.average01 = 0
|
||||||
// 单选按钮值变化时
|
this.average02 = 1
|
||||||
radioChange() {
|
this.checkboxList = []
|
||||||
if (this.radioValue === 1) {
|
},
|
||||||
this.$emit('update', 'hour', '*', 'hour');
|
// 单选按钮值变化时
|
||||||
}
|
radioChange() {
|
||||||
switch (this.radioValue) {
|
if (this.radioValue === 1) {
|
||||||
case 2:
|
this.$emit('update', 'hour', '*', 'hour');
|
||||||
this.$emit('update', 'hour', this.cycle01 + '-' + this.cycle02);
|
}
|
||||||
break;
|
switch (this.radioValue) {
|
||||||
case 3:
|
case 2:
|
||||||
this.$emit('update', 'hour', this.average01 + '/' + this.average02);
|
this.$emit('update', 'hour', this.cycle01 + '-' + this.cycle02);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 3:
|
||||||
this.$emit('update', 'hour', this.checkboxString);
|
this.$emit('update', 'hour', this.average01 + '/' + this.average02);
|
||||||
break;
|
break;
|
||||||
}
|
case 4:
|
||||||
},
|
this.$emit('update', 'hour', this.checkboxString);
|
||||||
// 周期两个值变化时
|
break;
|
||||||
cycleChange() {
|
}
|
||||||
if (this.radioValue == '2') {
|
},
|
||||||
this.$emit('update', 'hour', this.cycleTotal);
|
// 周期两个值变化时
|
||||||
}
|
cycleChange() {
|
||||||
},
|
if (this.radioValue == '2') {
|
||||||
// 平均两个值变化时
|
this.$emit('update', 'hour', this.cycleTotal);
|
||||||
averageChange() {
|
}
|
||||||
if (this.radioValue == '3') {
|
},
|
||||||
this.$emit('update', 'hour', this.averageTotal);
|
// 平均两个值变化时
|
||||||
}
|
averageChange() {
|
||||||
},
|
if (this.radioValue == '3') {
|
||||||
// checkbox值变化时
|
this.$emit('update', 'hour', this.averageTotal);
|
||||||
checkboxChange() {
|
}
|
||||||
if (this.radioValue == '4') {
|
},
|
||||||
this.$emit('update', 'hour', this.checkboxString);
|
// checkbox值变化时
|
||||||
}
|
checkboxChange() {
|
||||||
}
|
if (this.radioValue == '4') {
|
||||||
},
|
this.$emit('update', 'hour', this.checkboxString);
|
||||||
watch: {
|
}
|
||||||
"radioValue": "radioChange",
|
}
|
||||||
'cycleTotal': 'cycleChange',
|
},
|
||||||
'averageTotal': 'averageChange',
|
watch: {
|
||||||
'checkboxString': 'checkboxChange'
|
"radioValue": "radioChange",
|
||||||
},
|
'cycleTotal': 'cycleChange',
|
||||||
computed: {
|
'averageTotal': 'averageChange',
|
||||||
// 计算两个周期值
|
'checkboxString': 'checkboxChange'
|
||||||
cycleTotal: function () {
|
},
|
||||||
this.cycle01 = this.checkNum(this.cycle01, 0, 23)
|
computed: {
|
||||||
this.cycle02 = this.checkNum(this.cycle02, 0, 23)
|
// 计算两个周期值
|
||||||
return this.cycle01 + '-' + this.cycle02;
|
cycleTotal: function () {
|
||||||
},
|
this.cycle01 = this.checkNum(this.cycle01, 0, 23)
|
||||||
// 计算平均用到的值
|
this.cycle02 = this.checkNum(this.cycle02, 0, 23)
|
||||||
averageTotal: function () {
|
return this.cycle01 + '-' + this.cycle02;
|
||||||
this.average01 = this.checkNum(this.average01, 0, 23)
|
},
|
||||||
this.average02 = this.checkNum(this.average02, 1, 23)
|
// 计算平均用到的值
|
||||||
return this.average01 + '/' + this.average02;
|
averageTotal: function () {
|
||||||
},
|
this.average01 = this.checkNum(this.average01, 0, 23)
|
||||||
// 计算勾选的checkbox值合集
|
this.average02 = this.checkNum(this.average02, 1, 23)
|
||||||
checkboxString: function () {
|
return this.average01 + '/' + this.average02;
|
||||||
let str = this.checkboxList.join();
|
},
|
||||||
return str == '' ? '*' : str;
|
// 计算勾选的checkbox值合集
|
||||||
}
|
checkboxString: function () {
|
||||||
}
|
let str = this.checkboxList.join();
|
||||||
|
return str == '' ? '*' : str;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="4">
|
<el-radio v-model='radioValue' :label="4">
|
||||||
指定
|
指定
|
||||||
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
|
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%" @change="selectChange">
|
||||||
<el-option v-for="item in 60" :key="item" :value="item-1">{{item-1}}</el-option>
|
<el-option v-for="item in 60" :key="item" :value="item-1">{{item-1}}</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-radio>
|
</el-radio>
|
||||||
@ -50,6 +50,9 @@ export default {
|
|||||||
name: 'crontab-min',
|
name: 'crontab-min',
|
||||||
props: ['check', 'cron'],
|
props: ['check', 'cron'],
|
||||||
methods: {
|
methods: {
|
||||||
|
selectChange() {
|
||||||
|
this.radioValue = 4
|
||||||
|
},
|
||||||
init() {
|
init() {
|
||||||
this.cycle01 = 1
|
this.cycle01 = 1
|
||||||
this.cycle02 = 2
|
this.cycle02 = 2
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="4">
|
<el-radio v-model='radioValue' :label="4">
|
||||||
指定
|
指定
|
||||||
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
|
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%" @change="selectChange">
|
||||||
<el-option v-for="item in 12" :key="item" :value="item">{{item}}</el-option>
|
<el-option v-for="item in 12" :key="item" :value="item">{{item}}</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-radio>
|
</el-radio>
|
||||||
@ -48,7 +48,9 @@ export default {
|
|||||||
},
|
},
|
||||||
name: 'crontab-month',
|
name: 'crontab-month',
|
||||||
props: ['check', 'cron'],
|
props: ['check', 'cron'],
|
||||||
methods: {
|
methods: { selectChange() {
|
||||||
|
this.radioValue = 4
|
||||||
|
},
|
||||||
init() {
|
init() {
|
||||||
this.cycle01 = 1
|
this.cycle01 = 1
|
||||||
this.cycle02 = 2
|
this.cycle02 = 2
|
||||||
|
@ -1,54 +1,62 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form size="small">
|
<el-form size="small">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="1">
|
<el-radio v-model='radioValue' :label="1">
|
||||||
秒,允许的通配符[, - * /]
|
秒,允许的通配符[, - * /]
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="2">
|
<el-radio v-model='radioValue' :label="2">
|
||||||
周期从
|
周期从
|
||||||
<el-input-number v-model='cycle01' :min="0" :max="60" /> -
|
<el-input-number v-model='cycle01' :min="0" :max="60"/>
|
||||||
<el-input-number v-model='cycle02' :min="0" :max="60" /> 秒
|
-
|
||||||
</el-radio>
|
<el-input-number v-model='cycle02' :min="0" :max="60"/>
|
||||||
</el-form-item>
|
秒
|
||||||
|
</el-radio>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="3">
|
<el-radio v-model='radioValue' :label="3">
|
||||||
从
|
从
|
||||||
<el-input-number v-model='average01' :min="0" :max="60" /> 秒开始,每
|
<el-input-number v-model='average01' :min="0" :max="60"/>
|
||||||
<el-input-number v-model='average02' :min="0" :max="60" /> 秒执行一次
|
秒开始,每
|
||||||
</el-radio>
|
<el-input-number v-model='average02' :min="0" :max="60"/>
|
||||||
</el-form-item>
|
秒执行一次
|
||||||
|
</el-radio>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="4">
|
<el-radio v-model='radioValue' :label="4">
|
||||||
指定
|
指定
|
||||||
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%" @change="ch">
|
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%"
|
||||||
<el-option v-for="item in 60" :key="item" :value="item-1">{{item-1}}</el-option>
|
@change="selectChange">
|
||||||
</el-select>
|
<el-option v-for="item in 60" :key="item" :value="item-1">{{ item - 1 }}</el-option>
|
||||||
</el-radio>
|
</el-select>
|
||||||
</el-form-item>
|
</el-radio>
|
||||||
</el-form>
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
radioValue: 1,
|
radioValue: 1,
|
||||||
cycle01: 1,
|
cycle01: 1,
|
||||||
cycle02: 2,
|
cycle02: 2,
|
||||||
average01: 0,
|
average01: 0,
|
||||||
average02: 1,
|
average02: 1,
|
||||||
checkboxList: [],
|
checkboxList: [],
|
||||||
checkNum: this.$options.propsData.check
|
checkNum: this.$options.propsData.check
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
name: 'crontab-second',
|
name: 'crontab-second',
|
||||||
props: ['check', 'radioParent'],
|
props: ['check', 'radioParent'],
|
||||||
methods: {
|
methods: {
|
||||||
|
selectChange() {
|
||||||
|
this.radioValue = 4
|
||||||
|
},
|
||||||
init() {
|
init() {
|
||||||
this.cycle01 = 1
|
this.cycle01 = 1
|
||||||
this.cycle02 = 2
|
this.cycle02 = 2
|
||||||
@ -56,84 +64,84 @@ export default {
|
|||||||
this.average02 = 1
|
this.average02 = 1
|
||||||
this.checkboxList = []
|
this.checkboxList = []
|
||||||
},
|
},
|
||||||
// 单选按钮值变化时
|
// 单选按钮值变化时
|
||||||
radioChange() {
|
radioChange() {
|
||||||
switch (this.radioValue) {
|
switch (this.radioValue) {
|
||||||
case 1:
|
case 1:
|
||||||
this.$emit('update', 'second', '*', 'second');
|
this.$emit('update', 'second', '*', 'second');
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
this.$emit('update', 'second', this.cycle01 + '-' + this.cycle02);
|
this.$emit('update', 'second', this.cycle01 + '-' + this.cycle02);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
this.$emit('update', 'second', this.average01 + '/' + this.average02);
|
this.$emit('update', 'second', this.average01 + '/' + this.average02);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
this.$emit('update', 'second', this.checkboxString);
|
this.$emit('update', 'second', this.checkboxString);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 周期两个值变化时
|
// 周期两个值变化时
|
||||||
cycleChange() {
|
cycleChange() {
|
||||||
if (this.radioValue == '2') {
|
if (this.radioValue == '2') {
|
||||||
this.$emit('update', 'second', this.cycleTotal);
|
this.$emit('update', 'second', this.cycleTotal);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 平均两个值变化时
|
// 平均两个值变化时
|
||||||
averageChange() {
|
averageChange() {
|
||||||
if (this.radioValue == '3') {
|
if (this.radioValue == '3') {
|
||||||
this.$emit('update', 'second', this.averageTotal);
|
this.$emit('update', 'second', this.averageTotal);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// checkbox值变化时
|
// checkbox值变化时
|
||||||
checkboxChange() {
|
checkboxChange() {
|
||||||
if (this.radioValue == '4') {
|
if (this.radioValue == '4') {
|
||||||
this.$emit('update', 'second', this.checkboxString);
|
this.$emit('update', 'second', this.checkboxString);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
othChange() {
|
othChange() {
|
||||||
// 反解析
|
// 反解析
|
||||||
let ins = this.cron.second
|
let ins = this.cron.second
|
||||||
('反解析 second', ins);
|
('反解析 second', ins);
|
||||||
if (ins === '*') {
|
if (ins === '*') {
|
||||||
this.radioValue = 1;
|
this.radioValue = 1;
|
||||||
} else if (ins.indexOf('-') > -1) {
|
} else if (ins.indexOf('-') > -1) {
|
||||||
this.radioValue = 2
|
this.radioValue = 2
|
||||||
} else if (ins.indexOf('/') > -1) {
|
} else if (ins.indexOf('/') > -1) {
|
||||||
this.radioValue = 3
|
this.radioValue = 3
|
||||||
} else {
|
} else {
|
||||||
this.radioValue = 4
|
this.radioValue = 4
|
||||||
this.checkboxList = ins.split(',')
|
this.checkboxList = ins.split(',')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
"radioValue": "radioChange",
|
"radioValue": "radioChange",
|
||||||
'cycleTotal': 'cycleChange',
|
'cycleTotal': 'cycleChange',
|
||||||
'averageTotal': 'averageChange',
|
'averageTotal': 'averageChange',
|
||||||
'checkboxString': 'checkboxChange',
|
'checkboxString': 'checkboxChange',
|
||||||
radioParent() {
|
radioParent() {
|
||||||
this.radioValue = this.radioParent
|
this.radioValue = this.radioParent
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
// 计算两个周期值
|
// 计算两个周期值
|
||||||
cycleTotal: function () {
|
cycleTotal: function () {
|
||||||
this.cycle01 = this.checkNum(this.cycle01, 0, 59)
|
this.cycle01 = this.checkNum(this.cycle01, 0, 59)
|
||||||
this.cycle02 = this.checkNum(this.cycle02, 0, 59)
|
this.cycle02 = this.checkNum(this.cycle02, 0, 59)
|
||||||
return this.cycle01 + '-' + this.cycle02;
|
return this.cycle01 + '-' + this.cycle02;
|
||||||
},
|
},
|
||||||
// 计算平均用到的值
|
// 计算平均用到的值
|
||||||
averageTotal: function () {
|
averageTotal: function () {
|
||||||
this.average01 = this.checkNum(this.average01, 0, 59)
|
this.average01 = this.checkNum(this.average01, 0, 59)
|
||||||
this.average02 = this.checkNum(this.average02, 1, 59)
|
this.average02 = this.checkNum(this.average02, 1, 59)
|
||||||
return this.average01 + '/' + this.average02;
|
return this.average01 + '/' + this.average02;
|
||||||
},
|
},
|
||||||
// 计算勾选的checkbox值合集
|
// 计算勾选的checkbox值合集
|
||||||
checkboxString: function () {
|
checkboxString: function () {
|
||||||
let str = this.checkboxList.join();
|
let str = this.checkboxList.join();
|
||||||
return str == '' ? '*' : str;
|
return str == '' ? '*' : str;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -40,7 +40,8 @@
|
|||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="6">
|
<el-radio v-model='radioValue' :label="6">
|
||||||
指定
|
指定
|
||||||
<el-select clearable v-model="checkboxDescribeList" placeholder="可多选" multiple style="width:100%">
|
<el-select clearable v-model="checkboxDescribeList" placeholder="可多选" multiple style="width:100%"
|
||||||
|
@change="selectChange">
|
||||||
<el-option v-for="(item,index) of weekList" :key="index" :value="index+1">{{ item }}</el-option>
|
<el-option v-for="(item,index) of weekList" :key="index" :value="index+1">{{ item }}</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-radio>
|
</el-radio>
|
||||||
@ -68,11 +69,16 @@ export default {
|
|||||||
name: 'crontab-week',
|
name: 'crontab-week',
|
||||||
props: ['check', 'cron'],
|
props: ['check', 'cron'],
|
||||||
methods: {
|
methods: {
|
||||||
checkChange(data) {
|
selectChange(data) {
|
||||||
|
console.log(data);
|
||||||
|
this.radioValue = 6
|
||||||
this.checkboxList = []
|
this.checkboxList = []
|
||||||
|
this.checkboxDescribeList = []
|
||||||
data.forEach(value => {
|
data.forEach(value => {
|
||||||
this.weekList.find((item, index) => {
|
this.weekList.forEach((item,index) => {
|
||||||
if (item === value) {
|
if (index+1 === value) {
|
||||||
|
console.log((item));
|
||||||
|
this.checkboxDescribeList.push(this.weekList[index])
|
||||||
this.checkboxList.push(index + 1)
|
this.checkboxList.push(index + 1)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -90,7 +96,6 @@ export default {
|
|||||||
// 单选按钮值变化时
|
// 单选按钮值变化时
|
||||||
radioChange() {
|
radioChange() {
|
||||||
|
|
||||||
|
|
||||||
switch (this.radioValue) {
|
switch (this.radioValue) {
|
||||||
case 1:
|
case 1:
|
||||||
this.$emit('update', 'week', '*');
|
this.$emit('update', 'week', '*');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user