半成品入库
This commit is contained in:
@@ -2,7 +2,8 @@ import * as types from '../types'
|
||||
import { getStore, setStore } from '@config/utils.js'
|
||||
|
||||
const state = {
|
||||
keepAlive: [], // 缓存页面
|
||||
keepAlive: JSON.parse(getStore('keepAlive')) || [], // 缓存页面
|
||||
materObj: getStore('materObj') || '', // 存储对象
|
||||
deviceUuid: getStore('deviceUuid') || '',
|
||||
deviceCode: getStore('deviceCode') || '',
|
||||
isProductonplan: getStore('isProductonplan') || ''
|
||||
@@ -10,6 +11,7 @@ const state = {
|
||||
|
||||
const getters = {
|
||||
keepAlive: state => state.keepAlive,
|
||||
materObj: state => state.materObj,
|
||||
deviceUuid: state => state.deviceUuid,
|
||||
deviceCode: state => state.deviceCode,
|
||||
isProductonplan: state => state.isProductonplan
|
||||
@@ -17,8 +19,13 @@ const getters = {
|
||||
|
||||
const actions = {
|
||||
setKeepAlive ({commit}, res) {
|
||||
setStore('keepAlive', res)
|
||||
commit(types.SET_KEEP_ALIVE, res)
|
||||
},
|
||||
setMaterObj ({commit}, res) {
|
||||
setStore('materObj', res)
|
||||
commit(types.SET_MATER_OBJ, res)
|
||||
},
|
||||
setDevice ({commit}, res) {
|
||||
setStore('deviceUuid', res.deviceUuid)
|
||||
setStore('deviceCode', res.deviceCode)
|
||||
@@ -34,6 +41,9 @@ const mutations = {
|
||||
[types.SET_KEEP_ALIVE] (state, res) {
|
||||
state.keepAlive = res
|
||||
},
|
||||
[types.SET_MATER_OBJ] (state, res) {
|
||||
state.materObj = res
|
||||
},
|
||||
[types.DATA_DEVICE] (state, res) {
|
||||
state.deviceUuid = res.deviceUuid
|
||||
state.deviceCode = res.deviceCode
|
||||
|
||||
@@ -17,5 +17,6 @@ export const SAVE_TOKEN = 'SAVE_TOKEN'
|
||||
export const SET_KEEP_ALIVE = 'SET_KEEP_ALIVE'
|
||||
|
||||
// 数据
|
||||
export const SET_MATER_OBJ = 'SET_MATER_OBJ'
|
||||
export const DATA_DEVICE = 'DATA_DEVICE'
|
||||
export const DATA_IS_PROPLAN = 'DATA_IS_PROPLAN'
|
||||
|
||||
Reference in New Issue
Block a user