model.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import { commServer } from './server.js';
  2. import {dateHandle} from "../../utils/dateHandle.js";
  3. const initState = {
  4. showCheckMapDetail: false,
  5. showCheckMapAdd: false,
  6. showCheckPlan1: true,
  7. needReload: true, // 切换页面是否需要获取新数据
  8. stepActive: 0, // 步骤进度
  9. theme: {id: null, title: null, des: null}, // 主题选中数据(id: 0个案 1系统)
  10. condition: { // 条件页面数据
  11. options: [], // 树形节点数据
  12. conditionIds: [], // 选中的key
  13. depType: 1, // 门急诊类型 1-门诊 2-急诊
  14. defaultOpen: [], // 默认展开的项
  15. },
  16. checkRent: { // 查核组页面数据
  17. list: [],
  18. checkedItem: {id: null}
  19. },
  20. checkMap: { // 查核地图数据
  21. list: [], // 列表数据
  22. actionItem: {id: '', pointList: []}, // 当前操作的列表项
  23. deptList: [], // 新增单位数据
  24. },
  25. checkPlan: { // 查核计划
  26. checkedItem: {id: 'month', value: 2, label: '每月', model: 30}, // 选中的取模方式对象
  27. dateObj: { // 保存开始日期结束日期的对象
  28. start:dateHandle.todayDate(),
  29. end: '',
  30. dayNum: 0 // 两个日期间隔的天数
  31. },
  32. checkList: [], // 核查计划数组
  33. },
  34. situationPreview: { // 预览
  35. sitName: null,
  36. description: null,
  37. preDay: null,
  38. preH: null,
  39. startDay: null,
  40. situationType:1,
  41. showNotApplicable:0, //情境是否需要展示不适用快捷按钮 0 展示 1不展示
  42. },
  43. situationTypeList:[],//情境类型列表
  44. editConfig: null // 编辑时候的原始数据
  45. };
  46. export default {
  47. namespaced: true,
  48. state: JSON.parse(JSON.stringify(initState)),
  49. mutations: {
  50. comChangeState(state, {key, data}) {
  51. state[key] = data;
  52. },
  53. setInit(state) {
  54. let _initState = JSON.parse(JSON.stringify(initState));
  55. console.log({_initState});
  56. for(let key in _initState) {
  57. state[key] = _initState[key];
  58. }
  59. }
  60. },
  61. actions: {
  62. commActions({ commit, state }, { key, data }) {
  63. return commServer(key, data);
  64. },
  65. }
  66. }