1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- import Vue from 'vue'
- import Vuex from 'vuex'
- Vue.use(Vuex)
- const store = new Vuex.Store({
- /* 状态对象 */
- state: {
- result: false, // 获取信息是否成功
- // eslint-disable-next-line no-mixed-spaces-and-tabs
- code: '',
- msg: '', // 获取成功失败时返回的错误信息
- bcode: '',
- cbData: null,
- wxData: {},
- unfaresearchdata: {},
- revfaresearchdata: {},
- data: {}, // {userId,userName,staffCode,deptCode}
- token: {} // 令牌
- },
- mutations: {
- setResult (state, result) {
- state.result = result
- },
- setCode (state, code) {
- state.code = code
- },
- setMsg (state, msg) {
- state.msg = msg
- },
- setBcode (state, bcode) {
- state.bcode = bcode
- },
- setcbData (state, cbData) {
- state.cbData = cbData
- },
- setwxData (state, wxData) {
- state.wxData.vrepairapplycode = wxData.vrepairapplycode
- state.wxData.vbillstatus = wxData.vbillstatus
- },
- setvrepairapplycode (state, vrepairapplycode) {
- state.vrepairapplycode = vrepairapplycode
- },
- setunfaresearchData (state, unfaresearchdata) {
- state.unfaresearchdata.hname = unfaresearchdata.hname
- state.unfaresearchdata.ownername = unfaresearchdata.ownername
- },
- setrevfaresearchData (state, revfaresearchdata) {
- state.revfaresearchdata.hname = revfaresearchdata.hname
- state.revfaresearchdata.ownername = revfaresearchdata.ownername
- },
- setData (state, data) {
- state.data.staffCode = data.staffCode
- state.data.userID = data.userID
- state.data.deptCode = data.deptCode
- state.data.userName = data.userName
- },
- setToken (state, token) {
- state.token = token
- }
- },
- getters: {
- },
- actions: {
- // lazy loading openid
- }
- })
- export default store
|