UNPKG

xframelib

Version:

The accumulated front-end development foundation library originates from projects and serves projects.

70 lines (69 loc) 2.44 kB
import { LocationQueryRaw, Router, RouteRecordRaw } from 'vue-router'; import { RouteData } from '../model/ITypes'; import { IWidgetConfig } from '../model'; /** * 将对象添加当作参数拼接到URL上面 * @param baseUrl 需要拼接的url * @param obj 参数对象 * @returns {string} 拼接后的对象 * 例子: * let obj = {a: '3', b: '4'} * setObjToUrlParams('www.baidu.com', obj) * ==>www.baidu.com?a=3&b=4 */ export declare function ObjToUrlParams(baseUrl: string, obj: object): string; /** * 深入拷贝对象, 将target合并到src里 * @param src 原始对象 * @param target 要合并的对象 * @returns 更新后的原始对象 */ export declare function deepMerge<T = any>(src?: any, target?: any): T; /** * 新窗体打开router路由URL * @param router * @param pathURL 相对路径 * @param queryObj LocationQueryRaw对象 */ export declare function OpenRouterURL(router: Router, pathURL: string, queryObj?: LocationQueryRaw): void; /** * 获取vue的URL * @param sysURL * @returns */ export declare function getVueURL(sysURL: string): string | undefined; /** * 用于路由,获取完整的相对路由 * @param childPath * @param path * @returns */ export declare function getRouteURL(childPath?: string, path?: string): string; /** * 检查是否存在默认‘/’路由,并添加 * @param router 路由 * @param firstItem 默认权限的第一个 */ export declare function checkAddDefaultRoute(router: Router, firstItem: RouteRecordRaw): void; export declare function recursiveRoutes(components: Record<string, unknown>): Array<RouteRecordRaw>; /** * 递归过滤其他的对象 * @param components * @param orderIndex 是否需要排序 * @returns */ export declare function globFilterObjects<T>(components: Record<string, unknown>, orderIndex?: boolean): Array<T>; export declare function globFilterObjectsOld<T>(components: Record<string, unknown>, orderIndex?: boolean): Array<T>; /** * 递归过滤:widgetConfig配置文件 * @param components * @returns */ export declare function globFilterLayoutWidgetConfig(components: Record<string, unknown>, isProduct?: boolean): Map<string, Array<IWidgetConfig>>; /** * 根据路由路由配置记录,获取RouteData * @param configRouteItem 路由配置记录 * @param startPath 起始路径 * @returns */ export declare function getTabRouteData(configRouteItem: RouteRecordRaw, startPath?: string): RouteData;