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

export default {
  SET_LOADING(state: GlobalStateProps, val: boolean): void {
    state.showLoading = val
  },
  SET_CURRENT_VIEW(state: GlobalStateProps, val: ViewType): void {
    state.curView = val
  },
  SET_CURRENT_THEME(state: GlobalStateProps, val: ThemeType): void {
    state.curTheme = 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_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
  },
}
