flow.ts 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import { defineStore } from 'pinia'
  2. // 审核条目
  3. export const useFlowStore = defineStore({
  4. id: 'flow',
  5. state: () => {
  6. return {
  7. storeInfoName: '',
  8. processId: '',
  9. processKey: '', // 唯一标识
  10. processName: '', // 流程定义名称
  11. processIcon: 'approval', // 流程图标
  12. categoryId: '', // 流程组分类ID
  13. remark: '', // 备注说明
  14. createTime: '', // 创建时间
  15. useScope: 0, // 使用范围 0,全员 1,指定人员(业务关联) 2,均不可提交
  16. formId: undefined, //业务审批 表单Id
  17. // processActorList: [
  18. // {
  19. // actorId: 0, // 参与者ID
  20. // actorName: '', // 参与者
  21. // actorType: 0 // 参与者类型 0,用户 1,部门 2,用户组
  22. // }
  23. // ], // 流程参与者,当使用范围为指定人员时候设置
  24. processPermissionList: [], // 流程定义权限
  25. cacheSwitch: false, // 缓存开关
  26. modelContent: '', // 流程模型定义JSON内容
  27. processForm: {}, // 流程定义表单
  28. processSetting: {
  29. allowRevocation: true, // 允许撤销审批中的申请
  30. allowRevocationDay: true, // 允许撤销指定天内通过的审批
  31. allowUpdateDay: true, // 允许修改指定天内通过的审批
  32. allowDelegate: true, // 允许代他人提交
  33. allowBatchOperate: true, // 允许审批人批量处理
  34. secondOperatePrompt: true, // 开启秒批提示
  35. repeatOperateSkip: true // 重复审批跳过
  36. } //流程定义配置
  37. }
  38. },
  39. getters: {},
  40. actions: {
  41. initState(title: string) {
  42. console.log('init materialInfoStore')
  43. this.storeInfoName = title || '流程审核'
  44. },
  45. // 表单信息
  46. setProcessForm(value: any) {
  47. this.processForm = value
  48. },
  49. // 流程设计
  50. setModelContent(value: any) {
  51. this.modelContent = value
  52. },
  53. // 流程设置
  54. setProcessSetting(value: any) {
  55. this.processSetting = value
  56. }
  57. },
  58. persist: true
  59. })
  60. export default useFlowStore