model.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import { commServer } from './server.js';
  2. import {dateHandle} from "../../utils/dateHandle.js";
  3. console.log('dateHandle.todayDate()',dateHandle.todayDate());
  4. const initState = {
  5. showCheckMapDetail: false,
  6. showCheckMapAdd: false,
  7. showCheckPlan1: true,
  8. needReload: true, // 切换页面是否需要获取新数据
  9. stepActive: 0, // 步骤进度
  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. },
  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. }