import {reqGetVolcanCloudList} from "@/api/otherApi/volcanCloud"; const state = { // 公共组件数据(下侧购买信息) buyMangement:{ mangementList:['mongo.1c2g 3个','mongo.storage 60GiB'], lastPrice:588 }, showBuyTip:false,//控制价格计算的文字提示显示 // 云服务器 vlocanTableObj: {},//所有火山云配置 vlcanTableSimpleList:{},//火山云单个列表 } const mutations = { //更改显示价格计算的文字提示的状态 SETSHOWBUTTIP(state,showBuyTip){ state.showBuyTip=showBuyTip }, GETVLOCANTABLEOBJ(state,vlocanTableObj){ state.vlocanTableObj=vlocanTableObj }, //存储火山云配置列表 SETVLCANTABLESIMPLELIST(state,vlcanTableSimpleList){ state.vlcanTableSimpleList=vlcanTableSimpleList } } const actions = { async getVlocanTableObj({commit}, freeType) { let result = await reqGetVolcanCloudList(freeType) if (result.status) { commit('GETVLOCANTABLEOBJ', result) commit('SETVLCANTABLESIMPLELIST', result.data.instance_types) } } } const getters = {} export default { state, mutations, actions, getters }