model.js 2.0 KB

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