const state = {
  pageData: {
    list: [],
    selectKey:[],
    formList: [],
    config: {},
    templateName:"",
    industryId:"",
    channelCode:"",
    id:"",
    isPub:0,
    remark:""
  },
  selectWg: {},
  configTab: 'page',
  wgCollapse: "base",
  selectTheme: "",
  allAttrs:[],//所有的属性
  extraId: null,//业务ID - 当前操作的模板ID
  extraCurrAttrId: null,//当前操作的属性ID
  ossBase:null
};

const mutations = {
	setInitData(state){
	 	state.pageData.list =  [];
    state.pageData.selectKey=[];
    state.pageData.formList= [];
    state.pageData.config= {};
    state.pageData.id = "";
    state.pageData.isPub = 0;
    state.pageData.remark = "";

    state.selectWg = {};
  	state.configTab = 'page';
  	state.wgCollapse = "base";
  	state.selectTheme = "";
 		state.allAttrs = [];
 		state.ossBase = null;
	},

  setPageData(state, payload) {
    state.pageData = payload;
  },
  setPageDataList(state,data){
  	state.pageData.list = data;
  },
  setSelectWg(state, payload) {
    state.selectWg = payload;
  },
  setConfigTab(state, payload) {
    state.configTab = payload;
  },
  setWgCollapse(state, payload) {
    state.wgCollapse = payload;
  },
  setSelectTheme(state, payload) {
    state.selectTheme = payload;
  },
  setAllAttrs(state,payload){
    state.allAttrs=payload;
  },
  setExtraId(state,extraId){ //设置业务ID - 模板ID
  	state.extraId = extraId;
  },
  setExtraCurrAttrId(state,attrId){ //当前操作的属性ID
  	state.extraCurrAttrId = attrId;
  },
  setOssBase(state,ossBase){
  	state.ossBase = ossBase;
  }
};

export default {
  state,
  mutations
}
