import { StateTypes } from "./types";
import { MutationTree } from "vuex";
const mutations: MutationTree<StateTypes> = {
  // 更新
  updateBusinessType(state, type) {
    state.businessType = type
  },
  // 设置存证数量
  setGoodsNum(state, num) {
    state.goodsNum = num;
  },
  // 回收站数据总量
  setDeletedNum(state, num) {
    state.deletedNum = num;
  },
  // 右侧展示
  setSelectedStatus(state, num) {
    state.selectedStatus = num;
  },
  // 设置初始存证基础数据
  setDepositCertificate(state, val) {
    state.depositCertificate.base_id = val.item.id;
    state.depositCertificate.base_hash = val.item.hash;
  },
  // 设置存证数据列表
  setListOfInformation(state, val) {
    state.listOfInformation = val;
  },
  // 更改页码
  setPage(state, page) {
    state.page = page;
  },

  setIncrementList(state, val) {
    state.listOfInformation[val.index].incrementList = val.list
  },
  // 设置增量数据列表
  setExistingEvidenceList(state, val) {
    state.existingEvidenceList = val
  },
  setuserInfos(state, infos) {
    state.userInfos = infos
  },
  // 设置模板数量
  setTemplateNum(state, num) {
    state.templateNum = num;
  },
  setTheAnchor(state, num) {
    state.theAnchor = num
  },
  setChainStatus(state, str) {
    state.chainStatus = str
  },
  setTemplateType(state, num) {
    state.templateType = num
  },
  setTemplateData(state, data) {
    state.templateData = data
  },
  setCurrentRoute: (state, currentRoute) => {
    state.currentRoute = currentRoute
  },
};

export default mutations;
