This commit is contained in:
2019-12-06 00:29:15 +00:00
parent 2ed518029e
commit d9b6952bff

View File

@@ -190,36 +190,37 @@ export default {
methods: {
lt: function(ltkey) {
return window.$gz.locale.get(ltkey);
},
canHide: function(availableFieldItem) {
//Two things can prevent allowing hide, if the template says it's required and / or if the aviailable fields record
//hideable value is false
var templateSaysRequired = false;
var availableFieldsSayHideable = true;
//first check template
var templateItem = window.$gz.formCustomTemplate.getFieldTemplateValue(
this.formCustomTemplateKey,
availableFieldItem.key
);
if (
templateItem &&
templateItem.required !== undefined &&
templateItem.required === true //it's text
) {
templateSaysRequired = true;
}
//Now check availableFields collection
if (availableFieldItem.hideable != true) {
availableFieldsSayHideable = false;
}
return (
templateSaysRequired === false && availableFieldsSayHideable === true
);
}
// ,
// canHide: function(availableFieldItem) {
// //Two things can prevent allowing hide, if the template says it's required and / or if the aviailable fields record
// //hideable value is false
// var templateSaysRequired = false;
// var availableFieldsSayHideable = true;
// //first check template
// var templateItem = window.$gz.formCustomTemplate.getFieldTemplateValue(
// this.formCustomTemplateKey,
// availableFieldItem.key
// );
// if (
// templateItem &&
// templateItem.required !== undefined &&
// templateItem.required === true //it's text
// ) {
// templateSaysRequired = true;
// }
// //Now check availableFields collection
// if (availableFieldItem.hideable != true) {
// availableFieldsSayHideable = false;
// }
// return (
// templateSaysRequired === false && availableFieldsSayHideable === true
// );
// }
}
};
@@ -289,6 +290,8 @@ function initDataObject(vm) {
templateItem = { required: false, hide: false, type: "text" };
}
// var canHide=faf.hideable && templateItem.required!==true;
var objItem = {
key: faf.key,
title: window.$gz.locale.get(faf.key),
@@ -298,6 +301,7 @@ function initDataObject(vm) {
visible: templateItem.hide !== true,
type: templateItem.type
};
//debugger;
vm.obj.push(objItem);
}