mirror of
https://github.com/tenrok/vue-cron-editor-bootstrap.git
synced 2026-06-11 18:12:27 +03:00
Some bug fixes and layout changes (#5)
* Fixed bug when change the cronExpression outside the component * Increase the size of all inputs. Co-authored-by: Alex Freitas <afreitas@jbssa.com>
This commit is contained in:
+22
-11
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+22
-11
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+2
-2
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vue-cron-editor-bootstrap",
|
||||
"version": "0.1.8",
|
||||
"version": "0.1.9",
|
||||
"private": false,
|
||||
"main": "dist/vueCronEditorBootstrap.umd.js",
|
||||
"module": "dist/vueCronEditorBootstrap.esm.js",
|
||||
|
||||
+1
-3
@@ -14,9 +14,7 @@
|
||||
|
||||
<script>
|
||||
import VueCronEditorBootstrap from "./VueCronEditorBootstrap.vue";
|
||||
import {
|
||||
BFormInput
|
||||
} from "bootstrap-vue";
|
||||
import { BFormInput } from "bootstrap-vue";
|
||||
export default {
|
||||
name: "App",
|
||||
components: {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<b-form-input
|
||||
type="number"
|
||||
v-model="editorData.minuteInterval"
|
||||
v-bind:style="{ width: '50px' }"
|
||||
v-bind:style="{ width: '80px' }"
|
||||
/>
|
||||
<label class="mr-sm-2 ml-sm-2">{{ _$t("mminutes") }}</label>
|
||||
</b-form>
|
||||
@@ -19,7 +19,7 @@
|
||||
<b-form-input
|
||||
type="number"
|
||||
v-model="editorData.hourInterval"
|
||||
v-bind:style="{ width: '50px' }"
|
||||
v-bind:style="{ width: '80px' }"
|
||||
/>
|
||||
<label class="mr-sm-2 ml-sm-2">{{
|
||||
_$t("hoursOnMinute")
|
||||
@@ -29,7 +29,7 @@
|
||||
max="59"
|
||||
min="0"
|
||||
v-model="editorData.minutes"
|
||||
v-bind:style="{ width: '50px' }"
|
||||
v-bind:style="{ width: '80px' }"
|
||||
/>
|
||||
</b-form>
|
||||
</b-col>
|
||||
@@ -43,15 +43,14 @@
|
||||
<b-form-input
|
||||
type="number"
|
||||
v-model="editorData.dayInterval"
|
||||
v-bind:style="{ width: '50px' }"
|
||||
v-bind:style="{ width: '80px' }"
|
||||
/>
|
||||
<label class="mr-sm-2 ml-sm-2">{{
|
||||
_$t("daysAt")
|
||||
}}</label>
|
||||
<b-form-timepicker
|
||||
value="dateTime"
|
||||
:value="dateTime"
|
||||
:hour12="false"
|
||||
v-model="editorData.time"
|
||||
@input="setDateTime"
|
||||
/>
|
||||
</b-form>
|
||||
@@ -67,45 +66,55 @@
|
||||
value="0"
|
||||
class="mr-sm-2"
|
||||
v-model="editorData.days"
|
||||
switch
|
||||
>{{ _$t("sun") }}</b-form-checkbox
|
||||
>
|
||||
<b-form-checkbox
|
||||
value="1"
|
||||
class="mr-sm-2"
|
||||
v-model="editorData.days"
|
||||
switch
|
||||
>{{ _$t("mon") }}</b-form-checkbox
|
||||
>
|
||||
<b-form-checkbox
|
||||
value="2"
|
||||
class="mr-sm-2"
|
||||
v-model="editorData.days"
|
||||
switch
|
||||
>{{ _$t("tue") }}</b-form-checkbox
|
||||
>
|
||||
<b-form-checkbox
|
||||
value="3"
|
||||
class="mr-sm-2"
|
||||
v-model="editorData.days"
|
||||
switch
|
||||
>{{ _$t("wed") }}</b-form-checkbox
|
||||
>
|
||||
<b-form-checkbox
|
||||
value="4"
|
||||
class="mr-sm-2"
|
||||
v-model="editorData.days"
|
||||
switch
|
||||
>{{ _$t("thu") }}</b-form-checkbox
|
||||
>
|
||||
<b-form-checkbox
|
||||
value="5"
|
||||
class="mr-sm-2"
|
||||
v-model="editorData.days"
|
||||
switch
|
||||
>{{ _$t("fri") }}</b-form-checkbox
|
||||
>
|
||||
<b-form-checkbox value="6" v-model="editorData.days">{{
|
||||
_$t("sat")
|
||||
}}</b-form-checkbox>
|
||||
<b-form-checkbox
|
||||
value="6"
|
||||
v-model="editorData.days"
|
||||
switch
|
||||
>{{ _$t("sat") }}</b-form-checkbox
|
||||
>
|
||||
|
||||
<label class="mr-sm-2 ml-sm-2">{{ _$t("at") }}</label>
|
||||
<b-form-timepicker
|
||||
v-model="editorData.time"
|
||||
:value="dateTime"
|
||||
@input="setDateTime"
|
||||
:hour12="false"
|
||||
/>
|
||||
</b-form>
|
||||
@@ -120,7 +129,7 @@
|
||||
<b-form-input
|
||||
type="number"
|
||||
v-model="editorData.day"
|
||||
v-bind:style="{ width: '50px' }"
|
||||
v-bind:style="{ width: '80px' }"
|
||||
/>
|
||||
<label class="mr-sm-2 ml-sm-2">{{
|
||||
_$t("dayOfEvery")
|
||||
@@ -128,12 +137,13 @@
|
||||
<b-form-input
|
||||
type="number"
|
||||
v-model="editorData.monthInterval"
|
||||
v-bind:style="{ width: '50px' }"
|
||||
v-bind:style="{ width: '80px' }"
|
||||
/><label class="mr-sm-2 ml-sm-2">{{
|
||||
_$t("monthsAt")
|
||||
}}</label>
|
||||
<b-form-timepicker
|
||||
v-model="editorData.time"
|
||||
:value="dateTime"
|
||||
@input="setDateTime"
|
||||
:hour12="false"
|
||||
/>
|
||||
</b-form>
|
||||
@@ -208,9 +218,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
dateTime() {
|
||||
let dateTime = new Date();
|
||||
dateTime.setHours(this.editorData.hours);
|
||||
dateTime.setMinutes(this.editorData.minutes);
|
||||
let dateTime = `${this.editorData.hours}:${this.editorData.minutes}:00`;
|
||||
return dateTime;
|
||||
}
|
||||
},
|
||||
@@ -223,7 +231,7 @@ export default {
|
||||
if (e == null) {
|
||||
return;
|
||||
}
|
||||
const splittedTime = this.editorData.time.split(":");
|
||||
const splittedTime = e.split(":");
|
||||
|
||||
this.editorData.hours = splittedTime[0];
|
||||
this.editorData.minutes = splittedTime[1];
|
||||
|
||||
@@ -120,6 +120,9 @@ export default Vue.extend({
|
||||
return;
|
||||
}
|
||||
|
||||
const tabData = parseExpression(this.value);
|
||||
if (tabKey == tabData.type) return;
|
||||
|
||||
this.$data.editorData = Object.assign({}, initialData[tabKey]);
|
||||
this.__updateCronExpression(initialData[tabKey]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user