@steedos/standard-ui 2.6.1-beta.6 → 2.6.2-beta.2
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/applications/admin.app.yml +16 -10
- package/main/default/client/favicon.client.js +11 -0
- package/main/default/client/history_paths.client.js +153 -106
- package/main/default/objectTranslations/apps.en/apps.en.objectTranslation.yml +1 -0
- package/main/default/objectTranslations/apps.zh-CN/apps.zh-CN.objectTranslation.yml +1 -0
- package/main/default/objectTranslations/tabs.en/tabs.en.objectTranslation.yml +2 -0
- package/main/default/objectTranslations/tabs.zh-CN/tabs.zh-CN.objectTranslation.yml +4 -0
- package/main/default/objects/apps/buttons/amis_edit.button.yml +2 -2
- package/main/default/objects/apps/buttons/amis_nav_schema_design.button.js +23 -23
- package/main/default/objects/apps/buttons/amis_new.button.yml +2 -2
- package/main/default/objects/apps.action.js +2 -3
- package/main/default/objects/apps.object.yml +29 -24
- package/main/default/objects/tabs/buttons/generate_object_tabs.button.yml +2 -2
- package/main/default/objects/tabs.object.yml +19 -1
- package/main/default/pages/metadata.page.amis.json +256 -0
- package/main/default/pages/metadata.page.yml +8 -0
- package/main/default/routers/amis_app_nav_schema_design.router.js +18 -3
- package/main/default/routers/main_head.ejs +155 -0
- package/main/default/routers/main_head.router.js +100 -0
- package/main/default/tabs/admin_flow_positions.tab.yml +21 -0
- package/main/default/tabs/admin_flow_roles.tab.yml +1 -1
- package/main/default/tabs/admin_metadata.tab.yml +22 -0
- package/main/default/tabs/admin_personal_information.tab.yml +21 -0
- package/main/default/tabs/admin_workflow_notifications.tab.yml +1 -1
- package/main/default/triggers/apps.trigger.js +10 -3
- package/package.json +2 -2
- package/package.service.js +26 -3
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "page",
|
|
3
|
+
"title": "Welcome to Steedos",
|
|
4
|
+
"body": [
|
|
5
|
+
{
|
|
6
|
+
"type": "tabs",
|
|
7
|
+
"id": "u:688bc8415b59",
|
|
8
|
+
"tabs": [
|
|
9
|
+
{
|
|
10
|
+
"title": "对象",
|
|
11
|
+
"body": [
|
|
12
|
+
{
|
|
13
|
+
"type": "steedos-object-listview",
|
|
14
|
+
"label": "列表视图",
|
|
15
|
+
"objectApiName": "objects",
|
|
16
|
+
"listName": "customize",
|
|
17
|
+
"showHeader": true,
|
|
18
|
+
"className": "sm:border sm:shadow sm:rounded sm:border-gray-300 mb-4",
|
|
19
|
+
"id": "u:6f86e8fc0bac"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"id": "u:1f46ff0c18e9"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"title": "字段",
|
|
26
|
+
"body": [
|
|
27
|
+
{
|
|
28
|
+
"type": "steedos-object-listview",
|
|
29
|
+
"label": "列表视图",
|
|
30
|
+
"objectApiName": "object_fields",
|
|
31
|
+
"listName": "customize",
|
|
32
|
+
"showHeader": true,
|
|
33
|
+
"className": "sm:border sm:shadow sm:rounded sm:border-gray-300 mb-4",
|
|
34
|
+
"id": "u:3ce7bf1fb9fc"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"id": "u:a7903575040d"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"title": "列表视图",
|
|
41
|
+
"body": [
|
|
42
|
+
{
|
|
43
|
+
"type": "steedos-object-listview",
|
|
44
|
+
"label": "列表视图",
|
|
45
|
+
"objectApiName": "object_listviews",
|
|
46
|
+
"listName": "customize",
|
|
47
|
+
"showHeader": true,
|
|
48
|
+
"className": "sm:border sm:shadow sm:rounded sm:border-gray-300 mb-4",
|
|
49
|
+
"id": "u:65e97e052474",
|
|
50
|
+
"formFactor": "LARGE"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"id": "u:59b92e6a3fd2"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"title": "操作按钮",
|
|
57
|
+
"body": [
|
|
58
|
+
{
|
|
59
|
+
"type": "steedos-object-listview",
|
|
60
|
+
"label": "列表视图",
|
|
61
|
+
"objectApiName": "object_actions",
|
|
62
|
+
"listName": "customize",
|
|
63
|
+
"showHeader": true,
|
|
64
|
+
"className": "sm:border sm:shadow sm:rounded sm:border-gray-300 mb-4",
|
|
65
|
+
"id": "u:65e97e052474",
|
|
66
|
+
"formFactor": "LARGE"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"id": "u:936ab602e2a9"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"title": "页面布局",
|
|
73
|
+
"body": [
|
|
74
|
+
{
|
|
75
|
+
"type": "steedos-object-listview",
|
|
76
|
+
"label": "列表视图",
|
|
77
|
+
"objectApiName": "object_layouts",
|
|
78
|
+
"listName": "customize",
|
|
79
|
+
"showHeader": true,
|
|
80
|
+
"className": "sm:border sm:shadow sm:rounded sm:border-gray-300 mb-4",
|
|
81
|
+
"id": "u:65e97e052474",
|
|
82
|
+
"formFactor": "LARGE",
|
|
83
|
+
"crud": {
|
|
84
|
+
"footerToolbar": [],
|
|
85
|
+
"id": "u:8cf8bde10dcb"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"id": "u:3729aa71eccf"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"title": "对象权限",
|
|
93
|
+
"body": [
|
|
94
|
+
{
|
|
95
|
+
"type": "steedos-object-listview",
|
|
96
|
+
"label": "列表视图",
|
|
97
|
+
"objectApiName": "permission_objects",
|
|
98
|
+
"listName": "customize",
|
|
99
|
+
"showHeader": true,
|
|
100
|
+
"className": "sm:border sm:shadow sm:rounded sm:border-gray-300 mb-4",
|
|
101
|
+
"id": "u:65e97e052474",
|
|
102
|
+
"formFactor": "LARGE"
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"id": "u:5b798c6b51b3"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"title": "触发器",
|
|
109
|
+
"body": [
|
|
110
|
+
{
|
|
111
|
+
"type": "steedos-object-listview",
|
|
112
|
+
"label": "列表视图",
|
|
113
|
+
"objectApiName": "object_triggers",
|
|
114
|
+
"listName": "customize",
|
|
115
|
+
"showHeader": true,
|
|
116
|
+
"className": "sm:border sm:shadow sm:rounded sm:border-gray-300 mb-4",
|
|
117
|
+
"id": "u:65e97e052474",
|
|
118
|
+
"formFactor": "LARGE"
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"id": "u:23536bfbc790"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"title": "流程映射",
|
|
125
|
+
"body": [
|
|
126
|
+
{
|
|
127
|
+
"type": "steedos-object-listview",
|
|
128
|
+
"label": "列表视图",
|
|
129
|
+
"objectApiName": "object_workflows",
|
|
130
|
+
"listName": "customize",
|
|
131
|
+
"showHeader": true,
|
|
132
|
+
"className": "sm:border sm:shadow sm:rounded sm:border-gray-300 mb-4",
|
|
133
|
+
"id": "u:65e97e052474",
|
|
134
|
+
"formFactor": "LARGE",
|
|
135
|
+
"crud": {
|
|
136
|
+
"footerToolbar": []
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
"id": "u:648cb5bbffac"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"title": "验证规则",
|
|
144
|
+
"body": [
|
|
145
|
+
{
|
|
146
|
+
"type": "steedos-object-listview",
|
|
147
|
+
"label": "列表视图",
|
|
148
|
+
"objectApiName": "object_validation_rules",
|
|
149
|
+
"listName": "customize",
|
|
150
|
+
"showHeader": true,
|
|
151
|
+
"className": "sm:border sm:shadow sm:rounded sm:border-gray-300 mb-4",
|
|
152
|
+
"id": "u:65e97e052474",
|
|
153
|
+
"formFactor": "LARGE"
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
"id": "u:8a66c9a8a31a"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"title": "限制规则",
|
|
160
|
+
"body": [
|
|
161
|
+
{
|
|
162
|
+
"type": "steedos-object-listview",
|
|
163
|
+
"label": "列表视图",
|
|
164
|
+
"objectApiName": "restriction_rules",
|
|
165
|
+
"listName": "customize",
|
|
166
|
+
"showHeader": true,
|
|
167
|
+
"className": "sm:border sm:shadow sm:rounded sm:border-gray-300 mb-4",
|
|
168
|
+
"id": "u:65e97e052474",
|
|
169
|
+
"formFactor": "LARGE"
|
|
170
|
+
}
|
|
171
|
+
]
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"title": "共享规则",
|
|
175
|
+
"body": [
|
|
176
|
+
{
|
|
177
|
+
"type": "steedos-object-listview",
|
|
178
|
+
"label": "列表视图",
|
|
179
|
+
"objectApiName": "share_rules",
|
|
180
|
+
"listName": "customize",
|
|
181
|
+
"showHeader": true,
|
|
182
|
+
"className": "sm:border sm:shadow sm:rounded sm:border-gray-300 mb-4",
|
|
183
|
+
"id": "u:65e97e052474",
|
|
184
|
+
"formFactor": "LARGE"
|
|
185
|
+
}
|
|
186
|
+
]
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"title": "选项卡",
|
|
190
|
+
"body": [
|
|
191
|
+
{
|
|
192
|
+
"type": "steedos-object-listview",
|
|
193
|
+
"id": "u:65e97e052474",
|
|
194
|
+
"label": "列表视图",
|
|
195
|
+
"objectApiName": "tabs",
|
|
196
|
+
"listName": "customize",
|
|
197
|
+
"showHeader": true,
|
|
198
|
+
"className": "sm:border sm:shadow sm:rounded sm:border-gray-300 mb-4",
|
|
199
|
+
"formFactor": "LARGE",
|
|
200
|
+
"crud": {
|
|
201
|
+
"footerToolbar": []
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
],
|
|
205
|
+
"id": "u:32b59a9e8fd2"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"title": "流程",
|
|
209
|
+
"body": [
|
|
210
|
+
{
|
|
211
|
+
"type": "steedos-object-listview",
|
|
212
|
+
"label": "列表视图",
|
|
213
|
+
"objectApiName": "flows",
|
|
214
|
+
"listName": "customize",
|
|
215
|
+
"showHeader": true,
|
|
216
|
+
"className": "sm:border sm:shadow sm:rounded sm:border-gray-300 mb-4",
|
|
217
|
+
"formFactor": "LARGE",
|
|
218
|
+
"id": "u:749d0595fbf8",
|
|
219
|
+
"crud": {
|
|
220
|
+
"footerToolbar": []
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
],
|
|
224
|
+
"id": "u:785fa47d408e"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"title": "微页面",
|
|
228
|
+
"body": [
|
|
229
|
+
{
|
|
230
|
+
"type": "steedos-object-listview",
|
|
231
|
+
"label": "列表视图",
|
|
232
|
+
"objectApiName": "pages",
|
|
233
|
+
"listName": "customize",
|
|
234
|
+
"showHeader": true,
|
|
235
|
+
"className": "sm:border sm:shadow sm:rounded sm:border-gray-300 mb-4",
|
|
236
|
+
"id": "u:65e97e052474",
|
|
237
|
+
"formFactor": "LARGE"
|
|
238
|
+
}
|
|
239
|
+
],
|
|
240
|
+
"id": "u:936ab602e2a9"
|
|
241
|
+
}
|
|
242
|
+
],
|
|
243
|
+
"tabsMode": "vertical"
|
|
244
|
+
}
|
|
245
|
+
],
|
|
246
|
+
"regions": [
|
|
247
|
+
"body"
|
|
248
|
+
],
|
|
249
|
+
"data": {
|
|
250
|
+
"initialValues": {},
|
|
251
|
+
"appId": "builder",
|
|
252
|
+
"title": "",
|
|
253
|
+
"context": {}
|
|
254
|
+
},
|
|
255
|
+
"id": "u:dafae0b298ee"
|
|
256
|
+
}
|
|
@@ -11,12 +11,21 @@ const fs = require('fs');
|
|
|
11
11
|
const _ = require('lodash');
|
|
12
12
|
const path = require('path');
|
|
13
13
|
const objectql = require('@steedos/objectql');
|
|
14
|
-
|
|
14
|
+
const getPublicAssetUrls = function(assetUrls){
|
|
15
|
+
const values = _.map(_.split(assetUrls), (item)=>{
|
|
16
|
+
if(_.startsWith(item, '/')){
|
|
17
|
+
return Meteor.absoluteUrl(item) ;
|
|
18
|
+
}else{
|
|
19
|
+
return item;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
return _.join(values, ',')
|
|
23
|
+
}
|
|
15
24
|
router.get('/api/amisAppNavSchemaDesign', core.requireAuthentication, async function (req, res) {
|
|
16
25
|
try {
|
|
17
26
|
res.set('Content-Type', 'text/html');
|
|
18
27
|
const userSession = req.user;
|
|
19
|
-
let assetUrls = req.query.assetUrls;
|
|
28
|
+
let assetUrls = getPublicAssetUrls(req.query.assetUrls);
|
|
20
29
|
const assetUrl = `assetUrl=${assetUrls.split(',').join("&assetUrl=")}&`;
|
|
21
30
|
// const dataContext = {
|
|
22
31
|
// rootUrl: __meteor_runtime_config__.ROOT_URL,
|
|
@@ -25,9 +34,15 @@ router.get('/api/amisAppNavSchemaDesign', core.requireAuthentication, async func
|
|
|
25
34
|
// authToken: userSession.authToken
|
|
26
35
|
// }
|
|
27
36
|
|
|
37
|
+
let locale = "zh-CN";
|
|
38
|
+
if (req.query.locale == "en-us") {
|
|
39
|
+
locale = "en-US";
|
|
40
|
+
} else if (req.query.locale == "zh-cn") {
|
|
41
|
+
locale = "zh-CN";
|
|
42
|
+
}
|
|
28
43
|
const retUrl = __meteor_runtime_config__.ROOT_URL + `/app/admin/apps/view/${req.query.id}`
|
|
29
44
|
const steedosBuilderUrl = process.env.STEEDOS_BUILDER_URL || 'https://builder.steedos.cn';
|
|
30
|
-
const builderHost = `${steedosBuilderUrl}/amis?${assetUrl}retUrl=${retUrl}`;
|
|
45
|
+
const builderHost = `${steedosBuilderUrl}/amis?${assetUrl}locale=${locale}&retUrl=${retUrl}`;
|
|
31
46
|
|
|
32
47
|
const filename = __dirname+'/amis_app_nav_schema_design.ejs'
|
|
33
48
|
const data = {
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
(function(){
|
|
2
|
+
const loadJs = (url, callback)=>{
|
|
3
|
+
let scriptTag = document.createElement("script");
|
|
4
|
+
scriptTag.type = "text/javascript";
|
|
5
|
+
scriptTag.src = url;
|
|
6
|
+
scriptTag.async = false;
|
|
7
|
+
document.getElementsByTagName("head")[0].appendChild(scriptTag);
|
|
8
|
+
scriptTag.onload = function(script){
|
|
9
|
+
if(callback){
|
|
10
|
+
callback(script)
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const loadCss = (url)=>{
|
|
16
|
+
let styleTag = document.createElement("link");
|
|
17
|
+
styleTag.setAttribute("rel", "stylesheet");
|
|
18
|
+
styleTag.setAttribute("type", "text/css");
|
|
19
|
+
styleTag.setAttribute("href", src);
|
|
20
|
+
document.getElementsByTagName("head")[0].appendChild(styleTag);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
window.loadJs = loadJs;
|
|
24
|
+
window.loadCss = loadCss;
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
const STEEDOS_SENTRY_ENABLED = "<%=STEEDOS_SENTRY_ENABLED%>";
|
|
28
|
+
const NODE_ENV = "<%=NODE_ENV%>";
|
|
29
|
+
const STEEDOS_SENTRY_DSN = "<%=STEEDOS_SENTRY_DSN%>";
|
|
30
|
+
const ROOT_URL = "<%=ROOT_URL%>";
|
|
31
|
+
const STEEDOS_UNPKG_URL = "<%=STEEDOS_UNPKG_URL%>";
|
|
32
|
+
const STEEDOS_AMIS_URL = "<%=STEEDOS_AMIS_URL%>";
|
|
33
|
+
const STEEDOS_PUBLIC_SCRIPT_VCONSOLE = "<%=STEEDOS_PUBLIC_SCRIPT_VCONSOLE%>";
|
|
34
|
+
const STEEDOS_PUBLIC_SCRIPT_PLUGINS = "<%=STEEDOS_PUBLIC_SCRIPT_PLUGINS%>";
|
|
35
|
+
const STEEDOS_PUBLIC_STYLE_PLUGINS = "<%=STEEDOS_PUBLIC_STYLE_PLUGINS%>";
|
|
36
|
+
const STEEDOS_VERSION = "<%=STEEDOS_VERSION%>";
|
|
37
|
+
const STEEDOS_LOCALE = "<%=STEEDOS_LOCALE%>";
|
|
38
|
+
const STEEDOS_PUBLIC_PAGE_ASSETURLS = "<%=STEEDOS_PUBLIC_PAGE_ASSETURLS%>";
|
|
39
|
+
const STEEDOS_AMIS_VERSION= "<%=STEEDOS_AMIS_VERSION%>";
|
|
40
|
+
|
|
41
|
+
const platform = <%- JSON.stringify(platform) %>;
|
|
42
|
+
|
|
43
|
+
if (`${STEEDOS_SENTRY_ENABLED}` != 'false') {
|
|
44
|
+
loadJs(`${ROOT_URL}/sentry/sentry.min.js`, (script)=>{
|
|
45
|
+
const nodeEnv = NODE_ENV || 'development';
|
|
46
|
+
const DEFAULT_DSN_JS = {
|
|
47
|
+
'development': 'https://7c2b864b83bf4361a030a7df9d2ace0c@sentry.steedos.cn/7',
|
|
48
|
+
'production': 'https://8f3f63d02e8140718a6123b10d49ae2f@sentry.steedos.cn/6'
|
|
49
|
+
}
|
|
50
|
+
var dsn = STEEDOS_SENTRY_DSN || DEFAULT_DSN_JS[nodeEnv];
|
|
51
|
+
Sentry.init({
|
|
52
|
+
dsn: dsn
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
loadJs(`${STEEDOS_UNPKG_URL}/lodash@4.17.21/lodash.min.js`, ()=>{
|
|
58
|
+
// window._ = window.lodash;
|
|
59
|
+
try {
|
|
60
|
+
if(platform.hostname){
|
|
61
|
+
if (!_.includes(platform.hostname.split(','), window.location.hostname)) {
|
|
62
|
+
setTimeout(function(){
|
|
63
|
+
const banners = document.getElementsByClassName("steedos-banners")[0];
|
|
64
|
+
if(banners){
|
|
65
|
+
banners.style.display = 'flex';
|
|
66
|
+
banners.style.justifyContent = 'center';
|
|
67
|
+
}
|
|
68
|
+
console.error(`环境变量ROOT_URL中的hostname(${window.location.hostname})与许可证中设置的不一致,请确认。`)
|
|
69
|
+
}, 3000)
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
} catch (error) {
|
|
73
|
+
console.error(error)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
});
|
|
77
|
+
loadJs(`${STEEDOS_UNPKG_URL}/marked@4.0.17/marked.min.js`);
|
|
78
|
+
loadJs(`${STEEDOS_UNPKG_URL}/crypto-js@4.1.1/crypto-js.js`);
|
|
79
|
+
|
|
80
|
+
loadJs(`${STEEDOS_UNPKG_URL}/@steedos-builder/sdk@0.2.38/dist/index.umd.js`, ()=>{
|
|
81
|
+
window.Builder = BuilderSDK.Builder;
|
|
82
|
+
window.builder = BuilderSDK.builder;
|
|
83
|
+
window.builder.init('steedos');
|
|
84
|
+
|
|
85
|
+
let searchParams = new URLSearchParams(location.search);
|
|
86
|
+
if (searchParams.get('assetUrls')) {
|
|
87
|
+
sessionStorage.setItem('assetUrls', searchParams.get('assetUrls'))
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
let assetUrls = sessionStorage.getItem('assetUrls')? sessionStorage.getItem('assetUrls') : STEEDOS_PUBLIC_PAGE_ASSETURLS
|
|
91
|
+
if(typeof "assetUrls" == 'string'){
|
|
92
|
+
assetUrls = assetUrls.split(',');
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const getBrowserLocale = function() {
|
|
96
|
+
var l, locale;
|
|
97
|
+
l = window.navigator.userLanguage || window.navigator.language || 'en';
|
|
98
|
+
if (l.indexOf("zh") >= 0) {
|
|
99
|
+
locale = "zh-cn";
|
|
100
|
+
} else {
|
|
101
|
+
locale = "en-us";
|
|
102
|
+
}
|
|
103
|
+
return locale;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
Builder.set({
|
|
107
|
+
nodeEnv: NODE_ENV,
|
|
108
|
+
rootUrl: ROOT_URL,
|
|
109
|
+
unpkgUrl: STEEDOS_UNPKG_URL,
|
|
110
|
+
steedosVersion: STEEDOS_VERSION,
|
|
111
|
+
assetUrls,
|
|
112
|
+
steedosAmisVersion: STEEDOS_AMIS_VERSION,
|
|
113
|
+
locale: STEEDOS_LOCALE || getBrowserLocale()
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
loadJs(`${STEEDOS_AMIS_URL}/sdk/sdk.js`, ()=>{
|
|
118
|
+
window.axios = amisRequire('axios');
|
|
119
|
+
window.moment = amisRequire('moment');
|
|
120
|
+
window.React = amisRequire('react');
|
|
121
|
+
window.ReactDOM = amisRequire('react-dom');
|
|
122
|
+
window.React17 = window.React;
|
|
123
|
+
window.ReactDOM17 = window.ReactDOM;
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
window.addEventListener('message', function (event) {
|
|
127
|
+
const { data } = event;
|
|
128
|
+
if (data.type === 'Builder.loaded') {
|
|
129
|
+
Builder.registerRemoteAssets(Builder.settings.assetUrls);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
if (STEEDOS_PUBLIC_SCRIPT_VCONSOLE) {
|
|
134
|
+
loadJs(STEEDOS_PUBLIC_SCRIPT_VCONSOLE, ()=>{
|
|
135
|
+
window.vConsole = new window.VConsole();
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (STEEDOS_PUBLIC_SCRIPT_PLUGINS) {
|
|
140
|
+
STEEDOS_PUBLIC_SCRIPT_PLUGINS.split(',').forEach(function (src) {
|
|
141
|
+
loadJs(src)
|
|
142
|
+
})
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (STEEDOS_PUBLIC_STYLE_PLUGINS) {
|
|
146
|
+
STEEDOS_PUBLIC_STYLE_PLUGINS.split(',').forEach(function (src) {
|
|
147
|
+
loadCss(src)
|
|
148
|
+
})
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if(ROOT_URL){
|
|
152
|
+
loadJs(`${ROOT_URL}/cordova.i18n.js`)
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
})();
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: baozhoutao@steedos.com
|
|
3
|
+
* @Date: 2022-04-04 16:34:28
|
|
4
|
+
* @Description:
|
|
5
|
+
*/
|
|
6
|
+
const express = require("express");
|
|
7
|
+
const router = express.Router();
|
|
8
|
+
const core = require('@steedos/core');
|
|
9
|
+
const ejs = require('ejs');
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
const _ = require('lodash');
|
|
12
|
+
const path = require('path');
|
|
13
|
+
|
|
14
|
+
const getConfig = (key, platform)=>{
|
|
15
|
+
if(platform === 'cordova'){
|
|
16
|
+
if(key === 'STEEDOS_PUBLIC_PAGE_ASSETURLS'){
|
|
17
|
+
const values = _.map(_.split(process.env.STEEDOS_PUBLIC_PAGE_ASSETURLS), (item)=>{
|
|
18
|
+
if(_.startsWith(item, '/')){
|
|
19
|
+
return Meteor.absoluteUrl(item) ;
|
|
20
|
+
}else{
|
|
21
|
+
return item;
|
|
22
|
+
}
|
|
23
|
+
})
|
|
24
|
+
return _.join(values, ',')
|
|
25
|
+
}
|
|
26
|
+
let value = process.env[key];
|
|
27
|
+
//如果不是以http开头的,就是相对路径, 则加上ROOT_URL
|
|
28
|
+
if(_.startsWith(value, '/')){
|
|
29
|
+
return Meteor.absoluteUrl(value) ;
|
|
30
|
+
}
|
|
31
|
+
return value;
|
|
32
|
+
}else{
|
|
33
|
+
return process.env[key]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 虽然script 标签的 async = false; 可以解决js之间的依赖顺序问题, 但是它无法做到比 HTML 中其他非动态加载的 script 脚本更早执行
|
|
39
|
+
* 所以调整了meteor 内核加载 bundledJs、staticJs的方式 (creator/packages/boilerplate-generator)
|
|
40
|
+
*/
|
|
41
|
+
router.get('/main_head.js', async function (req, res) {
|
|
42
|
+
try {
|
|
43
|
+
const { platform } = req.query;
|
|
44
|
+
res.set('Content-Type', 'application/javascript; charset=UTF-8');
|
|
45
|
+
const filename = path.join(__dirname, 'main_head.ejs');
|
|
46
|
+
const data = {
|
|
47
|
+
ROOT_URL: platform === 'cordova' ? __meteor_runtime_config__.ROOT_URL : '',
|
|
48
|
+
STEEDOS_SENTRY_ENABLED: process.env.STEEDOS_SENTRY_ENABLED,
|
|
49
|
+
NODE_ENV: process.env.NODE_ENV,
|
|
50
|
+
STEEDOS_SENTRY_DSN: process.env.STEEDOS_SENTRY_DSN,
|
|
51
|
+
STEEDOS_UNPKG_URL: getConfig('STEEDOS_UNPKG_URL', platform),
|
|
52
|
+
STEEDOS_AMIS_URL: getConfig('STEEDOS_AMIS_URL', platform),
|
|
53
|
+
STEEDOS_PUBLIC_SCRIPT_VCONSOLE: getConfig('STEEDOS_PUBLIC_SCRIPT_VCONSOLE', platform),
|
|
54
|
+
STEEDOS_PUBLIC_SCRIPT_PLUGINS: getConfig('STEEDOS_PUBLIC_SCRIPT_PLUGINS', platform),
|
|
55
|
+
STEEDOS_PUBLIC_STYLE_PLUGINS: getConfig('STEEDOS_PUBLIC_STYLE_PLUGINS', platform),
|
|
56
|
+
STEEDOS_VERSION: process.env.STEEDOS_VERSION,
|
|
57
|
+
STEEDOS_LOCALE: "",
|
|
58
|
+
STEEDOS_PUBLIC_PAGE_ASSETURLS: getConfig("STEEDOS_PUBLIC_PAGE_ASSETURLS", platform),
|
|
59
|
+
STEEDOS_AMIS_VERSION: process.env.STEEDOS_AMIS_VERSION,
|
|
60
|
+
platform: __meteor_runtime_config__.PUBLIC_SETTINGS && __meteor_runtime_config__.PUBLIC_SETTINGS.platform || {}
|
|
61
|
+
}
|
|
62
|
+
const options = {}
|
|
63
|
+
ejs.renderFile(filename, data, options, function(err, str){
|
|
64
|
+
// str => Rendered HTML string
|
|
65
|
+
if(err){
|
|
66
|
+
res.send(err);
|
|
67
|
+
}else{
|
|
68
|
+
res.send(str);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
} catch (error) {
|
|
73
|
+
res.status(500).send({ message: error.message });
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
router.get('/main_head.css', async function(req, res){
|
|
81
|
+
const { platform } = req.query;
|
|
82
|
+
|
|
83
|
+
res.set('Content-Type', 'text/css; charset=UTF-8');
|
|
84
|
+
|
|
85
|
+
const STEEDOS_UNPKG_URL = getConfig('STEEDOS_UNPKG_URL', platform);
|
|
86
|
+
const STEEDOS_AMIS_URL = getConfig('STEEDOS_AMIS_URL', platform);
|
|
87
|
+
const ROOT_URL = platform === 'cordova' ? __meteor_runtime_config__.ROOT_URL : '';
|
|
88
|
+
|
|
89
|
+
res.send(`
|
|
90
|
+
@import url("${STEEDOS_UNPKG_URL}/@salesforce-ux/design-system@2.19.0/assets/styles/salesforce-lightning-design-system.min.css");
|
|
91
|
+
@import url("${STEEDOS_AMIS_URL}/lib/themes/antd.css");
|
|
92
|
+
@import url("${STEEDOS_AMIS_URL}/lib/helper.css");
|
|
93
|
+
@import url("${STEEDOS_AMIS_URL}/sdk/iconfont.css");
|
|
94
|
+
@import url("${STEEDOS_UNPKG_URL}/@fortawesome/fontawesome-free@6.2.0/css/all.min.css");
|
|
95
|
+
@import url("${ROOT_URL}/tailwind/tailwind-steedos.css");
|
|
96
|
+
@import url("${ROOT_URL}/amis/amis.css");
|
|
97
|
+
`);
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
exports.default = router;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: admin_flow_positions
|
|
2
|
+
desktop: true
|
|
3
|
+
icon: queue
|
|
4
|
+
is_new_window: false
|
|
5
|
+
label: 审批岗位成员
|
|
6
|
+
mobile: true
|
|
7
|
+
permissions:
|
|
8
|
+
- permission: 'on'
|
|
9
|
+
permission_set: admin
|
|
10
|
+
- permission: 'off'
|
|
11
|
+
permission_set: user
|
|
12
|
+
- permission: 'off'
|
|
13
|
+
permission_set: customer
|
|
14
|
+
- permission: 'off'
|
|
15
|
+
permission_set: supplier
|
|
16
|
+
- permission: 'off'
|
|
17
|
+
permission_set: organization_admin
|
|
18
|
+
- permission: 'off'
|
|
19
|
+
permission_set: workflow_admin
|
|
20
|
+
type: object
|
|
21
|
+
object: flow_positions
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: admin_metadata
|
|
2
|
+
desktop: true
|
|
3
|
+
icon: entity
|
|
4
|
+
is_new_window: false
|
|
5
|
+
is_use_iframe: false
|
|
6
|
+
label: 元数据
|
|
7
|
+
mobile: true
|
|
8
|
+
page: metadata
|
|
9
|
+
type: page
|
|
10
|
+
permissions:
|
|
11
|
+
- permission: 'on'
|
|
12
|
+
permission_set: admin
|
|
13
|
+
- permission: 'off'
|
|
14
|
+
permission_set: user
|
|
15
|
+
- permission: 'off'
|
|
16
|
+
permission_set: customer
|
|
17
|
+
- permission: 'off'
|
|
18
|
+
permission_set: supplier
|
|
19
|
+
- permission: 'off'
|
|
20
|
+
permission_set: organization_admin
|
|
21
|
+
- permission: 'off'
|
|
22
|
+
permission_set: workflow_admin
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: admin_personal_information
|
|
2
|
+
desktop: true
|
|
3
|
+
icon: user_role
|
|
4
|
+
is_new_window: false
|
|
5
|
+
label: 个人资料
|
|
6
|
+
mobile: true
|
|
7
|
+
permissions:
|
|
8
|
+
- permission: 'on'
|
|
9
|
+
permission_set: admin
|
|
10
|
+
- permission: 'on'
|
|
11
|
+
permission_set: user
|
|
12
|
+
- permission: 'off'
|
|
13
|
+
permission_set: customer
|
|
14
|
+
- permission: 'off'
|
|
15
|
+
permission_set: supplier
|
|
16
|
+
- permission: 'off'
|
|
17
|
+
permission_set: organization_admin
|
|
18
|
+
- permission: 'off'
|
|
19
|
+
permission_set: workflow_admin
|
|
20
|
+
type: url
|
|
21
|
+
url: /app/admin/space_users/view/${context.user.spaceUserId}
|