This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable */
|
||||
/* Xeslint-disable */
|
||||
///////////////////////////////
|
||||
// gzform
|
||||
//
|
||||
@@ -52,7 +52,6 @@ function getControl(vm, ref) {
|
||||
var customFields = vm.$refs["customFields"];
|
||||
if (customFields !== undefined) {
|
||||
ctrl = customFields.$refs[ref];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +75,7 @@ function getControlValue(ctrl) {
|
||||
// debugger;
|
||||
// if(ctrl._props){
|
||||
// var subvalue=ctrl._props;
|
||||
|
||||
|
||||
// }
|
||||
// }
|
||||
return value;
|
||||
@@ -87,13 +86,11 @@ function getControlValue(ctrl) {
|
||||
// Get field name from control
|
||||
//
|
||||
function getControlLabel(ctrl) {
|
||||
|
||||
if(ctrl.label==undefined){
|
||||
if (ctrl.label == undefined) {
|
||||
return "UNKNOWN CONTROL";
|
||||
}else{
|
||||
} else {
|
||||
return ctrl.label;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////
|
||||
@@ -151,7 +148,6 @@ function getErrorBoxErrors(vm, errs) {
|
||||
}
|
||||
|
||||
export default {
|
||||
|
||||
///////////////////////////////
|
||||
// REQUIRED
|
||||
//
|
||||
@@ -159,7 +155,7 @@ export default {
|
||||
if (vm.formState.loading) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
var ctrl = getControl(vm, ref);
|
||||
if (typeof ctrl == "undefined") {
|
||||
return false;
|
||||
@@ -169,7 +165,7 @@ export default {
|
||||
if (!isEmpty(value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// "ErrorRequiredFieldEmpty": "{0} is a required field. Please enter a value for {0}",
|
||||
var err = window.$gz.locale.get("ErrorRequiredFieldEmpty");
|
||||
var fieldName = getControlLabel(ctrl);
|
||||
@@ -344,31 +340,29 @@ export default {
|
||||
valid: false
|
||||
});
|
||||
return err;
|
||||
},
|
||||
},
|
||||
///////////////////////////////
|
||||
// CUSTOMFIELDS
|
||||
// For now the only rule is that they can be required or not
|
||||
//
|
||||
customFieldsCheck(vm, templateItem, subvm, fieldName) {
|
||||
|
||||
//templateItem sample
|
||||
// dataKey: "c2"
|
||||
// fld: "WidgetCustom2"
|
||||
// hide: "false"
|
||||
// required: "true"
|
||||
// type: "text"
|
||||
//templateItem sample
|
||||
// dataKey: "c2"
|
||||
// fld: "WidgetCustom2"
|
||||
// hide: "false"
|
||||
// required: "true"
|
||||
// type: "text"
|
||||
|
||||
if (vm.formState.loading) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if(!templateItem.required){
|
||||
if (!templateItem.required) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var value=subvm.GetValueForField(templateItem.dataKey);
|
||||
if(!isEmpty(value)){
|
||||
var value = subvm.GetValueForField(templateItem.dataKey);
|
||||
if (!isEmpty(value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user