model.js 2.2 KB

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