index.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * @Author: 廖明明
  3. * @Date: 2022-03-31 16:36:19
  4. * @LastEditors: 廖明明
  5. * @LastEditTime: 2022-04-01 17:45:03
  6. * @Description:vuex入口文件
  7. */
  8. import Vue from "vue";
  9. import Vuex from "vuex";
  10. import user from "@/store/modules/user";
  11. Vue.use(Vuex);
  12. const myPlugin = (store) => {
  13. // 当 store 初始化后调用
  14. let vuexStorage = uni.getStorageSync("vuexStorage");
  15. if (vuexStorage) {
  16. console.log(vuexStorage)
  17. store.replaceState(vuexStorage);
  18. }
  19. store.subscribe((mutation, state) => {
  20. uni.setStorageSync("vuexStorage", state);
  21. });
  22. };
  23. export default new Vuex.Store({
  24. state: {
  25. isShowSeiminModel: false,//是否显示切换科室弹窗
  26. qucikCreateOrderType: '',//快捷建单类型
  27. },
  28. mutations: {
  29. //是否显示切换科室弹窗
  30. changeSeiminModel(state, args) {
  31. state.isShowSeiminModel = args;
  32. },
  33. //快捷建单类型
  34. changeQucikCreateOrderType(state, args) {
  35. state.qucikCreateOrderType = args;
  36. },
  37. },
  38. modules: {
  39. user,
  40. },
  41. plugins: [myPlugin],
  42. });