This commit is contained in:
2024-04-15 10:54:18 +08:00
commit ba704ddc4c
217 changed files with 28294 additions and 0 deletions

43
src/vuex/modules/com.js Normal file
View File

@@ -0,0 +1,43 @@
import * as types from '../types'
import { getStore, setStore } from '@js/mUtils.js'
const baseUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.59:8080' : 'http://192.168.46.5:8080/hl_nlapp'
/**
* App通用配置
*/
const state = {
baseUrl: getStore('baseUrl') || baseUrl,
setTime: getStore('setTime') || 50000,
equipId: getStore('equipId') || '1'
}
const actions = {
setConfig ({commit}, res) {
setStore('baseUrl', res.baseUrl)
setStore('setTime', res.setTime)
setStore('equipId', res.equipId)
commit(types.COM_CONFIG, res)
}
}
const getters = {
baseUrl: state => state.baseUrl,
setTime: state => state.setTime,
equipId: state => state.equipId
}
const mutations = {
[types.COM_CONFIG] (state, res) {
state.baseUrl = res.baseUrl
state.setTime = res.setTime
state.equipId = res.equipId
}
}
export default {
state,
actions,
getters,
mutations
}