@steedos/service-plugin-amis 2.3.1-beta.6 → 2.3.2-beta.10
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.
|
@@ -130,60 +130,6 @@
|
|
|
130
130
|
"labelClassName": "text-left",
|
|
131
131
|
"id": "u:fc07a5376a46"
|
|
132
132
|
},
|
|
133
|
-
{
|
|
134
|
-
"name": "objects",
|
|
135
|
-
"label": "桌面主菜单(已作废)",
|
|
136
|
-
"type": "select",
|
|
137
|
-
"className": "m-0",
|
|
138
|
-
"labelClassName": "text-left",
|
|
139
|
-
"id": "u:4e5047e44905",
|
|
140
|
-
"joinValues": false,
|
|
141
|
-
"extractValue": true,
|
|
142
|
-
"labelField": "label",
|
|
143
|
-
"valueField": "value",
|
|
144
|
-
"multiple": true,
|
|
145
|
-
"checkAll": false,
|
|
146
|
-
"searchable": true,
|
|
147
|
-
"source": {
|
|
148
|
-
"method": "get",
|
|
149
|
-
"url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/options",
|
|
150
|
-
"headers": {
|
|
151
|
-
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
"name": "mobile_objects",
|
|
157
|
-
"label": "手机主菜单(已作废)",
|
|
158
|
-
"type": "select",
|
|
159
|
-
"className": "m-0",
|
|
160
|
-
"labelClassName": "text-left",
|
|
161
|
-
"id": "u:cfaeb2f857a8",
|
|
162
|
-
"joinValues": false,
|
|
163
|
-
"extractValue": true,
|
|
164
|
-
"labelField": "label",
|
|
165
|
-
"valueField": "value",
|
|
166
|
-
"multiple": true,
|
|
167
|
-
"checkAll": false,
|
|
168
|
-
"searchable": true,
|
|
169
|
-
"source": {
|
|
170
|
-
"method": "get",
|
|
171
|
-
"url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/options",
|
|
172
|
-
"messages": {},
|
|
173
|
-
"headers": {
|
|
174
|
-
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
"name": "description",
|
|
180
|
-
"label": "描述",
|
|
181
|
-
"type": "textarea",
|
|
182
|
-
"className": "col-span-2 m-0",
|
|
183
|
-
"labelClassName": "text-left",
|
|
184
|
-
"id": "u:40d99f2da55a",
|
|
185
|
-
"tpl": "<b><%=data.description%></b>"
|
|
186
|
-
},
|
|
187
133
|
{
|
|
188
134
|
"name": "is_creator",
|
|
189
135
|
"label": "在桌面中显示此应用",
|
|
@@ -210,6 +156,15 @@
|
|
|
210
156
|
"className": "m-0",
|
|
211
157
|
"labelClassName": "text-left",
|
|
212
158
|
"id": "u:07a8a4c5f875"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"name": "description",
|
|
162
|
+
"label": "描述",
|
|
163
|
+
"type": "textarea",
|
|
164
|
+
"className": "col-span-2 m-0",
|
|
165
|
+
"labelClassName": "text-left",
|
|
166
|
+
"id": "u:40d99f2da55a",
|
|
167
|
+
"tpl": "<b><%=data.description%></b>"
|
|
213
168
|
}
|
|
214
169
|
],
|
|
215
170
|
"id": "u:0b870f195836",
|
|
@@ -489,6 +444,63 @@
|
|
|
489
444
|
}
|
|
490
445
|
],
|
|
491
446
|
"id": "u:17ecc1ec4435"
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
"title": "其他",
|
|
450
|
+
"body": [
|
|
451
|
+
{
|
|
452
|
+
"type": "wrapper",
|
|
453
|
+
"className": "form-content",
|
|
454
|
+
"body": [
|
|
455
|
+
{
|
|
456
|
+
"name": "objects",
|
|
457
|
+
"label": "桌面主菜单(已作废)",
|
|
458
|
+
"type": "select",
|
|
459
|
+
"className": "m-0",
|
|
460
|
+
"labelClassName": "text-left",
|
|
461
|
+
"id": "u:4e5047e44905",
|
|
462
|
+
"joinValues": false,
|
|
463
|
+
"extractValue": true,
|
|
464
|
+
"labelField": "label",
|
|
465
|
+
"valueField": "value",
|
|
466
|
+
"multiple": true,
|
|
467
|
+
"checkAll": false,
|
|
468
|
+
"searchable": true,
|
|
469
|
+
"source": {
|
|
470
|
+
"method": "get",
|
|
471
|
+
"url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/options",
|
|
472
|
+
"headers": {
|
|
473
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
"name": "mobile_objects",
|
|
479
|
+
"label": "手机主菜单(已作废)",
|
|
480
|
+
"type": "select",
|
|
481
|
+
"className": "m-0",
|
|
482
|
+
"labelClassName": "text-left",
|
|
483
|
+
"id": "u:cfaeb2f857a8",
|
|
484
|
+
"joinValues": false,
|
|
485
|
+
"extractValue": true,
|
|
486
|
+
"labelField": "label",
|
|
487
|
+
"valueField": "value",
|
|
488
|
+
"multiple": true,
|
|
489
|
+
"checkAll": false,
|
|
490
|
+
"searchable": true,
|
|
491
|
+
"source": {
|
|
492
|
+
"method": "get",
|
|
493
|
+
"url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/options",
|
|
494
|
+
"messages": {},
|
|
495
|
+
"headers": {
|
|
496
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
],
|
|
501
|
+
"size": "none"
|
|
502
|
+
}
|
|
503
|
+
]
|
|
492
504
|
}
|
|
493
505
|
],
|
|
494
506
|
"tabsMode": "line",
|
|
@@ -6,50 +6,16 @@
|
|
|
6
6
|
* @Description:
|
|
7
7
|
*/
|
|
8
8
|
const AmisSchema = require('./utils/amis-schema');
|
|
9
|
-
const AmisLib = require('@steedos-widgets/amis-lib');
|
|
10
9
|
const objectql = require("@steedos/objectql");
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const object = objectql.getObject(objectName);
|
|
16
|
-
const objectConfig = clone(object.toConfig());
|
|
17
|
-
// TODO: 后续再支持附件子表
|
|
18
|
-
// let relatedLists = []
|
|
19
|
-
// if(objectConfig.enable_files){
|
|
20
|
-
// relatedLists.push("cms_files.parent")
|
|
21
|
-
// }
|
|
22
|
-
const relationsInfo = await object.getRelationsInfo();
|
|
23
|
-
|
|
24
|
-
// TODO: 跨工作区了,后续需要补充spaceId过滤条件
|
|
25
|
-
const dbListViews = await objectql.getObject("object_listviews").directFind({
|
|
26
|
-
filters: [['object_name', '=', objectName], ['shared', '=', true]]
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
objectConfig.list_views = Object.assign({}, objectConfig.list_views)
|
|
30
|
-
_.each(dbListViews, function(dbListView){
|
|
31
|
-
delete dbListView.created;
|
|
32
|
-
delete dbListView.created_by;
|
|
33
|
-
delete dbListView.modified;
|
|
34
|
-
delete dbListView.modified_by;
|
|
35
|
-
objectConfig.list_views[dbListView.name] = dbListView;
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
objectConfig.details = relationsInfo && relationsInfo.details;
|
|
39
|
-
objectConfig.masters = relationsInfo && relationsInfo.masters;
|
|
40
|
-
objectConfig.lookup_details = relationsInfo && relationsInfo.lookup_details;
|
|
41
|
-
// TODO: 后续再支持related_lists
|
|
42
|
-
// objectConfig.related_lists = relationsInfo && relationsInfo.related_lists;
|
|
43
|
-
|
|
44
|
-
// let lng = objectql.getUserLocale(userSession);
|
|
45
|
-
let lng = "zh-CN";//先写死中文,后续拟通过环境变量配置语言
|
|
46
|
-
steedosI18n.translationObject(lng, object.name, objectConfig);
|
|
47
|
-
return objectConfig;
|
|
10
|
+
|
|
11
|
+
const callObjectServiceAction = async function(actionName, userSession, data){
|
|
12
|
+
const broker = objectql.getSteedosSchema().broker;
|
|
13
|
+
return broker.call(actionName, data || {}, { meta: { user: userSession}})
|
|
48
14
|
}
|
|
49
15
|
|
|
50
|
-
|
|
51
|
-
return await
|
|
52
|
-
}
|
|
16
|
+
const getUISchema = async function(objectName, userSession){
|
|
17
|
+
return await callObjectServiceAction(`@${objectName}.getRecordView`, userSession);
|
|
18
|
+
}
|
|
53
19
|
|
|
54
20
|
module.exports = {
|
|
55
21
|
name: "amis",
|
|
@@ -133,6 +99,11 @@ module.exports = {
|
|
|
133
99
|
},
|
|
134
100
|
getInitSchema: {
|
|
135
101
|
async handler({type, objectApiName, formFactor, userSession}) {
|
|
102
|
+
|
|
103
|
+
const AmisLib = require('@steedos-widgets/amis-lib');
|
|
104
|
+
AmisLib.setUISchemaFunction(async function(objectName, force){
|
|
105
|
+
return await getUISchema(objectName, userSession);
|
|
106
|
+
});
|
|
136
107
|
if(objectApiName){
|
|
137
108
|
let schema;
|
|
138
109
|
switch(type){
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-plugin-amis",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2-beta.10",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "node .scripts/build.tailwind.js"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@steedos-widgets/amis-lib": "^0.0.
|
|
14
|
+
"@steedos-widgets/amis-lib": "^0.0.10"
|
|
15
15
|
},
|
|
16
|
-
"gitHead": "
|
|
16
|
+
"gitHead": "44b1617fea53eb016e82e72174e1d33bdbfe3fd1"
|
|
17
17
|
}
|