feat: 添加未选择页面的空承载页.

This commit is contained in:
lijiahangmax
2024-01-12 23:28:32 +08:00
parent 720c2247c8
commit c16a461e5c
16 changed files with 176 additions and 96 deletions

View File

@@ -163,7 +163,7 @@ export const resetObject = (obj: any, ignore: string[] = []) => {
export const objectTruthKeyCount = (obj: any, ignore: string[] = []) => {
return Object.keys(obj)
.filter(s => !ignore.includes(s))
.reduce(function(acc, curr) {
.reduce(function (acc, curr) {
const currVal = obj[curr];
return acc + ~~(currVal !== undefined && currVal !== null && currVal?.length !== 0 && currVal !== '');
}, 0);
@@ -196,13 +196,20 @@ export function detectZoom() {
* 获取唯一的 UUID
*/
export function getUUID() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
const r = Math.random() * 16 | 0;
const v = c === 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
/**
* 获取会话id
*/
export const nextSessionId = (len: number): string => {
return getUUID().replaceAll('-', '').substring(0, len);
};
/**
* 清除 xss
*/