12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- import {
- reqFetchDataList
- } from "@/request/api.js";
- import cloneDeep from 'lodash/cloneDeep'
- const stateReset = {
- systemInfo: {},
- };
- const state = cloneDeep(stateReset);
- const getters = {};
- const mutations = {
-
- resetVxSystem(state) {
- Object.assign(state, cloneDeep(stateReset))
- },
-
- vxSystem(state, args) {
- state.systemInfo[args.key] = args.data;
- },
- };
- const actions = {
-
- async vxSystem({
- commit,
- state
- }, args) {
- const excludeArr = ['updateTipsForNurses'];
- const keyconfig = args.systemConfiguration.keyconfig;
- if (state.systemInfo[keyconfig]) {
-
- return await Promise.resolve(state.systemInfo[keyconfig]);
- } else {
- let result = await reqFetchDataList('simple/data', 'systemConfiguration', args);
- if (result.status == 200) {
- if (!excludeArr.includes(keyconfig)) {
- commit("vxSystem", {
- key: keyconfig,
- data: result
- });
- }
- }
- return result;
- }
- },
- };
- export default {
- namespaced: true,
- state,
- getters,
- mutations,
- actions,
- };
|