// 组装loadOptions参数
const filterOptions = function(options) {
  const { tabId, id, saveParams, loadType, component, loadMode, path, originGroupId } = options;
  const keyCodes = [
    'id',
    'scopeId',
    'href',
    'url',
    'component',
    'children',
    'moduleName',
    'extraParams',
    'cacheParams',
    'pScopeId',
    'containerId',
    'loadType',
    'applCode',
    'groupId',
    'originGroupId',
    'singleMode',
    'zoom',
    'cache',
    'forceExtraUrl',
  ];
  if (saveParams) {
    options.cacheParams = Eui.getCacheParams(
      loadType === 'W' ? tabId : id,
      loadType,
      originGroupId,
    );
  }
  return Eui.Extra.filterDataByKey(options, keyCodes);
};
const transformOptions = function (options) {
  const { tabId = Eui.getTabId(), id, loadType = 'M', cache, forceExtraUrl } = options || {};
  return tabId
    ? {
        containerId: loadType === 'M' ? id : tabId,
        loadType: 'M',
        scopeId: Eui.getScopeId(tabId),
        ...options,
        tabId,
      }
    : options;
};

export { filterOptions, transformOptions };