model.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. },
  42. situationTypeList:[],//情境类型列表
  43. editConfig: null // 编辑时候的原始数据
  44. };
  45. export default {
  46. namespaced: true,
  47. state: JSON.parse(JSON.stringify(initState)),
  48. mutations: {
  49. comChangeState(state, {key, data}) {
  50. state[key] = data;
  51. },
  52. setInit(state) {
  53. let _initState = JSON.parse(JSON.stringify(initState));
  54. console.log({_initState});
  55. for(let key in _initState) {
  56. state[key] = _initState[key];
  57. }
  58. }
  59. },
  60. actions: {
  61. commActions({ commit, state }, { key, data }) {
  62. return commServer(key, data);
  63. },
  64. }
  65. }