This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* Xeslint-disable */
|
||||
/* eslint-disable */
|
||||
///////////////////////////////
|
||||
// GZVALIDATE
|
||||
//
|
||||
@@ -23,15 +23,8 @@ function isEmpty(o) {
|
||||
//
|
||||
function getControl(v, ref) {
|
||||
var ctrl = v.$refs[ref];
|
||||
if (errorHandler.developmentModeShowErrorsImmediately) {
|
||||
if (isEmpty(ctrl)) {
|
||||
throw "GZValidate:getControl - the control has no label " + ctrl;
|
||||
}
|
||||
} else {
|
||||
if (isEmpty(ctrl)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return ctrl;
|
||||
}
|
||||
|
||||
////////////////////////////////////
|
||||
@@ -65,7 +58,7 @@ export default {
|
||||
//
|
||||
Required(v, ref) {
|
||||
var ctrl = getControl(v, ref);
|
||||
if (!ctrl) {
|
||||
if(typeof ctrl == 'undefined'){
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -87,7 +80,7 @@ export default {
|
||||
//
|
||||
MaxLength(v, ref, max) {
|
||||
var ctrl = getControl(v, ref);
|
||||
if (!ctrl) {
|
||||
if(typeof ctrl == 'undefined'){
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -148,32 +141,25 @@ export default {
|
||||
// AFTER
|
||||
After(v, refStart, refEnd) {
|
||||
var ctrlStart = getControl(v, refStart);
|
||||
if (!ctrlStart) {
|
||||
if(typeof ctrlStart == 'undefined'){
|
||||
return false;
|
||||
}
|
||||
|
||||
var ctrlEnd = getControl(v, refEnd);
|
||||
if (!ctrlEnd) {
|
||||
if(typeof ctrlEnd == 'undefined'){
|
||||
return false;
|
||||
}
|
||||
|
||||
var valueStart = getControlValue(ctrlStart);
|
||||
if (!isEmpty(valueStart)) {
|
||||
if (isEmpty(valueStart)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var valueEnd = getControlValue(ctrlEnd);
|
||||
if (!isEmpty(valueEnd)) {
|
||||
if (isEmpty(valueEnd)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_.isEmpty(valueStart)) {
|
||||
return false;
|
||||
}
|
||||
if (_.isEmpty(valueEnd)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
valueStart = dayjs(valueStart);
|
||||
valueEnd = dayjs(valueEnd);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
v-model="obj.name"
|
||||
:counter="255"
|
||||
:label="this.$gzlocale.get('WidgetName')"
|
||||
:rules="[this.$gzv.Max255(this,'WidgetName')]"
|
||||
:rules="[this.$gzv.Max255(this,'name')]"
|
||||
ref="name"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
@@ -17,7 +17,7 @@
|
||||
v-model="obj.serial"
|
||||
:counter="10"
|
||||
:label="this.$gzlocale.get('WidgetSerial')"
|
||||
:rules="[this.$gzv.MaxLength(this,'WidgetSerial',10)]"
|
||||
:rules="[this.$gzv.MaxLength(this,'serial',10)]"
|
||||
ref="serial"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
@@ -27,7 +27,6 @@
|
||||
:counter="10"
|
||||
:label="this.$gzlocale.get('WidgetCount')"
|
||||
ref="count"
|
||||
name="count"
|
||||
:rules="[this.$gzv.Required(this,'count')]"
|
||||
required
|
||||
></v-text-field>
|
||||
@@ -47,7 +46,7 @@
|
||||
<gz-date-time-picker
|
||||
:label="this.$gzlocale.get('WidgetStartDate')"
|
||||
v-model="obj.startDate"
|
||||
name="startDate"
|
||||
ref="startDate"
|
||||
></gz-date-time-picker>
|
||||
</v-flex>
|
||||
|
||||
@@ -56,14 +55,14 @@
|
||||
:label="this.$gzlocale.get('WidgetEndDate')"
|
||||
:rules="[this.$gzv.After(this,'startDate','endDate')]"
|
||||
v-model="obj.endDate"
|
||||
name="endDate"
|
||||
ref="endDate"
|
||||
></gz-date-time-picker>
|
||||
</v-flex>
|
||||
<v-flex xs12 sm6 lg4 xl3 px-2>
|
||||
<v-checkbox
|
||||
v-model="obj.active"
|
||||
:label="this.$gzlocale.get('Active')"
|
||||
name="checkbox"
|
||||
ref="active"
|
||||
required
|
||||
></v-checkbox>
|
||||
</v-flex>
|
||||
|
||||
Reference in New Issue
Block a user