import {
  GlobalStateProps,
  ThemeType,
  ViewType,
  CommunityInfoProp,
  IssueProp,
  CombineProp,
  DutySumProp,
  DutyDataProp,
  YousubidaRankProp,
} from './index'

export default {
  SET_LOADING(state: GlobalStateProps, val: boolean): void {
    state.showLoading = val
  },
  SET_MAP_TYPE(state: GlobalStateProps, val: string): void {
    state.curMapType = val
  },
  SET_CURRENT_VIEW(state: GlobalStateProps, val: ViewType): void {
    state.curView = val
  },
  SET_CURRENT_THEME(state: GlobalStateProps, val: ThemeType): void {
    state.curTheme = val
  },
  SET_SHOW_COMMUNITY_POINTS(state: GlobalStateProps, val: boolean): void {
    state.showCommunityPoints = val
  },
  SET_PROPERTY_SUMMARY(
    state: GlobalStateProps,
    val: { [key: string]: number }
  ): void {
    state.propertySummary = val
  },
  SET_CASE_LIST(state: GlobalStateProps, data: unknown[]): void {
    state.caseList = data
  },
  SET_STATION(state: GlobalStateProps, data: { [key: string]: unknown }): void {
    state.stationInfo = data
  },
  SET_PUBLICSAFE_GATESENTRY_SHEHUIWUYE(
    // 公共安全-门岗值守-社会物业
    state: GlobalStateProps,
    data: { [key: string]: number }[]
  ): void {
    state.pubulicSafeGateSenteryShehuiwuye = data
  },
  SET_PUBLICSAFE_GATESENTRY_ZHIGUANGONGFANG(
    // 公共安全-门岗值守-直管公房
    state: GlobalStateProps,
    data: { [key: string]: number }[]
  ): void {
    state.pubulicSafeGateSenteryZhiguangongfang = data
  },
  SET_PUBLICSAFE_SAFEMAP(
    // 公共安全-平安地图
    state: GlobalStateProps,
    data: unknown[]
  ): void {
    state.pubulicSafeMap = data
  },
  SET_PUBLICSAFE_TRUE_PEOPLE(
    // 公共安全-实有人口
    state: GlobalStateProps,
    data: { [key: string]: number }
  ): void {
    state.pubulicSafeTruePeople = data
  },
  SET_PUBLICSAFE_HOUSE(
    // 公共安全-居住房屋
    state: GlobalStateProps,
    data: { [key: string]: any }
  ): void {
    state.pubulicSafeHouse = data
  },
  SET_PUBLICSAFE_NONRESIDENT(
    // 公共安全-非居房屋
    state: GlobalStateProps,
    data: { [key: string]: any }
  ): void {
    state.pubulicSafeNonResident = data
  },
  SET_PUBLICSAFE_HOUSE_STKIND(
    // 公共安全-居住房屋-stkind
    state: GlobalStateProps,
    data: { [key: string]: number }
  ): void {
    state.pubulicSafeHouseStKind = data
  },
  SET_PUBLICSAFE_TRUE_COMPANY(
    // 公共安全-实有单位
    state: GlobalStateProps,
    data: { [key: string]: any }
  ): void {
    state.pubulicSafeTrueCompany = data
  },
  SET_PUBLICSAFE_SOS_MATERIAL(
    // 公共安全-应急物资储备
    state: GlobalStateProps,
    data: { [key: string]: any }
  ): void {
    state.pubulicSafeSOSMaterail = data
  },
  SET_PUBLICSAFE_OUTHOUSEWALL(
    // 公共安全-房屋外立面
    state: GlobalStateProps,
    data: unknown[]
  ): void {
    state.pubulicSafeOutHouseWall = data
  },
  SET_PUBLICSAFE_BUILDINGS(
    // 公共安全-重点关注楼宇
    state: GlobalStateProps,
    data: unknown[]
  ): void {
    state.pubulicSafeBuildings = data
  },
  SET_PUBLICSAFE_PIEDATA(
    // 公共安全-房屋外立面饼图
    state: GlobalStateProps,
    data: unknown[]
  ): void {
    state.pubulicSafePieData = data
  },
  SET_PUBLICSAFE_NEWFIND(
    // 公共安全-最新发现数
    state: GlobalStateProps,
    data: { [key: string]: number }
  ): void {
    state.pubulicSafeNewFindNum = data
  },
  SET_PUBLICSAFE_COMMANDSYSTEM(
    // 左侧公共-指挥体系
    state: GlobalStateProps,
    data: { [key: string]: string }
  ): void {
    state.pubulicLeftCommandSystem = data
  },

  SET_PUBLICSAFE_STREETPOWER(
    // 左侧公共-网格工作站
    state: GlobalStateProps,
    data: unknown[]
  ): void {
    state.pubulicLeftStreetPower = data
  },
  SET_PUBLICSAFE_PARTY(
    // 左侧公共-党建
    state: GlobalStateProps,
    data: { [key: string]: number }
  ): void {
    state.pubulicLeftParty = data
  },
  SET_PUBLICSAFE_ECONOMIC(
    // 左侧公共-经济
    state: GlobalStateProps,
    data: { [key: string]: string }
  ): void {
    state.pubulicLeftEconomic = data
  },
  /** 小区页面 */
  SET_COMMUNITY_INFO(state: GlobalStateProps, data: CommunityInfoProp): void {
    state.communityInfo = data
  },
  SET_ISSUE_DATA(state: GlobalStateProps, data: IssueProp[]): void {
    state.issueData = data
  },
  SET_SCORE_ISSUE(state: GlobalStateProps, data: unknown): void {
    state.scoreIssue = data
  },
  SET_COMBINE_DATA(state: GlobalStateProps, data: CombineProp): void {
    state.combineData = data
  },

  /** 工作站 */
  SET_DUTY_SUM(state: GlobalStateProps, data: DutySumProp): void {
    state.dutySum = data
  },
  SET_DUTY_LIST(state: GlobalStateProps, data: { [key: string]: any }[]): void {
    state.dutyList = data
  },
  SET_DUTY_RANK(state: GlobalStateProps, data: DutyDataProp): void {
    state.dutyRank = data
  },
  SET_DUTY_EVENTS(state: GlobalStateProps, data: DutyDataProp): void {
    state.dutyEvents = data
  },
  SET_DUTY_PLACES(state: GlobalStateProps, data: DutyDataProp): void {
    state.dutyPlaces = data
  },
  SET_DUTY_RANKING(state: GlobalStateProps, data: DutyDataProp): void {
    state.dutyRanking = data
  },
  /** 公共管理 */
  // 有诉必答-占比
  SET_YOUSUBIDA_RANK(state: GlobalStateProps, data: YousubidaRankProp): void {
    state.yousubidaRank = data
  },
  // 有诉必答-分类排行
  SET_YOUSUBIDA_CLASSIFICATION_RANK(
    state: GlobalStateProps,
    data: unknown[]
  ): void {
    state.classificationRank = data
  },
  // 有诉必答-紧急案件
  SET_URGENTCASE(state: GlobalStateProps, data: unknown[]): void {
    state.urgentCase = data
  },
  // 有求必应-今日案件数
  SET_TODAYCASE(
    state: GlobalStateProps,
    data: { [key: string]: number }
  ): void {
    state.todayCase = data
  },
  // 有求必应-各阶段案件数
  SET_STAGECASE(
    state: GlobalStateProps,
    data: { [key: string]: number }
  ): void {
    state.stageCase = data
  },
  // 有求必应-工作站分类
  SET_WORKSTATION(state: GlobalStateProps, data: any[]): void {
    state.workstationKind = data
  },
  SET_WORKSTATION_PIEDATA(
    state: GlobalStateProps,
    data: { [key: string]: number }
  ): void {
    state.workstationKindPiEData = data
  },
  // 有求必应-事件跟踪
  SET_TRACKEVENT(state: GlobalStateProps, data: unknown[]): void {
    state.trackEvent = data
  },
  // 有求必应-分类排行
  SET_CASE_CLASSIFICATION_RANK(
    state: GlobalStateProps,
    data: DutyDataProp
  ): void {
    state.analysisRank = data
  },
  // 有求必应-多发地点
  SET_MOREHAPPEN_ADDR(state: GlobalStateProps, data: DutyDataProp): void {
    state.moreHappenAddr = data
  },
}
