This commit is contained in:
2019-12-05 23:29:21 +00:00
parent cb691bda68
commit 54e6eea0ab
2 changed files with 34 additions and 1 deletions

View File

@@ -44,6 +44,14 @@ CURRENT ROADMAP
CURRENT TODOs
=-=-=-=-=-=-=
TODO: Form customization
- Init of form: synthesize a single working collection array of objects in the vue data() for the session to play with not live data
- customize form should work with a *copy* of all data and only access the store to update after successful save and on init to make copy
- When go to save then synthesize the record to send back
- Update the Store on success
- Do not add any custom fields not set to be displayed, their mere presence in teh template means they are to be displayed
TODO: FORM CUSTOMIZATION FORM
- Customize option on every form if user is logged in with BizAdminFull rights

View File

@@ -43,11 +43,13 @@
{{ item.key }}
</v-card-subtitle>
<v-checkbox
v-model="item.hideable"
v-model="getTemplateItemForField(item.key).visible"
:label="lt('FormFieldVisible')"
:ref="item.key"
:disabled="!canHide(item)"
></v-checkbox>
<v-divider></v-divider>
{{ item }}
</v-card>
</v-col>
</template>
@@ -158,6 +160,29 @@ export default {
},
canDuplicate: function() {
return this.formState.valid && !this.formState.dirty;
},
getTemplateItemForField: function(customTemplateFieldKey) {
//first check template
var templateItem = window.$gz.formCustomTemplate.getFieldTemplateValue(
this.formCustomTemplateKey,
availableFieldItem.key
);
if(templateItem==undefined){
templateItem=
}
return templateItem;
},
fullName: {
// getter
get: function() {
return this.firstName + " " + this.lastName;
},
// setter
set: function(newValue) {
var names = newValue.split(" ");
this.firstName = names[0];
this.lastName = names[names.length - 1];
}
}
},
components: {},