HUGE REFACTOR / CLEANUP

if there is a issue it's probably something in here that was changed
This commit is contained in:
2021-09-28 20:19:44 +00:00
parent 51eddfede9
commit d0afdd9855
238 changed files with 3127 additions and 8614 deletions

View File

@@ -189,10 +189,6 @@
</div>
</template>
<script>
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* XXXeslint-disable */
////////////////////////////////////////////////////////////////////////////////////////////////////////////
export default {
data() {
return {};
@@ -226,20 +222,6 @@ export default {
window.$gz.form.fieldValueChanged(this.parentVM, ref);
}
},
// templateHasVisibleCustomFields() {
// let template = this.$store.state.formCustomTemplate[this.formKey];
// console.log(
// "custom-fields-control templateHasVisibleCustomFields template=",
// template
// );
// if (template == undefined) {
// return false;
// }
// //iterate template and see if it has any custom fields set to display
// //de-lodash
// //return window.$gz. _.find(template, "type") != undefined;
// return template.find(z => z.type != undefined);
// },
GetValueForField: function(dataKey) {
let cData = {};
//get the data out of the JSON string value
@@ -254,15 +236,7 @@ export default {
// - CURRENT TIME, DATE, DATETIME are pretty specific but all use a datetime string so any value not datetime like should be nulled
// - CURRENT NUMBER, CURRENCY are also pretty specific but easy to identify if not fully numeric and then sb nulled or attempt to convert then null if not
//Get the field data type
//https://lodash.com/docs#find
//de-lodash
// let ctrlType = window.$gz. _.find(
// this.$store.state.formCustomTemplate[this.formKey],
// ["dataKey", dataKey]
// ).type;
let ctrlType = this.$store.state.formCustomTemplate[this.formKey].find(
const ctrlType = this.$store.state.formCustomTemplate[this.formKey].find(
z => z.dataKey == dataKey
).type;
@@ -307,12 +281,10 @@ export default {
ret = window.$gz.util.stringToBoolean(ret);
break;
}
//The number 1?
if (ret === 1) {
ret = true;
break;
}
//The number 0?
if (ret === 0) {
ret = false;
break;
@@ -352,18 +324,14 @@ export default {
cData[dataKey] = newValue.toString();
}
//emit the new data so it syncs with the parent source
let ret = JSON.stringify(cData);
this.$emit("input", ret);
this.$emit("input", JSON.stringify(cData));
}
},
computed: {
availableCustomFields() {
//item.type only exists for custom fields so they are the ones to return
//In addition if there is a keyStartWith then there are multiple custom field controls on same form so that's a different route to take
let template = this.$store.state.formCustomTemplate[this.formKey];
// // debugger;
// console.log("Template is: ", template);
const template = this.$store.state.formCustomTemplate[this.formKey];
if (template != undefined) {
if (this.keyStartWith != "") {