@steedos/standard-ui 2.6.1-beta.7 → 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/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_nav_schema_design.button.js +23 -23
- package/main/default/objects/apps.action.js +2 -3
- package/main/default/objects/tabs.object.yml +18 -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 +11 -2
- 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 +6 -4
- package/package.json +2 -2
- package/package.service.js +26 -3
|
@@ -20,6 +20,9 @@ tab_items:
|
|
|
20
20
|
# admin_space_user_info:
|
|
21
21
|
# group: 个人设置
|
|
22
22
|
# index: 1
|
|
23
|
+
admin_personal_information:
|
|
24
|
+
group: personal_settings
|
|
25
|
+
index: 1
|
|
23
26
|
admin_process_delegation_rules:
|
|
24
27
|
group: personal_settings
|
|
25
28
|
index: 2
|
|
@@ -53,9 +56,6 @@ tab_items:
|
|
|
53
56
|
admin_datasources:
|
|
54
57
|
group: object_settings
|
|
55
58
|
index: 13
|
|
56
|
-
admin_queue_import:
|
|
57
|
-
group: advanced_settings
|
|
58
|
-
index: 38
|
|
59
59
|
admin_pages:
|
|
60
60
|
group: user_interface
|
|
61
61
|
index: 15
|
|
@@ -74,6 +74,9 @@ tab_items:
|
|
|
74
74
|
admin_developer:
|
|
75
75
|
group: development
|
|
76
76
|
index: 19.50
|
|
77
|
+
admin_metadata:
|
|
78
|
+
group: development
|
|
79
|
+
index: 19.505
|
|
77
80
|
admin_developer_triggers:
|
|
78
81
|
group: development
|
|
79
82
|
index: 19.51
|
|
@@ -98,15 +101,18 @@ tab_items:
|
|
|
98
101
|
admin_workflow_outbound_messages:
|
|
99
102
|
group: process_automation
|
|
100
103
|
index: 25
|
|
104
|
+
admin_flows:
|
|
105
|
+
group: approval_workflow
|
|
106
|
+
index: 20
|
|
101
107
|
admin_roles:
|
|
102
108
|
group: approval_workflow
|
|
103
109
|
index: 25
|
|
104
110
|
admin_flow_roles:
|
|
105
111
|
group: approval_workflow
|
|
106
112
|
index: 26
|
|
107
|
-
|
|
113
|
+
admin_flow_positions:
|
|
108
114
|
group: approval_workflow
|
|
109
|
-
index:
|
|
115
|
+
index: 26.5
|
|
110
116
|
admin_categories:
|
|
111
117
|
group: approval_workflow
|
|
112
118
|
index: 28
|
|
@@ -131,12 +137,12 @@ tab_items:
|
|
|
131
137
|
# admin_dashboard:
|
|
132
138
|
# group: 高级设置
|
|
133
139
|
# index: 35
|
|
134
|
-
admin_audit_records:
|
|
135
|
-
group: advanced_settings
|
|
136
|
-
index: 36
|
|
137
140
|
admin_autonumber:
|
|
138
141
|
group: advanced_settings
|
|
139
142
|
index: 37
|
|
143
|
+
admin_queue_import:
|
|
144
|
+
group: advanced_settings
|
|
145
|
+
index: 38
|
|
140
146
|
# admin_web_forms:
|
|
141
147
|
# group: 高级设置
|
|
142
148
|
# index: 38
|
|
@@ -153,6 +159,6 @@ tab_items:
|
|
|
153
159
|
group: development
|
|
154
160
|
index: 42
|
|
155
161
|
objects: []
|
|
156
|
-
sort:
|
|
162
|
+
sort: 999999
|
|
157
163
|
#url: /app/admin
|
|
158
|
-
visible:
|
|
164
|
+
visible: true
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
Meteor.startup(function(){
|
|
3
|
+
Tracker.autorun(function(){
|
|
4
|
+
const space = db.spaces.findOne(Steedos.getSpaceId());
|
|
5
|
+
if(space && space.favicon){
|
|
6
|
+
const faviconLink = document.querySelector('link[rel="shortcut icon"]');
|
|
7
|
+
faviconLink.href = Steedos.absoluteUrl("/api/files/avatars/"+space.favicon);
|
|
8
|
+
console.log('update faviconLink.href', faviconLink.href)
|
|
9
|
+
}
|
|
10
|
+
})
|
|
11
|
+
})
|
|
@@ -1,115 +1,40 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @Author: 殷亮辉 yinlianghui@hotoa.com
|
|
3
3
|
* @Date: 2023-05-16 17:00:38
|
|
4
|
-
* @LastEditors:
|
|
5
|
-
* @LastEditTime: 2023-
|
|
4
|
+
* @LastEditors: 涂佳俊 tujiajun@steedos.com
|
|
5
|
+
* @LastEditTime: 2023-11-23 17:22:22
|
|
6
6
|
*/
|
|
7
7
|
var buttonTriggerHistoryPathsChange;
|
|
8
|
-
; (function () {
|
|
9
|
-
try {
|
|
10
|
-
Meteor.startup(function () {
|
|
11
|
-
var rootId = "steedosHistoryPathsRoot";
|
|
12
|
-
var modalRoot = document.getElementById(rootId);
|
|
13
|
-
if (!modalRoot) {
|
|
14
|
-
modalRoot = document.createElement('div');
|
|
15
|
-
modalRoot.setAttribute('id', rootId);
|
|
16
|
-
$("body")[0].appendChild(modalRoot);
|
|
17
|
-
}
|
|
18
|
-
const page = {
|
|
19
|
-
name: "pageSteedosHistoryPaths",
|
|
20
|
-
render_engine: "amis",
|
|
21
|
-
schema: {
|
|
22
|
-
name: "serviceSteedosHistoryPaths",
|
|
23
|
-
id: "serviceSteedosHistoryPaths",
|
|
24
|
-
type: "service",
|
|
25
|
-
className: "service-steedos-history-paths",
|
|
26
|
-
body: [{
|
|
27
|
-
"type": "button",
|
|
28
|
-
"label": "触发@history_paths.changed",
|
|
29
|
-
"name": "buttonTriggerHistoryPathsChange",
|
|
30
|
-
"className": "button-trigger-history-paths-change hidden",
|
|
31
|
-
"onEvent": {
|
|
32
|
-
"click": {
|
|
33
|
-
"actions": [
|
|
34
|
-
{
|
|
35
|
-
"actionType": "broadcast",
|
|
36
|
-
"args": {
|
|
37
|
-
"eventName": "@history_paths.changed"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}]
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
const root = $("#" + rootId)[0];
|
|
47
|
-
Tracker.autorun(function (c) {
|
|
48
|
-
if (Creator.steedosInit.get() && Creator.validated.get()) {
|
|
49
|
-
Steedos.Page.render(root, page, {});
|
|
50
|
-
const findVars = (obj, vars) => {
|
|
51
|
-
try {
|
|
52
|
-
return vars.length === vars.filter(function (item) {
|
|
53
|
-
return item.split(".").reduce(function (sum, n) {
|
|
54
|
-
return sum[n];
|
|
55
|
-
}, obj) !== undefined;
|
|
56
|
-
}).length;
|
|
57
|
-
}
|
|
58
|
-
catch (ex) {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
const waittingVars = ["SteedosUI.refs.serviceSteedosHistoryPaths.getComponentByName"];
|
|
63
|
-
Promise.all([
|
|
64
|
-
waitForThing(window, waittingVars, findVars)
|
|
65
|
-
]).then(() => {
|
|
66
|
-
var scope = SteedosUI.refs["serviceSteedosHistoryPaths"];
|
|
67
|
-
buttonTriggerHistoryPathsChange = scope.getComponentByName("serviceSteedosHistoryPaths.buttonTriggerHistoryPathsChange");
|
|
68
|
-
Object.assign(Steedos, {
|
|
69
|
-
goBack
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
} catch (error) {
|
|
77
|
-
console.error(error)
|
|
78
|
-
};
|
|
79
|
-
})();
|
|
80
8
|
|
|
81
9
|
let historyPathsStoreKey = "history_paths";
|
|
82
10
|
|
|
83
|
-
//
|
|
84
|
-
|
|
85
|
-
if(!!window.opener){
|
|
86
|
-
// 记录详细页面点击右上角查看审批单等打开新窗口情况下,新窗口的history path继承了opener页面的history path,所以需要区别出来,否则会报错
|
|
87
|
-
historyPathsStoreKey = "history_paths_opener_level" + getOpenerLevel(window,0);
|
|
88
|
-
}
|
|
11
|
+
// 切换应用、对象、列表视图时清除本地存储中的过滤条件
|
|
12
|
+
function clearHistoryFilters(context, lastPath, paths) {
|
|
89
13
|
const path = context.path;
|
|
90
14
|
const params = context.params || {};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
15
|
+
if (!lastPath || lastPath.params.app_id != params.app_id || lastPath.params.object_name != params.object_name || lastPath.params.list_view_id != params.list_view_id) {
|
|
16
|
+
let listViewPropsStoreKey;
|
|
17
|
+
if (lastPath) {
|
|
18
|
+
if(lastPath.params.record_id){
|
|
19
|
+
// 是从记录详细界面直接切换到其他对象列表或其他应用时,进一步往上找,找到对象列表的path作为lastPath来清除对应的本地存储
|
|
20
|
+
for(let i = paths.length - 1;i >= 0;i--){
|
|
21
|
+
let tempPath = paths[i];
|
|
22
|
+
// if(!tempPath.params.record_id && tempPath.params.list_view_id){
|
|
23
|
+
// 不可以判断list_view_id表示对象列表,因为有可以从应用程序微页面进入记录详细页面,需要清除应用程序微页面中的对象表格或对象列表组件中本地存储中保存的过滤条件
|
|
24
|
+
if(!tempPath.params.record_id){
|
|
25
|
+
// record_id不存在,list_view_id存在表示对象列表页面
|
|
26
|
+
lastPath = tempPath;
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
listViewPropsStoreKey = lastPath.path.split('?')[0] + "/crud";
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
listViewPropsStoreKey = path.split('?')[0] + "/crud";
|
|
35
|
+
}
|
|
36
|
+
sessionStorage.removeItem(listViewPropsStoreKey);
|
|
37
|
+
sessionStorage.removeItem(listViewPropsStoreKey + "/query");
|
|
113
38
|
}
|
|
114
39
|
}
|
|
115
40
|
|
|
@@ -195,10 +120,132 @@ function debounce(fn, delay) {
|
|
|
195
120
|
}
|
|
196
121
|
}
|
|
197
122
|
|
|
198
|
-
function getOpenerLevel(opener,level){
|
|
123
|
+
function getOpenerLevel(opener, level) {
|
|
124
|
+
if (level > 3) {
|
|
125
|
+
return level + 1;
|
|
126
|
+
}
|
|
199
127
|
if (!!opener['opener']) {
|
|
200
128
|
return getOpenerLevel(opener['opener'], level + 1);
|
|
201
|
-
}else{
|
|
202
|
-
|
|
129
|
+
} else {
|
|
130
|
+
return level;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
function goBack(){
|
|
136
|
+
let prevPath = popHistoryPath();
|
|
137
|
+
if(prevPath && prevPath.path){
|
|
138
|
+
FlowRouter.go(prevPath.path);
|
|
203
139
|
}
|
|
204
|
-
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
window.goBack = goBack;
|
|
143
|
+
|
|
144
|
+
; (function () {
|
|
145
|
+
try {
|
|
146
|
+
Meteor.startup(function () {
|
|
147
|
+
Object.assign(Steedos, {
|
|
148
|
+
goBack
|
|
149
|
+
});
|
|
150
|
+
var rootId = "steedosHistoryPathsRoot";
|
|
151
|
+
var modalRoot = document.getElementById(rootId);
|
|
152
|
+
if (!modalRoot) {
|
|
153
|
+
modalRoot = document.createElement('div');
|
|
154
|
+
modalRoot.setAttribute('id', rootId);
|
|
155
|
+
$("body")[0].appendChild(modalRoot);
|
|
156
|
+
}
|
|
157
|
+
const page = {
|
|
158
|
+
name: "pageSteedosHistoryPaths",
|
|
159
|
+
render_engine: "amis",
|
|
160
|
+
schema: {
|
|
161
|
+
name: "serviceSteedosHistoryPaths",
|
|
162
|
+
id: "serviceSteedosHistoryPaths",
|
|
163
|
+
type: "service",
|
|
164
|
+
className: "service-steedos-history-paths",
|
|
165
|
+
body: [{
|
|
166
|
+
"type": "button",
|
|
167
|
+
"label": "触发@history_paths.changed",
|
|
168
|
+
"name": "buttonTriggerHistoryPathsChange",
|
|
169
|
+
"className": "button-trigger-history-paths-change hidden",
|
|
170
|
+
"onEvent": {
|
|
171
|
+
"click": {
|
|
172
|
+
"actions": [
|
|
173
|
+
{
|
|
174
|
+
"actionType": "broadcast",
|
|
175
|
+
"args": {
|
|
176
|
+
"eventName": "@history_paths.changed"
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}]
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
const root = $("#" + rootId)[0];
|
|
186
|
+
Tracker.autorun(function (c) {
|
|
187
|
+
if (Creator.steedosInit.get() && Creator.validated.get()) {
|
|
188
|
+
Steedos.Page.render(root, page, {});
|
|
189
|
+
const findVars = (obj, vars) => {
|
|
190
|
+
try {
|
|
191
|
+
return vars.length === vars.filter(function (item) {
|
|
192
|
+
return item.split(".").reduce(function (sum, n) {
|
|
193
|
+
return sum[n];
|
|
194
|
+
}, obj) !== undefined;
|
|
195
|
+
}).length;
|
|
196
|
+
}
|
|
197
|
+
catch (ex) {
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
Promise.all([
|
|
202
|
+
waitForThing(window, 'SteedosUI'),
|
|
203
|
+
]).then(() => {
|
|
204
|
+
const waittingVars = ["SteedosUI.refs.serviceSteedosHistoryPaths.getComponentByName"];
|
|
205
|
+
Promise.all([
|
|
206
|
+
waitForThing(window, waittingVars, findVars)
|
|
207
|
+
]).then(() => {
|
|
208
|
+
var scope = SteedosUI.refs["serviceSteedosHistoryPaths"];
|
|
209
|
+
buttonTriggerHistoryPathsChange = scope.getComponentByName("serviceSteedosHistoryPaths.buttonTriggerHistoryPathsChange");
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
} catch (error) {
|
|
217
|
+
console.error(error)
|
|
218
|
+
};
|
|
219
|
+
})();
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
// 使用debounce防抖动函数,连续多次自动触发enter事件时,只需要捕获最后一次
|
|
223
|
+
FlowRouter.triggers.enter(debounce(function (context, redirect, stop) {
|
|
224
|
+
if(!!window.opener){
|
|
225
|
+
// 记录详细页面点击右上角查看审批单等打开新窗口情况下,新窗口的history path继承了opener页面的history path,所以需要区别出来,否则会报错
|
|
226
|
+
historyPathsStoreKey = "history_paths_opener_level" + getOpenerLevel(window,0);
|
|
227
|
+
}
|
|
228
|
+
const path = context.path;
|
|
229
|
+
const params = context.params || {};
|
|
230
|
+
// const pathDef = context.route.pathDef;
|
|
231
|
+
const recordId = params.record_id;
|
|
232
|
+
var paths = getHistoryPaths() || [];
|
|
233
|
+
let lastPath = paths && paths[paths.length - 1];
|
|
234
|
+
if (recordId) {
|
|
235
|
+
//判断当前路由与记录的路由是否相同,为解决从设计器微页面返回重复记录的问题#4978
|
|
236
|
+
var top0 = null;
|
|
237
|
+
if(lastPath && lastPath.path && lastPath.path.split){
|
|
238
|
+
top0 = lastPath.path.split('?')[0]
|
|
239
|
+
}
|
|
240
|
+
if(path.split('?')[0] != top0){
|
|
241
|
+
// 触发广播事件前,把当前path和params累加存入amis变量historyPaths中
|
|
242
|
+
pushHistoryPath(path, params);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
clearHistoryFilters(context, lastPath, paths);
|
|
247
|
+
// 触发广播事件前重置amis变量historyPaths值为空数组,并把当前path和params存入amis变量historyPaths中
|
|
248
|
+
resetHistoryPath(path, params);
|
|
249
|
+
}
|
|
250
|
+
triggerBroadcastHistoryPathsChanged(buttonTriggerHistoryPathsChange);
|
|
251
|
+
}, 200));
|
|
@@ -2,30 +2,30 @@
|
|
|
2
2
|
* @Author: baozhoutao@steedos.com
|
|
3
3
|
* @Date: 2023-04-11 14:05:42
|
|
4
4
|
* @LastEditors: baozhoutao@steedos.com
|
|
5
|
-
* @LastEditTime: 2023-
|
|
5
|
+
* @LastEditTime: 2023-10-09 15:44:47
|
|
6
6
|
* @Description:
|
|
7
7
|
*/
|
|
8
8
|
module.exports = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
if(!record.enable_nav_schema){
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
if (record_permissions) {
|
|
22
|
-
perms = record_permissions;
|
|
23
|
-
} else {
|
|
24
|
-
record_permissions = Creator.getRecordPermissions(object_name, record, Meteor.userId());
|
|
25
|
-
if (record_permissions) {
|
|
26
|
-
perms = record_permissions;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return perms["allowEdit"];
|
|
9
|
+
amis_nav_schema_design: function (object_name, record_id) {
|
|
10
|
+
document.location = Steedos.absoluteUrl(`/api/amisAppNavSchemaDesign?id=${record_id}&object=${this.record.object_name}&assetUrls=${Builder.settings.assetUrls}&locale=${Builder.settings.locale}`);
|
|
11
|
+
},
|
|
12
|
+
amis_nav_schema_designVisible: function (object_name, record_id, record_permissions, data) {
|
|
13
|
+
var perms = {};
|
|
14
|
+
var record = data.record;
|
|
15
|
+
if (!record) {
|
|
16
|
+
return false;
|
|
30
17
|
}
|
|
31
|
-
|
|
18
|
+
if (!record.enable_nav_schema) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
if (record_permissions) {
|
|
22
|
+
perms = record_permissions;
|
|
23
|
+
} else {
|
|
24
|
+
record_permissions = Creator.getRecordPermissions(object_name, record, Meteor.userId());
|
|
25
|
+
if (record_permissions) {
|
|
26
|
+
perms = record_permissions;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return perms["allowEdit"];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @Author: baozhoutao@hotoa.com
|
|
3
3
|
* @Date: 2021-12-27 10:49:33
|
|
4
|
-
* @LastEditors:
|
|
5
|
-
* @LastEditTime: 2023-
|
|
4
|
+
* @LastEditors: 廖大雪 2291335922@qq.com
|
|
5
|
+
* @LastEditTime: 2023-03-05 18:11:32
|
|
6
6
|
* @Description:
|
|
7
7
|
*/
|
|
8
8
|
module.exports = {
|
|
@@ -13,7 +13,6 @@ module.exports = {
|
|
|
13
13
|
delete newRecord._id;
|
|
14
14
|
delete newRecord.record_permissions;
|
|
15
15
|
newRecord.from_code_id = record_id;
|
|
16
|
-
newRecord.tabs = doc.tabs;
|
|
17
16
|
Creator.odata.insert(object_name, newRecord, function(result, error){
|
|
18
17
|
if(result){
|
|
19
18
|
FlowRouter.go(`/app/-/${object_name}/view/${result._id}`)
|
|
@@ -80,6 +80,10 @@ fields:
|
|
|
80
80
|
is_new_window:
|
|
81
81
|
type: boolean
|
|
82
82
|
visible_on: "{{'url' === formData.type ? true: false}}"
|
|
83
|
+
is_use_iframe:
|
|
84
|
+
type: boolean
|
|
85
|
+
label: Open with iframe
|
|
86
|
+
defaultValue: false
|
|
83
87
|
page:
|
|
84
88
|
type: lookup
|
|
85
89
|
label: 页面
|
|
@@ -105,7 +109,20 @@ fields:
|
|
|
105
109
|
disabled: true
|
|
106
110
|
list_views:
|
|
107
111
|
all:
|
|
108
|
-
label: All
|
|
112
|
+
label: All Tabs
|
|
113
|
+
filter_scope: space
|
|
114
|
+
columns:
|
|
115
|
+
- label
|
|
116
|
+
- name
|
|
117
|
+
# - parent
|
|
118
|
+
- desktop
|
|
119
|
+
- mobile
|
|
120
|
+
- type
|
|
121
|
+
- is_system
|
|
122
|
+
customize:
|
|
123
|
+
label: 自定义
|
|
124
|
+
filters:
|
|
125
|
+
- ["is_system","<>",true]
|
|
109
126
|
filter_scope: space
|
|
110
127
|
columns:
|
|
111
128
|
- label
|
|
@@ -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,
|
|
@@ -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}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @Author: baozhoutao@steedos.com
|
|
3
3
|
* @Date: 2022-08-05 14:17:44
|
|
4
|
-
* @LastEditors:
|
|
5
|
-
* @LastEditTime: 2023-
|
|
4
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
5
|
+
* @LastEditTime: 2023-10-09 15:46:06
|
|
6
6
|
* @Description:
|
|
7
7
|
*/
|
|
8
8
|
const _ = require('underscore');
|
|
@@ -81,8 +81,10 @@ module.exports = {
|
|
|
81
81
|
if(id && _.isEmpty(this.data.values)){
|
|
82
82
|
let lng = await getLng(this.userId);
|
|
83
83
|
let app = await objectql.getAppConfig(id);
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
if(app){
|
|
85
|
+
i18n.translationApp(lng, app._id, app)
|
|
86
|
+
Object.assign(this.data.values, Object.assign({code: app._id}, clone(app), baseRecord))
|
|
87
|
+
}
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/standard-ui",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.2-beta.2",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
"description": "steedos package",
|
|
13
13
|
"repository": {},
|
|
14
14
|
"license": "MIT",
|
|
15
|
-
"gitHead": "
|
|
15
|
+
"gitHead": "ddef9fbc34afc7b57c59a31e9ed4f56818dc4c31"
|
|
16
16
|
}
|
package/package.service.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @Author: sunhaolin@hotoa.com
|
|
3
3
|
* @Date: 2022-07-29 09:40:31
|
|
4
|
-
* @LastEditors:
|
|
5
|
-
* @LastEditTime:
|
|
4
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
5
|
+
* @LastEditTime: 2023-09-11 15:45:29
|
|
6
6
|
* @Description:
|
|
7
7
|
*/
|
|
8
8
|
"use strict";
|
|
@@ -36,7 +36,30 @@ module.exports = {
|
|
|
36
36
|
* Actions
|
|
37
37
|
*/
|
|
38
38
|
actions: {
|
|
39
|
-
|
|
39
|
+
getUsersName: {
|
|
40
|
+
rest: {
|
|
41
|
+
method: "POST",
|
|
42
|
+
fullPath: "/service/api/standard-ui/getUsersName"
|
|
43
|
+
},
|
|
44
|
+
async handler(ctx) {
|
|
45
|
+
const { userIds } = ctx.params;
|
|
46
|
+
if(!userIds || userIds.length == 0){
|
|
47
|
+
return []
|
|
48
|
+
}
|
|
49
|
+
//此查询不带权限, 使用userIds 获取用户姓名
|
|
50
|
+
return await ctx.broker.call(
|
|
51
|
+
'objectql.find',
|
|
52
|
+
{
|
|
53
|
+
objectName: 'space_users',
|
|
54
|
+
query: {
|
|
55
|
+
fields: ['_id', 'user', 'name', 'sort_no'],
|
|
56
|
+
filters: [["user", "in", userIds]],
|
|
57
|
+
sort: 'sort_no desc'
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
40
63
|
},
|
|
41
64
|
|
|
42
65
|
/**
|