| | |
| | | 0: { type: 'danger', key: 'common.status.disabled', bool: false } |
| | | } |
| | | |
| | | const DEFAULT_ROLE_ORDER_BY = 'create_time asc' |
| | | |
| | | export function createRoleSearchState() { |
| | | return { |
| | | name: '', |
| | | code: '', |
| | | memo: '', |
| | | status: void 0, |
| | | condition: '' |
| | | condition: '', |
| | | orderBy: DEFAULT_ROLE_ORDER_BY |
| | | } |
| | | } |
| | | |
| | |
| | | code: normalizeText(params.code), |
| | | memo: normalizeText(params.memo), |
| | | status: params.status, |
| | | condition: normalizeText(params.condition) |
| | | condition: normalizeText(params.condition), |
| | | orderBy: normalizeText(params.orderBy) || DEFAULT_ROLE_ORDER_BY |
| | | } |
| | | |
| | | return Object.fromEntries(Object.entries(searchParams).filter(([, value]) => hasValue(value))) |
| | |
| | | scopeType === 'menu' && Array.isArray(metaSource.authList) && metaSource.authList.length |
| | | ? metaSource.authList.map((auth, index) => ({ |
| | | id: normalizeScopeKey(auth.id ?? auth.authMark ?? `${node.id || 'auth'}-${index}`), |
| | | label: normalizeScopeTitle(auth.title || auth.name || auth.authMark || ''), |
| | | label: resolveScopeNodeTitle(auth), |
| | | type: 1, |
| | | isAuthButton: true, |
| | | authMark: auth.authMark || auth.authority || auth.code || '', |
| | |
| | | |
| | | return { |
| | | id: normalizeScopeKey(node.id ?? node.value), |
| | | label: normalizeScopeTitle( |
| | | node.label || node.title || node.name || metaSource.title || node.code || '' |
| | | ), |
| | | label: resolveScopeNodeTitle(node, metaSource), |
| | | type: node.type, |
| | | path: node.path || '', |
| | | component: node.component || '', |
| | |
| | | const metaSource = node.meta && typeof node.meta === 'object' ? node.meta : node |
| | | return { |
| | | id: normalizeScopeKey(node.id ?? node.value), |
| | | label: normalizeScopeTitle(node.label || node.title || node.name || metaSource.title || ''), |
| | | label: resolveScopeNodeTitle(node, metaSource), |
| | | type: 1, |
| | | isAuthButton: true, |
| | | authMark: node.authMark || metaSource.authMark || metaSource.authority || metaSource.code || '', |
| | |
| | | return trimmedTitle |
| | | } |
| | | |
| | | function resolveScopeNodeTitle(source = {}, metaSource = source) { |
| | | return normalizeScopeTitle( |
| | | source.name || |
| | | metaSource.name || |
| | | source.label || |
| | | source.title || |
| | | metaSource.title || |
| | | source.code || |
| | | metaSource.code || |
| | | source.authMark || |
| | | metaSource.authMark || |
| | | source.authority || |
| | | metaSource.authority || |
| | | '' |
| | | ) |
| | | } |
| | | |
| | | function normalizeRoleId(value) { |
| | | if (!hasValue(value)) { |
| | | return void 0 |