| | |
| | | if(!RoleList) { |
| | | RoleList = [ |
| | | /^[a-zA-Z]+$/, |
| | | /\bid$/i |
| | | /id$/i |
| | | ] |
| | | } |
| | | if(!Array.isArray(RoleList)){ |
| | |
| | | } |
| | | } |
| | | |
| | | let FieldListCache = Array(FieldList) |
| | | let FieldListCache = Array(...FieldList) |
| | | |
| | | let list1 = FieldListCache.filter(elem => role[0].test(elem.ColmCols)) |
| | | console.log('list1: ',list1); |
| | | // RoleList.forEach(role => { |
| | | // console.log(FieldListCache.filter(field => !role.test(field.ColmCols))) |
| | | // FieldListCache = FieldListCache.filter(field => !role.test(field.ColmCols)) |
| | | // }) |
| | | RoleList.forEach(role => { |
| | | FieldListCache = FieldListCache.filter(elem => !role.test(elem.ColmCols)) |
| | | }) |
| | | |
| | | FieldListCache = FieldListCache.filter(elem => !ExcludeKeys.includes(elem)) |
| | | return { |
| | | status: true, |
| | | data: FieldListCache, |
| | | Message: "" |
| | | } |
| | | } |
| | | |
| | | emptyValueFilter(item, fieldList){ |
| | | return fieldList.filter(e => { |
| | | return item[e.ColmCols] |
| | | }) |
| | | } |
| | | } |
| | | |
| | | export const CommonUtils = new commonUtils() |