mirror of
https://github.com/tenrok/vue-cron-editor-bootstrap.git
synced 2026-06-20 20:10:34 +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",
|
"name": "vue-cron-editor-bootstrap",
|
||||||
"version": "0.1.8",
|
"version": "0.1.9",
|
||||||
"private": false,
|
"private": false,
|
||||||
"main": "dist/vueCronEditorBootstrap.umd.js",
|
"main": "dist/vueCronEditorBootstrap.umd.js",
|
||||||
"module": "dist/vueCronEditorBootstrap.esm.js",
|
"module": "dist/vueCronEditorBootstrap.esm.js",
|
||||||
|
|||||||
+1
-3
@@ -14,9 +14,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import VueCronEditorBootstrap from "./VueCronEditorBootstrap.vue";
|
import VueCronEditorBootstrap from "./VueCronEditorBootstrap.vue";
|
||||||
import {
|
import { BFormInput } from "bootstrap-vue";
|
||||||
BFormInput
|
|
||||||
} from "bootstrap-vue";
|
|
||||||
export default {
|
export default {
|
||||||
name: "App",
|
name: "App",
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<b-form-input
|
<b-form-input
|
||||||
type="number"
|
type="number"
|
||||||
v-model="editorData.minuteInterval"
|
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>
|
<label class="mr-sm-2 ml-sm-2">{{ _$t("mminutes") }}</label>
|
||||||
</b-form>
|
</b-form>
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
<b-form-input
|
<b-form-input
|
||||||
type="number"
|
type="number"
|
||||||
v-model="editorData.hourInterval"
|
v-model="editorData.hourInterval"
|
||||||
v-bind:style="{ width: '50px' }"
|
v-bind:style="{ width: '80px' }"
|
||||||
/>
|
/>
|
||||||
<label class="mr-sm-2 ml-sm-2">{{
|
<label class="mr-sm-2 ml-sm-2">{{
|
||||||
_$t("hoursOnMinute")
|
_$t("hoursOnMinute")
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
max="59"
|
max="59"
|
||||||
min="0"
|
min="0"
|
||||||
v-model="editorData.minutes"
|
v-model="editorData.minutes"
|
||||||
v-bind:style="{ width: '50px' }"
|
v-bind:style="{ width: '80px' }"
|
||||||
/>
|
/>
|
||||||
</b-form>
|
</b-form>
|
||||||
</b-col>
|
</b-col>
|
||||||
@@ -43,15 +43,14 @@
|
|||||||
<b-form-input
|
<b-form-input
|
||||||
type="number"
|
type="number"
|
||||||
v-model="editorData.dayInterval"
|
v-model="editorData.dayInterval"
|
||||||
v-bind:style="{ width: '50px' }"
|
v-bind:style="{ width: '80px' }"
|
||||||
/>
|
/>
|
||||||
<label class="mr-sm-2 ml-sm-2">{{
|
<label class="mr-sm-2 ml-sm-2">{{
|
||||||
_$t("daysAt")
|
_$t("daysAt")
|
||||||
}}</label>
|
}}</label>
|
||||||
<b-form-timepicker
|
<b-form-timepicker
|
||||||
value="dateTime"
|
:value="dateTime"
|
||||||
:hour12="false"
|
:hour12="false"
|
||||||
v-model="editorData.time"
|
|
||||||
@input="setDateTime"
|
@input="setDateTime"
|
||||||
/>
|
/>
|
||||||
</b-form>
|
</b-form>
|
||||||
@@ -67,45 +66,55 @@
|
|||||||
value="0"
|
value="0"
|
||||||
class="mr-sm-2"
|
class="mr-sm-2"
|
||||||
v-model="editorData.days"
|
v-model="editorData.days"
|
||||||
|
switch
|
||||||
>{{ _$t("sun") }}</b-form-checkbox
|
>{{ _$t("sun") }}</b-form-checkbox
|
||||||
>
|
>
|
||||||
<b-form-checkbox
|
<b-form-checkbox
|
||||||
value="1"
|
value="1"
|
||||||
class="mr-sm-2"
|
class="mr-sm-2"
|
||||||
v-model="editorData.days"
|
v-model="editorData.days"
|
||||||
|
switch
|
||||||
>{{ _$t("mon") }}</b-form-checkbox
|
>{{ _$t("mon") }}</b-form-checkbox
|
||||||
>
|
>
|
||||||
<b-form-checkbox
|
<b-form-checkbox
|
||||||
value="2"
|
value="2"
|
||||||
class="mr-sm-2"
|
class="mr-sm-2"
|
||||||
v-model="editorData.days"
|
v-model="editorData.days"
|
||||||
|
switch
|
||||||
>{{ _$t("tue") }}</b-form-checkbox
|
>{{ _$t("tue") }}</b-form-checkbox
|
||||||
>
|
>
|
||||||
<b-form-checkbox
|
<b-form-checkbox
|
||||||
value="3"
|
value="3"
|
||||||
class="mr-sm-2"
|
class="mr-sm-2"
|
||||||
v-model="editorData.days"
|
v-model="editorData.days"
|
||||||
|
switch
|
||||||
>{{ _$t("wed") }}</b-form-checkbox
|
>{{ _$t("wed") }}</b-form-checkbox
|
||||||
>
|
>
|
||||||
<b-form-checkbox
|
<b-form-checkbox
|
||||||
value="4"
|
value="4"
|
||||||
class="mr-sm-2"
|
class="mr-sm-2"
|
||||||
v-model="editorData.days"
|
v-model="editorData.days"
|
||||||
|
switch
|
||||||
>{{ _$t("thu") }}</b-form-checkbox
|
>{{ _$t("thu") }}</b-form-checkbox
|
||||||
>
|
>
|
||||||
<b-form-checkbox
|
<b-form-checkbox
|
||||||
value="5"
|
value="5"
|
||||||
class="mr-sm-2"
|
class="mr-sm-2"
|
||||||
v-model="editorData.days"
|
v-model="editorData.days"
|
||||||
|
switch
|
||||||
>{{ _$t("fri") }}</b-form-checkbox
|
>{{ _$t("fri") }}</b-form-checkbox
|
||||||
>
|
>
|
||||||
<b-form-checkbox value="6" v-model="editorData.days">{{
|
<b-form-checkbox
|
||||||
_$t("sat")
|
value="6"
|
||||||
}}</b-form-checkbox>
|
v-model="editorData.days"
|
||||||
|
switch
|
||||||
|
>{{ _$t("sat") }}</b-form-checkbox
|
||||||
|
>
|
||||||
|
|
||||||
<label class="mr-sm-2 ml-sm-2">{{ _$t("at") }}</label>
|
<label class="mr-sm-2 ml-sm-2">{{ _$t("at") }}</label>
|
||||||
<b-form-timepicker
|
<b-form-timepicker
|
||||||
v-model="editorData.time"
|
:value="dateTime"
|
||||||
|
@input="setDateTime"
|
||||||
:hour12="false"
|
:hour12="false"
|
||||||
/>
|
/>
|
||||||
</b-form>
|
</b-form>
|
||||||
@@ -120,7 +129,7 @@
|
|||||||
<b-form-input
|
<b-form-input
|
||||||
type="number"
|
type="number"
|
||||||
v-model="editorData.day"
|
v-model="editorData.day"
|
||||||
v-bind:style="{ width: '50px' }"
|
v-bind:style="{ width: '80px' }"
|
||||||
/>
|
/>
|
||||||
<label class="mr-sm-2 ml-sm-2">{{
|
<label class="mr-sm-2 ml-sm-2">{{
|
||||||
_$t("dayOfEvery")
|
_$t("dayOfEvery")
|
||||||
@@ -128,12 +137,13 @@
|
|||||||
<b-form-input
|
<b-form-input
|
||||||
type="number"
|
type="number"
|
||||||
v-model="editorData.monthInterval"
|
v-model="editorData.monthInterval"
|
||||||
v-bind:style="{ width: '50px' }"
|
v-bind:style="{ width: '80px' }"
|
||||||
/><label class="mr-sm-2 ml-sm-2">{{
|
/><label class="mr-sm-2 ml-sm-2">{{
|
||||||
_$t("monthsAt")
|
_$t("monthsAt")
|
||||||
}}</label>
|
}}</label>
|
||||||
<b-form-timepicker
|
<b-form-timepicker
|
||||||
v-model="editorData.time"
|
:value="dateTime"
|
||||||
|
@input="setDateTime"
|
||||||
:hour12="false"
|
:hour12="false"
|
||||||
/>
|
/>
|
||||||
</b-form>
|
</b-form>
|
||||||
@@ -208,9 +218,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
dateTime() {
|
dateTime() {
|
||||||
let dateTime = new Date();
|
let dateTime = `${this.editorData.hours}:${this.editorData.minutes}:00`;
|
||||||
dateTime.setHours(this.editorData.hours);
|
|
||||||
dateTime.setMinutes(this.editorData.minutes);
|
|
||||||
return dateTime;
|
return dateTime;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -223,7 +231,7 @@ export default {
|
|||||||
if (e == null) {
|
if (e == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const splittedTime = this.editorData.time.split(":");
|
const splittedTime = e.split(":");
|
||||||
|
|
||||||
this.editorData.hours = splittedTime[0];
|
this.editorData.hours = splittedTime[0];
|
||||||
this.editorData.minutes = splittedTime[1];
|
this.editorData.minutes = splittedTime[1];
|
||||||
|
|||||||
@@ -120,6 +120,9 @@ export default Vue.extend({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const tabData = parseExpression(this.value);
|
||||||
|
if (tabKey == tabData.type) return;
|
||||||
|
|
||||||
this.$data.editorData = Object.assign({}, initialData[tabKey]);
|
this.$data.editorData = Object.assign({}, initialData[tabKey]);
|
||||||
this.__updateCronExpression(initialData[tabKey]);
|
this.__updateCronExpression(initialData[tabKey]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user