zhiyong.zhou
2024-02-26 60d911172b1dbebe0ab952ce10366b327d5744f1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
//审批节点默认属性
export const APPROVAL_PROPS = {
  assignedType: "ASSIGN_USER",
  //mode: "AND",
  //sign: false,
  nobody: {
    handler: "TO_PASS",
    assignedUser:[]
  },
 
  assignedUser:[],
  refuse: {
    type: 'TO_END', //驳回规则 TO_END  TO_NODE  TO_BEFORE
    target: '' //驳回到指定ID的节点
  },
  groups:[
    {
     // groupType:"aaa", //条件组内条件关系 OR、AND
     // cids:[], //条件ID集合
     // conditions:[] //组内子条件
    }
  ],
}
 
//根节点默认属性
export const ROOT_PROPS = {
  assignedUser: [],
  formPerms:[]
}
 
//条件节点默认属性
export const CONDITION_PROPS = {
  groupsType:"OR", //条件组逻辑关系 OR、AND
  groups:[
    {
      groupType:"AND", //条件组内条件关系 OR、AND
      cids:[], //条件ID集合
      conditions:[] //组内子条件
    }
  ],
  expression: "" //自定义表达式,灵活构建逻辑关系
}
 
//抄送节点默认属性
export const CC_PROPS = {
  shouldAdd: false,
  assignedUser: [],
  formPerms:[]
}
 
//触发器节点默认属性
export const TRIGGER_PROPS = {
  type: 'WEBHOOK',
  http:{
    method: 'GET', //请求方法 支持GET/POST
    url: '', //URL地址,可以直接带参数
    headers: [ //http header
      {
        name: '',
        isField: true,
        value: '' //支持表达式 ${xxx} xxx为表单字段名称
      }
    ],
    contentType: 'FORM', //请求参数类型
    params:[ //请求参数
      {
        name: '',
        isField: true, //是表单字段还是自定义
        value: '' //支持表达式 ${xxx} xxx为表单字段名称
      }
    ],
    retry: 1,
    handlerByScript: false,
    success: 'function handlerOk(res) {\n  return true;\n}',
    fail: 'function handlerFail(res) {\n  return true;\n}'
  },
  email:{
    subject: '',
    to: [],
    content: ''
  }
}
 
//延时节点默认属性
export const DELAY_PROPS = {
  type: "FIXED", //延时类型 FIXED:到达当前节点后延时固定时长 、AUTO:延时到 dateTime设置的时间
  time: 0, //延时时间
  unit: "M", //时间单位 D天 H小时 M分钟
  dateTime: "" //如果当天没有超过设置的此时间点,就延时到这个指定的时间,到了就直接跳过不延时
}
 
//办理人节点默认属性
export const TASK_PROPS = {
  assignedType: "ASSIGN_USER",
  mode: "AND",
  sign: false,
  nobody: {
    handler: "TO_PASS",
    assignedUser:[]
  },
  // timeLimit:{
  //   timeout:{
  //     unit: "H",
  //     value: 0
  //   },
  //   handler:{
  //     type: "REFUSE",
  //     notify:{
  //       once: true,
  //       hour: 1
  //     }
  //   }
  // },
  assignedUser:[],
  formPerms:[],
  // selfSelect: {
  //   multiple: false
  // },
  // leaderTop: {
  //   endCondition: "TOP",
  //   endLevel: 1,
  // },
  // leader:{
  //   level: 1
  // },
  role:[],
  refuse: {
    type: 'TO_END', //驳回规则 TO_END  TO_NODE  TO_BEFORE
    target: '' //驳回到指定ID的节点
  },
  formUser: ''
}
 
//包容节点默认属性
export const INCLUSIVE_PROPS = {
  groupsType:"OR", //条件组逻辑关系 OR、AND
  groups:[
    {
      groupType:"AND", //条件组内条件关系 OR、AND
      cids:[], //条件ID集合
      conditions:[] //组内子条件
    }
  ],
  expression: "" //自定义表达式,灵活构建逻辑关系
}
 
 
export default {
  APPROVAL_PROPS, TASK_PROPS, CC_PROPS, DELAY_PROPS, CONDITION_PROPS, ROOT_PROPS, TRIGGER_PROPS, INCLUSIVE_PROPS
}