This commit is contained in:
@@ -254,6 +254,7 @@ export default {
|
|||||||
|
|
||||||
//Get the field data type
|
//Get the field data type
|
||||||
//https://lodash.com/docs#find
|
//https://lodash.com/docs#find
|
||||||
|
//de-lodash
|
||||||
// let ctrlType = window.$gz. _.find(
|
// let ctrlType = window.$gz. _.find(
|
||||||
// this.$store.state.formCustomTemplate[this.formKey],
|
// this.$store.state.formCustomTemplate[this.formKey],
|
||||||
// ["dataKey", dataKey]
|
// ["dataKey", dataKey]
|
||||||
|
|||||||
@@ -474,10 +474,13 @@ function synthesizeWorkingArray(vm) {
|
|||||||
//first, insert the templated fields into the working array so they are in current selected order
|
//first, insert the templated fields into the working array so they are in current selected order
|
||||||
for (let i = 0; i < template.length; i++) {
|
for (let i = 0; i < template.length; i++) {
|
||||||
let templateItem = template[i];
|
let templateItem = template[i];
|
||||||
let afItem = window.$gz._.find(vm.availableFields, [
|
//de-lodash
|
||||||
"fieldKey",
|
// let afItem = window.$gz. _.find(vm.availableFields, [
|
||||||
templateItem.fld
|
// "fieldKey",
|
||||||
]);
|
// templateItem.fld
|
||||||
|
// ]);
|
||||||
|
|
||||||
|
let afItem = vm.availableFields.find(z => z.fieldKey == templateItem.fld);
|
||||||
|
|
||||||
if (afItem != null) {
|
if (afItem != null) {
|
||||||
//Push into working array
|
//Push into working array
|
||||||
@@ -498,7 +501,12 @@ function synthesizeWorkingArray(vm) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//is this field already in the template and was added above?
|
//is this field already in the template and was added above?
|
||||||
if (window.$gz._.find(template, ["fld", afItem.fieldKey]) != null) {
|
//de-lodash
|
||||||
|
// if (window.$gz ._.find(template, ["fld", afItem.fieldKey]) != null) {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (template.find(z => z.fld == afItem.fieldKey) != null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -655,8 +655,19 @@ export default {
|
|||||||
filterItem.value,
|
filterItem.value,
|
||||||
item.enumType
|
item.enumType
|
||||||
);
|
);
|
||||||
|
|
||||||
//add only if not already in the collection (accidental double click)
|
//add only if not already in the collection (accidental double click)
|
||||||
if (!window.$gz._.find(item.filter.items, filterItem)) {
|
//de-lodash
|
||||||
|
// if (!window.$gz._.find(item.filter.items, filterItem)) {
|
||||||
|
|
||||||
|
//some fits better here as it only test for truthiness and returns immediately on true
|
||||||
|
//also the item is unique and display doesn't need to be compared for equality it's irrelevant
|
||||||
|
//so only the op and the value need to be checked
|
||||||
|
if (
|
||||||
|
!item.filter.items.some(
|
||||||
|
z => z.op == filterItem.op && z.value == filterItem.value
|
||||||
|
)
|
||||||
|
) {
|
||||||
item.filter.items.push(filterItem);
|
item.filter.items.push(filterItem);
|
||||||
window.$gz.form.setFormState({
|
window.$gz.form.setFormState({
|
||||||
vm: this,
|
vm: this,
|
||||||
|
|||||||
Reference in New Issue
Block a user