This commit is contained in:
2019-07-17 23:37:09 +00:00
parent c7fdde0b7b
commit c9b935e03d

View File

@@ -13,11 +13,13 @@
</div> </div>
<hr /> <hr />
<div> <div>
<template v-for="item in this.$store.state.formCustomTemplate[formKey]"> <v-layout align-center justify-left row wrap>
<span :key="item.fld"> <template v-for="item in this.$store.state.formCustomTemplate[formKey]">
[{{ item.type }}] <v-flex v-if="item.type" :key="item.fld" xs12 sm6 lg4 xl3 px-2>
</span> [{{ item.type }}]
</template> </v-flex>
</template>
</v-layout>
</div> </div>
</div> </div>
</template> </template>
@@ -31,8 +33,15 @@
* TODO: have the template, have the custom field data, now just need to show it all properly and update the fragment of json when changes made which then updates the * TODO: have the template, have the custom field data, now just need to show it all properly and update the fragment of json when changes made which then updates the
* parent object. * parent object.
* *
* 1) read the template * 1) read the template, extract out only the Custom fields, use pattern XXXXCustomXXX to match? Nope, if it has a "type" then it's custom for sure.
*
* 2) Generate the controls dynamically based on the template * 2) Generate the controls dynamically based on the template
* Possible types are:
* ret.Add(AyDataType.Date);
ret.Add(AyDataType.Text);
ret.Add(AyDataType.Integer);
ret.Add(AyDataType.Bool);
ret.Add(AyDataType.Decimal);
* 3) bind to the data somehow (might have to warp the data to fit the controls in some cases due to changed template design) * 3) bind to the data somehow (might have to warp the data to fit the controls in some cases due to changed template design)
* 4) Profit$ * 4) Profit$
* *
@@ -70,7 +79,7 @@ export default {
}, },
created() { created() {
if (this.$gzdevmode()) { if (this.$gzdevmode()) {
debugger; //debugger;
if (!this.formKey) { if (!this.formKey) {
throw "custom-fields-control: formKey property is required and missing"; throw "custom-fields-control: formKey property is required and missing";
} }