@steedos/service-pages 2.3.6 → 2.3.8
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 -11
- package/main/default/client/page.render.client.js +100 -441
- package/main/default/objects/pages/buttons/customPage.button.js +1 -2
- package/main/default/objects/pages/buttons/deploy.button.js +1 -2
- package/main/default/objects/pages/buttons/disable.button.js +1 -2
- package/main/default/objects/pages/buttons/enable.button.js +1 -2
- package/main/default/objects/pages/buttons/resetSchema.button.js +1 -2
- 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/objects/pages/pages.object.yml +12 -1
- package/main/default/triggers/pages_init.trigger.js +1 -17
- package/package.json +2 -2
- package/public/logo.png +0 -0
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
}else{
|
|
19
19
|
thing = lodash.get(obj, path);
|
|
20
20
|
}
|
|
21
|
-
// console.log(`_innerWaitForThing`, path)
|
|
22
21
|
if (thing) {
|
|
23
22
|
return resolve(thing);
|
|
24
23
|
}
|
|
@@ -56,12 +55,12 @@
|
|
|
56
55
|
// Object.defineProperty(window, 'MonacoEnvironment', {set: ()=>{}, get: ()=>window.SteedosMonacoEnvironment})
|
|
57
56
|
|
|
58
57
|
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
if (window.define)
|
|
59
|
+
window.define.amd = undefined;
|
|
61
60
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
window.ReactDOM = ReactDom;
|
|
62
|
+
window.React17 = window.React;
|
|
63
|
+
window.ReactDOM17 = window.ReactDOM;
|
|
65
64
|
|
|
66
65
|
// const BuilderSDK = BuilderReact;
|
|
67
66
|
|
|
@@ -72,17 +71,16 @@
|
|
|
72
71
|
|
|
73
72
|
window.BuilderComponent = BuilderReact.BuilderComponent;
|
|
74
73
|
|
|
75
|
-
window.builder = BuilderReact.builder;
|
|
76
|
-
window.builder.init('steedos');
|
|
74
|
+
// window.builder = BuilderReact.builder;
|
|
77
75
|
|
|
78
76
|
Promise.all([
|
|
79
77
|
waitForThing(Creator, 'USER_CONTEXT'),
|
|
80
78
|
]).then(()=>{
|
|
81
79
|
Builder.set({
|
|
82
|
-
rootUrl:
|
|
83
|
-
unpkgUrl:
|
|
80
|
+
rootUrl: __meteor_runtime_config__.ROOT_URL,
|
|
81
|
+
unpkgUrl: Steedos.absoluteUrl('/unpkg.com'),
|
|
84
82
|
context: {
|
|
85
|
-
rootUrl:
|
|
83
|
+
rootUrl: __meteor_runtime_config__.ROOT_URL,
|
|
86
84
|
tenantId: Creator.USER_CONTEXT.spaceId,
|
|
87
85
|
userId: Creator.USER_CONTEXT.userId,
|
|
88
86
|
authToken: Creator.USER_CONTEXT.user.authToken
|
|
@@ -4,33 +4,10 @@
|
|
|
4
4
|
* @Description: 提供自定义page渲染能力, 供内部使用, 内容会迭代调整, 不对用户开放.
|
|
5
5
|
*/
|
|
6
6
|
;(function(){
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const withModalWrap = (component, provideProps) => {
|
|
10
|
-
return (props) => {
|
|
11
|
-
const ModalComponent = component;
|
|
12
|
-
return React.createElement(ModalComponent, props);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
const render = (component, componentProps, container, provideProps = {} ) => {
|
|
16
|
-
try {
|
|
17
|
-
const wrapComponent = withModalWrap(component, provideProps);
|
|
18
|
-
const contentEle = React.createElement(wrapComponent,{
|
|
19
|
-
...componentProps
|
|
20
|
-
});
|
|
21
|
-
setTimeout(()=>{
|
|
22
|
-
ReactDOM.render(contentEle, container);
|
|
23
|
-
}, 100)
|
|
24
|
-
} catch (error) {
|
|
25
|
-
console.log(`error`, error)
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
7
|
Steedos.Page = {
|
|
30
8
|
App: {},
|
|
31
9
|
Record: {},
|
|
32
10
|
Listview: {},
|
|
33
|
-
Header: {},
|
|
34
11
|
RelatedListview: {},
|
|
35
12
|
Form: {
|
|
36
13
|
StandardNew: {},
|
|
@@ -56,10 +33,10 @@
|
|
|
56
33
|
return modalRoot;
|
|
57
34
|
}
|
|
58
35
|
|
|
36
|
+
|
|
59
37
|
Steedos.Page.getPage = function (type, appId, objectApiName, recordId, pageId) {
|
|
60
|
-
let objectInfo = null;
|
|
61
38
|
if (type != 'list' && objectApiName) {
|
|
62
|
-
objectInfo = Creator.getObject(objectApiName);
|
|
39
|
+
const objectInfo = Creator.getObject(objectApiName);
|
|
63
40
|
if (objectInfo && objectInfo.version < 2) {
|
|
64
41
|
return;
|
|
65
42
|
}
|
|
@@ -78,192 +55,64 @@
|
|
|
78
55
|
if (page && page.schema) {
|
|
79
56
|
return page;
|
|
80
57
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
"
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
"id": "u:7b47b6042b0d"
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}else if(type === 'record'){
|
|
108
|
-
return {
|
|
109
|
-
render_engine: 'amis',
|
|
110
|
-
name: 'steedosRecordPage',
|
|
111
|
-
schema: {
|
|
112
|
-
"type": "service",
|
|
113
|
-
"className": 'sm:p-3',
|
|
114
|
-
"name": `amis-${appId}-${objectApiName}-detail`,
|
|
115
|
-
"title": "Welcome to Steedos",
|
|
116
|
-
"body": [
|
|
117
|
-
{
|
|
118
|
-
"type": "steedos-record-detail",
|
|
119
|
-
"objectApiName": "${objectName}",
|
|
120
|
-
"recordId": "${recordId}",
|
|
121
|
-
appId: appId,
|
|
122
|
-
"id": "u:48d2c28eb755",
|
|
123
|
-
onEvent: {
|
|
124
|
-
"recordLoaded": {
|
|
125
|
-
"actions": [
|
|
126
|
-
{
|
|
127
|
-
"actionType": "reload",
|
|
128
|
-
"data": {
|
|
129
|
-
"name": `\${record.${objectInfo?.NAME_FIELD_KEY || 'name'}}`
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
]
|
|
133
|
-
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
Steedos.Page.render = function (root, page, data, options = {}) {
|
|
61
|
+
const loadingContentData = {
|
|
62
|
+
"inputs": [],
|
|
63
|
+
// "title": "loading",
|
|
64
|
+
"blocks": [
|
|
65
|
+
{
|
|
66
|
+
"@type": "@builder.io/sdk:Element",
|
|
67
|
+
"@version": 2,
|
|
68
|
+
"layerName": "Box",
|
|
69
|
+
"id": "builder-8070f86b1aed4e78a5878fa5c0d79e49",
|
|
70
|
+
"children": [
|
|
71
|
+
{
|
|
72
|
+
"@type": "@builder.io/sdk:Element",
|
|
73
|
+
"@version": 2,
|
|
74
|
+
"layerName": "Loading...\n...",
|
|
75
|
+
"id": "builder-4b16375a68dc4e49b4844843091bf91d",
|
|
76
|
+
"component": {
|
|
77
|
+
"name": "Text",
|
|
78
|
+
"options": {
|
|
79
|
+
"text": "<p>Loading...</p>\n"
|
|
80
|
+
}
|
|
134
81
|
},
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
const object = Creator.getObject(objectApiName)
|
|
148
|
-
const idFieldName = masterObject.idFieldName;
|
|
149
|
-
return {
|
|
150
|
-
render_engine: 'amis',
|
|
151
|
-
name: 'steedosRelatedListPage',
|
|
152
|
-
schema: {
|
|
153
|
-
type: 'service',
|
|
154
|
-
name: `amis-${appId}-${FlowRouter.getParam("object_name")}-related-${objectApiName}`,
|
|
155
|
-
api: {
|
|
156
|
-
method: "post",
|
|
157
|
-
url: `\${context.rootUrl}/graphql`,
|
|
158
|
-
requestAdaptor: `
|
|
159
|
-
api.data = {
|
|
160
|
-
query: \`{
|
|
161
|
-
data: ${masterObject.name}(filters:["${idFieldName}", "=", "${FlowRouter.getParam("record_id")}"]){
|
|
162
|
-
${idFieldName}
|
|
163
|
-
${masterObject.NAME_FIELD_KEY},
|
|
164
|
-
recordPermissions: _permissions{
|
|
165
|
-
allowCreate,
|
|
166
|
-
allowCreateFiles,
|
|
167
|
-
allowDelete,
|
|
168
|
-
allowDeleteFiles,
|
|
169
|
-
allowEdit,
|
|
170
|
-
allowEditFiles,
|
|
171
|
-
allowRead,
|
|
172
|
-
allowReadFiles,
|
|
173
|
-
disabled_actions,
|
|
174
|
-
disabled_list_views,
|
|
175
|
-
field_permissions,
|
|
176
|
-
modifyAllFiles,
|
|
177
|
-
modifyAllRecords,
|
|
178
|
-
modifyAssignCompanysRecords,
|
|
179
|
-
modifyCompanyRecords,
|
|
180
|
-
uneditable_fields,
|
|
181
|
-
unreadable_fields,
|
|
182
|
-
unrelated_objects,
|
|
183
|
-
viewAllFiles,
|
|
184
|
-
viewAllRecords,
|
|
185
|
-
viewAssignCompanysRecords,
|
|
186
|
-
viewCompanyRecords,
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}\`
|
|
190
|
-
}
|
|
191
|
-
return api;
|
|
192
|
-
`,
|
|
193
|
-
adaptor: `
|
|
194
|
-
if(payload.data.data){
|
|
195
|
-
var data = payload.data.data[0];
|
|
196
|
-
payload.data = data;
|
|
82
|
+
"responsiveStyles": {
|
|
83
|
+
"large": {
|
|
84
|
+
"display": "flex",
|
|
85
|
+
"flexDirection": "column",
|
|
86
|
+
"position": "relative",
|
|
87
|
+
"flexShrink": "0",
|
|
88
|
+
"boxSizing": "border-box",
|
|
89
|
+
"marginTop": "20px",
|
|
90
|
+
"lineHeight": "normal",
|
|
91
|
+
"height": "auto",
|
|
92
|
+
"textAlign": "center"
|
|
93
|
+
}
|
|
197
94
|
}
|
|
198
|
-
payload.data.$breadcrumb = [
|
|
199
|
-
{
|
|
200
|
-
"label": "${masterObject.label}",
|
|
201
|
-
"href": "/app/${appId}/${masterObject.name}"
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
"label": payload.data.${masterObject.NAME_FIELD_KEY},
|
|
205
|
-
"href": "/app/${appId}/${masterObject.name}/view/${FlowRouter.getParam("record_id")}",
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
"label": "相关 ${object.label}"
|
|
209
|
-
},
|
|
210
|
-
]
|
|
211
|
-
payload.data.$loaded = true;
|
|
212
|
-
return payload;
|
|
213
|
-
`,
|
|
214
|
-
headers: {
|
|
215
|
-
Authorization: "Bearer ${context.tenantId},${context.authToken}"
|
|
216
95
|
}
|
|
217
|
-
|
|
218
|
-
"
|
|
219
|
-
"
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
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
|
|
96
|
+
],
|
|
97
|
+
"responsiveStyles": {
|
|
98
|
+
"large": {
|
|
99
|
+
"display": "flex",
|
|
100
|
+
"flexDirection": "column",
|
|
101
|
+
"position": "relative",
|
|
102
|
+
"flexShrink": "0",
|
|
103
|
+
"boxSizing": "border-box"
|
|
238
104
|
}
|
|
239
|
-
|
|
240
|
-
// {
|
|
241
|
-
// type: 'steedos-object-related-listview',
|
|
242
|
-
// objectApiName: masterObject.name,
|
|
243
|
-
// recordId: FlowRouter.getParam("record_id"),
|
|
244
|
-
// relatedObjectApiName: objectApiName,
|
|
245
|
-
// foreign_key: relatedKey,
|
|
246
|
-
// relatedKey: relatedKey,
|
|
247
|
-
// hiddenOn: "!!!this.$loaded"
|
|
248
|
-
// // top: 5
|
|
249
|
-
// }
|
|
250
|
-
]
|
|
105
|
+
}
|
|
251
106
|
}
|
|
252
|
-
|
|
253
|
-
}
|
|
254
|
-
}
|
|
107
|
+
]
|
|
108
|
+
};
|
|
255
109
|
|
|
256
|
-
Steedos.Page.render = function (root, page, data, options = {}) {
|
|
257
|
-
|
|
258
110
|
if (page.render_engine && page.render_engine != 'redash') {
|
|
259
111
|
|
|
260
112
|
let schema = typeof page.schema === 'string' ? JSON.parse(page.schema) : page.schema;
|
|
261
113
|
|
|
262
|
-
const defData = lodash.defaultsDeep({}, data , {
|
|
114
|
+
const defData = lodash.defaultsDeep({}, data , {
|
|
263
115
|
data: {
|
|
264
|
-
app_id: data.appId,
|
|
265
|
-
object_name: data.objectName,
|
|
266
|
-
record_id: data.recordId,
|
|
267
116
|
context: {
|
|
268
117
|
rootUrl: __meteor_runtime_config__.ROOT_URL,
|
|
269
118
|
tenantId: Creator.USER_CONTEXT.spaceId,
|
|
@@ -277,9 +126,7 @@
|
|
|
277
126
|
user: Creator.USER_CONTEXT.user,
|
|
278
127
|
now: new Date(),
|
|
279
128
|
// mode: mode //由表单提供
|
|
280
|
-
}
|
|
281
|
-
scopeId: schema.name || schema.id,
|
|
282
|
-
$scopeId : schema.name || schema.id
|
|
129
|
+
}
|
|
283
130
|
}
|
|
284
131
|
});
|
|
285
132
|
|
|
@@ -312,20 +159,24 @@
|
|
|
312
159
|
|
|
313
160
|
if(!lodash.isFunction(root)){
|
|
314
161
|
//渲染loading
|
|
162
|
+
SteedosUI.render(BuilderComponent, {
|
|
163
|
+
model: "page", content: {
|
|
164
|
+
"data": loadingContentData
|
|
165
|
+
}
|
|
166
|
+
}, root)
|
|
315
167
|
}
|
|
316
168
|
|
|
317
169
|
Promise.all([
|
|
318
|
-
waitForThing(window, 'renderAmis'),
|
|
319
170
|
waitForThing(window, 'BuilderComponent'),
|
|
320
171
|
waitForThing(Builder.components, upperFirst(page.render_engine), findComponent)
|
|
321
172
|
]).then(()=>{
|
|
322
173
|
//渲染page
|
|
323
174
|
if(!lodash.isFunction(root)){
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
)
|
|
175
|
+
SteedosUI.render(BuilderComponent, {
|
|
176
|
+
model: "page", content: {
|
|
177
|
+
"data": pageContentData
|
|
178
|
+
}
|
|
179
|
+
}, root)
|
|
329
180
|
}else{
|
|
330
181
|
if(root === SteedosUI.Drawer){
|
|
331
182
|
data.drawerName = data.drawerName || lodash.uniqueId(`drawer-${page.object_name}`);
|
|
@@ -423,7 +274,6 @@
|
|
|
423
274
|
}
|
|
424
275
|
|
|
425
276
|
if (page.render_engine && page.render_engine != 'redash') {
|
|
426
|
-
data.listName = data.listViewId;
|
|
427
277
|
return Steedos.Page.render($("#" + rootId)[0], page, Object.assign({}, options, data));
|
|
428
278
|
}
|
|
429
279
|
} catch (error) {
|
|
@@ -543,6 +393,20 @@
|
|
|
543
393
|
// data: initialValues,
|
|
544
394
|
// }));
|
|
545
395
|
}
|
|
396
|
+
|
|
397
|
+
SteedosUI.showModal(stores.ComponentRegistry.components.ObjectForm, {
|
|
398
|
+
name: `${objectApiName}_standard_new_form`,
|
|
399
|
+
objectApiName: objectApiName,
|
|
400
|
+
title: title,
|
|
401
|
+
initialValues: initialValues,
|
|
402
|
+
afterInsert: function (result) {
|
|
403
|
+
if (result.length > 0) {
|
|
404
|
+
var record = result[0];
|
|
405
|
+
SteedosUI.router.go({objectName: objectApiName, recordId: record._id, type: 'new'});
|
|
406
|
+
return true;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}, null, { iconPath: '/assets/icons' });
|
|
546
410
|
};
|
|
547
411
|
|
|
548
412
|
Steedos.Page.Form.StandardEdit.render = function (appId, objectApiName, title, recordId, options) {
|
|
@@ -606,6 +470,32 @@
|
|
|
606
470
|
// recordId: recordId
|
|
607
471
|
// }));
|
|
608
472
|
}
|
|
473
|
+
|
|
474
|
+
return SteedosUI.showModal(stores.ComponentRegistry.components.ObjectForm, {
|
|
475
|
+
name: `${objectApiName}_standard_edit_form`,
|
|
476
|
+
objectApiName: objectApiName,
|
|
477
|
+
recordId: recordId,
|
|
478
|
+
title: title,
|
|
479
|
+
afterUpdate: function () {
|
|
480
|
+
setTimeout(function () {
|
|
481
|
+
if(["/app/:app_id/:object_name/view/:record_id", "/app/:app_id/:object_name/:record_id/:related_object_name/grid"].indexOf(FlowRouter.current().route.pathDef) > -1){
|
|
482
|
+
// 记录详细界面编辑子表记录,或相关子表列表界面编辑子表记录
|
|
483
|
+
var params = FlowRouter.current().params;
|
|
484
|
+
if(params.record_id !== recordId){
|
|
485
|
+
// ObjectForm有缓存,修改子表记录可能会有主表记录的汇总字段变更,需要刷新主表记录
|
|
486
|
+
SteedosUI.reloadRecord(params.object_name, params.record_id)
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
if (FlowRouter.current().route.path.endsWith("/:record_id")) {
|
|
490
|
+
FlowRouter.reload()
|
|
491
|
+
} else {
|
|
492
|
+
window.refreshDxSchedulerInstance()
|
|
493
|
+
window.refreshGrid(options.gridName);
|
|
494
|
+
}
|
|
495
|
+
}, 1);
|
|
496
|
+
return true;
|
|
497
|
+
}
|
|
498
|
+
}, null, { iconPath: '/assets/icons' })
|
|
609
499
|
};
|
|
610
500
|
|
|
611
501
|
// Steedos.Page.Form.StandardDelete.render = function(){
|
|
@@ -668,235 +558,4 @@
|
|
|
668
558
|
graphqlFieldsQuery: getGraphqlFieldsQuery(objectApiName, selectFields, expandFields)
|
|
669
559
|
})
|
|
670
560
|
}
|
|
671
|
-
|
|
672
|
-
const getSpaceLogo = function(){
|
|
673
|
-
let logoSrc = '';
|
|
674
|
-
const space = db.spaces.findOne(Steedos.getSpaceId())
|
|
675
|
-
if(space?.avatar){
|
|
676
|
-
logoSrc = Steedos.absoluteUrl(space.avatar)
|
|
677
|
-
}else if(space?.avatar_square){
|
|
678
|
-
logoSrc = Steedos.absoluteUrl(space.avatar_square)
|
|
679
|
-
}else{
|
|
680
|
-
var settings = Session.get("tenant_settings");
|
|
681
|
-
if(settings){
|
|
682
|
-
avatar_url = settings?.logo_square_url;
|
|
683
|
-
}
|
|
684
|
-
if(!avatar_url || !settings){
|
|
685
|
-
avatar_url = "/images/logo_platform.png"
|
|
686
|
-
if(Meteor.user()?.locale != 'zh-cn'){
|
|
687
|
-
avatar_url = "/images/logo_platform.en-us.png"
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
logoSrc = Steedos.absoluteUrl(avatar_url)
|
|
691
|
-
}
|
|
692
|
-
return logoSrc
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
Steedos.Page.Header.render = function(appId, tabId){
|
|
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'}
|
|
707
|
-
}
|
|
708
|
-
try {
|
|
709
|
-
const data = {
|
|
710
|
-
app,
|
|
711
|
-
isMobile: window.innerWidth <= 768
|
|
712
|
-
};
|
|
713
|
-
const page = Steedos.Page.Header.getPage(appId, tabId);
|
|
714
|
-
var rootId = "steedosGlobalHeaderRoot";
|
|
715
|
-
var modalRoot = document.getElementById(rootId);
|
|
716
|
-
if (!modalRoot) {
|
|
717
|
-
modalRoot = document.createElement('div');
|
|
718
|
-
modalRoot.setAttribute('id', rootId);
|
|
719
|
-
$(".steedos-global-header-root")[0].appendChild(modalRoot);
|
|
720
|
-
}
|
|
721
|
-
if (page.render_engine && page.render_engine != 'redash') {
|
|
722
|
-
return Steedos.Page.render($("#" + rootId)[0], page, Object.assign({}, data));
|
|
723
|
-
}
|
|
724
|
-
} catch (error) {
|
|
725
|
-
console.error(`Steedos.Page.Header.render`, error)
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
Steedos.Page.Header.getPage = function(appId, tabId){
|
|
729
|
-
const logoSrc = getSpaceLogo()
|
|
730
|
-
return {
|
|
731
|
-
render_engine: 'amis',
|
|
732
|
-
name: 'steedosGlobalHeaderPage',
|
|
733
|
-
schema: {
|
|
734
|
-
"type": "service",
|
|
735
|
-
name: "globalHeader",
|
|
736
|
-
body: [
|
|
737
|
-
{
|
|
738
|
-
"type": "wrapper",
|
|
739
|
-
"className": 'p-0',
|
|
740
|
-
body: [
|
|
741
|
-
{
|
|
742
|
-
"type": "wrapper",
|
|
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",
|
|
744
|
-
body: [
|
|
745
|
-
{
|
|
746
|
-
"type": "wrapper",
|
|
747
|
-
"className": 'flex w-full px-4 h-[50px] p-0 justify-between items-center steedos-header-container-line-one',
|
|
748
|
-
"body": [
|
|
749
|
-
{
|
|
750
|
-
type: "wrapper",
|
|
751
|
-
className: 'p-0 flex flex-1 items-center',
|
|
752
|
-
body: [
|
|
753
|
-
{
|
|
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
|
-
],
|
|
777
|
-
},
|
|
778
|
-
{
|
|
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>`,
|
|
782
|
-
},
|
|
783
|
-
],
|
|
784
|
-
},
|
|
785
|
-
{
|
|
786
|
-
"type": "steedos-global-header",
|
|
787
|
-
"label": "Global Header",
|
|
788
|
-
className: 'flex flex-nowrap gap-x-3 items-center',
|
|
789
|
-
logoutScript: "window.Steedos.logout();",
|
|
790
|
-
customButtons: [
|
|
791
|
-
{
|
|
792
|
-
"type": "button",
|
|
793
|
-
"className": "toggle-sidebar",
|
|
794
|
-
"visibleOn": "${AND(app.showSidebar,!isMobile)}",
|
|
795
|
-
"onEvent": {
|
|
796
|
-
"click": {
|
|
797
|
-
"actions": [
|
|
798
|
-
{
|
|
799
|
-
"actionType": "custom",
|
|
800
|
-
"script": "document.body.classList.toggle('sidebar-open')",
|
|
801
|
-
}
|
|
802
|
-
]
|
|
803
|
-
}
|
|
804
|
-
},
|
|
805
|
-
"body": [
|
|
806
|
-
{
|
|
807
|
-
"type": "steedos-icon",
|
|
808
|
-
"category": "utility",
|
|
809
|
-
"name": "rows",
|
|
810
|
-
"colorVariant": "default",
|
|
811
|
-
"id": "u:afc3a08e8cf3",
|
|
812
|
-
"className": "slds-button_icon slds-global-header__icon"
|
|
813
|
-
}
|
|
814
|
-
],
|
|
815
|
-
},]
|
|
816
|
-
}
|
|
817
|
-
],
|
|
818
|
-
},
|
|
819
|
-
|
|
820
|
-
{
|
|
821
|
-
"type": "grid",
|
|
822
|
-
"hiddenOn": "${isMobile}",
|
|
823
|
-
"className": 'steedos-context-bar flex flex-nowrap h-10 leading-5 pl-4 mb-[-3px] steedos-header-container-line-two',
|
|
824
|
-
"columns": [
|
|
825
|
-
{
|
|
826
|
-
"columnClassName": "items-center flex pb-0",
|
|
827
|
-
"body": [
|
|
828
|
-
{
|
|
829
|
-
"type": "steedos-app-launcher",
|
|
830
|
-
"showAppName": true,
|
|
831
|
-
"appId": "${app.id}",
|
|
832
|
-
}
|
|
833
|
-
],
|
|
834
|
-
"md": "auto",
|
|
835
|
-
"valign": "middle"
|
|
836
|
-
},
|
|
837
|
-
{
|
|
838
|
-
hiddenOn: "${app.showSidebar === true}",
|
|
839
|
-
"columnClassName": "flex overflow-hidden",
|
|
840
|
-
"body": [
|
|
841
|
-
{
|
|
842
|
-
"type": "steedos-app-menu",
|
|
843
|
-
"stacked": false,
|
|
844
|
-
showIcon: false,
|
|
845
|
-
"appId": "${app.id}",
|
|
846
|
-
hiddenOn: "${app.showSidebar === true}",
|
|
847
|
-
overflow: {
|
|
848
|
-
enable: false,
|
|
849
|
-
itemWidth: 80,
|
|
850
|
-
},
|
|
851
|
-
"id": "u:77851eb4aa89",
|
|
852
|
-
}
|
|
853
|
-
],
|
|
854
|
-
"id": "u:5367229505d8",
|
|
855
|
-
"md": "",
|
|
856
|
-
"valign": "middle",
|
|
857
|
-
}
|
|
858
|
-
],
|
|
859
|
-
},
|
|
860
|
-
],
|
|
861
|
-
},
|
|
862
|
-
|
|
863
|
-
{
|
|
864
|
-
|
|
865
|
-
"type": "button",
|
|
866
|
-
"className": 'p-0 absolute inset-0 mt-[50px] sm:mt-[90px]',
|
|
867
|
-
hiddenOn: "${app.showSidebar != true}",
|
|
868
|
-
body: [{
|
|
869
|
-
type: "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',
|
|
871
|
-
body: [
|
|
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
|
-
},
|
|
883
|
-
]
|
|
884
|
-
}],
|
|
885
|
-
"onEvent": {
|
|
886
|
-
"click": {
|
|
887
|
-
"actions": [
|
|
888
|
-
{
|
|
889
|
-
"actionType": "custom",
|
|
890
|
-
"script": "console.log(event.target); if(window.innerWidth < 768){ document.body.classList.remove('sidebar-open'); }",
|
|
891
|
-
}
|
|
892
|
-
]
|
|
893
|
-
}
|
|
894
|
-
},
|
|
895
|
-
}
|
|
896
|
-
],
|
|
897
|
-
},
|
|
898
|
-
]
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
561
|
})();
|
|
@@ -30,8 +30,7 @@ module.exports = {
|
|
|
30
30
|
};
|
|
31
31
|
Steedos.authRequest(url, options);
|
|
32
32
|
},
|
|
33
|
-
customPageVisible: function (object_name, record_id, permission,
|
|
34
|
-
var record = data && data.record;
|
|
33
|
+
customPageVisible: function (object_name, record_id, permission, record) {
|
|
35
34
|
return record && record.is_system;
|
|
36
35
|
}
|
|
37
36
|
}
|
|
@@ -31,8 +31,7 @@ module.exports = {
|
|
|
31
31
|
};
|
|
32
32
|
Steedos.authRequest(url, options);
|
|
33
33
|
},
|
|
34
|
-
deployVisible: function (object_name, record_id, permission,
|
|
35
|
-
var record = data && data.record;
|
|
34
|
+
deployVisible: function (object_name, record_id, permission, record) {
|
|
36
35
|
return record && !record.is_system;
|
|
37
36
|
}
|
|
38
37
|
}
|
|
@@ -24,8 +24,7 @@ module.exports = {
|
|
|
24
24
|
};
|
|
25
25
|
Steedos.authRequest(url, options);
|
|
26
26
|
},
|
|
27
|
-
disableVisible: function (object_name, record_id, permission,
|
|
28
|
-
var record = data && data.record;
|
|
27
|
+
disableVisible: function (object_name, record_id, permission, record) {
|
|
29
28
|
return record && record.is_active && !record.is_system
|
|
30
29
|
}
|
|
31
30
|
}
|
|
@@ -24,8 +24,7 @@ module.exports = {
|
|
|
24
24
|
};
|
|
25
25
|
Steedos.authRequest(url, options);
|
|
26
26
|
},
|
|
27
|
-
enableVisible: function (object_name, record_id, permission,
|
|
28
|
-
var record = data && data.record;
|
|
27
|
+
enableVisible: function (object_name, record_id, permission, record) {
|
|
29
28
|
return record && !record.is_active && !record.is_system
|
|
30
29
|
}
|
|
31
30
|
}
|
|
@@ -41,8 +41,7 @@ module.exports = {
|
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
},
|
|
44
|
-
resetSchemaVisible: function (object_name, record_id, permission,
|
|
45
|
-
var record = data && data.record;
|
|
44
|
+
resetSchemaVisible: function (object_name, record_id, permission, record) {
|
|
46
45
|
return record && !record.is_system && record.type === 'form';
|
|
47
46
|
}
|
|
48
47
|
}
|
|
@@ -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
|
+
optionsFunction: !!js/function |
|
|
8
|
+
function () {
|
|
9
|
+
return Steedos.getObjectsOptions()
|
|
10
10
|
}
|
|
11
11
|
filterable: true
|
|
12
12
|
required: "{{'record' == formData.type || 'list' == formData.type || 'form' == formData.type ? true: false}}"
|
|
@@ -17,4 +17,15 @@ hidden: true
|
|
|
17
17
|
icon: contract
|
|
18
18
|
is_enable: true
|
|
19
19
|
label: 微页面
|
|
20
|
-
version: 2
|
|
20
|
+
version: 2
|
|
21
|
+
form:
|
|
22
|
+
afterView: !!js/function |
|
|
23
|
+
function(){
|
|
24
|
+
if(this.doc.name && (this.doc.render_engine === 'redash' || !this.doc.render_engine)){
|
|
25
|
+
return SteedosUI.render(stores.ComponentRegistry.components.Page, { pageId: this.doc.name }, $(".slds-template__container")[0])
|
|
26
|
+
}
|
|
27
|
+
if(this.doc.type === 'app'){
|
|
28
|
+
$('[data-object-name="page_assignments"]').hide()
|
|
29
|
+
}
|
|
30
|
+
$('[data-object-name="page_versions"]').hide()
|
|
31
|
+
}
|
|
@@ -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: 2022-05-28 11:15:32
|
|
6
6
|
* @Description:
|
|
7
7
|
*/
|
|
8
8
|
const auth = require('@steedos/auth');
|
|
@@ -24,22 +24,6 @@ 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
|
-
|
|
43
27
|
// const actions = broker.registry.getActionList({
|
|
44
28
|
// onlyLocal: false
|
|
45
29
|
// });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-pages",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.8",
|
|
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": "b2393877080bbb08d758ce883522d37bc0a12ba2",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"ejs": "^3.1.8"
|
|
14
14
|
}
|
package/public/logo.png
DELETED
|
Binary file
|