text: import {
      reqGetCompetitionTheTopFive,
      reqGetTeamTheTopFive,
      reqGetCompetitionTheBottom,
      reqGetTeamTheBottom,
  
      reqGetCompetitionTheTopFive2,
      reqGetTeamTheTopFive2,
      reqGetCompetitionTheBottom2,
      reqGetTeamTheBottom2,
  
      /* 今天 */
      reqGetOddsMovedTheMostOnehour,
      reqGetOddsMovedTheMostToday,
  
  
      /* 亚洲 -大小 */
      reqGetOuLargestFloating,
      reqGetAhLargestFloating,
      /* 票据 */
      reqGetgetUsersEmploy,
      reqGetTodayUsersEmploy,
      reqGetNotTheStartEmploy,
      reqGetEndUserEmploy,
      reqGetTomorrowUsersEmploy
  
  } from '@/api'
  import Vue from "vue";
  const state = {
      /* 联赛前五 */
      CompetitionTheTopFive: [],
      /* 球队前五 */
      TeamTheTopFive: [],
      /* 倒数 */
      CompetitionTheBottom: [],
      TeamTheBottom: [],
      /* 赔率一个小时内 */
      OddsMovedTheMostOnehour: [],
      OddsMovedTheMostToday: [],
      /* 用户票据 */
      UsersEmploy: [],
      OuLargestFloating: [],
      AhLargestFloating: [],
      TomorrowUsersEmploy: []
  };
  const actions = {
      /* 2021-22 */
      async getCompetitionTheTopFive({
          commit
      }, data) {
          let request = await reqGetCompetitionTheTopFive(data);
          commit("GETCOMPETITIONTHETOPFIVE", request)
      },
      async getTeamTheTopFive({
          commit
      }, data) {
          let request = await reqGetTeamTheTopFive(data);
  
          commit("GETTEAMTHETOPFIVE", request)
      },
      async getCompetitionTheBottom({
          commit
      }, data) {
          let request = await reqGetCompetitionTheBottom(data);
          commit("GETCOMPETITIONTHEBOTTOM", request)
      },
      async getTeamTheBottom({
          commit
      }, data) {
          let request = await reqGetTeamTheBottom(data);
          commit("GETTEAMTHEBOTTOM", request)
      },
      /* 2020-21 */
      async getCompetitionTheTopFive2({
          commit
      }, data) {
          let request = await reqGetCompetitionTheTopFive2(data);
          commit("GETCOMPETITIONTHETOPFIVE", request)
      },
      async getTeamTheTopFive2({
          commit
      }, data) {
          let request = await reqGetTeamTheTopFive2(data);
  
          commit("GETTEAMTHETOPFIVE", request)
      },
      async getCompetitionTheBottom2({
          commit
      }, data) {
          let request = await reqGetCompetitionTheBottom2(data);
          commit("GETCOMPETITIONTHEBOTTOM", request)
      },
      async getTeamTheBottom2({
          commit
      }, data) {
          let request = await reqGetTeamTheBottom2(data);
          commit("GETTEAMTHEBOTTOM", request)
      },
      /* 小时 */
      async getOddsMovedTheMostOnehour({
          commit
      }) {
          let request = await reqGetOddsMovedTheMostOnehour();
          commit("GETODDSMOVEDTHEMOSTONEHOUR", request)
      },
      /* 今天 */
      async getOddsMovedTheMostToday({
          commit
      }) {
          let request = await reqGetOddsMovedTheMostToday();
          commit("GETODDSMOVEDTHEMOSTTODAY", request)
      },
      /* 票据 */
      async GetgetUsersEmploy({
          commit
      }, date) {
          let request = await reqGetgetUsersEmploy(date);
          commit("GETGETUSERSEMPLOY", request)
      },
  
      async getUsersEmploy({
          commit
      }, date) {
          let request;
          if (date.choice == 1) {
              request = await reqGetTodayUsersEmploy(date.id);
          } else if (date.choice == 2) {
              request = await reqGetNotTheStartEmploy(date.id);
          } else if (date.choice == 3) {
              request = await reqGetEndUserEmploy(date.id);
          }
  
          commit("GETGETUSERSEMPLOY", request)
      },
      /* 大小 */
      async getOuLargestFloating({
          commit
      }) {
          let request = await reqGetOuLargestFloating();
          commit("GETOULARGESTFLOATING", request)
      },
      async getAhLargestFloating({
          commit
      }) {
          let request = await reqGetAhLargestFloating();
          commit("GETAHLARGESTFLOATING", request)
      },
      async getTomorrowUsersEmploy({
          commit
      }, data) {
          let request = await reqGetTomorrowUsersEmploy(data);
          let ary = []
  
          /* request.homeMatchResult.forEach((item, index) => {
              let a = item.time.split(' ')[0]
              request.homeMatchResult.forEach((item2, index2) => {
                  let re = {
                      time: '',
                      pnl: 0
                  }
                  if (item.time.split(' ')[0] == item2.time.split(' ')[0] && index != index2 &&a==item2.time.split(' ')[0]) {
                      re.tiem = item.time.split(' ')[0]
                      let pnl
                      if (item2.PNL.indexOf('-') == 0) {
                          pnl = Number(item2.PNL.split('-')[1])
                      } else {
                          pnl = Number(item2.PNL)
                      }
         
                      if (item2.resultDesc == "Win Half" || item2.resultDesc == "Win") {
                          re.pnl += pnl
                      } else if (item2.resultDesc == "Lose" || item2.resultDesc == "Lose Half") {
                          re.pnl -= pnl
                      }
                  }else{
                      a=item2.time.split(' ')[0]
                  }
                  ary.push(re)
              })
          });
   */        
          
          for(let i =0;i<request.homeMatchResult.length;i++){
              let info = {}
              let pnl
              if (request.homeMatchResult[i].PNL.indexOf('-') == 0) {
                  pnl = Number(request.homeMatchResult[i].PNL.split('-')[1])
              } else {
                  pnl = Number(request.homeMatchResult[i].PNL)
              }
             
              if(request.homeMatchResult[i+1]!=null){
                  if(request.homeMatchResult[i].time.split(' ')[0]==request.homeMatchResult[i+1].time.split(' ')[0]){
                      info.time = request.homeMatchResult[i].time.split(' ')[0];
                      if (request.homeMatchResult[i].resultDesc == "Win Half" || request.homeMatchResult[i].resultDesc == "Win") {
                          info.pnl= ( Math.abs(info.pnl) + Math.abs(pnl))*-1
                      } else if (request.homeMatchResult[i].resultDesc == "Lose" || request.homeMatchResult[i].resultDesc == "Lose Half") {
                          info.pnl= ( Math.abs(info.pnl) - Math.abs(pnl))*-1
                      }else{
                          info.pnl= ( Math.abs(info.pnl) + Math.abs(pnl))*-1
                      }
                      ary.push(info)
                  }
              }
  
          }
  
          console.log(ary);
          commit("GETTOMORROWUSERSEMPLOY", request)
      }
  };
  const mutations = {
      GETCOMPETITIONTHETOPFIVE(state, CompetitionTheTopFiveList) {
          Vue.set(state, "CompetitionTheTopFive", CompetitionTheTopFiveList)
      },
      GETTEAMTHETOPFIVE(state, TeamTheTopFiveList) {
          Vue.set(state, "TeamTheTopFive", TeamTheTopFiveList)
      },
      GETCOMPETITIONTHEBOTTOM(state, CompetitionTheBottom) {
          Vue.set(state, "CompetitionTheBottom", CompetitionTheBottom)
      },
      GETTEAMTHEBOTTOM(state, TeamTheBottom) {
          Vue.set(state, "TeamTheBottom", TeamTheBottom)
      },
      GETCOMPETITIONTHETOPTEN(state, CompetitionTheTopTen) {
          Vue.set(state, "CompetitionTheTopTen", CompetitionTheTopTen)
      },
      GETODDSMOVEDTHEMOSTONEHOUR(state, OddsMovedTheMostOnehour) {
          Vue.set(state, "OddsMovedTheMostOnehour", OddsMovedTheMostOnehour)
      },
      GETODDSMOVEDTHEMOSTTODAY(state, OddsMovedTheMostToday) {
          Vue.set(state, "OddsMovedTheMostToday", OddsMovedTheMostToday)
      },
      GETGETUSERSEMPLOY(state, UsersEmploy) {
          /* if(state.index==0){
              Vue.set(state, "UserSumEmploy", UsersEmploy)
          } */
          Vue.set(state, "UsersEmploy", UsersEmploy)
          /*        state.index++; */
      },
      GETOULARGESTFLOATING(state, OuLargestFloating) {
          Vue.set(state, "OuLargestFloating", OuLargestFloating)
      },
      GETAHLARGESTFLOATING(state, AhLargestFloating) {
          Vue.set(state, "AhLargestFloating", AhLargestFloating)
      },
      GETTOMORROWUSERSEMPLOY(state, TomorrowUsersEmploy) {
          Vue.set(state, "TomorrowUsersEmploy", TomorrowUsersEmploy)
      }
  };
  const getters = {
      getCompetitionTheTopFive(state) {
          return state.CompetitionTheTopFive.list || []
      },
      getTeamTheTopFive(state) {
          return state.TeamTheTopFive.list || []
      },
      getCompetitionTheBottom(state) {
          return state.CompetitionTheBottom.list || []
      },
      getTeamTheBottom(state) {
          return state.TeamTheBottom.list || []
      },
      getMostOnehour(state) {
          return state.OddsMovedTheMostOnehour.homeMatchResult || []
      },
      getMovedTheMostToday(state) {
          return state.OddsMovedTheMostToday.homeMatchResult || []
      },
      getUsersEmploy(state) {
          return state.UsersEmploy.homeMatchResult || []
      },
      getOuLargestFloating(state) {
          return state.OuLargestFloating.ouLargestFloating || []
      },
      getAhLargestFloating(state) {
          return state.AhLargestFloating.ahLargestFloating || []
      },
      getTomorrowUsersEmploy(state) {
          return state.TomorrowUsersEmploy.homeMatchResult || []
      },
  
  };
  
  export default ({
      state,
      mutations,
      actions,
      getters
  })