zet-lib 1.0.86 → 1.0.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/zRoute.js +13 -4
- package/package.json +1 -1
package/lib/zRoute.js
CHANGED
|
@@ -304,15 +304,25 @@ zRoute.attributeData = async (res, MYMODEL, obj) => {
|
|
|
304
304
|
filter = null
|
|
305
305
|
}
|
|
306
306
|
attributeData.labels = MYMODEL.labels
|
|
307
|
+
invisibles = invisibles.filter(Util.arrayUnique)
|
|
308
|
+
visibles = visibles.filter(Util.arrayUnique)
|
|
309
|
+
//check custom code
|
|
310
|
+
let customs = []
|
|
311
|
+
for (var key in MYMODEL.widgets) {
|
|
312
|
+
if (MYMODEL.widgets[key].name == 'custom') {
|
|
313
|
+
customs.push(key)
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
if (customs.length) {
|
|
317
|
+
visibles = visibles.filter((item) => !customs.includes(item))
|
|
318
|
+
invisibles = invisibles.filter((item) => !customs.includes(item))
|
|
319
|
+
}
|
|
307
320
|
|
|
308
321
|
res.locals.routeName = routeName
|
|
309
322
|
res.locals.attributeData = attributeData
|
|
310
323
|
res.locals.visibles = visibles
|
|
311
324
|
res.locals.invisibles = invisibles
|
|
312
325
|
res.locals.gridFilter = filter
|
|
313
|
-
/* res.locals.visiblesObj = visibles.reduce((result, item) => {
|
|
314
|
-
return { ...result, [item]: MYMODEL.labels[item] }
|
|
315
|
-
}, [])*/
|
|
316
326
|
let visiblesObj = []
|
|
317
327
|
visibles.map((item) => {
|
|
318
328
|
visiblesObj.push({
|
|
@@ -649,7 +659,6 @@ zRoute.dataTableFilter = (MYMODEL, relations, filter) => {
|
|
|
649
659
|
let types = {}
|
|
650
660
|
let dataTable = {}
|
|
651
661
|
let options
|
|
652
|
-
console.log('fields', fields)
|
|
653
662
|
for (let key in fields) {
|
|
654
663
|
let html = ''
|
|
655
664
|
const value = filterObject.hasOwnProperty(key) ? filterObject[key] : ''
|