declare namespace API {
  interface DialogConfigDto {
    width?: number; //宽度
    title: string;
    height?: number;
    content: ReactNode;
  }

  interface CountDto {
    actualityCount: string;
    checkCount: string;
    ratio: number;
    sum: string;
  }

  interface BaseChartInfo {
    name: string;
    value: string | number;
    unit?: string;
    percent: string;
  }

  interface OptionsDto {
    label: string;
    value: string | number;
    count?: string | number;
  }

  interface CarInfoDto {
    checkedNum: number;
    inspectionNum: number;
    coverageCategoryNum: number;
    reportNum: number;
    toCheckedNum: number;
  }

  interface BaseChartInfo {
    type: DialogConfigType;
    name: string;
    value: string;
    unit: string;
    percent: string;
  }

  interface BaseInfo {
    type: DialogConfigType;
    name: string;
    value: string;
    percent: string;
    totalValue?: string;
    unit?: string;
  }

  interface DiscoveryDto {
    name: string;
    type: string;
    unit: string;
    percent: string;
    value: string;
  }

  interface CityStatisticsDto {
    bRatio: number;
    bTotal: number;
    basePreprocessingPlatform: { name: string; value: string }[];
    bcaseClosedNum: number;
    bdisposalNum: number;
    pRatio: number;
    proCaseClosedNum: number;
    promotionNum: number;
    total: number;
  }

  interface DispatchStaticDto {
    alreadyNum: number;
    pRatio: number;
    waitDisposalNum: number;
  }

  interface AccessToCenterDto {
    disposalNum: number;
    disDirectNum: number;
    backlogNum: number;
    backlogDeptNum: number;
    normalTimeNum: number;
    caseClosedNum: number;
    totalNum: number;
    timeOutNum: number;
    rate: number;
  }

  interface NameVal {
    name: string;
    value: string;
    type?: string;
  }

  interface PreprocessingDto {
    basePreprocessingPlatform: NameVal[];
    groupPreprocessingPlatform: NameVal[];
  }

  interface DispatchCenterDto {
    allocation: BaseInfo[];
    statistics: BaseInfo[];
  }

  interface CgtfNum {
    caseClosedNum: number;
    disposalNum: number;
    totalNum: number;
  }

  interface CgtfStaticDto {
    szcg: CgtfNum;
    cgtf: CgtfNum;
    yhxyw: CgtfNum;
    direct: CgtfNum;
    handle: CgtfNum;
    grid: number;
    handleUnitNum: number;
  }

  interface AcceptRulesDto {
    externalPlatform: string;
    id: string;
    newInstCondSelection: string;
    orderByNum: number;
    orderByText: string;
    collectionMode: {
      name: string;
      totalValue: string;
      type: string;
      value: string;
    };
  }

  interface AcceptRulesForm {
    codeIds: any;
    id?: number; //有编辑就传
    orderByNum: number;
    collectionModes: string; //单个
    newInstCondCodes: string; //多个，用，隔开
    eventSpecialAreaLabel: string; //多个
    autoAcceptFlag: 1;
    externalPlatform: string;
  }

  interface LabelVal {
    label: string;
    value: string | number;
  }

  interface NewInstCondDto extends LabelVal {
    children?: LabelVal[];
  }

  interface RulesOptionsDto {
    mode: LabelVal[];
    newInstCond: NewInstCondDto[];
    area: LabelVal[];
    platform: LabelVal[];
  }

  interface CulationType {
    caseClosureCriteria: unknown;
    processingTimeLimitText: string;
    circulationRecordId: string; //流转记录ID
    consumptionTimeText: string;
    disposeDeadline: string;
    createTime: string;
    string: string;
    handleRoles: string;
    eventId: string; //事件ID
    caseStatus: string; //案件状态码（10,20等
    caseStatusName: string; //案件状态名称（待受理、待预处理）
    operationType: string; //节点办理内容（上报、受理、立案等）
    detailStatus: string; //详细状态
    circulationPersonName: string; //流转人员（设备）名称
    circulationPersonId: string; //流转人员（设备）ID
    personRoles: string; //人员岗位
    personHeadPic: string; //人员头像
    personRolesCode: string; //人员岗位代码
    processingCenter: string; //办理中心
    processingCenterId: string; //办理中心ID
    contactNumber: string; //联系方式
    recordTime: string; //记录时间
    consumptionTime: string; //耗时
    consumptionTimeUnit: string; //耗时单位
    remarks: string; //备注
    limitation: string; //时效
    processingTimeLimit: string; //办理时限
    processingTimeLimitUnit: string; //办理时限单位
    signStatus: string; //签收状态（0不需要签收，1待签收，2已签收）
    signTime: string; //签收时间
    remainingTimeText?: string; //记录的超时时间，只有超时才有
    eventAttachmentInfos: any[]; //附件集合
    limitationDescription: string; //办理时效描述
  }

  interface AttachmentInfoDto {
    attachmentId: string;
    eventId: string;
    attachmentPath: string;
    fileType: string;
    attachmentType: string;
    createTime: string;
    circulationRecordId: string;
  }

  interface EventBaseDetailDto {
    eventStatus: string;
    dbzdMark:'1'|'0';//判断是否直达
    eventId: string;
    eventCollectionModeName: string;
    eventDestinationSystemName: string;
    extendAddress: string;
    informantPhone: string;
    standardEventNumber: string;
    standardEventTitle: string;
    standardEventContent: string;
    newInstCondCode: string;
    eventCollectionMode: string;
    reportTime: string;
    informantName: string;
    extendClass: string;
    timeDescription: string;
    componentCode: string;
    componentName: string;
    mainTypeCode: string;
    mainTypeName: string;
    subTypeCode: string;
    subTypeName: string;
    thirdTypeCode: string;
    thirdTypeName: string;
    cityCode: string;
    cityName: string;
    districtCode: string;
    districtName: string;
    streetCode: string;
    streetName: string;
    communityCode: string;
    communityName: string;
    address: string;
    lon: string;
    lat: string;
  }

  interface EventDetailDto {
    eventBase: EventBaseDetailDto;
    eventAttachment: {
      preHandleAttachmentInfos: AttachmentInfoDto[];
      handledAttachmentInfos: AttachmentInfoDto[];
    };
  }

  interface DispatchAllocationReq extends DealAPI.PageParmas {
    searchText?: string;
    distributionState: string; //分拨状态 0 未分拨   1,2已分拨
  }

  interface DispatchAllocationItem {
    handlingMethod: string;
    dealOverdue: ReactNode;
    eventTypeName: ReactNode;
    reportTime: any;
    eventDestinationSystemName: string | undefined;
    eventDestinationSystemCode: boolean | undefined;
    address: string;
    caseStatus: string;
    caseStatusText: string;
    disposePicPath: string;
    eventId: string;
    sourceSystem: string;
    standardEventContent: string;
    standardEventTitle: string;
    timeDescription: string;
  }

  interface ChannelItem {
    description: string;
    systemCode: string;
    systemName: string;
  }

  type CategoryDto = 'mainClass' | 'subClass' | 'subdivisionClass';
  type RegionDto = 'street' | 'community';

  interface StaticTop3Dto {
    name: string;
    percent: string;
    serialNumber: number;
    value: string;
  }

  interface SourceDto {
    activeFlag: boolean;
    code: string;
    createBy: string;
    createTime: string;
    delFlag: string;
    id: '1';
    sourceCode: string;
    sourceDescription: string;
    sourceName: string;
    sourceType: string;
    updateBy: string;
    updateTime: string;
  }

  interface EventTypeDto {
    dept: number;
    worring: number;
    important: {
      num: string;
      source_system: string;
    }[];
  }

  interface EventStatisticsReq {
    sourceSystemCode?: string;
    eventType?: any;
    type: string;
    time: string;
    isDispose?: 1; //是否处置 1.处置,状态查询处置才传，取代状态40,50,60
  }

  interface EventBaseStatistics {
    bTotal: number;
    bdisposalNum: number;
    caseClosedNum: number;
    disposalNum: number;
    lately: {
      name: string;
      value: string;
    }[];
    promotionNum: number;
    ratio: number;
    total: number;
  }

  interface CategoryAnalysisReq extends EventStatisticsReq {
    category: CategoryDto; //类别 mainClass大类，subClass小类 subdivisionClass细类
  }

  interface AreaAnalysisReq extends EventStatisticsReq {
    region: string; //district 区县 street 街道 community 社区
  }

  interface TopLineDto {
    name: string;
    percent: string; 
    value: string;
  }

  interface EventAllListReq extends EventStatisticsReq, DealAPI.PageParmas {}
}
