text: import {
      reqGetTheUserName,
      reqGetQueryingUserNames,
      reqGetTheUserNameToday,
      reqGetTheUserNameWeek,
      reqGetTheUserNameMonth,
  
  } from '@/api'
  import Vue from "vue";
  const state = {
      TheUserName: [],
      QueryingUserNames: [],
  
  }
  const mutations = {
  
      GETTHEUSERNAME(state, TheUserName) {
          let ary = []
          if (TheUserName != null) {
              for (let i = 0; i < TheUserName.homeMatchResult.length;) {
  
                  if (TheUserName.homeMatchResult[i + 1] != undefined || TheUserName.homeMatchResult[i + 1] != null) {
  
                      if (TheUserName.homeMatchResult[i].id == TheUserName.homeMatchResult[i + 1].id) {
                          let obj = {
                              Name: TheUserName.homeMatchResult[i].real_name,
                              id: TheUserName.homeMatchResult[i].id,
                              status: TheUserName.homeMatchResult[i].STATUS,
                              Unread: TheUserName.homeMatchResult[i].total,
                              Settled: TheUserName.homeMatchResult[i + 1].total,
                              sum: TheUserName.homeMatchResult[i + 1].sum
                          }
                          i += 2;
                          ary.push(obj)
                      } else {
                          i++;
                      }
                  } else {
                      if (TheUserName.homeMatchResult[i].status_id == 1) {
                          let obj = {
                              Name: TheUserName.homeMatchResult[i].real_name,
                              id: TheUserName.homeMatchResult[i].id,
                              status: TheUserName.homeMatchResult[i].STATUS,
                              Unread: TheUserName.homeMatchResult[i].total,
  
                          }
                          i++
                          ary.push(obj)
                      } else if (TheUserName.homeMatchResult[i].status_id == 8) {
                          let obj = {
                              Name: TheUserName.homeMatchResult[i].real_name,
                              id: TheUserName.homeMatchResult[i].id,
                              status: TheUserName.homeMatchResult[i].STATUS,
                              Settled: TheUserName.homeMatchResult[i].total,
                              sum: TheUserName.homeMatchResult[i].sum
                          }
                          i++
                          ary.push(obj)
                      }
                  }
              }
          }
          console.log(ary);
          Vue.set(state, 'TheUserName', ary)
      },
      GETQUERYINGUSERNAMES(state, UserNames) {
          Vue.set(state, "QueryingUserNames", UserNames)
      }
  
  }
  const actions = {
      /* 月 */
      async getTheUserNameMonth({
          commit
      }, data) {
          let request = await reqGetTheUserNameMonth(data);
          commit("GETTHEUSERNAME", request)
      },
      /* 周 */
  
      async getTheUserNameWeek({
          commit
      }, data) {
          let request = await reqGetTheUserNameWeek(data);
          commit("GETTHEUSERNAME", request)
      },
      /* 今天 */
      async getTheUserNameToday({
          commit
      }, data) {
          let request = await reqGetTheUserNameToday(data);
          commit("GETTHEUSERNAME", request)
      },
      /* 有票的 */
      async getTheUserName({
          commit
      }, data) {
          let request = await reqGetTheUserName(data);
  
          commit("GETTHEUSERNAME", request)
      },
      /* 所有的 */
      async GetQueryingUserNames({
          commit
      }, data) {
          let request = await reqGetQueryingUserNames(data);
          commit("GETQUERYINGUSERNAMES", request)
      },
  }
  const getters = {
      getTheUserName(state) {
          return state.TheUserName || []
      },
      QueryingUserNames(state) {
          return state.QueryingUserNames.queryingUserNames || []
      }
  }
  
  
  export default ({
      state,
      mutations,
      actions,
      getters
  })