主机卡片列表.

This commit is contained in:
lijiahang
2023-10-07 18:08:31 +08:00
parent 25f2bc3040
commit d0f0c9428e
15 changed files with 203 additions and 92 deletions

View File

@@ -159,12 +159,26 @@ export function replaceNumber(value: string) {
/**
* 重设对象
*/
export const resetObject = (obj: any) => {
Object.keys(obj).forEach(k => {
export const resetObject = (obj: any, ignore: string[] = []) => {
Object.keys(obj)
.filter(s => !ignore.includes(s))
.forEach(k => {
obj[k] = undefined;
});
};
/**
* 重设对象
*/
export const objectTruthKeyCount = (obj: any, ignore: string[] = []) => {
return Object.keys(obj)
.filter(s => !ignore.includes(s))
.reduce(function(acc, curr) {
const currVal = obj[curr];
return acc + ~~(currVal !== undefined && currVal !== null && currVal?.length !== 0 && currVal !== '');
}, 0);
};
/**
* 获取当前页面的缩放值
*/