半成品盘点

This commit is contained in:
2023-07-03 14:11:31 +08:00
parent 8f43c079b9
commit 6e5fb6b057
14 changed files with 221 additions and 26 deletions

View File

@@ -4,6 +4,7 @@ import { getStore, setStore } from '@config/utils.js'
const state = {
keepAlive: JSON.parse(getStore('keepAlive')) || [], // 缓存页面
materObj: getStore('materObj') || '', // 存储对象
materArr: JSON.parse(getStore('materArr')) || [], // 存储数组
deviceUuid: getStore('deviceUuid') || '',
deviceCode: getStore('deviceCode') || '',
isProductonplan: getStore('isProductonplan') || ''
@@ -12,6 +13,7 @@ const state = {
const getters = {
keepAlive: state => state.keepAlive,
materObj: state => state.materObj,
materArr: state => state.materArr,
deviceUuid: state => state.deviceUuid,
deviceCode: state => state.deviceCode,
isProductonplan: state => state.isProductonplan
@@ -26,6 +28,10 @@ const actions = {
setStore('materObj', res)
commit(types.SET_MATER_OBJ, res)
},
setMaterArr ({commit}, res) {
setStore('materArr', res)
commit(types.SET_MATER_ARR, res)
},
setDevice ({commit}, res) {
setStore('deviceUuid', res.deviceUuid)
setStore('deviceCode', res.deviceCode)
@@ -44,6 +50,9 @@ const mutations = {
[types.SET_MATER_OBJ] (state, res) {
state.materObj = res
},
[types.SET_MATER_ARR] (state, res) {
state.materArr = res
},
[types.DATA_DEVICE] (state, res) {
state.deviceUuid = res.deviceUuid
state.deviceCode = res.deviceCode

View File

@@ -15,6 +15,7 @@ export const SAVE_TOKEN = 'SAVE_TOKEN'
// 缓存页面
export const SET_KEEP_ALIVE = 'SET_KEEP_ALIVE'
export const SET_MATER_ARR = 'SET_MATER_ARR'
// 数据
export const SET_MATER_OBJ = 'SET_MATER_OBJ'