import type { MenuDataItem, Settings as ProSettings } from '@ant-design/pro-layout';
import { GlobalModelState } from './global';
import { UserModelState } from './user';
import type { StateType } from './login';
import type { MenuModelState } from './menu';

export { GlobalModelState, UserModelState };

export type Loading = {
  global: boolean;
  effects: Record<string, boolean | undefined>;
  models: {
    global?: boolean;
    menu?: boolean;
    setting?: boolean;
    user?: boolean;
    login?: boolean;
  };
};

export type ConnectState = {
  global: GlobalModelState;
  loading: Loading;
  settings: ProSettings;
  user: UserModelState;
  login: StateType;
  menu: MenuModelState
};

export type Route = {
  routes?: Route[];
} & MenuDataItem;

export type BehaviorRecordModel = {
  BEHAVIORRECORD_ID: number; // 用户行为记录内码
  USER_ID: number; // 用户内码
  USER_NAME: string; // 用户名称
  USER_PASSPORT: string; // 登录账户
  USER_MOBILEPHONE: string; // 手机号码
  BEHAVIORRECORD_TYPE: number; // 行为类型
  BEHAVIORRECORD_EXPLAIN: string; // 行为描述
  BEHAVIORRECORD_TIME: number; // 发生时间
  BEHAVIORRECORD_ROUT: string; // 访问路径
  BEHAVIORRECORD_ROUTNAME: string; // 页面名称
  BEHAVIORRECORD_PREROUT: string; // 前序路径
  BEHAVIORRECORD_LEAVETIME: number; // 结束时间
  BEHAVIORRECORD_DURATION: number; // 停留时长
  BEHAVIORRECORD_DESC: string; // 备注说明
}