| | |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | //没有添加锁的异步查询 |
| | | async doRequest2Async({ |
| | | url, |
| | | data, |
| | |
| | | console.log('播放暂停,销毁'); |
| | | innerAudioContext.destroy(); |
| | | }); |
| | | innerAudioContext.onStop(function() { |
| | | console.log('播放暂停,销毁'); |
| | | innerAudioContext.destroy(); |
| | | }) |
| | | |
| | | } |
| | | // playSound(e) { |
| | | // // 全局维护一个音频实例,防止缓存溢出 |
| | |
| | | return handler(key, match); |
| | | }); |
| | | } |
| | | |
| | | fieldListFilterRole({FieldList, ExcludeKeys = [] ,RoleList = null}) { |
| | | if(!RoleList) { |
| | | RoleList = [ |
| | | /^[a-zA-Z]+$/, |
| | | /id$/i |
| | | ] |
| | | } |
| | | if(!Array.isArray(RoleList)){ |
| | | return { |
| | | status: false, |
| | | data: null, |
| | | Message: "过滤字段列表失败,规则必须是数组。" |
| | | } |
| | | } |
| | | |
| | | let FieldListCache = Array(...FieldList) |
| | | |
| | | 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() |