@steedos-labs/plugin-workflow 3.0.0-beta.25 → 3.0.0-beta.27

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.
@@ -54,13 +54,13 @@ window.SteedosWorkflow.InstanceTask = {
54
54
  "label": "",
55
55
  "icon": "fa fa-bars",
56
56
  "className": "bg-white p-2 rounded border-gray-300 text-gray-500",
57
- "align": "right",
57
+ "align": "left",
58
58
  "onEvent": {
59
59
  "click": {
60
60
  "actions": [
61
61
  {
62
62
  "actionType": "custom",
63
- "script": "document.querySelector('.instances-customPage').classList.toggle('instances-sidebar-open');if(window.innerWidth < 768){document.querySelector('.isInset').classList.toggle('inset-0')}"
63
+ "script": "document.querySelector('.instances-customPage').classList.toggle('instances-sidebar-open');"
64
64
  }
65
65
  ]
66
66
  }
@@ -122,13 +122,13 @@ window.SteedosWorkflow.Instance = {
122
122
  "label": "",
123
123
  "icon": "fa fa-bars",
124
124
  "className": "bg-white p-2 rounded border-gray-300 text-gray-500",
125
- "align": "right",
125
+ "align": "left",
126
126
  "onEvent": {
127
127
  "click": {
128
128
  "actions": [
129
129
  {
130
130
  "actionType": "custom",
131
- "script": "document.querySelector('.instances-customPage').classList.toggle('instances-sidebar-open');if(window.innerWidth < 768){document.querySelector('.isInset').classList.toggle('inset-0')}"
131
+ "script": "document.querySelector('.instances-customPage').classList.toggle('instances-sidebar-open');"
132
132
  }
133
133
  ]
134
134
  }
@@ -246,7 +246,7 @@ WorkflowManager.getUser = async function (spaceId, userId, notNeedDetails) {
246
246
  }
247
247
 
248
248
  if (typeof userId !== 'string') {
249
- return WorkflowManager.getUsers(spaceId, userId, notNeedDetails);
249
+ return await WorkflowManager.getUsers(spaceId, userId, notNeedDetails);
250
250
  }
251
251
 
252
252
  const spaceUsersCollection = await getCollection('space_users');
@@ -3,7 +3,7 @@
3
3
  "body": [{
4
4
  "type": "wrapper",
5
5
  "visibleOn": "${AND(display != 'split', ${window:innerWidth > 768},!!!_inDrawer)}",
6
- "className": "bg-white m-0 p-0 flex-shrink-0 min-w-[240px] lg:order-first lg:flex lg:flex-col border-r border-gray-300",
6
+ "className": "bg-white p-0 flex-shrink-0 min-w-[240px] lg:order-first lg:flex lg:flex-col rounded shadow my-4 ml-4 mr-1 my-4 sm:rounded",
7
7
  "body": [{
8
8
  "type": "service",
9
9
  "className": "w-full h-full",
@@ -18,7 +18,7 @@
18
18
  "type": "input-tree",
19
19
  "treeContainerClassName": "h-full",
20
20
  "name": "tree",
21
- "className": "instance-box-tree bg-white w-full",
21
+ "className": "instance-box-tree w-full",
22
22
  "id": "u:9f3dd961ca12",
23
23
  "stacked": true,
24
24
  "multiple": false,
@@ -87,7 +87,7 @@
87
87
  },
88
88
  {
89
89
  "type": "wrapper",
90
- "className": "steedos-instance-detail-wrapper m-0 p-0 flex-1 focus:outline-none lg:order-last sm:pt-3 sm:px-3",
90
+ "className": "steedos-instance-detail-wrapper m-0 p-0 flex-1 focus:outline-none lg:order-last sm:m-4 shadow sm:rounded",
91
91
  "body": [{
92
92
  "type": "service",
93
93
  "id": "u:d6db0c84f150",
@@ -4,7 +4,7 @@
4
4
  {
5
5
  "type": "wrapper",
6
6
  "visibleOn": "${AND(display != 'split', ${window:innerWidth > 768})}",
7
- "className": "bg-white m-0 p-0 flex-shrink-0 min-w-[240px] lg:order-first lg:flex lg:flex-col border-r border-gray-300",
7
+ "className": "bg-white p-0 flex-shrink-0 min-w-[240px] lg:order-first lg:flex lg:flex-col rounded shadow my-4 ml-4 mr-1 my-4 sm:rounded",
8
8
  "body": [
9
9
  {
10
10
  "type": "service",
@@ -23,7 +23,7 @@
23
23
  "type": "input-tree",
24
24
  "treeContainerClassName": "h-full",
25
25
  "name": "tree",
26
- "className": "instance-box-tree bg-white w-full",
26
+ "className": "instance-box-tree w-full",
27
27
  "id": "u:9f3dd961ca12",
28
28
  "stacked": true,
29
29
  "multiple": false,
@@ -90,7 +90,7 @@
90
90
  },
91
91
  {
92
92
  "type": "wrapper",
93
- "className": "steedos-instance-detail-wrapper m-0 p-0 flex-1 focus:outline-none lg:order-last sm:pt-3 sm:px-3",
93
+ "className": "steedos-instance-detail-wrapper m-0 p-0 flex-1 focus:outline-none lg:order-last sm:m-4 shadow sm:rounded",
94
94
  "body": [
95
95
  {
96
96
  "type": "service",
@@ -1,77 +1,23 @@
1
1
  {
2
2
  "type": "page",
3
- "title": "Welcome to Steedos",
4
3
  "body": [
5
4
  {
6
5
  "type": "service",
7
- "id": "instance_tasks_list_service",
8
- "className": "h-full w-full p-0 m-0",
9
- "pageGridClassName": "h-full m-0",
6
+ "className": "h-full",
10
7
  "body": [
11
8
  {
12
- "type": "steedos-object-listview",
13
- "objectApiName": "instance_tasks",
14
- "columnsTogglable": false,
15
- "filterVisible": true,
16
- "visibleOn": "${!!!flowId}",
17
- "showHeader": true,
18
- "id": "u:d29cef0d1007",
19
- "showDisplayAs": true,
20
- "className": "h-full w-full bg-white instance-tasks-list",
21
- "hiddenColumnOperation": true,
22
- "formFactor": "LARGE",
23
- "headerToolbarItems": [
24
- {
25
- "type": "button",
26
- "label": "",
27
- "icon": "fa fa-bars",
28
- "className": "bg-white p-2 rounded border-gray-300 text-gray-500",
29
- "align": "right",
30
- "onEvent": {
31
- "click": {
32
- "actions": [
33
- {
34
- "actionType": "custom",
35
- "script": "console.log(event.target);document.querySelector('.instances-customPage').classList.toggle('instances-sidebar-open');if(window.innerWidth < 768){document.querySelector('.isInset').classList.toggle('inset-0')}"
36
- }
37
- ]
38
- }
39
- },
40
- "id": "u:115e270cae4d"
41
- }
42
- ],
43
- "listName": "inbox",
44
- "rowClassNameExpr": "<%=(data.is_read === false && (!data.clientIds || data.clientIds.length == 0 || !data.clientIds.includes(data._id))) ? 'unread-instance' : '' %>",
45
- "rebuildOn": "\\${flowId || categoryId}",
46
- "adaptor": "const isSearch = _.some(_.keys(api.body.self), key => key.includes('__keywords') || key.includes('__searchable__'));\nif(payload.data.count==0 && !isSearch){\n const searchParams = new URLSearchParams(window.location.search);\n const flowId = searchParams.get(\"flowId\");\n const categoryId = searchParams.get(\"categoryId\");\n const pathname = window.location.pathname;\n if(flowId || categoryId){\n window.FlowRouter.go(pathname + \"?additionalFilters=&flowId=&categoryId=\");\n }\n // if(flowId) {\n // window.FlowRouter.go(pathname + \"?additionalFilters=['category','=','\" + categoryId +\"']&flowId=&categoryId=\" + categoryId);\n // }else if(categoryId) {\n // window.FlowRouter.go(pathname + \"?additionalFilters=&flowId=&categoryId=\");\n // }\n};\nif (api.body.self.listName == \"inbox\") {\n _.each(payload.data.rows, function (item, index) {\n if (item.type == 'cc') {\n item.instance_name += '(传阅)';\n }\n if (item.instance__expand.values) {\n const form_fields = api.body.self.form_fields;\n _.each(item.instance__expand.values, function (field, field_code) {\n const form_field = _.find(form_fields, { code: field_code });\n if (form_field && form_field.type == \"group\") {\n if (form_field.is_multiselect) {\n item.instance__expand.values[field_code] = field && field.length > 0 ? _.map(field, 'fullname').toString() : \"\";\n } else {\n item.instance__expand.values[field_code] = field ? field.fullname : \"\";\n }\n } else if (form_field && form_field.type == \"user\") {\n if (form_field.is_multiselect) {\n item.instance__expand.values[field_code] = field && field.length > 0 ? _.map(field, 'name').toString() : \"\";\n } else {\n item.instance__expand.values[field_code] = field ? field.name : \"\";\n }\n }\n })\n }\n })\n}\n"
47
- },
48
- {
49
- "type": "service",
50
- "visibleOn": "${!!flowId}",
51
- "schemaApi": {
52
- "url": "/graphql?flowId=${flowId}&categoryId=${categoryId}",
53
- "method": "post",
54
- "data": {
55
- "query": "{flow: flows__findOne(id:\"${flowId}\"){form__expand{current}}}"
56
- },
57
- "adaptor": "const schema = window.SteedosWorkflow.InstanceTask.getListViewSchema(payload.data.flow); return schema;"
58
- }
59
- },
60
- {
61
- "type": "action",
9
+ "type": "wrapper",
10
+ "size": "none",
11
+ "className": "flex flex-1 overflow-hidden h-full",
62
12
  "body": [
63
13
  {
64
- "type": "action",
65
- "className": {
66
- "mobileCss": "${window:innerWidth < 768}",
67
- "pcCss": "${window:innerWidth > 768}",
68
- "instances-sidebar-wrapper px-0 fixed z-20 h-full h-fill ease-in-out duration-300 flex flex-col overflow-y-auto bg-white block -translate-x-0 py-0 rounded shadow bg-white my-4 ml-4 mr-1": "true"
69
- },
14
+ "type": "wrapper",
15
+ "size": "none",
16
+ "className": "instances-sidebar-wrapper flex-shrink-0 min-w-[240px] overflow-y-auto sm:rounded shadow bg-white my-4 ml-4 mr-1 lg:order-first lg:flex lg:flex-col ",
70
17
  "body": [
71
18
  {
72
19
  "type": "service",
73
- "id": "u:aa4f4dc5f439",
74
- "className": "w-full h-full rounded",
20
+ "className": "bg-none",
75
21
  "onEvent": {
76
22
  "@data.changed.instance_tasks": {
77
23
  "actions": [
@@ -87,7 +33,6 @@
87
33
  "name": "tree",
88
34
  "treeContainerClassName": "h-full",
89
35
  "className": "instance-box-tree bg-white h-full w-full p-0",
90
- "id": "u:9f3dd961ca12",
91
36
  "stacked": true,
92
37
  "multiple": false,
93
38
  "enableNodePath": false,
@@ -110,7 +55,7 @@
110
55
  },
111
56
  {
112
57
  "actionType": "custom",
113
- "script": "if (window.innerWidth < 768) { document.querySelector('.instances-customPage').classList.remove('instances-sidebar-open'); document.querySelector('.isInset').classList.remove('inset-0') }\n//获取上一次的flowId和categoryId\nconst lastFlowId = event.data.flowId;\nconst lastCategoryId = event.data.categoryId;\n//从value中获取最新的flowId\nvar flowIdRegex = /&flowId=([^&]+)/;\nvar flowIdMatch = event.data.value.match(flowIdRegex);\nconst flowId = flowIdMatch && flowIdMatch.length > 0 ? flowIdMatch[1] : \"\";\n//从value中获取最新的categoryId\nvar categoryIdRegex = /&categoryId=([^&]+)/;\nvar categoryIdMatch = event.data.value.match(categoryIdRegex);\nconst categoryId = categoryIdMatch && categoryIdMatch.length > 0 ? categoryIdMatch[1] : \"\";\n//获取上一次的listname和最新的listname\nconst lastListName = event.data.listName;\nconst listName = event.data.value.split('?')[0].split('instance_tasks/grid/')[1];\n//切换流程时清除过滤条件\nif (lastListName == \"inbox\" && listName == \"inbox\" && (flowId != lastFlowId || categoryId != lastCategoryId)) {\n listViewPropsStoreKey = window.location.pathname + \"/crud\";\n sessionStorage.removeItem(listViewPropsStoreKey);\n sessionStorage.removeItem(listViewPropsStoreKey + \"/query\");\n}\n\n"
58
+ "script": "if (window.innerWidth < 768) { document.querySelector('.instances-customPage').classList.remove('instances-sidebar-open'); }\n//获取上一次的flowId和categoryId\nconst lastFlowId = event.data.flowId;\nconst lastCategoryId = event.data.categoryId;\n//从value中获取最新的flowId\nvar flowIdRegex = /&flowId=([^&]+)/;\nvar flowIdMatch = event.data.value.match(flowIdRegex);\nconst flowId = flowIdMatch && flowIdMatch.length > 0 ? flowIdMatch[1] : \"\";\n//从value中获取最新的categoryId\nvar categoryIdRegex = /&categoryId=([^&]+)/;\nvar categoryIdMatch = event.data.value.match(categoryIdRegex);\nconst categoryId = categoryIdMatch && categoryIdMatch.length > 0 ? categoryIdMatch[1] : \"\";\n//获取上一次的listname和最新的listname\nconst lastListName = event.data.listName;\nconst listName = event.data.value.split('?')[0].split('instance_tasks/grid/')[1];\n//切换流程时清除过滤条件\nif (lastListName == \"inbox\" && listName == \"inbox\" && (flowId != lastFlowId || categoryId != lastCategoryId)) {\n listViewPropsStoreKey = window.location.pathname + \"/crud\";\n sessionStorage.removeItem(listViewPropsStoreKey);\n sessionStorage.removeItem(listViewPropsStoreKey + \"/query\");\n}\n\n"
114
59
  },
115
60
  {
116
61
  "actionType": "setValue",
@@ -166,7 +111,8 @@
166
111
  "id": "u:74a18fd2df0b"
167
112
  },
168
113
  "unfoldedLevel": 2,
169
- "source": "${options}"
114
+ "source": "${options}",
115
+ "id": "u:09e092ab054a"
170
116
  }
171
117
  ],
172
118
  "api": {
@@ -175,33 +121,99 @@
175
121
  "headers": {
176
122
  "Authorization": "Bearer ${context.tenantId},${context.authToken}"
177
123
  },
178
- "messages": {
179
- },
124
+ "messages": {},
180
125
  "trackExpression": "${_reloadKey}"
181
126
  },
182
- "messages": {
183
- }
127
+ "messages": {},
128
+ "dsType": "api",
129
+ "id": "u:b22ab9089a5e"
184
130
  }
185
131
  ],
186
- "id": "u:5d1f5d7c38d2"
187
- }
188
- ],
189
- "onEvent": {
190
- "click": {
191
- "actions": [
132
+ "id": "u:fd659f5c3657",
133
+ "isFixedHeight": false,
134
+ "isFixedWidth": false
135
+ },
136
+ {
137
+ "type": "button",
138
+ "className": "instances-sidebar-overlay",
139
+ "id": "u:773b1d00aab2",
140
+ "visibleOn": "${isMobile}",
141
+ "body": [],
142
+ "onEvent": {
143
+ "click": {
144
+ "actions": [
145
+ {
146
+ "actionType": "custom",
147
+ "script": "document.querySelector('.instances-customPage').classList.toggle('instances-sidebar-open');"
148
+ }
149
+ ]
150
+ }
151
+ }
152
+ },
153
+ {
154
+ "type": "wrapper",
155
+ "size": "none",
156
+ "className": "flex-1 focus:outline-none lg:order-last w-96",
157
+ "body": [
158
+ {
159
+ "type": "steedos-object-listview",
160
+ "objectApiName": "instance_tasks",
161
+ "columnsTogglable": false,
162
+ "filterVisible": true,
163
+ "visibleOn": "${!!!flowId}",
164
+ "showHeader": true,
165
+ "id": "u:d29cef0d1007",
166
+ "showDisplayAs": true,
167
+ "className": "h-full w-full bg-white instance-tasks-list",
168
+ "hiddenColumnOperation": true,
169
+ "formFactor": "LARGE",
170
+ "headerToolbarItems": [
171
+ {
172
+ "type": "button",
173
+ "label": "",
174
+ "align": "left",
175
+ "icon": "fa fa-bars",
176
+ "className": "bg-white p-2 rounded border-gray-300 text-gray-500",
177
+ "onEvent": {
178
+ "click": {
179
+ "actions": [
180
+ {
181
+ "actionType": "custom",
182
+ "script": "document.querySelector('.instances-customPage').classList.toggle('instances-sidebar-open');"
183
+ }
184
+ ]
185
+ }
186
+ },
187
+ "id": "u:5f2ce9ca2de6"
188
+ }
189
+ ],
190
+ "listName": "inbox",
191
+ "rowClassNameExpr": "<%=(data.is_read === false && (!data.clientIds || data.clientIds.length == 0 || !data.clientIds.includes(data._id))) ? 'unread-instance' : '' %>",
192
+ "rebuildOn": "\\${flowId || categoryId}",
193
+ "adaptor": "const isSearch = _.some(_.keys(api.body.self), key => key.includes('__keywords') || key.includes('__searchable__'));\nif(payload.data.count==0 && !isSearch){\n const searchParams = new URLSearchParams(window.location.search);\n const flowId = searchParams.get(\"flowId\");\n const categoryId = searchParams.get(\"categoryId\");\n const pathname = window.location.pathname;\n if(flowId || categoryId){\n window.FlowRouter.go(pathname + \"?additionalFilters=&flowId=&categoryId=\");\n }\n // if(flowId) {\n // window.FlowRouter.go(pathname + \"?additionalFilters=['category','=','\" + categoryId +\"']&flowId=&categoryId=\" + categoryId);\n // }else if(categoryId) {\n // window.FlowRouter.go(pathname + \"?additionalFilters=&flowId=&categoryId=\");\n // }\n};\nif (api.body.self.listName == \"inbox\") {\n _.each(payload.data.rows, function (item, index) {\n if (item.type == 'cc') {\n item.instance_name += '(传阅)';\n }\n if (item.instance__expand.values) {\n const form_fields = api.body.self.form_fields;\n _.each(item.instance__expand.values, function (field, field_code) {\n const form_field = _.find(form_fields, { code: field_code });\n if (form_field && form_field.type == \"group\") {\n if (form_field.is_multiselect) {\n item.instance__expand.values[field_code] = field && field.length > 0 ? _.map(field, 'fullname').toString() : \"\";\n } else {\n item.instance__expand.values[field_code] = field ? field.fullname : \"\";\n }\n } else if (form_field && form_field.type == \"user\") {\n if (form_field.is_multiselect) {\n item.instance__expand.values[field_code] = field && field.length > 0 ? _.map(field, 'name').toString() : \"\";\n } else {\n item.instance__expand.values[field_code] = field ? field.name : \"\";\n }\n }\n })\n }\n })\n}\n"
194
+ },
192
195
  {
193
- "actionType": "custom",
194
- "script": "if(window.innerWidth < 768){document.querySelector('.instances-customPage').classList.remove('instances-sidebar-open');document.querySelector('.isInset').classList.remove('inset-0') }"
196
+ "type": "service",
197
+ "visibleOn": "${!!flowId}",
198
+ "schemaApi": {
199
+ "url": "/graphql?flowId=${flowId}&categoryId=${categoryId}",
200
+ "method": "post",
201
+ "data": {
202
+ "query": "{flow: flows__findOne(id:\"${flowId}\"){form__expand{current}}}"
203
+ },
204
+ "adaptor": "const schema = window.SteedosWorkflow.InstanceTask.getListViewSchema(payload.data.flow); return schema;"
205
+ },
206
+ "id": "u:dbe8ed1cab9d",
207
+ "dsType": "api"
195
208
  }
196
- ]
209
+ ],
210
+ "id": "u:a3a1e6aa0e2f"
197
211
  }
198
- },
199
- "className": {
200
- "absolute isInset": "true"
201
- },
202
- "id": "u:c8fc09ce5d6b"
212
+ ],
213
+ "id": "u:e0bc37818327"
203
214
  }
204
215
  ],
216
+ "id": "instance_tasks_list_service",
205
217
  "onEvent": {
206
218
  "@data.changed.steedos_keyvalues": {
207
219
  "actions": [
@@ -219,8 +231,10 @@
219
231
  }
220
232
  },
221
233
  "data": {
234
+ "isMobile": "${window:innerWidth <= 768}",
222
235
  "isFlowDataDone": false
223
- }
236
+ },
237
+ "dsType": "api"
224
238
  }
225
239
  ],
226
240
  "regions": [
@@ -229,30 +243,146 @@
229
243
  "data": {
230
244
  "objectName": "instance_tasks",
231
245
  "initialValues": {},
232
- "title": ""
246
+ "title": "",
247
+ "context": {
248
+ "rootUrl": "http://127.0.0.1:5600",
249
+ "tenantId": "68400b7542187738fb1bab2c",
250
+ "userId": "68400b7042187738fb1bab2a",
251
+ "authToken": "c317dc22e82ffecda1f13f09767a9242b3ee44363f2b4d19a436afea7994c8e2bdb72ff0426aae544ecc5c",
252
+ "user": {
253
+ "authToken": "c317dc22e82ffecda1f13f09767a9242b3ee44363f2b4d19a436afea7994c8e2bdb72ff0426aae544ecc5c",
254
+ "spaceId": "68400b7542187738fb1bab2c",
255
+ "userId": "68400b7042187738fb1bab2a",
256
+ "name": "YLH1",
257
+ "username": "yinlianghui",
258
+ "email": "yinlianghui@hotoa.com",
259
+ "utcOffset": null,
260
+ "steedos_id": "68400b7042187738fb1bab2a",
261
+ "locale": "en-us",
262
+ "language": "en",
263
+ "roles": [
264
+ "admin"
265
+ ],
266
+ "profile": "admin",
267
+ "user": "68400b7042187738fb1bab2a",
268
+ "user_accepted": true,
269
+ "organization": {
270
+ "_id": "68400b7542187738fb1bab2c",
271
+ "name": "TEW",
272
+ "fullname": "TEW",
273
+ "company_id": "68400b7542187738fb1bab2c"
274
+ },
275
+ "organizations": [
276
+ {
277
+ "_id": "68400b7542187738fb1bab2c",
278
+ "name": "TEW",
279
+ "fullname": "TEW",
280
+ "company_id": "68400b7542187738fb1bab2c"
281
+ },
282
+ {
283
+ "_id": "684784a17f4aeba0af86e0bb",
284
+ "name": "生产部",
285
+ "fullname": "生产部",
286
+ "company_id": "68400b7542187738fb1bab2c"
287
+ }
288
+ ],
289
+ "space": {
290
+ "_id": "68400b7542187738fb1bab2c",
291
+ "name": "TEW",
292
+ "admins": [
293
+ "68400b7042187738fb1bab2a",
294
+ "686ccd4a33466ba7d2a1fce6",
295
+ "686cc9f8b6409ed05d63c80d"
296
+ ]
297
+ },
298
+ "owner": "68400b7042187738fb1bab2a",
299
+ "created_by": "68400b7042187738fb1bab2a",
300
+ "created": "2025-06-04T09:01:41.340Z",
301
+ "modified_by": "68400b7042187738fb1bab2a",
302
+ "modified": "2025-08-31T09:38:56.388Z",
303
+ "email_verified": null,
304
+ "company_id": "68400b7542187738fb1bab2c",
305
+ "organizations_parents": [
306
+ "68400b7542187738fb1bab2c",
307
+ "684784a17f4aeba0af86e0bb"
308
+ ],
309
+ "company_ids": [
310
+ "68400b7542187738fb1bab2c"
311
+ ],
312
+ "spaces": [
313
+ {
314
+ "_id": "68400b7542187738fb1bab2c",
315
+ "name": "TEW",
316
+ "admins": [
317
+ "68400b7042187738fb1bab2a",
318
+ "686ccd4a33466ba7d2a1fce6",
319
+ "686cc9f8b6409ed05d63c80d"
320
+ ]
321
+ }
322
+ ],
323
+ "companies": [
324
+ {
325
+ "_id": "68400b7542187738fb1bab2c",
326
+ "name": "TEW",
327
+ "organization": "68400b7542187738fb1bab2c"
328
+ }
329
+ ],
330
+ "company": {
331
+ "_id": "68400b7542187738fb1bab2c",
332
+ "name": "TEW",
333
+ "organization": "68400b7542187738fb1bab2c"
334
+ },
335
+ "permission_shares": [],
336
+ "spaceUserId": "68400b7542187738fb1bab2d",
337
+ "is_space_admin": true,
338
+ "is_phone": false,
339
+ "is_tablet": false
340
+ }
341
+ }
233
342
  },
234
- "id": "u:7e20ab64163e",
343
+ "id": "u:b7167e2fcaf0",
344
+ "name": "page_instances_list",
345
+ "bodyClassName": "p-0",
235
346
  "asideResizor": false,
236
347
  "pullRefresh": {
237
348
  "disabled": true
238
349
  },
239
- "bodyClassName": {
240
- "p-0 instances-customPage instances-sidebar": "true",
241
- "pc instances-sidebar-open instances-minwidth": "${window:innerWidth > 768}"
350
+ "className": {
351
+ "instances-customPage h-full": true,
352
+ "instances-list-mobile": "${window:innerWidth < 768}",
353
+ "instances-list-pc instances-sidebar-open": "${window:innerWidth > 768}"
242
354
  },
355
+ "style": {},
356
+ "dsType": "api",
243
357
  "css": {
244
- ".instances-customPage.instances-sidebar.instances-sidebar-open.pc": {
245
- "margin-left": "256px"
358
+ ".instances-customPage.instances-list-mobile .instances-sidebar-wrapper": {
359
+ "z-index": "601",
360
+ "top": "50px",
361
+ "left": "0px",
362
+ "bottom": "0px",
363
+ "position": "fixed",
364
+ "margin": "0px"
365
+ },
366
+ ".instances-customPage.instances-list-mobile .instances-sidebar-overlay": {
367
+ "z-index": "600",
368
+ "position": "fixed",
369
+ "bottom": "0px",
370
+ "right": "0px",
371
+ "left": "0px",
372
+ "top": "50px",
373
+ "display": "none"
246
374
  },
247
- ".instances-sidebar-wrapper": {
375
+ ".instances-customPage.instances-list-mobile.instances-sidebar-open .instances-sidebar-overlay": {
376
+ "display": "block"
377
+ },
378
+ ".instances-customPage .instances-sidebar-wrapper": {
248
379
  "transition": "0.5s ease transform",
249
380
  "will-change": "transform",
250
381
  "transform": "translate(-100%,0)",
251
382
  "-webkit-transform": "translate(-100%,0)",
252
383
  "-moz-transform": "translate(-100%,0)",
253
384
  "-ms-transform": "translate(-100%,0)",
254
- "-o-transform": "translate(-100%,0)",
255
- "width": "240px"
385
+ "-o-transform": "translate(-100%,0)"
256
386
  },
257
387
  ".instances-customPage.instances-sidebar-open .instances-sidebar-wrapper": {
258
388
  "transform": "translate(0,0)",
@@ -261,20 +391,20 @@
261
391
  "-ms-transform": "translate(0,0)",
262
392
  "-o-transform": "translate(0,0)"
263
393
  },
264
- ".instances-sidebar-wrapper.pcCss": {
265
- "top": "50px",
266
- "left": "0px"
267
- },
268
- ".sidebar .instances-sidebar-wrapper.pcCss": {
269
- "left": "220px"
270
- },
271
- ".instances-sidebar-wrapper.mobileCss": {
272
- "top": "50px",
273
- "left": "0px",
274
- "padding-bottom": "65px"
394
+ ".instances-customPage.instances-list-pc .instances-sidebar-wrapper": {
395
+ "min-width": "0px",
396
+ "width": "0px"
275
397
  },
276
- ".instances-minwidth": {
277
- "min-width": "388px"
398
+ ".instances-customPage.instances-list-pc.instances-sidebar-open .instances-sidebar-wrapper": {
399
+ "min-width": "240px"
278
400
  }
279
- }
401
+ },
402
+ "themeCss": {
403
+ "baseControlClassName": {
404
+ "padding-and-margin:default": {
405
+ "padding": "${displayAs == 'grid'?'':'0px'}"
406
+ }
407
+ }
408
+ },
409
+ "title": "Welcome to Steedos"
280
410
  }
@@ -1,75 +1,24 @@
1
1
  {
2
2
  "type": "page",
3
- "title": "Welcome to Steedos",
4
3
  "body": [
5
4
  {
6
5
  "type": "service",
7
- "pageGridClassName": "h-full m-0",
6
+ "className": "h-full",
8
7
  "body": [
9
8
  {
10
- "type": "steedos-object-listview",
11
- "objectApiName": "instances",
12
- "columnsTogglable": false,
13
- "filterVisible": true,
14
- "visibleOn": "${!!!flowId}",
15
- "showHeader": true,
16
- "id": "u:d29cef0d1007",
17
- "showDisplayAs": true,
18
- "className": "h-full w-full bg-white",
19
- "hiddenColumnOperation": true,
20
- "formFactor": "LARGE",
21
- "headerToolbarItems": [
22
- {
23
- "type": "button",
24
- "label": "",
25
- "icon": "fa fa-bars",
26
- "className": "bg-white p-2 rounded border-gray-300 text-gray-500",
27
- "align": "right",
28
- "onEvent": {
29
- "click": {
30
- "actions": [
31
- {
32
- "actionType": "custom",
33
- "script": "console.log(event.target);document.querySelector('.instances-customPage').classList.toggle('instances-sidebar-open');if(window.innerWidth < 768){document.querySelector('.isInset').classList.toggle('inset-0')}"
34
- }
35
- ]
36
- }
37
- },
38
- "id": "u:115e270cae4d"
39
- }
40
- ],
41
- "listName": "completed",
42
- "rebuildOn": "${flowId || categoryId}",
43
- "adaptor": "//在列表上加流程表单字段时,group和user需要特殊处理\nif (api.body.self.listName == \"monitor\") {\n _.each(payload.data.rows, function (item, index) {\n if (item.values) {\n const form_fields = api.body.self.form_fields;\n _.each(item.values, function (field, field_code) {\n const form_field = _.find(form_fields, { code: field_code });\n if (form_field && form_field.type == \"group\") {\n if (form_field.is_multiselect) {\n item.values[field_code] = field && field.length > 0 ? _.map(field, 'fullname').toString() : \"\";\n } else {\n item.values[field_code] = field ? field.fullname : \"\";\n }\n } else if (form_field && form_field.type == \"user\") {\n if (form_field.is_multiselect) {\n item.values[field_code] = field && field.length > 0 ? _.map(field, 'name').toString() : \"\";\n } else {\n item.values[field_code] = field ? field.name : \"\";\n }\n }\n })\n }\n })\n}\n",
44
- "crudDataFilter": "if (data && data.flowId && (data.listName == 'inbox' || 'monitor') && window.innerWidth > 768) {\r\n var api = {\r\n url: \"${context.rootUrl}/graphql\",\r\n method: \"post\",\r\n dataType: \"json\",\r\n data: {\r\n \"query\": '{flow: flows__findOne(id:\"' + data.flowId + '\"){form__expand{current}}}'\r\n },\r\n headers: {\r\n Authorization:\r\n \"Bearer ${context.tenantId},${context.authToken}\",\r\n },\r\n };\r\n return env.fetcher(api).then((result) => {\r\n if (result.data && result.data.flow && result.data.flow.form__expand.current.fields && result.data.flow.form__expand.current.fields.length > 0) {\r\n let fields = result.data.flow.form__expand.current.fields;\r\n fields.forEach(function (field) {\r\n if (field.is_list_display) {\r\n crud.columns.push({\r\n \"name\": \"values.\" + field.code,\r\n \"label\": field.name || field.code,\r\n \"width\": \"unset\",\r\n \"type\": \"text\",\r\n \"className\": \" whitespace-nowrap\",\r\n \"static\": true,\r\n \"options\": null\r\n });\r\n }\r\n })\r\n let schemaApiService = data._scoped.parent.getComponentById(\"instances_list_service\");\r\n schemaApiService && schemaApiService.setData({ form_fields: fields, isFlowDataDone: true });\r\n // crud.api.sendOn = \"this.isFlowDataDone\";\r\n }\r\n return crud;\r\n });\r\n} else {\r\n let schemaApiService = data._scoped.parent.getComponentById(\"instances_list_service\");\r\n schemaApiService && schemaApiService.setData({ isFlowDataDone: true });\r\n // crud.api.sendOn = \"this.isFlowDataDone\";\r\n return crud;\r\n}\r\n"
45
- },
46
- {
47
- "type": "service",
48
- "visibleOn": "${!!flowId}",
49
- "schemaApi": {
50
- "url": "/graphql?flowId=${flowId}&categoryId=${categoryId}",
51
- "method": "post",
52
- "data": {
53
- "query": "{flow: flows__findOne(id:\"${flowId}\"){form__expand{current}}}"
54
- },
55
- "adaptor": "const schema = window.SteedosWorkflow.Instance.getListViewSchema(payload.data.flow); return schema;"
56
- }
57
- },
58
- {
59
- "type": "action",
9
+ "type": "wrapper",
10
+ "size": "none",
11
+ "className": "flex flex-1 overflow-hidden h-full",
60
12
  "body": [
61
13
  {
62
- "type": "action",
63
- "className": {
64
- "mobileCss": "${window:innerWidth < 768}",
65
- "pcCss": "${window:innerWidth > 768}",
66
- "instances-sidebar-wrapper px-0 fixed z-20 h-full h-fill ease-in-out duration-300 flex flex-col overflow-y-auto bg-white block -translate-x-0 py-0 rounded shadow bg-white my-4 ml-4 mr-1": "true"
67
- },
14
+ "type": "wrapper",
15
+ "size": "none",
16
+ "className": "instances-sidebar-wrapper flex-shrink-0 min-w-[240px] overflow-y-auto sm:rounded shadow bg-white my-4 ml-4 mr-1 lg:order-first lg:flex lg:flex-col ",
68
17
  "body": [
69
18
  {
70
19
  "type": "service",
71
20
  "id": "u:aa4f4dc5f439",
72
- "className": "w-full h-full rounded",
21
+ "className": "bg-none",
73
22
  "onEvent": {
74
23
  "@data.changed.instances": {
75
24
  "actions": [
@@ -108,7 +57,7 @@
108
57
  },
109
58
  {
110
59
  "actionType": "custom",
111
- "script": "if (window.innerWidth < 768) { document.querySelector('.instances-customPage').classList.remove('instances-sidebar-open'); document.querySelector('.isInset').classList.remove('inset-0') }\n//获取上一次的flowId和categoryId\nconst lastFlowId = event.data.flowId;\nconst lastCategoryId = event.data.categoryId;\n//从value中获取最新的flowId\nvar flowIdRegex = /&flowId=([^&]+)/;\nvar flowIdMatch = event.data.value.match(flowIdRegex);\nconst flowId = flowIdMatch && flowIdMatch.length > 0 ? flowIdMatch[1] : \"\";\n//从value中获取最新的categoryId\nvar categoryIdRegex = /&categoryId=([^&]+)/;\nvar categoryIdMatch = event.data.value.match(categoryIdRegex);\nconst categoryId = categoryIdMatch && categoryIdMatch.length > 0 ? categoryIdMatch[1] : \"\";\n//获取上一次的listname和最新的listname\nconst lastListName = event.data.listName;\nconst listName = event.data.value.split('?')[0].split('instances/grid/')[1];\n//切换流程时清除过滤条件\nif (lastListName == \"monitor\" && listName == \"monitor\" && (flowId != lastFlowId || categoryId != lastCategoryId)) {\n listViewPropsStoreKey = window.location.pathname + \"/crud\";\n sessionStorage.removeItem(listViewPropsStoreKey);\n sessionStorage.removeItem(listViewPropsStoreKey + \"/query\");\n}"
60
+ "script": "if (window.innerWidth < 768) { document.querySelector('.instances-customPage').classList.remove('instances-sidebar-open'); }\n//获取上一次的flowId和categoryId\nconst lastFlowId = event.data.flowId;\nconst lastCategoryId = event.data.categoryId;\n//从value中获取最新的flowId\nvar flowIdRegex = /&flowId=([^&]+)/;\nvar flowIdMatch = event.data.value.match(flowIdRegex);\nconst flowId = flowIdMatch && flowIdMatch.length > 0 ? flowIdMatch[1] : \"\";\n//从value中获取最新的categoryId\nvar categoryIdRegex = /&categoryId=([^&]+)/;\nvar categoryIdMatch = event.data.value.match(categoryIdRegex);\nconst categoryId = categoryIdMatch && categoryIdMatch.length > 0 ? categoryIdMatch[1] : \"\";\n//获取上一次的listname和最新的listname\nconst lastListName = event.data.listName;\nconst listName = event.data.value.split('?')[0].split('instances/grid/')[1];\n//切换流程时清除过滤条件\nif (lastListName == \"monitor\" && listName == \"monitor\" && (flowId != lastFlowId || categoryId != lastCategoryId)) {\n listViewPropsStoreKey = window.location.pathname + \"/crud\";\n sessionStorage.removeItem(listViewPropsStoreKey);\n sessionStorage.removeItem(listViewPropsStoreKey + \"/query\");\n}"
112
61
  },
113
62
  {
114
63
  "actionType": "setValue",
@@ -141,7 +90,8 @@
141
90
  {
142
91
  "type": "tpl",
143
92
  "className": "flex-1 w-6/12",
144
- "tpl": "${label}"
93
+ "tpl": "${label}",
94
+ "id": "u:9dee51f00db4"
145
95
  },
146
96
  {
147
97
  "type": "tpl",
@@ -156,9 +106,11 @@
156
106
  "mode": "text",
157
107
  "text": "${tag | toInt}",
158
108
  "overflowCount": 999
159
- }
109
+ },
110
+ "id": "u:2329cd1fecc2"
160
111
  }
161
- ]
112
+ ],
113
+ "id": "u:545154bcc334"
162
114
  },
163
115
  "unfoldedLevel": 2,
164
116
  "source": "${options}"
@@ -172,27 +124,94 @@
172
124
  },
173
125
  "messages": {}
174
126
  },
175
- "messages": {}
127
+ "messages": {},
128
+ "dsType": "api"
176
129
  }
177
- ]
178
- }
179
- ],
180
- "onEvent": {
181
- "click": {
182
- "actions": [
130
+ ],
131
+ "id": "u:fd659f5c3657",
132
+ "isFixedHeight": false,
133
+ "isFixedWidth": false
134
+ },
135
+ {
136
+ "type": "button",
137
+ "className": "instances-sidebar-overlay",
138
+ "id": "u:773b1d00aab2",
139
+ "visibleOn": "${isMobile}",
140
+ "body": [],
141
+ "onEvent": {
142
+ "click": {
143
+ "actions": [
144
+ {
145
+ "actionType": "custom",
146
+ "script": "document.querySelector('.instances-customPage').classList.toggle('instances-sidebar-open');"
147
+ }
148
+ ]
149
+ }
150
+ }
151
+ },
152
+ {
153
+ "type": "wrapper",
154
+ "size": "none",
155
+ "className": "flex-1 focus:outline-none lg:order-last w-96",
156
+ "body": [
157
+ {
158
+ "type": "steedos-object-listview",
159
+ "objectApiName": "instances",
160
+ "columnsTogglable": false,
161
+ "filterVisible": true,
162
+ "visibleOn": "${!!!flowId}",
163
+ "showHeader": true,
164
+ "id": "u:d29cef0d1007",
165
+ "showDisplayAs": true,
166
+ "className": "bg-gray-100",
167
+ "hiddenColumnOperation": true,
168
+ "formFactor": "LARGE",
169
+ "headerToolbarItems": [
170
+ {
171
+ "type": "button",
172
+ "label": "",
173
+ "align": "left",
174
+ "icon": "fa fa-bars",
175
+ "className": "bg-white p-2 rounded border-gray-300 text-gray-500",
176
+ "onEvent": {
177
+ "click": {
178
+ "actions": [
179
+ {
180
+ "actionType": "custom",
181
+ "script": "document.querySelector('.instances-customPage').classList.toggle('instances-sidebar-open');"
182
+ }
183
+ ]
184
+ }
185
+ },
186
+ "id": "u:6f237cc36419"
187
+ }
188
+ ],
189
+ "listName": "completed",
190
+ "rebuildOn": "${flowId || categoryId}",
191
+ "adaptor": "//在列表上加流程表单字段时,group和user需要特殊处理\nif (api.body.self.listName == \"monitor\") {\n _.each(payload.data.rows, function (item, index) {\n if (item.values) {\n const form_fields = api.body.self.form_fields;\n _.each(item.values, function (field, field_code) {\n const form_field = _.find(form_fields, { code: field_code });\n if (form_field && form_field.type == \"group\") {\n if (form_field.is_multiselect) {\n item.values[field_code] = field && field.length > 0 ? _.map(field, 'fullname').toString() : \"\";\n } else {\n item.values[field_code] = field ? field.fullname : \"\";\n }\n } else if (form_field && form_field.type == \"user\") {\n if (form_field.is_multiselect) {\n item.values[field_code] = field && field.length > 0 ? _.map(field, 'name').toString() : \"\";\n } else {\n item.values[field_code] = field ? field.name : \"\";\n }\n }\n })\n }\n })\n}\n",
192
+ "crudDataFilter": "if (data && data.flowId && (data.listName == 'inbox' || 'monitor') && window.innerWidth > 768) {\r\n var api = {\r\n url: \"${context.rootUrl}/graphql\",\r\n method: \"post\",\r\n dataType: \"json\",\r\n data: {\r\n \"query\": '{flow: flows__findOne(id:\"' + data.flowId + '\"){form__expand{current}}}'\r\n },\r\n headers: {\r\n Authorization:\r\n \"Bearer ${context.tenantId},${context.authToken}\",\r\n },\r\n };\r\n return env.fetcher(api).then((result) => {\r\n if (result.data && result.data.flow && result.data.flow.form__expand.current.fields && result.data.flow.form__expand.current.fields.length > 0) {\r\n let fields = result.data.flow.form__expand.current.fields;\r\n fields.forEach(function (field) {\r\n if (field.is_list_display) {\r\n crud.columns.push({\r\n \"name\": \"values.\" + field.code,\r\n \"label\": field.name || field.code,\r\n \"width\": \"unset\",\r\n \"type\": \"text\",\r\n \"className\": \" whitespace-nowrap\",\r\n \"static\": true,\r\n \"options\": null\r\n });\r\n }\r\n })\r\n let schemaApiService = data._scoped.parent.getComponentById(\"instances_list_service\");\r\n schemaApiService && schemaApiService.setData({ form_fields: fields, isFlowDataDone: true });\r\n // crud.api.sendOn = \"this.isFlowDataDone\";\r\n }\r\n return crud;\r\n });\r\n} else {\r\n let schemaApiService = data._scoped.parent.getComponentById(\"instances_list_service\");\r\n schemaApiService && schemaApiService.setData({ isFlowDataDone: true });\r\n // crud.api.sendOn = \"this.isFlowDataDone\";\r\n return crud;\r\n}\r\n"
193
+ },
183
194
  {
184
- "actionType": "custom",
185
- "script": " if(window.innerWidth < 768){ document.querySelector('.instances-customPage').classList.remove('instances-sidebar-open');document.querySelector('.isInset').classList.remove('inset-0') }"
195
+ "type": "service",
196
+ "visibleOn": "${!!flowId}",
197
+ "schemaApi": {
198
+ "url": "/graphql?flowId=${flowId}&categoryId=${categoryId}",
199
+ "method": "post",
200
+ "data": {
201
+ "query": "{flow: flows__findOne(id:\"${flowId}\"){form__expand{current}}}"
202
+ },
203
+ "adaptor": "const schema = window.SteedosWorkflow.Instance.getListViewSchema(payload.data.flow); console.log('===schema==234==>', schema);return schema;"
204
+ },
205
+ "id": "u:30c21a4ee7cb",
206
+ "dsType": "api"
186
207
  }
187
- ]
208
+ ],
209
+ "id": "u:ca495ec221e7"
188
210
  }
189
- },
190
- "className": {
191
- "absolute isInset": "true"
192
- }
211
+ ],
212
+ "id": "u:9526a450d59b"
193
213
  }
194
214
  ],
195
- "className": "h-full w-full p-0 m-0",
196
215
  "id": "instances_list_service",
197
216
  "onEvent": {
198
217
  "@data.changed.steedos_keyvalues": {
@@ -211,46 +230,158 @@
211
230
  }
212
231
  },
213
232
  "data": {
233
+ "isMobile": "${window:innerWidth <= 768}",
214
234
  "isFlowDataDone": false
215
- }
235
+ },
236
+ "dsType": "api"
216
237
  }
217
238
  ],
218
239
  "regions": [
219
240
  "body"
220
241
  ],
221
242
  "data": {
222
- "objectName": "instance_tasks",
243
+ "objectName": "instances",
223
244
  "initialValues": {},
224
245
  "title": "",
225
246
  "context": {
226
- "rootUrl": "http://127.0.0.1:5000",
227
- "tenantId": "644484b7aff6100247b3e6cf",
228
- "userId": "6c017281-b966-49fe-aa2b-f09b835feed7",
229
- "authToken": "ec7b993f86f01162b471f17d9063241beb7c57987a45d40f911e40269ca2e21b8f806cba87de7be1a07c41"
247
+ "rootUrl": "http://127.0.0.1:5600",
248
+ "tenantId": "68400b7542187738fb1bab2c",
249
+ "userId": "68400b7042187738fb1bab2a",
250
+ "authToken": "cc31877680017ca5bc8b6de2a9f1cb38debce7c39bd2f79e21c43400783f8c4d852662a1e443e9c44584be",
251
+ "user": {
252
+ "authToken": "cc31877680017ca5bc8b6de2a9f1cb38debce7c39bd2f79e21c43400783f8c4d852662a1e443e9c44584be",
253
+ "spaceId": "68400b7542187738fb1bab2c",
254
+ "userId": "68400b7042187738fb1bab2a",
255
+ "name": "YLH1",
256
+ "username": "yinlianghui",
257
+ "email": "yinlianghui@hotoa.com",
258
+ "utcOffset": null,
259
+ "steedos_id": "68400b7042187738fb1bab2a",
260
+ "locale": "en-us",
261
+ "language": "en",
262
+ "roles": [
263
+ "admin"
264
+ ],
265
+ "profile": "admin",
266
+ "user": "68400b7042187738fb1bab2a",
267
+ "user_accepted": true,
268
+ "organization": {
269
+ "_id": "68400b7542187738fb1bab2c",
270
+ "name": "TEW",
271
+ "fullname": "TEW",
272
+ "company_id": "68400b7542187738fb1bab2c"
273
+ },
274
+ "organizations": [
275
+ {
276
+ "_id": "68400b7542187738fb1bab2c",
277
+ "name": "TEW",
278
+ "fullname": "TEW",
279
+ "company_id": "68400b7542187738fb1bab2c"
280
+ },
281
+ {
282
+ "_id": "684784a17f4aeba0af86e0bb",
283
+ "name": "生产部",
284
+ "fullname": "生产部",
285
+ "company_id": "68400b7542187738fb1bab2c"
286
+ }
287
+ ],
288
+ "space": {
289
+ "_id": "68400b7542187738fb1bab2c",
290
+ "name": "TEW",
291
+ "admins": [
292
+ "68400b7042187738fb1bab2a",
293
+ "686ccd4a33466ba7d2a1fce6",
294
+ "686cc9f8b6409ed05d63c80d"
295
+ ]
296
+ },
297
+ "owner": "68400b7042187738fb1bab2a",
298
+ "created_by": "68400b7042187738fb1bab2a",
299
+ "created": "2025-06-04T09:01:41.340Z",
300
+ "modified_by": "68400b7042187738fb1bab2a",
301
+ "modified": "2025-08-31T09:38:56.388Z",
302
+ "email_verified": null,
303
+ "company_id": "68400b7542187738fb1bab2c",
304
+ "organizations_parents": [
305
+ "68400b7542187738fb1bab2c",
306
+ "684784a17f4aeba0af86e0bb"
307
+ ],
308
+ "company_ids": [
309
+ "68400b7542187738fb1bab2c"
310
+ ],
311
+ "spaces": [
312
+ {
313
+ "_id": "68400b7542187738fb1bab2c",
314
+ "name": "TEW",
315
+ "admins": [
316
+ "68400b7042187738fb1bab2a",
317
+ "686ccd4a33466ba7d2a1fce6",
318
+ "686cc9f8b6409ed05d63c80d"
319
+ ]
320
+ }
321
+ ],
322
+ "companies": [
323
+ {
324
+ "_id": "68400b7542187738fb1bab2c",
325
+ "name": "TEW",
326
+ "organization": "68400b7542187738fb1bab2c"
327
+ }
328
+ ],
329
+ "company": {
330
+ "_id": "68400b7542187738fb1bab2c",
331
+ "name": "TEW",
332
+ "organization": "68400b7542187738fb1bab2c"
333
+ },
334
+ "permission_shares": [],
335
+ "spaceUserId": "68400b7542187738fb1bab2d",
336
+ "is_space_admin": true,
337
+ "is_phone": false,
338
+ "is_tablet": false
339
+ }
230
340
  }
231
341
  },
232
- "id": "u:7e20ab64163e",
342
+ "id": "u:b7167e2fcaf0",
343
+ "name": "page_instances_list",
344
+ "bodyClassName": "p-0",
233
345
  "asideResizor": false,
234
346
  "pullRefresh": {
235
347
  "disabled": true
236
348
  },
237
- "bodyClassName": {
238
- "p-0 instances-customPage instances-sidebar": "true",
239
- "pc instances-sidebar-open instances-minwidth": "${window:innerWidth > 768}"
349
+ "className": {
350
+ "instances-customPage h-full": true,
351
+ "instances-list-mobile": "${window:innerWidth < 768}",
352
+ "instances-list-pc instances-sidebar-open": "${window:innerWidth > 768}"
240
353
  },
354
+ "style": {},
355
+ "dsType": "api",
241
356
  "css": {
242
- ".instances-customPage.instances-sidebar.instances-sidebar-open.pc": {
243
- "margin-left": "256px"
357
+ ".instances-customPage.instances-list-mobile .instances-sidebar-wrapper": {
358
+ "z-index": "601",
359
+ "top": "50px",
360
+ "left": "0px",
361
+ "bottom": "0px",
362
+ "position": "fixed",
363
+ "margin": "0px"
364
+ },
365
+ ".instances-customPage.instances-list-mobile .instances-sidebar-overlay": {
366
+ "z-index": "600",
367
+ "position": "fixed",
368
+ "bottom": "0px",
369
+ "right": "0px",
370
+ "left": "0px",
371
+ "top": "50px",
372
+ "display": "none"
373
+ },
374
+ ".instances-customPage.instances-list-mobile.instances-sidebar-open .instances-sidebar-overlay": {
375
+ "display": "block"
244
376
  },
245
- ".instances-sidebar-wrapper": {
377
+ ".instances-customPage .instances-sidebar-wrapper": {
246
378
  "transition": "0.5s ease transform",
247
379
  "will-change": "transform",
248
380
  "transform": "translate(-100%,0)",
249
381
  "-webkit-transform": "translate(-100%,0)",
250
382
  "-moz-transform": "translate(-100%,0)",
251
383
  "-ms-transform": "translate(-100%,0)",
252
- "-o-transform": "translate(-100%,0)",
253
- "width": "240px"
384
+ "-o-transform": "translate(-100%,0)"
254
385
  },
255
386
  ".instances-customPage.instances-sidebar-open .instances-sidebar-wrapper": {
256
387
  "transform": "translate(0,0)",
@@ -259,20 +390,19 @@
259
390
  "-ms-transform": "translate(0,0)",
260
391
  "-o-transform": "translate(0,0)"
261
392
  },
262
- ".instances-sidebar-wrapper.pcCss": {
263
- "top": "50px",
264
- "left": "0px"
265
- },
266
- ".sidebar .instances-sidebar-wrapper.pcCss": {
267
- "left": "220px"
268
- },
269
- ".instances-sidebar-wrapper.mobileCss": {
270
- "top": "50px",
271
- "left": "0px",
272
- "padding-bottom": "65px"
393
+ ".instances-customPage.instances-list-pc .instances-sidebar-wrapper": {
394
+ "min-width": "0px",
395
+ "width": "0px"
273
396
  },
274
- ".instances-minwidth": {
275
- "min-width": "388px"
397
+ ".instances-customPage.instances-list-pc.instances-sidebar-open .instances-sidebar-wrapper": {
398
+ "min-width": "240px"
399
+ }
400
+ },
401
+ "themeCss": {
402
+ "baseControlClassName": {
403
+ "padding-and-margin:default": {
404
+ "padding": "${displayAs == 'grid'?'':'0px'}"
405
+ }
276
406
  }
277
407
  }
278
408
  }
@@ -83,11 +83,16 @@ router.post('/api/workflow/v2/nextStepUsers', requireAuthentication, async funct
83
83
  var
84
84
  userField = nextStep.approver_user_field,
85
85
  userFieldValue = values[userField];
86
- if (userField.is_multiselect) { //如果多选,以userFieldValue值为Array
87
- nextStepUsers = await WorkflowManager.getUsers(spaceId, userFieldValue);
88
- } else {
89
- nextStepUsers.push(await WorkflowManager.getUser(spaceId, userFieldValue));
86
+ if(userFieldValue){
87
+ if (_.isArray(userFieldValue)) { //如果多选,以userFieldValue值为Array
88
+ nextStepUsers = await WorkflowManager.getUsers(spaceId, userFieldValue);
89
+ } else {
90
+ nextStepUsers.push(await WorkflowManager.getUser(spaceId, userFieldValue));
91
+ }
92
+ }else {
93
+ error = "FIELD_VALUE_EMPTY";
90
94
  }
95
+
91
96
  break;
92
97
  case 'orgField':
93
98
  var
@@ -96,7 +101,7 @@ router.post('/api/workflow/v2/nextStepUsers', requireAuthentication, async funct
96
101
  orgField = nextStep.approver_org_field,
97
102
  orgFieldValue = values[orgField];
98
103
  if (orgFieldValue) {
99
- if (orgField.is_multiselect) { //如果多选,以orgFieldValue值为Array
104
+ if (_.isArray(orgFieldValue)) { //如果多选,以orgFieldValue值为Array
100
105
  orgs = await WorkflowManager.getOrganizations(orgFieldValue);
101
106
  orgChildrens = await WorkflowManager.getOrganizationsChildrens(spaceId, orgFieldValue);
102
107
  } else {
@@ -105,7 +110,7 @@ router.post('/api/workflow/v2/nextStepUsers', requireAuthentication, async funct
105
110
  }
106
111
  nextStepUsers = await WorkflowManager.getOrganizationsUsers(spaceId, orgChildrens);
107
112
 
108
- orgFieldUsers = await WorkflowManager.getOrganizationsUsers(spaceId, orgs);
113
+ const orgFieldUsers = await WorkflowManager.getOrganizationsUsers(spaceId, orgs);
109
114
 
110
115
  nextStepUsers = nextStepUsers.concat(orgFieldUsers);
111
116
 
@@ -131,7 +136,7 @@ router.post('/api/workflow/v2/nextStepUsers', requireAuthentication, async funct
131
136
  userFieldValue = values[userField],
132
137
  approverRoleIds = nextStep.approver_roles;
133
138
  if (userFieldValue) {
134
- if (userField.is_multiselect) { //如果多选,以userFieldValue值为Array
139
+ if (_.isArray(userFieldValue)) { //如果多选,以userFieldValue值为Array
135
140
  nextStepUsers = await WorkflowManager.getRoleUsersByUsersAndRoles(spaceId, userFieldValue, approverRoleIds);
136
141
  } else {
137
142
  nextStepUsers = await WorkflowManager.getRoleUsersByUsersAndRoles(spaceId, [userFieldValue], approverRoleIds);
@@ -153,7 +158,7 @@ router.post('/api/workflow/v2/nextStepUsers', requireAuthentication, async funct
153
158
  approverRoleIds = nextStep.approver_roles;
154
159
 
155
160
  if (orgFieldValue) {
156
- if (orgField.is_multiselect) { //如果多选,以orgFieldValue值为Array
161
+ if (_.isArray(orgFieldValue)) { //如果多选,以orgFieldValue值为Array
157
162
  nextStepUsers = await WorkflowManager.getRoleUsersByOrgsAndRoles(spaceId, orgFieldValue, approverRoleIds);
158
163
  } else {
159
164
  nextStepUsers = await WorkflowManager.getRoleUsersByOrgsAndRoles(spaceId, [orgFieldValue], approverRoleIds);
@@ -160,8 +160,8 @@ function transformFormFields(amisField) {
160
160
 
161
161
 
162
162
  if(amisField.type === 'steedos-field'){
163
- return {
164
- _id: new ObjectId().toHexString(),
163
+ const sfield = {
164
+ _id: amisField.config.name,
165
165
  code: amisField.config.name,
166
166
  name: amisField.config.label,
167
167
  is_wide: amisField.config.is_wide,
@@ -173,6 +173,17 @@ function transformFormFields(amisField) {
173
173
  type: 'steedos-field',
174
174
  config: amisField.config
175
175
  }
176
+
177
+ let tempConfig = amisField.config;
178
+
179
+ if (tempConfig.reference_to === "organizations") {
180
+ sfield.type = 'group'
181
+ sfield._type = 'steedos-field'
182
+ }else if(tempConfig.reference_to === "space_users" || tempConfig.reference_to === "users"){
183
+ sfield.type = 'user'
184
+ sfield._type = 'steedos-field'
185
+ }
186
+ return sfield;
176
187
  };
177
188
 
178
189
  let formFieldsItem = {
@@ -454,7 +465,7 @@ function transformFormFields(amisField) {
454
465
 
455
466
  if (tempConfig.reference_to === "organizations") {
456
467
  steedosField.type = 'group'
457
- }else if(tempConfig.reference_to === "space_users"){
468
+ }else if(tempConfig.reference_to === "space_users" || tempConfig.reference_to === "user"){
458
469
  // && tempConfig.reference_to_field === 'user'
459
470
  steedosField.type = 'user'
460
471
  }else{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos-labs/plugin-workflow",
3
- "version": "3.0.0-beta.25",
3
+ "version": "3.0.0-beta.27",
4
4
  "main": "package.service.js",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -366,4 +366,8 @@ tbody .color-priority-muted *{
366
366
  .steedos-amis-instance-view-body .antd-Panel-title{
367
367
  font-size: 14px;
368
368
  font-weight: 500;
369
+ }
370
+
371
+ .steedos-amis-instance-view-body .approve-button{
372
+ z-index: 900;
369
373
  }