@steedos/service-plugin-amis 2.3.0-beta.16 → 2.3.0-beta.18

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.
@@ -22,7 +22,10 @@
22
22
  "responseData": {
23
23
  "recordId": "${record._id}"
24
24
  },
25
- "adaptor": "\n SteedosUI.getRef(api.body.modalName).close();\n SteedosUI.router.go({objectName: api.body.objectName, recordId: payload.data.record._id, type: api.body.recordId ? 'edit': 'new'});\n return payload;\n "
25
+ "adaptor": "\n SteedosUI.getRef(api.body.modalName).close();\n SteedosUI.router.go({objectName: api.body.objectName, recordId: payload.data.record._id, type: api.body.recordId ? 'edit': 'new'});\n return payload;\n ",
26
+ "headers": {
27
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
28
+ }
26
29
  },
27
30
  "initApi": {
28
31
  "method": "post",
@@ -31,6 +34,9 @@
31
34
  "adaptor": "var data = payload.data.data[0];\nif(data){\n //初始化接口返回的字段移除字段值为null的字段\n for (key in data){\n if(data[key] === null){\n delete data[key];\n }\n }\n};\npayload.data = data;\ndelete payload.extensions;\nreturn payload;\n ",
32
35
  "data": {
33
36
  "query": "{data:apps(filters:[\"_id\", \"=\", \"${recordId}\"]){_id,name,code,icon_slds,visible,description,tabs,tab_items,tab_groups,objects,mobile_objects,is_creator,mobile,sort,url,is_use_ie,is_use_iframe,is_new_window,on_click,auth_name,secret,is_system,from_code_id,instance_state,created,created_by:created_by__expand{_id,name},modified,modified_by:modified_by__expand{_id,name},_display{visible,is_creator,mobile,is_use_ie,is_use_iframe,is_new_window,is_system,instance_state,created,modified}}}"
37
+ },
38
+ "headers": {
39
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
34
40
  }
35
41
  },
36
42
  "initFetch": true,
@@ -47,9 +53,10 @@
47
53
  "data": {
48
54
  "query": "{options:tabs{_id label:label value:name,type,object,desktop,mobile}}"
49
55
  },
50
- "sendOn": ""
56
+ "headers": {
57
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
58
+ }
51
59
  },
52
- "messages": {},
53
60
  "placeholder": "-",
54
61
  "body": [
55
62
  {
@@ -84,31 +91,34 @@
84
91
  "id": "u:784ac1e92fbf"
85
92
  },
86
93
  {
87
- "name": "icon_slds",
88
- "label": "图标",
89
- "type": "select",
90
- "className": "m-0",
91
- "labelClassName": "text-left",
92
- "id": "u:d0724fe17aa7",
93
- "required": true,
94
- "joinValues": false,
95
- "extractValue": true,
96
- "labelField": "label",
97
- "valueField": "value",
98
- "multiple": false,
99
- "source": {
100
- "method": "post",
101
- "url": "${context.rootUrl}/graphql",
102
- "data": {
103
- "query": "{objects(filters: [\"_id\", \"=\", \"-1\"]){_id}}",
104
- "$": "$$",
105
- "$term": "$term",
106
- "$value": "$icon_slds._id",
107
- "rfield": "${object_name}"
108
- },
109
- "requestAdaptor": "\n var filters = '[]';\n var top = 10;\n if(api.data.$term){\n filters = '[\"name\", \"contains\", \"'+ api.data.$term +'\"]';\n }else if(api.data.$value){\n filters = '[\"_id\", \"=\", \"'+ api.data.$value +'\"]';\n }\n api.data.query = api.data.query.replace(/{__filters}/g, filters).replace('{__top}', top);\n return api;\n ",
110
- "adaptor": "\npayload.data.options = eval(function anonymous() {\n\n var options;\n options = [];\n if (!window.Creator) { \n return options;\n }\n _.forEach(Creator.resources.sldsIcons.standard, function (svg) {\n return options.push({\n value: svg,\n label: svg,\n icon: svg\n });\n });\n\n return options;\n\n})(api.data);\n\nreturn payload;\n ",
111
- "messages": {}
94
+ "type": "service",
95
+ "body": [
96
+ {
97
+ "name": "icon_slds",
98
+ "label": "图标",
99
+ "type": "select",
100
+ "className": "m-0",
101
+ "labelClassName": "text-left",
102
+ "id": "u:d0724fe17aa7",
103
+ "required": true,
104
+ "joinValues": false,
105
+ "extractValue": true,
106
+ "labelField": "symbol",
107
+ "valueField": "symbol",
108
+ "multiple": false,
109
+ "source": "${sldsIconsOptions}",
110
+ "menuTpl": "<span class=\"flex justify-center items-center mt-0.5\">\n <span role=\"img\" aria-label=\"smile\" class=\"anticon anticon-smile\">\n <span class=\"slds-icon_container slds-icon-standard-${symbol|split:_|join:-}\">\n <svg class=\"slds-icon slds-icon_x-small\" aria-hidden=\"true\">\n <use xlink:href=\"/unpkg.com/@salesforce-ux/design-system/assets/icons/standard-sprite/svg/symbols.svg#${symbol}\"></use>\n </svg>\n </span>\n </span>\n <span class=\"pl-1.5\">${symbol}</span>\n</span>"
111
+ }
112
+ ],
113
+ "id": "u:420b0162ce2c",
114
+ "api": {
115
+ "method": "get",
116
+ "url": "${context.rootUrl}/unpkg.com/@salesforce-ux/design-system/ui.icons.json",
117
+ "requestAdaptor": "",
118
+ "adaptor": "if (payload && payload.length) {\n let data = {};\n let sldsStandardIcons = _.find(payload, { name: \"standard\" });\n sldsStandardIcons = sldsStandardIcons && sldsStandardIcons.icons;\n data.sldsIconsOptions = sldsStandardIcons;\n payload.data = data;\n}\nreturn payload;\n",
119
+ "headers": {
120
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
121
+ }
112
122
  }
113
123
  },
114
124
  {
@@ -133,7 +143,13 @@
133
143
  "multiple": true,
134
144
  "checkAll": false,
135
145
  "searchable": true,
136
- "source": "get:${context.rootUrl}/service/api/amis-metadata-objects/objects/options"
146
+ "source": {
147
+ "method": "get",
148
+ "url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/options",
149
+ "headers": {
150
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
151
+ }
152
+ }
137
153
  },
138
154
  {
139
155
  "name": "mobile_objects",
@@ -149,7 +165,14 @@
149
165
  "multiple": true,
150
166
  "checkAll": false,
151
167
  "searchable": true,
152
- "source": "get:${context.rootUrl}/service/api/amis-metadata-objects/objects/options"
168
+ "source": {
169
+ "method": "get",
170
+ "url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/options",
171
+ "messages": {},
172
+ "headers": {
173
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
174
+ }
175
+ }
153
176
  },
154
177
  {
155
178
  "name": "description",
@@ -35,12 +35,13 @@
35
35
  "options": [],
36
36
  "id": "u:e224b24aa867",
37
37
  "searchable": true,
38
- "source": "get:${context.rootUrl}/service/api/amis-metadata-objects/objects/generate_tabs_options",
39
- "headers": {
40
- "Authorization": "Bearer ${context.tenantId},${context.authToken}"
38
+ "source": {
39
+ "method": "get",
40
+ "url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/generate_tabs_options",
41
+ "headers": {
42
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
43
+ }
41
44
  },
42
- "validations": {},
43
- "validationErrors": {},
44
45
  "required": true
45
46
  }
46
47
  ],
@@ -57,7 +57,8 @@
57
57
  "labelClassName": "text-left",
58
58
  "en-US": {
59
59
  "label": "Label"
60
- }
60
+ },
61
+ "id": "u:a45229ed29f8"
61
62
  },
62
63
  {
63
64
  "name": "name",
@@ -70,7 +71,8 @@
70
71
  "en-US": {
71
72
  "label": "API Name",
72
73
  "labelRemark": "Can only contain lowercase letters and numbers, must start with a letter,cannot end with an underscore character or contain two consecutive underscore characters"
73
- }
74
+ },
75
+ "id": "u:ff927884ec36"
74
76
  },
75
77
  {
76
78
  "name": "object_name",
@@ -92,7 +94,8 @@
92
94
  },
93
95
  "en-US": {
94
96
  "label": "Object"
95
- }
97
+ },
98
+ "id": "u:1427b8edc8f5"
96
99
  },
97
100
  {
98
101
  "name": "filter_scope",
@@ -110,7 +113,6 @@
110
113
  "en-US": {
111
114
  "label": "Mine"
112
115
  }
113
-
114
116
  },
115
117
  {
116
118
  "label": "工作区",
@@ -125,8 +127,8 @@
125
127
  "labelClassName": "text-left",
126
128
  "en-US": {
127
129
  "label": "Filter Scope"
128
- }
129
-
130
+ },
131
+ "id": "u:5f00b15822d5"
130
132
  },
131
133
  {
132
134
  "name": "shared",
@@ -137,7 +139,8 @@
137
139
  "option": "共享视图到工作区",
138
140
  "en-US": {
139
141
  "option": "Shared to All Users"
140
- }
142
+ },
143
+ "id": "u:3ba5090f7fd0"
141
144
  },
142
145
  {
143
146
  "name": "show_count",
@@ -148,13 +151,15 @@
148
151
  "option": "显示条目数",
149
152
  "en-US": {
150
153
  "option": "Show Record Count"
151
- }
154
+ },
155
+ "id": "u:811f0c5d03ad"
152
156
  },
153
157
  {
154
158
  "label": "显示的列",
155
159
  "type": "transfer",
156
160
  "name": "columns",
157
161
  "options": [],
162
+ "multiple": true,
158
163
  "id": "u:92c0b3cccca0",
159
164
  "required": true,
160
165
  "placeholder": "-",
@@ -186,9 +191,11 @@
186
191
  "labelClassName": "text-left",
187
192
  "en-US": {
188
193
  "label": "Sort NO."
189
- }
194
+ },
195
+ "id": "u:25a6ee957503"
190
196
  }
191
- ]
197
+ ],
198
+ "id": "u:7f7b2d3ea064"
192
199
  },
193
200
  {
194
201
  "type": "fieldSet",
@@ -217,7 +224,8 @@
217
224
  "extractValue": true,
218
225
  "en-US": {
219
226
  "label": "Default Filter Fields"
220
- }
227
+ },
228
+ "multiple": true
221
229
  },
222
230
  {
223
231
  "type": "radios",
@@ -241,7 +249,6 @@
241
249
  "en-US": {
242
250
  "label": "Controller"
243
251
  }
244
-
245
252
  },
246
253
  {
247
254
  "type": "condition-builder",
@@ -276,7 +283,8 @@
276
283
  "collapsed": true,
277
284
  "en-US": {
278
285
  "title": "Filter"
279
- }
286
+ },
287
+ "id": "u:7d4a03469ab2"
280
288
  },
281
289
  {
282
290
  "type": "fieldSet",
@@ -308,15 +316,16 @@
308
316
  "extractValue": true,
309
317
  "en-US": {
310
318
  "label": "Default Sort Order"
311
- }
319
+ },
320
+ "multiple": true
312
321
  }
313
322
  ],
314
323
  "visibleOn": "!!this.object_name",
315
324
  "collapsed": true,
316
325
  "en-US": {
317
326
  "title": "Order"
318
- }
319
-
327
+ },
328
+ "id": "u:82b56e7d9639"
320
329
  },
321
330
  {
322
331
  "type": "fieldSet",
@@ -349,14 +358,16 @@
349
358
  "className": "col-span-2 m-0",
350
359
  "en-US": {
351
360
  "label": "Mobile Columns"
352
- }
361
+ },
362
+ "multiple": true
353
363
  }
354
364
  ],
355
365
  "collapsed": true,
356
366
  "visibleOn": "!!this.object_name",
357
367
  "en-US": {
358
368
  "title": "Mobile"
359
- }
369
+ },
370
+ "id": "u:51174159a42e"
360
371
  }
361
372
  ],
362
373
  "panelClassName": "m-0",
@@ -371,7 +382,8 @@
371
382
  "onClick": "SteedosUI.getRef(props.data.__super.modalName).close();",
372
383
  "en-US": {
373
384
  "label": "Cancel"
374
- }
385
+ },
386
+ "id": "u:2b559c02ad83"
375
387
  },
376
388
  {
377
389
  "type": "button",
@@ -380,12 +392,14 @@
380
392
  "level": "info",
381
393
  "en-US": {
382
394
  "label": "Save"
383
- }
395
+ },
396
+ "id": "u:a48a8052e83a"
384
397
  }
385
398
  ],
386
399
  "actionsClassName": "p-sm b-t b-light text-center",
387
400
  "className": "steedos-amis-form",
388
- "language": "javascript"
401
+ "language": "javascript",
402
+ "id": "u:d951542bb161"
389
403
  }
390
404
  ],
391
405
  "regions": [
@@ -394,11 +408,12 @@
394
408
  "data": {
395
409
  "objectName": "object_listviews",
396
410
  "context": {
397
- "rootUrl": "http://127.0.0.1:5000"
411
+ "rootUrl": "http://127.0.0.1:5800"
398
412
  }
399
413
  },
400
414
  "bodyClassName": "p-0",
401
415
  "name": "page_edit_${recordId}",
402
416
  "initApi": null,
403
- "initFetch": null
417
+ "initFetch": null,
418
+ "id": "u:6ada123f9d4a"
404
419
  }
@@ -21,7 +21,10 @@
21
21
  "responseData": {
22
22
  "recordId": "${record._id}"
23
23
  },
24
- "adaptor": "\n SteedosUI.getRef(api.body.modalName).close();\n SteedosUI.router.go({objectName: api.body.objectName, recordId: payload.data.record._id, type: api.body.recordId ? 'edit': 'new'});\n return payload;\n "
24
+ "adaptor": "\n SteedosUI.getRef(api.body.modalName).close();\n SteedosUI.router.go({objectName: api.body.objectName, recordId: payload.data.record._id, type: api.body.recordId ? 'edit': 'new'});\n return payload;\n ",
25
+ "headers": {
26
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
27
+ }
25
28
  },
26
29
  "initApi": {
27
30
  "method": "post",
@@ -31,6 +34,9 @@
31
34
  "adaptor": "var data = payload.data.data[0];\nif(data){\n data.object_name = data.object_name ? data.object_name.name:null;\n \n \n //初始化接口返回的字段移除字段值为null的字段\n for (key in data){\n if(data[key] === null){\n delete data[key];\n }\n }\n};\npayload.data = data;\ndelete payload.extensions;\nreturn payload;\n",
32
35
  "data": {
33
36
  "query": "{data:object_layouts(filters:[\"_id\", \"=\", \"${recordId}\"]){_id,name,label,object_name:object_name__expand{name,label},profiles,buttons,fields,related_lists,field_groups,created,created_by:created_by__expand{_id,name},modified,modified_by:modified_by__expand{_id,name},_display{created,modified}}}"
37
+ },
38
+ "headers": {
39
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
34
40
  }
35
41
  },
36
42
  "initFetch": true,
@@ -80,7 +86,14 @@
80
86
  "checkAll": false,
81
87
  "searchable": true,
82
88
  "id": "u:4e769995f638",
83
- "source": "get:/service/api/amis-metadata-objects/objects/options"
89
+ "source": {
90
+ "method": "get",
91
+ "url": "/service/api/amis-metadata-objects/objects/options",
92
+ "headers": {
93
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
94
+ }
95
+ },
96
+ "multiple": false
84
97
  },
85
98
  {
86
99
  "name": "profiles",
@@ -101,7 +114,10 @@
101
114
  "query": "{options:permission_set(filters: [\"type\", \"=\", \"profile\"]){name,label}}"
102
115
  },
103
116
  "requestAdaptor": "",
104
- "adaptor": ""
117
+ "adaptor": "",
118
+ "headers": {
119
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
120
+ }
105
121
  },
106
122
  "valueField": "name",
107
123
  "searchable": true,
@@ -226,7 +242,10 @@
226
242
  "method": "get",
227
243
  "url": "/service/api/amis-metadata-objects/objects/${object_name}/actions/options",
228
244
  "adaptor": "let data = payload.data;\ndata.buttons_options = data.options;\ndelete data.options\npayload.data = data;\nreturn payload;\n",
229
- "sendOn": "!!this.object_name"
245
+ "sendOn": "!!this.object_name",
246
+ "headers": {
247
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
248
+ }
230
249
  },
231
250
  "className": "col-span-2 m-0",
232
251
  "affixFooter": false,
@@ -478,7 +497,10 @@
478
497
  "url": "/service/api/amis-metadata-objects/objects/${object_name}/fields/layout_options",
479
498
  "adaptor": "let data = payload.data;\ndata.fields_options = data.options;\ndata.field_groups_options = lodash.uniq(lodash.compact(lodash.map(data.options, \"group\"))) || [];\ndelete data.options\npayload.data = data;\nreturn payload;\n",
480
499
  "sendOn": "!!this.object_name",
481
- "data": null
500
+ "data": null,
501
+ "headers": {
502
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
503
+ }
482
504
  },
483
505
  "className": "col-span-2 m-0",
484
506
  "placeholder": "-",
@@ -514,7 +536,10 @@
514
536
  "method": "get",
515
537
  "url": "/service/api/amis-metadata-objects/objects/${object_name}/relatedLists/options",
516
538
  "sendOn": "!!this.object_name",
517
- "adaptor": "let data = payload.data;\ndata.related_lists_options = data.options;\ndelete data.options\npayload.data = data;\nreturn payload;\n"
539
+ "adaptor": "let data = payload.data;\ndata.related_lists_options = data.options;\ndelete data.options\npayload.data = data;\nreturn payload;\n",
540
+ "headers": {
541
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
542
+ }
518
543
  },
519
544
  "className": "col-span-2 m-0",
520
545
  "affixFooter": false,
@@ -576,7 +601,10 @@
576
601
  "source": {
577
602
  "method": "get",
578
603
  "url": "/service/api/amis-metadata-objects/objects/${related_field_fullname|split:.|first}/fields/options",
579
- "cache": 60000
604
+ "cache": 60000,
605
+ "headers": {
606
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
607
+ }
580
608
  },
581
609
  "searchable": true,
582
610
  "onEvent": {
@@ -620,7 +648,10 @@
620
648
  "source": {
621
649
  "method": "get",
622
650
  "url": "/service/api/amis-metadata-objects/objects/${related_field_fullname|split:.|first}/fields/options",
623
- "cache": 60000
651
+ "cache": 60000,
652
+ "headers": {
653
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
654
+ }
624
655
  },
625
656
  "searchable": true,
626
657
  "name": "sort_field_name",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/service-plugin-amis",
3
- "version": "2.3.0-beta.16",
3
+ "version": "2.3.0-beta.18",
4
4
  "main": "package.service.js",
5
5
  "scripts": {
6
6
  "build": "node .scripts/build.tailwind.js"
@@ -10,5 +10,5 @@
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
13
- "gitHead": "01c22a1eb4fb1ce0de0ccb75ef8290d44b8d857a"
13
+ "gitHead": "ddc6c3d7f2ba9cabb7fec700b82f353cf12e37dc"
14
14
  }