@steedos/service-plugin-amis 2.5.0-beta.1 → 2.5.0-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.
- package/main/default/client/amis.render.client.js +23 -24
- package/main/default/pages/apps_form.page.amis.json +78 -68
- package/main/default/pages/listview_form.page.amis.json +1 -1
- package/main/default/services/utils/page-schema.js +11 -56
- package/package.json +2 -2
- package/public/tailwind/tailwind-steedos.css +81 -8
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
const { $schema, body, render } = props
|
|
82
82
|
const [schema, setSchema] = amisReact.useState(null);
|
|
83
83
|
amisReact.useEffect(()=>{
|
|
84
|
-
console.log("AmisWrapper===>==useEffect==", comp.amis.render.type, JSON.stringify(props.data?.recordId))
|
|
84
|
+
// console.log("AmisWrapper===>==useEffect==", comp.amis.render.type, JSON.stringify(props.data?.recordId))
|
|
85
85
|
const result = Component.class(props);
|
|
86
86
|
if(result.then && typeof result.then === 'function'){
|
|
87
87
|
result.then((data)=>{
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
// console.log("AmisWrapper===>==useEffect==result", result)
|
|
93
93
|
setSchema(result)
|
|
94
94
|
}
|
|
95
|
-
}, [JSON.stringify($schema)
|
|
95
|
+
}, [JSON.stringify($schema)]) //, JSON.stringify(props.data)
|
|
96
96
|
|
|
97
97
|
if (!schema)
|
|
98
98
|
return render('body', {
|
|
@@ -109,8 +109,7 @@
|
|
|
109
109
|
console.trace('Component: ', props, 'Generated Amis Schema: ', schema);
|
|
110
110
|
console.groupEnd();
|
|
111
111
|
}
|
|
112
|
-
|
|
113
|
-
return amisReact.createElement(amisReact.Fragment, null, amisReact.createElement(amisReact.Fragment, null, schema && render ? render('body', schema) : ''), amisReact.createElement(amisReact.Fragment, null, render ? render('body', body) : ''));
|
|
112
|
+
return amisReact.createElement(amisReact.Fragment, null, amisReact.createElement(amisReact.Fragment, null, schema && render ? render('body', schema) : ''));
|
|
114
113
|
}
|
|
115
114
|
}
|
|
116
115
|
// 注册amis渲染器
|
|
@@ -220,33 +219,33 @@
|
|
|
220
219
|
// return div;
|
|
221
220
|
// },
|
|
222
221
|
jumpTo: (to, action) => {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
222
|
+
if (to === 'goBack') {
|
|
223
|
+
return window.history.back();
|
|
224
|
+
}
|
|
226
225
|
|
|
227
|
-
|
|
226
|
+
to = normalizeLink(to);
|
|
228
227
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
228
|
+
if (action && action.actionType === 'url') {
|
|
229
|
+
action.blank === false ? (window.location.href = to) : window.open(to);
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
233
232
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
233
|
+
// 主要是支持 nav 中的跳转
|
|
234
|
+
if (action && to && action.target) {
|
|
235
|
+
window.open(to, action.target);
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
239
238
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
239
|
+
if (/^https?:\/\//.test(to)) {
|
|
240
|
+
window.location.replace(to);
|
|
241
|
+
} else {
|
|
242
|
+
FlowRouter.go(to);
|
|
243
|
+
}
|
|
245
244
|
},
|
|
246
245
|
theme: 'antd',
|
|
247
246
|
isCurrentUrl: isCurrentUrl,
|
|
248
247
|
};
|
|
249
|
-
|
|
248
|
+
// 已弃用
|
|
250
249
|
const AmisRender = function (props) {
|
|
251
250
|
let env = props.env;
|
|
252
251
|
const schema = props.schema;
|
|
@@ -338,10 +337,10 @@
|
|
|
338
337
|
return scoped = ref
|
|
339
338
|
}
|
|
340
339
|
|
|
341
|
-
|
|
342
340
|
const amisScope = amisRequire('amis/embed').embed(root, schema, {data, name, locale: getAmisLng()}, Object.assign({}, AmisEnv, env))
|
|
343
341
|
if(window.SteedosUI && refName){
|
|
344
342
|
SteedosUI.refs[refName] = amisScope;
|
|
343
|
+
SteedosUI.refs[refName].__$schema = schema;
|
|
345
344
|
}
|
|
346
345
|
};
|
|
347
346
|
|
|
@@ -2,62 +2,64 @@
|
|
|
2
2
|
"type": "page",
|
|
3
3
|
"body": [
|
|
4
4
|
{
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"promptPageLeave": true,
|
|
10
|
-
"name": "form_edit_${recordId}",
|
|
11
|
-
"title": "",
|
|
5
|
+
"type": "service",
|
|
6
|
+
"className": "col-span-2 m-0",
|
|
7
|
+
"id": "tabs-options-service",
|
|
8
|
+
"affixFooter": false,
|
|
12
9
|
"api": {
|
|
13
10
|
"method": "post",
|
|
14
11
|
"url": "${context.rootUrl}/graphql",
|
|
12
|
+
"adaptor": "let data = payload.data;\ndata.tabs_options = [];\nif (data.options && data.options.length) {\n data.tabs_options = data.options.map(function (option) { \n option.label = option.label + \"(\" + option.value + \")\";\n return option;\n });\n}\ndelete data.options\npayload.data = data;\nreturn payload;\n",
|
|
15
13
|
"data": {
|
|
16
|
-
"
|
|
17
|
-
"recordId": "${recordId}",
|
|
18
|
-
"modalName": "${modalName}",
|
|
19
|
-
"objectName": "${objectName}"
|
|
20
|
-
},
|
|
21
|
-
"requestAdaptor": "\nconst formData = api.data.$;\nconst recordId = formData.recordId;\nfor (key in formData){\n // image、select等字段清空值后保存的空字符串转换为null。\n if(formData[key] === ''){\n formData[key] = null;\n }\n}\nconst objectName = api.data.objectName;\nconst fieldsName = Object.keys(formData);\ndelete formData.created;\ndelete formData.created_by;\ndelete formData.modified;\ndelete formData.modified_by;\ndelete formData._display;\ndelete formData.tabs_options;\ndelete formData.tab_groups_options;\ndelete formData.sldsIconsOptions;\ndelete formData.recordId;\n\n// 新加字段tab_items,值同步回传到老字段tabs中兼容老UI界面\nformData.tabs = [];\nif (formData.tab_items && formData.tab_items.length) { \n formData.tabs = formData.tab_items.map(function (item) { return item.tab_name; });\n}\n\n/*\ntab_items存储为:\ntab_items: {\n test1:{\n group:\"xxx\"\n },\n test3:{\n group:\"yyy\"\n }\n}\n而不是:\ntab_items: [\n {\n \"index\":1,\n \"group\":\"xxx\"\n },\n {\n \"index\":2,\n \"group\":\"yyy\"\n }\n]\n*/\nif (formData.tab_items) { \n formData.tab_items = _.keyBy(formData.tab_items, \"tab_name\")\n let tempIndex = 0;\n _.each(formData.tab_items, function (n, k) {\n tempIndex++;\n n.index = tempIndex;\n delete n.tab_name;\n });\n}\n\nlet query = `mutation{record: ${objectName}__insert(doc: {__saveData}){_id}}`;\nif(recordId){\n query = `mutation{record: ${objectName}__update(id: \"${recordId}\", doc: {__saveData}){_id}}`;\n};\ndelete formData._id;\nlet __saveData = JSON.stringify(JSON.stringify(formData));\n\napi.data = {query: query.replace('{__saveData}', __saveData)};\nreturn api;\n",
|
|
22
|
-
"responseData": {
|
|
23
|
-
"recordId": "${record._id}"
|
|
14
|
+
"query": "{options:tabs{_id label:label value:name,type,object,desktop,mobile}}"
|
|
24
15
|
},
|
|
25
|
-
"adaptor": "\nif (payload.errors) {\n payload.status = 2;\n payload.msg = window.t ? window.t(payload.errors[0].message) : payload.errors[0].message;\n}\nreturn payload;",
|
|
26
16
|
"headers": {
|
|
27
17
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
28
18
|
}
|
|
29
19
|
},
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
"url": "${context.rootUrl}/graphql",
|
|
33
|
-
"sendOn": "!!this.recordId",
|
|
34
|
-
"adaptor": "var data = payload.data.data[0];\nif(data){\n //初始化接口返回的字段移除字段值为null的字段\n for (key in data){\n if(data[key] === null){\n delete data[key];\n }\n }\n};\nif (data.tab_items && !_.isArray(data.tab_items)) {\n // 数据库中存储的是对象格式而不是数组,转换为数组用于界面显示\n let arrTabItems = [];\n _.each(data.tab_items, function (n, k) {\n n.tab_name = k;\n delete n.index;\n arrTabItems.push(n);\n });\n data.tab_items = arrTabItems;\n}\npayload.data = data;\ndelete payload.extensions;\nreturn payload;\n ",
|
|
35
|
-
"data": {
|
|
36
|
-
"query": "{data:apps(filters:[\"_id\", \"=\", \"${recordId}\"]){_id,name,code,icon_slds,visible, showSidebar, description,tabs,tab_items,tab_groups,objects,mobile_objects,is_creator,mobile,sort,url,is_use_ie,is_use_iframe,is_new_window,on_click,auth_name,secret,is_system,from_code_id,instance_state,created,created_by:created_by__expand{_id,name},modified,modified_by:modified_by__expand{_id,name},_display{visible,is_creator,mobile,is_use_ie,is_use_iframe,is_new_window,is_system,instance_state,created,modified}}}"
|
|
37
|
-
},
|
|
38
|
-
"headers": {
|
|
39
|
-
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
"initFetch": true,
|
|
20
|
+
"placeholder": "-",
|
|
21
|
+
"messages": {},
|
|
43
22
|
"body": [
|
|
44
23
|
{
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
24
|
+
"className": "steedos-amis-form",
|
|
25
|
+
"type": "form",
|
|
26
|
+
"mode": "normal",
|
|
27
|
+
"persistData": false,
|
|
28
|
+
"canAccessSuperData": false,
|
|
29
|
+
"promptPageLeave": true,
|
|
30
|
+
"name": "form_edit_${recordId}",
|
|
31
|
+
"title": "",
|
|
49
32
|
"api": {
|
|
50
33
|
"method": "post",
|
|
51
34
|
"url": "${context.rootUrl}/graphql",
|
|
52
|
-
"adaptor": "let data = payload.data;\ndata.tabs_options = [];\nif (data.options && data.options.length) {\n data.tabs_options = data.options.map(function (option) { \n option.label = option.label + \"(\" + option.value + \")\";\n return option;\n });\n}\ndelete data.options\npayload.data = data;\nreturn payload;\n",
|
|
53
35
|
"data": {
|
|
54
|
-
"
|
|
36
|
+
"$": "$$",
|
|
37
|
+
"recordId": "${recordId}",
|
|
38
|
+
"modalName": "${modalName}",
|
|
39
|
+
"objectName": "${objectName}"
|
|
40
|
+
},
|
|
41
|
+
"requestAdaptor": "\nconst formData = api.data.$;\nconst recordId = formData.recordId;\nfor (key in formData){\n // image、select等字段清空值后保存的空字符串转换为null。\n if(formData[key] === ''){\n formData[key] = null;\n }\n}\nconst objectName = api.data.objectName;\nconst fieldsName = Object.keys(formData);\ndelete formData.created;\ndelete formData.created_by;\ndelete formData.modified;\ndelete formData.modified_by;\ndelete formData._display;\ndelete formData.tabs_options;\ndelete formData.tab_groups_options;\ndelete formData.sldsIconsOptions;\ndelete formData.recordId;\n\n// 新加字段tab_items,值同步回传到老字段tabs中兼容老UI界面\nformData.tabs = [];\nif (formData.tab_items && formData.tab_items.length) { \n formData.tabs = formData.tab_items.map(function (item) { return item.tab_name; });\n}\n\n/*\ntab_items存储为:\ntab_items: {\n test1:{\n group:\"xxx\"\n },\n test3:{\n group:\"yyy\"\n }\n}\n而不是:\ntab_items: [\n {\n \"index\":1,\n \"group\":\"xxx\"\n },\n {\n \"index\":2,\n \"group\":\"yyy\"\n }\n]\n*/\nif (formData.tab_items) { \n formData.tab_items = _.keyBy(formData.tab_items, \"tab_name\")\n let tempIndex = 0;\n _.each(formData.tab_items, function (n, k) {\n tempIndex++;\n n.index = tempIndex;\n delete n.tab_name;\n });\n}\n\nlet query = `mutation{record: ${objectName}__insert(doc: {__saveData}){_id}}`;\nif(recordId){\n query = `mutation{record: ${objectName}__update(id: \"${recordId}\", doc: {__saveData}){_id}}`;\n};\ndelete formData._id;\nlet __saveData = JSON.stringify(JSON.stringify(formData));\n\napi.data = {query: query.replace('{__saveData}', __saveData)};\nreturn api;\n",
|
|
42
|
+
"responseData": {
|
|
43
|
+
"recordId": "${record._id}"
|
|
44
|
+
},
|
|
45
|
+
"adaptor": "\nif (payload.errors) {\n payload.status = 2;\n payload.msg = window.t ? window.t(payload.errors[0].message) : payload.errors[0].message;\n}\nreturn payload;",
|
|
46
|
+
"headers": {
|
|
47
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"initApi": {
|
|
51
|
+
"method": "post",
|
|
52
|
+
"url": "${context.rootUrl}/graphql",
|
|
53
|
+
"sendOn": "!!this.recordId",
|
|
54
|
+
"adaptor": "var data = payload.data.data[0];\nif(data){\n //初始化接口返回的字段移除字段值为null的字段\n for (key in data){\n if(data[key] === null){\n delete data[key];\n }\n }\n};\nif (data.tab_items && !_.isArray(data.tab_items)) {\n // 数据库中存储的是对象格式而不是数组,转换为数组用于界面显示\n let arrTabItems = [];\n _.each(data.tab_items, function (n, k) {\n n.tab_name = k;\n delete n.index;\n arrTabItems.push(n);\n });\n data.tab_items = arrTabItems;\n}\npayload.data = data;\ndelete payload.extensions;\nreturn payload;\n ",
|
|
55
|
+
"data": {
|
|
56
|
+
"query": "{data:apps(filters:[\"_id\", \"=\", \"${recordId}\"]){_id,name,code,icon_slds,visible, showSidebar, enable_nav_schema, description,tabs,tab_items,tab_groups,objects,mobile_objects,is_creator,mobile,sort,url,is_use_ie,is_use_iframe,is_new_window,on_click,auth_name,secret,is_system,from_code_id,instance_state,created,created_by:created_by__expand{_id,name},modified,modified_by:modified_by__expand{_id,name},_display{visible,is_creator,mobile,is_use_ie,is_use_iframe,is_new_window,is_system,instance_state,created,modified}}}"
|
|
55
57
|
},
|
|
56
58
|
"headers": {
|
|
57
59
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
58
60
|
}
|
|
59
61
|
},
|
|
60
|
-
"
|
|
62
|
+
"initFetch": true,
|
|
61
63
|
"body": [
|
|
62
64
|
{
|
|
63
65
|
"type": "tabs",
|
|
@@ -506,6 +508,15 @@
|
|
|
506
508
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
507
509
|
}
|
|
508
510
|
}
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
"name": "enable_nav_schema",
|
|
514
|
+
"label": "启用自定义导航",
|
|
515
|
+
"type": "checkbox",
|
|
516
|
+
"tpl": null,
|
|
517
|
+
"className": "m-0",
|
|
518
|
+
"labelClassName": "text-left",
|
|
519
|
+
"id": "u:07a8a4c5f89"
|
|
509
520
|
}
|
|
510
521
|
],
|
|
511
522
|
"size": "none"
|
|
@@ -518,39 +529,38 @@
|
|
|
518
529
|
"contentClassName": ""
|
|
519
530
|
}
|
|
520
531
|
],
|
|
521
|
-
"
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
"script": "const data = context.props.data;\nif (!data._id) { \n return;\n}\nif (data.tab_items) {\n return;\n}\n\nconst tabOptions = data.tabs_options || [];\nconst tabItems = [];\n// 把应用中原来tabs属性值添加到新的tab_items属性的默认值中\nif (data.tabs && data.tabs.length) {\n data.tabs.forEach(function (item) {\n tabItems.push({ tab_name: item });\n });\n}\nconst pushObjectsToTabItems = function (objects) {\n objects.forEach(function (item) {\n // 已经有绑定到指定对象的选项卡就不添加\n let existObjectItem = !!tabItems.find(function (tabItem) {\n return !!tabOptions.find(function (option) {\n return tabItem.tab_name === tabItem.value && option.object === item;\n });\n });\n if (existObjectItem) {\n return;\n }\n // 找到指向指定对象的选项卡\n let tempOption = tabOptions.find(function (option) {\n return option.type === \"object\" && option.object === item;\n });\n if (!tempOption) {\n return;\n }\n // 选项卡名称如果重复了就不添加\n let existTabItem = !!tabItems.find(function (tabItem) {\n return tabItem.tab_name === tempOption.value;\n });\n if (existTabItem) {\n return;\n }\n if (tempOption) {\n tabItems.push({ tab_name: tempOption.value });\n }\n });\n}\n// 把应用中原来objects属性值添加到新的tab_items属性的默认值中\nif (data.objects && data.objects.length) {\n pushObjectsToTabItems(data.objects);\n}\n// 把应用中原来mobile_objects属性值添加到新的tab_items属性的默认值中\nif (data.mobile_objects && data.mobile_objects.length) {\n pushObjectsToTabItems(data.mobile_objects);\n}\n\ndoAction({\n actionType: 'setValue',\n args: {\n \"value\": { tab_items: tabItems }\n }\n});"
|
|
535
|
-
}
|
|
536
|
-
]
|
|
537
|
-
},
|
|
538
|
-
"submitSucc": {
|
|
539
|
-
"weight": 0,
|
|
540
|
-
"actions": [
|
|
541
|
-
{
|
|
542
|
-
"actionType": "broadcast",
|
|
543
|
-
"args": {
|
|
544
|
-
"eventName": "@data.changed.apps"
|
|
532
|
+
"panelClassName": "m-0 -mt-3",
|
|
533
|
+
"actions": false,
|
|
534
|
+
"actionsClassName": "p-sm b-t b-light text-center",
|
|
535
|
+
"affixFooter": false,
|
|
536
|
+
"debug": false,
|
|
537
|
+
"onEvent": {
|
|
538
|
+
"inited": {
|
|
539
|
+
"actions": [
|
|
540
|
+
{
|
|
541
|
+
"actionType": "custom",
|
|
542
|
+
"script": "const data = context.props.data;\nif (!data._id) { \n return;\n}\nif (data.tab_items) {\n return;\n}\n\nconst tabOptions = data.tabs_options || [];\nconst tabItems = [];\n// 把应用中原来tabs属性值添加到新的tab_items属性的默认值中\nif (data.tabs && data.tabs.length) {\n data.tabs.forEach(function (item) {\n tabItems.push({ tab_name: item });\n });\n}\nconst pushObjectsToTabItems = function (objects) {\n objects.forEach(function (item) {\n // 已经有绑定到指定对象的选项卡就不添加\n let existObjectItem = !!tabItems.find(function (tabItem) {\n return !!tabOptions.find(function (option) {\n return tabItem.tab_name === tabItem.value && option.object === item;\n });\n });\n if (existObjectItem) {\n return;\n }\n // 找到指向指定对象的选项卡\n let tempOption = tabOptions.find(function (option) {\n return option.type === \"object\" && option.object === item;\n });\n if (!tempOption) {\n return;\n }\n // 选项卡名称如果重复了就不添加\n let existTabItem = !!tabItems.find(function (tabItem) {\n return tabItem.tab_name === tempOption.value;\n });\n if (existTabItem) {\n return;\n }\n if (tempOption) {\n tabItems.push({ tab_name: tempOption.value });\n }\n });\n}\n// 把应用中原来objects属性值添加到新的tab_items属性的默认值中\nif (data.objects && data.objects.length) {\n pushObjectsToTabItems(data.objects);\n}\n// 把应用中原来mobile_objects属性值添加到新的tab_items属性的默认值中\nif (data.mobile_objects && data.mobile_objects.length) {\n pushObjectsToTabItems(data.mobile_objects);\n}\n\ndoAction({\n actionType: 'setValue',\n args: {\n \"value\": { tab_items: tabItems }\n }\n});"
|
|
543
|
+
}
|
|
544
|
+
]
|
|
545
545
|
},
|
|
546
|
-
"
|
|
547
|
-
"
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
546
|
+
"submitSucc": {
|
|
547
|
+
"weight": 0,
|
|
548
|
+
"actions": [
|
|
549
|
+
{
|
|
550
|
+
"actionType": "broadcast",
|
|
551
|
+
"args": {
|
|
552
|
+
"eventName": "@data.changed.apps"
|
|
553
|
+
},
|
|
554
|
+
"data": {
|
|
555
|
+
"objectName": "apps"
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
]
|
|
559
|
+
}
|
|
560
|
+
},
|
|
561
|
+
"id": "apps-form"
|
|
562
|
+
}
|
|
563
|
+
]
|
|
554
564
|
}
|
|
555
565
|
],
|
|
556
566
|
"regions": [
|
|
@@ -100,67 +100,22 @@ const getRecordPageInitSchema = async function (objectApiName, userSession) {
|
|
|
100
100
|
if (hasRelatedLists) {
|
|
101
101
|
content.tabs.push(related)
|
|
102
102
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
"objectApiName": "${objectName}",
|
|
110
|
-
"recordId": "${recordId}",
|
|
111
|
-
onEvent: {
|
|
112
|
-
"recordLoaded": {
|
|
113
|
-
"actions": [
|
|
114
|
-
{
|
|
115
|
-
"actionType": "reload",
|
|
116
|
-
"data": {
|
|
117
|
-
"name": `\${event.data.record.${uiSchema.NAME_FIELD_KEY || 'name'}}`,
|
|
118
|
-
"record": `\${event.data.record}`,
|
|
119
|
-
"recordLoaded": true,
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
"actionType": "reload",
|
|
124
|
-
"componentId": `page_readonly_${objectApiName}_header`, //刷新标题, 详细页面header service 嵌套太多, 导致仅刷新第一层service无法更新recordName
|
|
125
|
-
"data": {
|
|
126
|
-
"name": `\${event.data.record.${uiSchema.NAME_FIELD_KEY || 'name'}}`,
|
|
127
|
-
"record": `\${event.data.record}`,
|
|
128
|
-
"recordLoaded": true,
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
]
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
content
|
|
136
|
-
],
|
|
137
|
-
data: {
|
|
138
|
-
"_master.objectName": "${objectName}",
|
|
139
|
-
"_master.recordId": "${recordId}"
|
|
140
|
-
},
|
|
141
|
-
onEvent: {
|
|
142
|
-
"recordLoaded": {
|
|
143
|
-
"actions": [
|
|
144
|
-
{
|
|
145
|
-
"actionType": "reload",
|
|
146
|
-
"data": {
|
|
147
|
-
"name": `\${record.${uiSchema.NAME_FIELD_KEY || 'name'}}`,
|
|
148
|
-
"_master.record": `\${record}`,
|
|
149
|
-
// 不清楚reload 如何给对象下的某个key复制, 所以此处重复设置_master的objectName、recordId
|
|
150
|
-
"_master.objectName": "${objectName}",
|
|
151
|
-
"_master.recordId": "${recordId}"
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
]
|
|
155
|
-
}
|
|
103
|
+
body = [
|
|
104
|
+
{
|
|
105
|
+
"type": "steedos-record-detail-header",
|
|
106
|
+
"label": "标题面板",
|
|
107
|
+
"objectApiName": "${objectName}",
|
|
108
|
+
"recordId": "${recordId}"
|
|
156
109
|
},
|
|
157
|
-
|
|
158
|
-
|
|
110
|
+
content
|
|
111
|
+
];
|
|
159
112
|
return {
|
|
160
|
-
type: '
|
|
113
|
+
type: 'steedos-record-service',
|
|
161
114
|
id: `page_${objectApiName}_record_detail`,
|
|
162
115
|
name: getScopeId(objectApiName, "record_detail"),
|
|
116
|
+
objectApiName: "${objectName}",
|
|
163
117
|
bodyClassName: '',
|
|
118
|
+
className: "object-detail-page",
|
|
164
119
|
regions: [
|
|
165
120
|
"body"
|
|
166
121
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-plugin-amis",
|
|
3
|
-
"version": "2.5.0-beta.
|
|
3
|
+
"version": "2.5.0-beta.10",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "yarn build:tailwind-base && yarn build:tailwind",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"publishConfig": {
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
|
-
"gitHead": "
|
|
16
|
+
"gitHead": "d751a4f5d4d6872b19a615769fe2484fc803ee82",
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"tailwindcss": "3.2.4"
|
|
19
19
|
}
|
|
@@ -89,10 +89,6 @@
|
|
|
89
89
|
margin: 0px
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
.m-3 {
|
|
93
|
-
margin: 0.75rem
|
|
94
|
-
}
|
|
95
|
-
|
|
96
92
|
.mx-4 {
|
|
97
93
|
margin-left: 1rem;
|
|
98
94
|
margin-right: 1rem
|
|
@@ -132,14 +128,14 @@
|
|
|
132
128
|
margin-top: -0.75rem
|
|
133
129
|
}
|
|
134
130
|
|
|
135
|
-
.mt-3 {
|
|
136
|
-
margin-top: 0.75rem
|
|
137
|
-
}
|
|
138
|
-
|
|
139
131
|
.mb-4 {
|
|
140
132
|
margin-bottom: 1rem
|
|
141
133
|
}
|
|
142
134
|
|
|
135
|
+
.mt-3 {
|
|
136
|
+
margin-top: 0.75rem
|
|
137
|
+
}
|
|
138
|
+
|
|
143
139
|
.block {
|
|
144
140
|
display: block
|
|
145
141
|
}
|
|
@@ -200,11 +196,23 @@
|
|
|
200
196
|
width: 50%
|
|
201
197
|
}
|
|
202
198
|
|
|
199
|
+
.w-96 {
|
|
200
|
+
width: 24rem
|
|
201
|
+
}
|
|
202
|
+
|
|
203
203
|
.min-w-max {
|
|
204
204
|
min-width: -moz-max-content;
|
|
205
205
|
min-width: max-content
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
+
.min-w-\[240px\] {
|
|
209
|
+
min-width: 240px
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.min-w-\[200px\] {
|
|
213
|
+
min-width: 200px
|
|
214
|
+
}
|
|
215
|
+
|
|
208
216
|
.flex-none {
|
|
209
217
|
flex: none
|
|
210
218
|
}
|
|
@@ -213,6 +221,10 @@
|
|
|
213
221
|
flex: 1 1 0%
|
|
214
222
|
}
|
|
215
223
|
|
|
224
|
+
.flex-shrink-0 {
|
|
225
|
+
flex-shrink: 0
|
|
226
|
+
}
|
|
227
|
+
|
|
216
228
|
.-translate-x-0 {
|
|
217
229
|
--tw-translate-x: -0px;
|
|
218
230
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))
|
|
@@ -247,6 +259,10 @@
|
|
|
247
259
|
column-gap: 0.75rem
|
|
248
260
|
}
|
|
249
261
|
|
|
262
|
+
.overflow-auto {
|
|
263
|
+
overflow: auto
|
|
264
|
+
}
|
|
265
|
+
|
|
250
266
|
.overflow-hidden {
|
|
251
267
|
overflow: hidden
|
|
252
268
|
}
|
|
@@ -255,6 +271,10 @@
|
|
|
255
271
|
overflow-y: auto
|
|
256
272
|
}
|
|
257
273
|
|
|
274
|
+
.rounded {
|
|
275
|
+
border-radius: 0.25rem
|
|
276
|
+
}
|
|
277
|
+
|
|
258
278
|
.border-b-\[3px\] {
|
|
259
279
|
border-bottom-width: 3px
|
|
260
280
|
}
|
|
@@ -286,11 +306,26 @@
|
|
|
286
306
|
border-color: rgb(203 213 225 / var(--tw-border-opacity))
|
|
287
307
|
}
|
|
288
308
|
|
|
309
|
+
.border-gray-200 {
|
|
310
|
+
--tw-border-opacity: 1;
|
|
311
|
+
border-color: rgb(229 231 235 / var(--tw-border-opacity))
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.border-gray-300 {
|
|
315
|
+
--tw-border-opacity: 1;
|
|
316
|
+
border-color: rgb(209 213 219 / var(--tw-border-opacity))
|
|
317
|
+
}
|
|
318
|
+
|
|
289
319
|
.bg-white {
|
|
290
320
|
--tw-bg-opacity: 1;
|
|
291
321
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity))
|
|
292
322
|
}
|
|
293
323
|
|
|
324
|
+
.bg-gray-100 {
|
|
325
|
+
--tw-bg-opacity: 1;
|
|
326
|
+
background-color: rgb(243 244 246 / var(--tw-bg-opacity))
|
|
327
|
+
}
|
|
328
|
+
|
|
294
329
|
.p-0 {
|
|
295
330
|
padding: 0px
|
|
296
331
|
}
|
|
@@ -299,6 +334,10 @@
|
|
|
299
334
|
padding: 1rem
|
|
300
335
|
}
|
|
301
336
|
|
|
337
|
+
.p-2 {
|
|
338
|
+
padding: 0.5rem
|
|
339
|
+
}
|
|
340
|
+
|
|
302
341
|
.px-4 {
|
|
303
342
|
padding-left: 1rem;
|
|
304
343
|
padding-right: 1rem
|
|
@@ -390,6 +429,11 @@
|
|
|
390
429
|
color: rgb(0 0 0 / var(--tw-text-opacity))
|
|
391
430
|
}
|
|
392
431
|
|
|
432
|
+
.text-gray-500 {
|
|
433
|
+
--tw-text-opacity: 1;
|
|
434
|
+
color: rgb(107 114 128 / var(--tw-text-opacity))
|
|
435
|
+
}
|
|
436
|
+
|
|
393
437
|
.underline {
|
|
394
438
|
text-decoration-line: underline
|
|
395
439
|
}
|
|
@@ -428,11 +472,20 @@
|
|
|
428
472
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1)
|
|
429
473
|
}
|
|
430
474
|
|
|
475
|
+
.focus\:outline-none:focus {
|
|
476
|
+
outline: 2px solid transparent;
|
|
477
|
+
outline-offset: 2px
|
|
478
|
+
}
|
|
479
|
+
|
|
431
480
|
@media (min-width: 640px) {
|
|
432
481
|
.sm\:mt-\[90px\] {
|
|
433
482
|
margin-top: 90px
|
|
434
483
|
}
|
|
435
484
|
|
|
485
|
+
.sm\:mt-3 {
|
|
486
|
+
margin-top: 0.75rem
|
|
487
|
+
}
|
|
488
|
+
|
|
436
489
|
.sm\:w-\[220px\] {
|
|
437
490
|
width: 220px
|
|
438
491
|
}
|
|
@@ -454,6 +507,10 @@
|
|
|
454
507
|
border-color: rgb(209 213 219 / var(--tw-border-opacity))
|
|
455
508
|
}
|
|
456
509
|
|
|
510
|
+
.sm\:p-3 {
|
|
511
|
+
padding: 0.75rem
|
|
512
|
+
}
|
|
513
|
+
|
|
457
514
|
.sm\:shadow {
|
|
458
515
|
--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
|
459
516
|
--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
|
|
@@ -465,4 +522,20 @@
|
|
|
465
522
|
.lg\:z-50 {
|
|
466
523
|
z-index: 50
|
|
467
524
|
}
|
|
525
|
+
|
|
526
|
+
.lg\:order-first {
|
|
527
|
+
order: -9999
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
.lg\:order-last {
|
|
531
|
+
order: 9999
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
.lg\:flex {
|
|
535
|
+
display: flex
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
.lg\:flex-col {
|
|
539
|
+
flex-direction: column
|
|
540
|
+
}
|
|
468
541
|
}
|