const state = {
	tabbarActive: 0,
	tabbarPageScrollTop: [0, 0, 0, 0],
	currentRouter: {
		meta: {}
	},
	duration: 1000 * 6, // analog 请求频率
	emptyDescription: "这里什么都没有",
	finishedText: "没有更多了",
	successText: "刷新成功",
	showNavBar: true,
	title: null,
	//
	analogList: [],
	analogIntervalTimer: null,
	curAnalogSn: null,
	applyPurchaseDetails: {}, // 申购
	applyPurchaseDetailsCustomList: [], // 自定义申购
	sparePartAccessDetailsOut: {}, // 备件出库
	sparePartAccessDetailsIn: {}, // 备件入库
	sparePartApplyDetails: {}, // 备件申领
	maintenanceApplyDetails: {}, // 维保申请
	maintenanceApplyDetailsCustomList: [], // 自定义维保申请
	applyList: [], // 我的待办
	maintenanceRecordList: [], // 维保记录
	warehouseAccessDetailsIn: {}, // 物料清单入库
	warehouseAccessDetailsOut: {}, // 物料清单出库
	warehouseApplyDetails: {}, // 物料清单申领
	timeout: 1000 * 60 * 1, // analog 离线判断
	currencyConfigList: [], // 通用数据配置表
}

const mutations = {
	SET_TABBARACTIVE: (state, object) => {
		state.tabbarActive = object
	},
	SET_APPLYPURCHASEDETAILS: (state, object) => {
		state.applyPurchaseDetails = object
	},
	SET_SPAREPARTACCESSDETAILSOUT: (state, object) => {
		state.sparePartAccessDetailsOut = object
	},
	SET_SPAREPARTACCESSDETAILSIN: (state, object) => {
		state.sparePartAccessDetailsIn = object
	},
	SET_SPAREPARTAPPLYDETAILS: (state, object) => {
		state.sparePartApplyDetails = object
	},
	SET_MAINTENANCEAPPLYDETAILS: (state, object) => {
		state.maintenanceApplyDetails = object
	},
	SET_WAREHOUSEACCESSDETAILSIN: (state, object) => {
		state.warehouseAccessDetailsIn = object
	},
	SET_WAREHOUSEACCESSDETAILSOUT: (state, object) => {
		state.warehouseAccessDetailsOut = object
	},
	SET_WAREHOUSEAPPLYDETAILS: (state, object) => {
		state.warehouseApplyDetails = object
	},
}

const actions = {
	setTabbarActive({
		commit
	}, object) {
		commit('SET_TABBARACTIVE', object)
	},
	setShoppingCart({
		commit
	}, object) {
		commit('SET_APPLYPURCHASEDETAILS', object)
	},
	setSparePartAccessDetailsOut({
		commit
	}, object) {
		commit('SET_SPAREPARTACCESSDETAILSOUT', object)
	},
	setSparePartAccessDetailsIn({
		commit
	}, object) {
		commit('SET_SPAREPARTACCESSDETAILSIN', object)
	},
	setSparePartApplyDetails({
		commit
	}, object) {
		commit('SET_SPAREPARTAPPLYDETAILS', object)
	},
	setMaintenanceApplyDetails({
		commit
	}, object) {
		commit('SET_MAINTENANCEAPPLYDETAILS', object)
	},
	setWarehouseAccessDetailsIn({
		commit
	}, object) {
		commit('SET_WAREHOUSEACCESSDETAILSIN', object)
	},
	setWarehouseAccessDetailsOut({
		commit
	}, object) {
		commit('SET_WAREHOUSEACCESSDETAILSOUT', object)
	},
	setWarehouseApplyDetails({
		commit
	}, object) {
		commit('SET_WAREHOUSEAPPLYDETAILS', object)
	},
}

export default {
	namespaced: true,
	state,
	mutations,
	actions
}