index.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. // 搜索科室需要传递的参数
  39. searchDeptParams: {},
  40. },
  41. mutations: {
  42. //是否显示切换科室弹窗
  43. changeSeiminModel(state, args) {
  44. state.isShowSeiminModel = args;
  45. },
  46. //快捷建单类型
  47. changeQucikCreateOrderType(state, args = {}) {
  48. state.qucikCreateOrderType = args.type;
  49. state.qucikCreateOrderTypeId = args.taskTypeId;
  50. },
  51. //护士端科室显示选择(名称还是别名)1是名称,2是别名
  52. changeDeptDisplay(state, args) {
  53. state.deptDisplay = args;
  54. },
  55. //护士端更新提示
  56. changeUpdateTipsForNurses(state, args) {
  57. state.updateTipsForNurses = args;
  58. },
  59. //标本按钮文字
  60. changeSpecimenButton(state, args) {
  61. state.specimenButton = args;
  62. },
  63. //护士科室切换提示自动关闭设置
  64. changeNurseDeptSwitchTip(state, args) {
  65. state.nurseDeptSwitchTip = args;
  66. },
  67. //搜索到的科室-searchDept
  68. changeSearchDeptResult(state, args) {
  69. state.searchDeptResult = args;
  70. },
  71. //搜索科室需要传递的参数
  72. changeSearchDeptParams(state, args) {
  73. state.searchDeptParams = args;
  74. },
  75. },
  76. modules: {
  77. user,
  78. },
  79. plugins: [myPlugin],
  80. });