ÎļþÃû´Ó ruoyi-ui/src/components/Crontab/mouth.vue ÐÞ¸Ä |
| | |
| | | <template>
|
| | | <el-form size='small'>
|
| | | <el-form-item>
|
| | | <el-radio v-model='radioValue' :label="1">
|
| | | æï¼å
许çéé
符[, - * /]
|
| | | </el-radio>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item>
|
| | | <el-radio v-model='radioValue' :label="2">
|
| | | 卿ä»
|
| | | <el-input-number v-model='cycle01' :min="1" :max="12" /> -
|
| | | <el-input-number v-model='cycle02' :min="1" :max="12" /> æ
|
| | | </el-radio>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item>
|
| | | <el-radio v-model='radioValue' :label="3">
|
| | | ä»
|
| | | <el-input-number v-model='average01' :min="1" :max="12" /> æå¼å§ï¼æ¯
|
| | | <el-input-number v-model='average02' :min="1" :max="12" /> æææ§è¡ä¸æ¬¡
|
| | | </el-radio>
|
| | | </el-form-item>
|
| | |
|
| | | <el-form-item>
|
| | | <el-radio v-model='radioValue' :label="4">
|
| | | æå®
|
| | | <el-select clearable v-model="checkboxList" placeholder="å¯å¤é" multiple style="width:100%">
|
| | | <el-option v-for="item in 12" :key="item" :value="item">{{item}}</el-option>
|
| | | </el-select>
|
| | | </el-radio>
|
| | | </el-form-item>
|
| | | </el-form>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | radioValue: 1,
|
| | | cycle01: 1,
|
| | | cycle02: 2,
|
| | | average01: 1,
|
| | | average02: 1,
|
| | | checkboxList: [],
|
| | | checkNum: this.check
|
| | | }
|
| | | },
|
| | | name: 'crontab-mouth',
|
| | | props: ['check', 'cron'],
|
| | | methods: {
|
| | | // åéæé®å¼ååæ¶
|
| | | radioChange() {
|
| | | if (this.radioValue === 1) {
|
| | | this.$emit('update', 'mouth', '*');
|
| | | this.$emit('update', 'year', '*');
|
| | | } else {
|
| | | if (this.cron.day === '*') {
|
| | | this.$emit('update', 'day', '0', 'mouth');
|
| | | }
|
| | | if (this.cron.hour === '*') {
|
| | | this.$emit('update', 'hour', '0', 'mouth');
|
| | | }
|
| | | if (this.cron.min === '*') {
|
| | | this.$emit('update', 'min', '0', 'mouth');
|
| | | }
|
| | | if (this.cron.second === '*') {
|
| | | this.$emit('update', 'second', '0', 'mouth');
|
| | | }
|
| | | }
|
| | | switch (this.radioValue) {
|
| | | case 2:
|
| | | this.$emit('update', 'mouth', this.cycle01 + '-' + this.cycle02);
|
| | | break;
|
| | | case 3:
|
| | | this.$emit('update', 'mouth', this.average01 + '/' + this.average02);
|
| | | break;
|
| | | case 4:
|
| | | this.$emit('update', 'mouth', this.checkboxString);
|
| | | break;
|
| | | }
|
| | | },
|
| | | // å¨æä¸¤ä¸ªå¼ååæ¶
|
| | | cycleChange() {
|
| | | if (this.radioValue == '2') {
|
| | | this.$emit('update', 'mouth', this.cycleTotal);
|
| | | }
|
| | | },
|
| | | // å¹³å两个å¼ååæ¶
|
| | | averageChange() {
|
| | | if (this.radioValue == '3') {
|
| | | this.$emit('update', 'mouth', this.averageTotal);
|
| | | }
|
| | | },
|
| | | // checkboxå¼ååæ¶
|
| | | checkboxChange() {
|
| | | if (this.radioValue == '4') {
|
| | | this.$emit('update', 'mouth', this.checkboxString);
|
| | | }
|
| | | }
|
| | | },
|
| | | watch: {
|
| | | "radioValue": "radioChange",
|
| | | 'cycleTotal': 'cycleChange',
|
| | | 'averageTotal': 'averageChange',
|
| | | 'checkboxString': 'checkboxChange'
|
| | | },
|
| | | computed: {
|
| | | // 计ç®ä¸¤ä¸ªå¨æå¼
|
| | | cycleTotal: function () {
|
| | | this.cycle01 = this.checkNum(this.cycle01, 1, 12)
|
| | | this.cycle02 = this.checkNum(this.cycle02, 1, 12)
|
| | | return this.cycle01 + '-' + this.cycle02;
|
| | | },
|
| | | // 计ç®å¹³åç¨å°çå¼
|
| | | averageTotal: function () {
|
| | | this.average01 = this.checkNum(this.average01, 1, 12)
|
| | | this.average02 = this.checkNum(this.average02, 1, 12)
|
| | | return this.average01 + '/' + this.average02;
|
| | | },
|
| | | // 计ç®å¾éçcheckboxå¼åé
|
| | | checkboxString: function () {
|
| | | let str = this.checkboxList.join();
|
| | | return str == '' ? '*' : str;
|
| | | }
|
| | | }
|
| | | }
|
| | | </script> |
| | | <template> |
| | | <el-form size='small'> |
| | | <el-form-item> |
| | | <el-radio v-model='radioValue' :label="1"> |
| | | æï¼å
许çéé
符[, - * /] |
| | | </el-radio> |
| | | </el-form-item> |
| | | |
| | | <el-form-item> |
| | | <el-radio v-model='radioValue' :label="2"> |
| | | å¨æä» |
| | | <el-input-number v-model='cycle01' :min="1" :max="12" /> - |
| | | <el-input-number v-model='cycle02' :min="1" :max="12" /> æ |
| | | </el-radio> |
| | | </el-form-item> |
| | | |
| | | <el-form-item> |
| | | <el-radio v-model='radioValue' :label="3"> |
| | | ä» |
| | | <el-input-number v-model='average01' :min="1" :max="12" /> æå¼å§ï¼æ¯ |
| | | <el-input-number v-model='average02' :min="1" :max="12" /> æææ§è¡ä¸æ¬¡ |
| | | </el-radio> |
| | | </el-form-item> |
| | | |
| | | <el-form-item> |
| | | <el-radio v-model='radioValue' :label="4"> |
| | | æå® |
| | | <el-select clearable v-model="checkboxList" placeholder="å¯å¤é" multiple style="width:100%"> |
| | | <el-option v-for="item in 12" :key="item" :value="item">{{item}}</el-option> |
| | | </el-select> |
| | | </el-radio> |
| | | </el-form-item> |
| | | </el-form> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return { |
| | | radioValue: 1, |
| | | cycle01: 1, |
| | | cycle02: 2, |
| | | average01: 1, |
| | | average02: 1, |
| | | checkboxList: [], |
| | | checkNum: this.check |
| | | } |
| | | }, |
| | | name: 'crontab-month', |
| | | props: ['check', 'cron'], |
| | | methods: { |
| | | // åéæé®å¼ååæ¶ |
| | | radioChange() { |
| | | if (this.radioValue === 1) { |
| | | this.$emit('update', 'month', '*'); |
| | | this.$emit('update', 'year', '*'); |
| | | } else { |
| | | if (this.cron.day === '*') { |
| | | this.$emit('update', 'day', '0', 'month'); |
| | | } |
| | | if (this.cron.hour === '*') { |
| | | this.$emit('update', 'hour', '0', 'month'); |
| | | } |
| | | if (this.cron.min === '*') { |
| | | this.$emit('update', 'min', '0', 'month'); |
| | | } |
| | | if (this.cron.second === '*') { |
| | | this.$emit('update', 'second', '0', 'month'); |
| | | } |
| | | } |
| | | switch (this.radioValue) { |
| | | case 2: |
| | | this.$emit('update', 'month', this.cycle01 + '-' + this.cycle02); |
| | | break; |
| | | case 3: |
| | | this.$emit('update', 'month', this.average01 + '/' + this.average02); |
| | | break; |
| | | case 4: |
| | | this.$emit('update', 'month', this.checkboxString); |
| | | break; |
| | | } |
| | | }, |
| | | // å¨æä¸¤ä¸ªå¼ååæ¶ |
| | | cycleChange() { |
| | | if (this.radioValue == '2') { |
| | | this.$emit('update', 'month', this.cycleTotal); |
| | | } |
| | | }, |
| | | // å¹³å两个å¼ååæ¶ |
| | | averageChange() { |
| | | if (this.radioValue == '3') { |
| | | this.$emit('update', 'month', this.averageTotal); |
| | | } |
| | | }, |
| | | // checkboxå¼ååæ¶ |
| | | checkboxChange() { |
| | | if (this.radioValue == '4') { |
| | | this.$emit('update', 'month', this.checkboxString); |
| | | } |
| | | } |
| | | }, |
| | | watch: { |
| | | "radioValue": "radioChange", |
| | | 'cycleTotal': 'cycleChange', |
| | | 'averageTotal': 'averageChange', |
| | | 'checkboxString': 'checkboxChange' |
| | | }, |
| | | computed: { |
| | | // 计ç®ä¸¤ä¸ªå¨æå¼ |
| | | cycleTotal: function () { |
| | | this.cycle01 = this.checkNum(this.cycle01, 1, 12) |
| | | this.cycle02 = this.checkNum(this.cycle02, 1, 12) |
| | | return this.cycle01 + '-' + this.cycle02; |
| | | }, |
| | | // 计ç®å¹³åç¨å°çå¼ |
| | | averageTotal: function () { |
| | | this.average01 = this.checkNum(this.average01, 1, 12) |
| | | this.average02 = this.checkNum(this.average02, 1, 12) |
| | | return this.average01 + '/' + this.average02; |
| | | }, |
| | | // 计ç®å¾éçcheckboxå¼åé |
| | | checkboxString: function () { |
| | | let str = this.checkboxList.join(); |
| | | return str == '' ? '*' : str; |
| | | } |
| | | } |
| | | } |
| | | </script> |