@steedos/service-pages 2.4.0-beta.3 → 2.4.0-beta.30
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/main/default/client/builder.client.js +9 -8
- package/main/default/client/page.render.client.js +89 -112
- package/main/default/objects/pages/buttons/customPage.button.js +2 -1
- package/main/default/objects/pages/buttons/deploy.button.js +2 -1
- package/main/default/objects/pages/buttons/disable.button.js +2 -1
- package/main/default/objects/pages/buttons/enable.button.js +2 -1
- package/main/default/objects/pages/buttons/resetSchema.button.js +2 -1
- package/main/default/objects/pages/fields/object_name.field.yml +3 -3
- package/main/default/objects/pages/fields/render_engine.field.yml +2 -2
- package/main/default/triggers/pages_init.trigger.js +17 -1
- package/package.json +2 -2
|
@@ -56,12 +56,12 @@
|
|
|
56
56
|
// Object.defineProperty(window, 'MonacoEnvironment', {set: ()=>{}, get: ()=>window.SteedosMonacoEnvironment})
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
if (window.define)
|
|
60
|
-
|
|
59
|
+
// if (window.define)
|
|
60
|
+
// window.define.amd = undefined;
|
|
61
61
|
|
|
62
62
|
// window.ReactDOM = ReactDom;
|
|
63
|
-
window.React17 = window.React;
|
|
64
|
-
window.ReactDOM17 = window.ReactDOM;
|
|
63
|
+
// window.React17 = window.React;
|
|
64
|
+
// window.ReactDOM17 = window.ReactDOM;
|
|
65
65
|
|
|
66
66
|
// const BuilderSDK = BuilderReact;
|
|
67
67
|
|
|
@@ -72,16 +72,17 @@
|
|
|
72
72
|
|
|
73
73
|
window.BuilderComponent = BuilderReact.BuilderComponent;
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
window.builder = BuilderReact.builder;
|
|
76
|
+
window.builder.init('steedos');
|
|
76
77
|
|
|
77
78
|
Promise.all([
|
|
78
79
|
waitForThing(Creator, 'USER_CONTEXT'),
|
|
79
80
|
]).then(()=>{
|
|
80
81
|
Builder.set({
|
|
81
|
-
rootUrl:
|
|
82
|
-
unpkgUrl:
|
|
82
|
+
rootUrl: __steedos_runtime_config__.ROOT_URL,
|
|
83
|
+
unpkgUrl: __steedos_runtime_config__.STEEDOS_UNPKG_URL,
|
|
83
84
|
context: {
|
|
84
|
-
rootUrl:
|
|
85
|
+
rootUrl: __steedos_runtime_config__.ROOT_URL,
|
|
85
86
|
tenantId: Creator.USER_CONTEXT.spaceId,
|
|
86
87
|
userId: Creator.USER_CONTEXT.userId,
|
|
87
88
|
authToken: Creator.USER_CONTEXT.user.authToken
|
|
@@ -86,13 +86,14 @@
|
|
|
86
86
|
"type": "page",
|
|
87
87
|
name: `amis-${appId}-${objectApiName}-listview`,
|
|
88
88
|
"title": "Welcome to Steedos",
|
|
89
|
-
bodyClassName: 'p-3',
|
|
89
|
+
bodyClassName: 'steedos-listview p-0 sm:border bg-white sm:shadow sm:rounded border-slate-300 border-solid sm:m-3 flex flex-1 flex-col',
|
|
90
90
|
"body": [
|
|
91
91
|
{
|
|
92
92
|
"type": "steedos-object-listview",
|
|
93
93
|
showHeader: true,
|
|
94
94
|
"label": "列表视图",
|
|
95
95
|
"objectApiName": "${objectName}",
|
|
96
|
+
"columnsTogglable": false,
|
|
96
97
|
"listName": "all",
|
|
97
98
|
"id": "u:be7c6341cd11"
|
|
98
99
|
}
|
|
@@ -107,9 +108,9 @@
|
|
|
107
108
|
return {
|
|
108
109
|
render_engine: 'amis',
|
|
109
110
|
name: 'steedosRecordPage',
|
|
110
|
-
bodyClassName: 'p-3',
|
|
111
111
|
schema: {
|
|
112
|
-
"type": "
|
|
112
|
+
"type": "service",
|
|
113
|
+
"className": 'sm:p-3',
|
|
113
114
|
"name": `amis-${appId}-${objectApiName}-detail`,
|
|
114
115
|
"title": "Welcome to Steedos",
|
|
115
116
|
"body": [
|
|
@@ -220,24 +221,21 @@
|
|
|
220
221
|
},
|
|
221
222
|
body: [
|
|
222
223
|
{
|
|
223
|
-
"type": "panel",
|
|
224
|
-
"title": {
|
|
225
224
|
"type": "breadcrumb",
|
|
226
|
-
"source": "${$breadcrumb}"
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
225
|
+
"source": "${$breadcrumb}",
|
|
226
|
+
"className": "mx-4 my-2",
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
type: 'steedos-object-related-listview',
|
|
230
|
+
objectApiName: masterObject.name,
|
|
231
|
+
recordId: FlowRouter.getParam("record_id"),
|
|
232
|
+
relatedObjectApiName: objectApiName,
|
|
233
|
+
foreign_key: relatedKey,
|
|
234
|
+
relatedKey: relatedKey,
|
|
235
|
+
hiddenOn: "!!!this.$loaded",
|
|
236
|
+
"className": "mx-4",
|
|
237
|
+
// top: 5
|
|
238
|
+
}
|
|
241
239
|
,
|
|
242
240
|
// {
|
|
243
241
|
// type: 'steedos-object-related-listview',
|
|
@@ -256,55 +254,7 @@
|
|
|
256
254
|
}
|
|
257
255
|
|
|
258
256
|
Steedos.Page.render = function (root, page, data, options = {}) {
|
|
259
|
-
|
|
260
|
-
"inputs": [],
|
|
261
|
-
// "title": "loading",
|
|
262
|
-
"blocks": [
|
|
263
|
-
{
|
|
264
|
-
"@type": "@builder.io/sdk:Element",
|
|
265
|
-
"@version": 2,
|
|
266
|
-
"layerName": "Box",
|
|
267
|
-
"id": "builder-8070f86b1aed4e78a5878fa5c0d79e49",
|
|
268
|
-
"children": [
|
|
269
|
-
{
|
|
270
|
-
"@type": "@builder.io/sdk:Element",
|
|
271
|
-
"@version": 2,
|
|
272
|
-
"layerName": "Loading...\n...",
|
|
273
|
-
"id": "builder-4b16375a68dc4e49b4844843091bf91d",
|
|
274
|
-
"component": {
|
|
275
|
-
"name": "Text",
|
|
276
|
-
"options": {
|
|
277
|
-
"text": "<p>Loading...</p>\n"
|
|
278
|
-
}
|
|
279
|
-
},
|
|
280
|
-
"responsiveStyles": {
|
|
281
|
-
"large": {
|
|
282
|
-
"display": "flex",
|
|
283
|
-
"flexDirection": "column",
|
|
284
|
-
"position": "relative",
|
|
285
|
-
"flexShrink": "0",
|
|
286
|
-
"boxSizing": "border-box",
|
|
287
|
-
"marginTop": "20px",
|
|
288
|
-
"lineHeight": "normal",
|
|
289
|
-
"height": "auto",
|
|
290
|
-
"textAlign": "center"
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
],
|
|
295
|
-
"responsiveStyles": {
|
|
296
|
-
"large": {
|
|
297
|
-
"display": "flex",
|
|
298
|
-
"flexDirection": "column",
|
|
299
|
-
"position": "relative",
|
|
300
|
-
"flexShrink": "0",
|
|
301
|
-
"boxSizing": "border-box"
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
]
|
|
306
|
-
};
|
|
307
|
-
|
|
257
|
+
|
|
308
258
|
if (page.render_engine && page.render_engine != 'redash') {
|
|
309
259
|
|
|
310
260
|
let schema = typeof page.schema === 'string' ? JSON.parse(page.schema) : page.schema;
|
|
@@ -328,7 +278,8 @@
|
|
|
328
278
|
now: new Date(),
|
|
329
279
|
// mode: mode //由表单提供
|
|
330
280
|
},
|
|
331
|
-
scopeId: schema.name || schema.id
|
|
281
|
+
scopeId: schema.name || schema.id,
|
|
282
|
+
$scopeId : schema.name || schema.id
|
|
332
283
|
}
|
|
333
284
|
});
|
|
334
285
|
|
|
@@ -361,24 +312,20 @@
|
|
|
361
312
|
|
|
362
313
|
if(!lodash.isFunction(root)){
|
|
363
314
|
//渲染loading
|
|
364
|
-
render(BuilderComponent, {
|
|
365
|
-
model: "page", content: {
|
|
366
|
-
"data": loadingContentData
|
|
367
|
-
}
|
|
368
|
-
}, root)
|
|
369
315
|
}
|
|
370
316
|
|
|
371
317
|
Promise.all([
|
|
318
|
+
waitForThing(window, 'renderAmis'),
|
|
372
319
|
waitForThing(window, 'BuilderComponent'),
|
|
373
320
|
waitForThing(Builder.components, upperFirst(page.render_engine), findComponent)
|
|
374
321
|
]).then(()=>{
|
|
375
322
|
//渲染page
|
|
376
323
|
if(!lodash.isFunction(root)){
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
324
|
+
renderAmis(
|
|
325
|
+
root,
|
|
326
|
+
schema,
|
|
327
|
+
data,
|
|
328
|
+
)
|
|
382
329
|
}else{
|
|
383
330
|
if(root === SteedosUI.Drawer){
|
|
384
331
|
data.drawerName = data.drawerName || lodash.uniqueId(`drawer-${page.object_name}`);
|
|
@@ -746,19 +693,22 @@
|
|
|
746
693
|
}
|
|
747
694
|
|
|
748
695
|
Steedos.Page.Header.render = function(appId, tabId){
|
|
749
|
-
|
|
750
|
-
if (
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
696
|
+
let app = _.find(Session.get('app_menus'), {id: appId}) || {}
|
|
697
|
+
if (appId === 'admin' || (window.innerWidth < 768))
|
|
698
|
+
app.showSidebar = true;
|
|
699
|
+
if (app.showSidebar)
|
|
700
|
+
document.body.classList.add('sidebar')
|
|
701
|
+
else
|
|
702
|
+
document.body.classList.remove("sidebar")
|
|
703
|
+
if (window.innerWidth >= 768)
|
|
704
|
+
document.body.classList.add('sidebar-open')
|
|
705
|
+
if(app.showSidebar && window.location.pathname.startsWith("/workflow")){
|
|
706
|
+
app = {id: 'workflow'}
|
|
757
707
|
}
|
|
758
|
-
|
|
759
708
|
try {
|
|
760
709
|
const data = {
|
|
761
|
-
app
|
|
710
|
+
app,
|
|
711
|
+
isMobile: window.innerWidth <= 768
|
|
762
712
|
};
|
|
763
713
|
const page = Steedos.Page.Header.getPage(appId, tabId);
|
|
764
714
|
var rootId = "steedosGlobalHeaderRoot";
|
|
@@ -790,26 +740,45 @@
|
|
|
790
740
|
body: [
|
|
791
741
|
{
|
|
792
742
|
"type": "wrapper",
|
|
793
|
-
"className": "p-0
|
|
743
|
+
"className": "bg-white sticky p-0 top-0 z-40 w-full flex-none backdrop-blur transition-colors duration-500 lg:z-50 sm:shadow border-b-[3px] border-sky-500 border-solid steedos-header-container",
|
|
794
744
|
body: [
|
|
795
745
|
{
|
|
796
746
|
"type": "wrapper",
|
|
797
|
-
"className": 'flex w-full px-4 h-[50px] p-0 justify-between items-center',
|
|
747
|
+
"className": 'flex w-full px-4 h-[50px] p-0 justify-between items-center steedos-header-container-line-one',
|
|
798
748
|
"body": [
|
|
799
749
|
{
|
|
800
750
|
type: "wrapper",
|
|
801
751
|
className: 'p-0 flex flex-1 items-center',
|
|
802
752
|
body: [
|
|
803
753
|
{
|
|
804
|
-
"type": "
|
|
805
|
-
"
|
|
806
|
-
"
|
|
807
|
-
"
|
|
754
|
+
"type": "button",
|
|
755
|
+
"className": "toggle-sidebar flex items-center pr-4",
|
|
756
|
+
"hiddenOn": "${!isMobile}",
|
|
757
|
+
"onEvent": {
|
|
758
|
+
"click": {
|
|
759
|
+
"actions": [
|
|
760
|
+
{
|
|
761
|
+
"actionType": "custom",
|
|
762
|
+
"script": "document.body.classList.toggle('sidebar-open')",
|
|
763
|
+
}
|
|
764
|
+
]
|
|
765
|
+
}
|
|
766
|
+
},
|
|
767
|
+
"body": [
|
|
768
|
+
{
|
|
769
|
+
"type": "steedos-icon",
|
|
770
|
+
"category": "utility",
|
|
771
|
+
"name": "rows",
|
|
772
|
+
"colorVariant": "default",
|
|
773
|
+
"id": "u:afc3a08e8cf3",
|
|
774
|
+
"className": "slds-button_icon slds-global-header__icon"
|
|
775
|
+
}
|
|
776
|
+
],
|
|
808
777
|
},
|
|
809
778
|
{
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
779
|
+
"className": 'block h-10 w-auto mr-4',
|
|
780
|
+
"type": "tpl",
|
|
781
|
+
"tpl": `<a href='/app' class='flex items-center '><img class='block h-10 w-auto' src='${logoSrc}'></a>`,
|
|
813
782
|
},
|
|
814
783
|
],
|
|
815
784
|
},
|
|
@@ -817,12 +786,12 @@
|
|
|
817
786
|
"type": "steedos-global-header",
|
|
818
787
|
"label": "Global Header",
|
|
819
788
|
className: 'flex flex-nowrap gap-x-3 items-center',
|
|
820
|
-
logoutScript: "window.
|
|
789
|
+
logoutScript: "window.Steedos.logout();",
|
|
821
790
|
customButtons: [
|
|
822
791
|
{
|
|
823
792
|
"type": "button",
|
|
824
793
|
"className": "toggle-sidebar",
|
|
825
|
-
"
|
|
794
|
+
"visibleOn": "${AND(app.showSidebar,!isMobile)}",
|
|
826
795
|
"onEvent": {
|
|
827
796
|
"click": {
|
|
828
797
|
"actions": [
|
|
@@ -850,11 +819,11 @@
|
|
|
850
819
|
|
|
851
820
|
{
|
|
852
821
|
"type": "grid",
|
|
853
|
-
hiddenOn: "${
|
|
854
|
-
"className": 'steedos-context-bar
|
|
822
|
+
"hiddenOn": "${isMobile}",
|
|
823
|
+
"className": 'steedos-context-bar flex flex-nowrap h-10 leading-5 pl-4 mb-[-3px] steedos-header-container-line-two',
|
|
855
824
|
"columns": [
|
|
856
825
|
{
|
|
857
|
-
"columnClassName": "items-center
|
|
826
|
+
"columnClassName": "items-center flex pb-0",
|
|
858
827
|
"body": [
|
|
859
828
|
{
|
|
860
829
|
"type": "steedos-app-launcher",
|
|
@@ -866,13 +835,15 @@
|
|
|
866
835
|
"valign": "middle"
|
|
867
836
|
},
|
|
868
837
|
{
|
|
869
|
-
|
|
838
|
+
hiddenOn: "${app.showSidebar === true}",
|
|
839
|
+
"columnClassName": "flex overflow-hidden",
|
|
870
840
|
"body": [
|
|
871
841
|
{
|
|
872
842
|
"type": "steedos-app-menu",
|
|
873
843
|
"stacked": false,
|
|
874
844
|
showIcon: false,
|
|
875
845
|
"appId": "${app.id}",
|
|
846
|
+
hiddenOn: "${app.showSidebar === true}",
|
|
876
847
|
overflow: {
|
|
877
848
|
enable: false,
|
|
878
849
|
itemWidth: 80,
|
|
@@ -892,17 +863,23 @@
|
|
|
892
863
|
{
|
|
893
864
|
|
|
894
865
|
"type": "button",
|
|
895
|
-
"className": 'p-0 absolute inset-0 mt-[50px]',
|
|
866
|
+
"className": 'p-0 absolute inset-0 mt-[50px] sm:mt-[90px]',
|
|
896
867
|
hiddenOn: "${app.showSidebar != true}",
|
|
897
868
|
body: [{
|
|
898
869
|
type: "wrapper",
|
|
899
|
-
className: 'sidebar-wrapper
|
|
870
|
+
className: 'sidebar-wrapper px-0 pt-4 pb-16 fixed z-20 h-full ease-in-out duration-300 flex flex-col border-r overflow-y-auto bg-white border-slate-200 block -translate-x-0 sm:w-[220px] w-64',
|
|
900
871
|
body: [
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
872
|
+
{
|
|
873
|
+
"type": "steedos-app-launcher",
|
|
874
|
+
"className": "px-4 pb-4",
|
|
875
|
+
"visibleOn": "${isMobile}",
|
|
876
|
+
"showAppName": true
|
|
877
|
+
},
|
|
878
|
+
{
|
|
879
|
+
"type": "steedos-app-menu",
|
|
880
|
+
"stacked": true,
|
|
881
|
+
"appId": "${app.id}",
|
|
882
|
+
},
|
|
906
883
|
]
|
|
907
884
|
}],
|
|
908
885
|
"onEvent": {
|
|
@@ -30,7 +30,8 @@ module.exports = {
|
|
|
30
30
|
};
|
|
31
31
|
Steedos.authRequest(url, options);
|
|
32
32
|
},
|
|
33
|
-
customPageVisible: function (object_name, record_id, permission,
|
|
33
|
+
customPageVisible: function (object_name, record_id, permission, data) {
|
|
34
|
+
var record = data && data.record;
|
|
34
35
|
return record && record.is_system;
|
|
35
36
|
}
|
|
36
37
|
}
|
|
@@ -31,7 +31,8 @@ module.exports = {
|
|
|
31
31
|
};
|
|
32
32
|
Steedos.authRequest(url, options);
|
|
33
33
|
},
|
|
34
|
-
deployVisible: function (object_name, record_id, permission,
|
|
34
|
+
deployVisible: function (object_name, record_id, permission, data) {
|
|
35
|
+
var record = data && data.record;
|
|
35
36
|
return record && !record.is_system;
|
|
36
37
|
}
|
|
37
38
|
}
|
|
@@ -24,7 +24,8 @@ module.exports = {
|
|
|
24
24
|
};
|
|
25
25
|
Steedos.authRequest(url, options);
|
|
26
26
|
},
|
|
27
|
-
disableVisible: function (object_name, record_id, permission,
|
|
27
|
+
disableVisible: function (object_name, record_id, permission, data) {
|
|
28
|
+
var record = data && data.record;
|
|
28
29
|
return record && record.is_active && !record.is_system
|
|
29
30
|
}
|
|
30
31
|
}
|
|
@@ -24,7 +24,8 @@ module.exports = {
|
|
|
24
24
|
};
|
|
25
25
|
Steedos.authRequest(url, options);
|
|
26
26
|
},
|
|
27
|
-
enableVisible: function (object_name, record_id, permission,
|
|
27
|
+
enableVisible: function (object_name, record_id, permission, data) {
|
|
28
|
+
var record = data && data.record;
|
|
28
29
|
return record && !record.is_active && !record.is_system
|
|
29
30
|
}
|
|
30
31
|
}
|
|
@@ -41,7 +41,8 @@ module.exports = {
|
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
},
|
|
44
|
-
resetSchemaVisible: function (object_name, record_id, permission,
|
|
44
|
+
resetSchemaVisible: function (object_name, record_id, permission, data) {
|
|
45
|
+
var record = data && data.record;
|
|
45
46
|
return record && !record.is_system && record.type === 'form';
|
|
46
47
|
}
|
|
47
48
|
}
|
|
@@ -4,9 +4,9 @@ type: lookup
|
|
|
4
4
|
sort_no: 135
|
|
5
5
|
reference_to: objects
|
|
6
6
|
reference_to_field: name
|
|
7
|
-
|
|
8
|
-
function
|
|
9
|
-
return
|
|
7
|
+
filtersFunction: !!js/function |
|
|
8
|
+
function(filters, values){
|
|
9
|
+
return ['name', '!=', 'cfs_instances_filerecord']
|
|
10
10
|
}
|
|
11
11
|
filterable: true
|
|
12
12
|
required: "{{'record' == formData.type || 'list' == formData.type || 'form' == formData.type ? true: false}}"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: baozhoutao@steedos.com
|
|
3
3
|
* @Date: 2022-05-23 10:02:16
|
|
4
4
|
* @LastEditors: baozhoutao@steedos.com
|
|
5
|
-
* @LastEditTime:
|
|
5
|
+
* @LastEditTime: 2023-02-06 10:50:08
|
|
6
6
|
* @Description:
|
|
7
7
|
*/
|
|
8
8
|
const auth = require('@steedos/auth');
|
|
@@ -24,6 +24,22 @@ module.exports = {
|
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
+
// 默认添加 全组织 全设备授权
|
|
28
|
+
if(page.type != 'app'){
|
|
29
|
+
await objectql.getObject('page_assignments').insert({
|
|
30
|
+
type: "orgDefault",
|
|
31
|
+
page: id,
|
|
32
|
+
desktop: true,
|
|
33
|
+
mobile: true,
|
|
34
|
+
space: page.space,
|
|
35
|
+
owner: page.owner,
|
|
36
|
+
created_by: page.created_by,
|
|
37
|
+
modified_by: page.modified_by,
|
|
38
|
+
company_id: page.company_id,
|
|
39
|
+
company_ids: page.company_ids
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
|
|
27
43
|
// const actions = broker.registry.getActionList({
|
|
28
44
|
// onlyLocal: false
|
|
29
45
|
// });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-pages",
|
|
3
|
-
"version": "2.4.0-beta.
|
|
3
|
+
"version": "2.4.0-beta.30",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"scripts": {},
|
|
6
6
|
"license": "MIT",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"access": "public"
|
|
10
10
|
},
|
|
11
|
-
"gitHead": "
|
|
11
|
+
"gitHead": "22c0cf80236640dac2c2a85b7a209355ef00e57c",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"ejs": "^3.1.8"
|
|
14
14
|
}
|