index.js 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. qucikCreateOrderTypeId: '', //快捷建单类型id
  28. deptDisplay: 1, //护士端科室显示选择(名称还是别名)1是名称,2是别名
  29. updateTipsForNurses: '', //护士端更新提示
  30. specimenButton: '', //标本按钮文字
  31. //护士科室切换提示自动关闭设置
  32. // (1) 当用户设置为正数时,用户必须查看此窗体指定秒数。
  33. // (2) 当用户设置为负数时,用户可点击知道了也可倒计时自动关闭。
  34. // (3) 如果用户填写0则为无自动关闭和强制查看时间。
  35. nurseDeptSwitchTip: 0,
  36. // 搜索到的科室-searchDept
  37. searchDeptResult: {},
  38. // 搜索到的科室集合-searchDept-选起点科室并且需要选终点科室
  39. searchDeptResultList: {},
  40. // 搜索科室需要传递的参数
  41. searchDeptParams: {},
  42. },
  43. mutations: {
  44. //是否显示切换科室弹窗
  45. changeSeiminModel(state, args) {
  46. state.isShowSeiminModel = args;
  47. },
  48. //快捷建单类型
  49. changeQucikCreateOrderType(state, args) {
  50. state.qucikCreateOrderType = args.type;
  51. state.qucikCreateOrderTypeId = args.taskTypeId;
  52. },
  53. //护士端科室显示选择(名称还是别名)1是名称,2是别名
  54. changeDeptDisplay(state, args) {
  55. state.deptDisplay = args;
  56. },
  57. //护士端更新提示
  58. changeUpdateTipsForNurses(state, args) {
  59. state.updateTipsForNurses = args;
  60. },
  61. //标本按钮文字
  62. changeSpecimenButton(state, args) {
  63. state.specimenButton = args;
  64. },
  65. //护士科室切换提示自动关闭设置
  66. changeNurseDeptSwitchTip(state, args) {
  67. state.nurseDeptSwitchTip = args;
  68. },
  69. //搜索到的科室-searchDept
  70. changeSearchDeptResult(state, args) {
  71. state.searchDeptResult = args || {};
  72. },
  73. //搜索到的科室集合-searchDept-选起点科室并且需要选终点科室
  74. changeSearchDeptResultList(state, args) {
  75. state.searchDeptResultList = args || {};
  76. },
  77. //搜索科室需要传递的参数
  78. changeSearchDeptParams(state, args) {
  79. state.searchDeptParams = args;
  80. },
  81. },
  82. modules: {
  83. user,
  84. },
  85. plugins: [myPlugin],
  86. });