ddy-process-pc-vue2 1.0.1-beta.30 → 1.0.1-beta.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  ## 新流程接入文档
4
4
 
5
5
  ### 安装
6
+
6
7
  ```
7
8
  npm install ddy-process-pc-vue2
8
9
  ```
@@ -15,99 +16,115 @@ import process, {
15
16
  ProcessAPI,
16
17
  beforeCreate,
17
18
  reactivate,
18
- ProcessEnums
19
- } from 'ddy-process-pc-vue2';
19
+ ProcessEnums,
20
+ } from "ddy-process-pc-vue2";
20
21
 
21
22
  // 设置请求函数
22
23
  ProcessAPI.setAjax(ajaxFuc);
23
24
  ```
24
25
 
25
- > 说明: ajaxFuc 为函数类型
26
- >>``` js
27
- >>ajaxFuc(obj)
28
- >>
29
- >>obj {
30
- >> type: String, //请求方式('get'||'post')
31
- >> url: String,
32
- >> param: Any
33
- >>}
34
- >>// 调用时会传入上述参数
35
- >>```
36
-
37
- ``` js
38
- // 创建并启动流程
26
+ > 说明: ajaxFuc 为函数类型
27
+ >
28
+ > > ```js
29
+ > > ajaxFuc(obj)
30
+ > >
31
+ > > obj {
32
+ > > type: String, //请求方式('get'||'post')
33
+ > > url: String,
34
+ > > param: Any
35
+ > > }
36
+ > > // 调用时会传入上述参数
37
+ > > ```
38
+
39
+ ```vue
40
+ <!-- 创建并启动流程 -->
39
41
  <template>
40
42
  <beforeCreate ref="beforeCreateRef"></beforeCreate>
41
43
  </template>
42
44
 
43
45
  <script>
44
-
45
- export default {
46
- components: {
47
- beforeCreate
48
- ...
49
-
50
- this.$refs.beforeCreateRef.selectShow({
51
- appId: 'com.awspaas.user.apps.top.study.project',
52
- processGroupName: this.beType
53
- }).then((createAndStart) => {
54
- // ...业务保存的相关逻辑
55
-
56
- // 业务保存成功后调用
57
- let p = {
58
- processBusinessKey: res.data.id, //业务ID
59
- businessType: 26, //流程类型
60
- title: '标题' //流程标题
61
- };
62
- createAndStart(p).then((res)=>{
63
- if (res.code == ProcessEnums.apiCode.success) {
64
- // 创建成功
65
- }else{
66
- // 创建失败
67
- }
68
- }).finally(()=>{
69
- // 创建失败
70
- })
71
- })
72
-
73
-
74
- ```
75
-
76
- ``` js
77
- // 复活流程
78
- <beforeCreate ref="beforeCreateRef"></beforeCreate>
79
-
80
-
81
46
  export default {
82
47
  components: {
83
48
  beforeCreate
84
- ...
85
-
86
- this.$refs.beforeCreateRef.revivalShow(BusinessKey).then((revivalFlow) => {
87
- // ...业务保存的相关逻辑
88
-
89
- // 业务保存成功后调用
90
- revivalFlow().then((res)=>{
91
- if (res.code == ProcessEnums.apiCode.success) {
92
- // 复活成功
93
- }else{
94
- // 复活失败
95
- }
96
- }).finally(()=>{
97
- // 复活失败
98
- })
99
- })
100
-
101
-
49
+ },
50
+ methods: {
51
+ // 1,打开流程弹窗
52
+ openProcess(){
53
+ this.$refs.beforeCreateRef.selectShow({
54
+ // 🆘businessCode流程标识,原先的type,字符串
55
+ // 🆘userInfo用户信息,包括用户部门,用户公司,等等都放在这
56
+ businessCode: '9',
57
+ userInfo: {
58
+ deptId: this.saveData.deptId || '',
59
+ "subjectId": localStorage.getItem('lastSubjectId') || '',
60
+ }
61
+ }).then((createAndStart) => {
62
+ // 2, 发起流程,业务保存成功后调用
63
+ let p = {
64
+ // 业务id
65
+ processBusinessKey: data.businessKey,
66
+ // 🆘流程标识,原先的type,字符串
67
+ businessType: data.businessType
68
+ // 流程标题
69
+ title: '陈淞淞发起了xxx申请',
70
+ // 流程名称,与流程标识对应
71
+ name: '请假申请',
72
+ // 发起流程/激活流程使用的申请人id
73
+ applyUserId: this.$store.getters.userId,
74
+ };
75
+ createAndStart(p).then((res)=>{
76
+ if (res.code == ProcessEnums.apiCode.success) {
77
+ // 创建成功
78
+ }else{
79
+ // 创建失败
80
+ }
81
+ }).finally(()=>{
82
+ // 创建失败
83
+ })
84
+ })
85
+ },
86
+ // 复活流程
87
+ revivalProcess(){
88
+ // 1,打开流程弹窗
89
+ // 🆘参数由字符串列表 改为 对象形式
90
+ this.$refs.beforeCreateRef.revivalShow({
91
+ // 流程实例id
92
+ processInstId: saveData.processId,
93
+ // 部门id
94
+ deptId: saveData.deptId,
95
+ // 业务id
96
+ businessId: saveData.id,
97
+ }).then((revivalFlow) => {
98
+ // ...业务保存的相关逻辑
99
+
100
+ // 2, 重新发起,业务保存成功后调用
101
+ // 🆘参数 改为 对象形式
102
+ revivalFlow({
103
+ // 流程名称,与流程标识对应
104
+ name: '请假申请',
105
+ // 申请人id
106
+ applyUserId: this.$store.getters.userId,
107
+ }).then((res)=>{
108
+ if (res.code == ProcessEnums.apiCode.success) {
109
+ // 复活成功
110
+ }else{
111
+ // 复活失败
112
+ }
113
+ }).finally(()=>{
114
+ // 复活失败
115
+ })
116
+ })
117
+ }
118
+ }
119
+ }
120
+ </script>
102
121
  ```
103
122
 
104
-
105
- ``` js
106
- // 查看及流程审批相关操作
107
- <process
123
+ ```vue
124
+ <!-- 创建并启动流程 -->
125
+ <template>
126
+ <process
108
127
  :processId="processInstId"
109
- :processDefId="processDefId"
110
- :task="task"
111
128
  @Complete="
112
129
  //操作成功回调
113
130
  "
@@ -115,57 +132,55 @@ this.$refs.beforeCreateRef.revivalShow(BusinessKey).then((revivalFlow) => {
115
132
  :isView="
116
133
  //是否只查看
117
134
  ">
118
- </process>
119
-
135
+ </process>
136
+ </template>
120
137
 
121
- task {
122
- activityDefId: 节点id,
123
- processInstId: 流程实例id,
124
- processDefId: 流程定义id,
125
- id: 任务id,
138
+ <script>
139
+ export default {
140
+ components: {
141
+ process
142
+ },
126
143
  }
127
-
128
-
129
-
130
-
144
+ </script>
131
145
  ```
132
146
 
133
-
134
-
135
-
136
- ## yanhuang流程接入文档
147
+ ## yanhuang 流程接入文档
137
148
 
138
149
  ### 安装
150
+
139
151
  ```
140
152
  npm install ui-process-pc
141
153
  ```
142
154
 
143
155
  ### 基础用法
144
- ``` js
156
+
157
+ ```js
145
158
  // 导入依赖
146
159
  import process, {
147
160
  ProcessAPI,
148
161
  beforeCreate,
149
162
  reactivate,
150
- ProcessEnums
151
- } from 'ui-process-pc';
163
+ ProcessEnums,
164
+ } from "ui-process-pc";
152
165
 
153
166
  // 设置请求函数
154
167
  ProcessAPI.setAjax(ajaxFuc);
155
168
  ```
156
- > 说明: ajaxFuc 为函数类型
157
- >>``` js
158
- >>ajaxFuc(obj)
159
- >>
160
- >>obj {
161
- >> type: String, //请求方式('get'||'post')
162
- >> url: String,
163
- >> param: Any
164
- >>}
165
- >>// 调用时会传入上述参数
166
- >>```
167
-
168
- ``` js
169
+
170
+ > 说明: ajaxFuc 为函数类型
171
+ >
172
+ > > ```js
173
+ > > ajaxFuc(obj)
174
+ > >
175
+ > > obj {
176
+ > > type: String, //请求方式('get'||'post')
177
+ > > url: String,
178
+ > > param: Any
179
+ > > }
180
+ > > // 调用时会传入上述参数
181
+ > > ```
182
+
183
+ ```js
169
184
  // 创建并启动流程
170
185
  <beforeCreate ref="beforeCreateRef"></beforeCreate>
171
186
 
@@ -201,7 +216,7 @@ this.$refs.beforeCreateRef.selectShow({
201
216
 
202
217
  ```
203
218
 
204
- ``` js
219
+ ```js
205
220
  // 复活流程
206
221
  <beforeCreate ref="beforeCreateRef"></beforeCreate>
207
222
 
@@ -229,8 +244,7 @@ this.$refs.beforeCreateRef.revivalShow(BusinessKey).then((revivalFlow) => {
229
244
 
230
245
  ```
231
246
 
232
-
233
- ``` js
247
+ ```js
234
248
  // 查看及流程审批相关操作
235
249
  <process
236
250
  :processId="processInstId"
@@ -257,5 +271,3 @@ task {
257
271
 
258
272
 
259
273
  ```
260
-
261
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ddy-process-pc-vue2",
3
- "version": "1.0.1-beta.30",
3
+ "version": "1.0.1-beta.32",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bundleDependencies": false,