@steedos/service-plugin-amis 2.4.8 → 2.5.0-beta.1
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.
|
@@ -77,18 +77,22 @@
|
|
|
77
77
|
if(comp.componentType === 'amisSchema'){
|
|
78
78
|
let amisReact = amisRequire('react');
|
|
79
79
|
AmisWrapper = function(props){
|
|
80
|
+
// console.log(`AmisWrapper===>`, props)
|
|
80
81
|
const { $schema, body, render } = props
|
|
81
82
|
const [schema, setSchema] = amisReact.useState(null);
|
|
82
83
|
amisReact.useEffect(()=>{
|
|
84
|
+
console.log("AmisWrapper===>==useEffect==", comp.amis.render.type, JSON.stringify(props.data?.recordId))
|
|
83
85
|
const result = Component.class(props);
|
|
84
86
|
if(result.then && typeof result.then === 'function'){
|
|
85
87
|
result.then((data)=>{
|
|
88
|
+
// console.log("AmisWrapper===>==useEffect==setSchema", data)
|
|
86
89
|
setSchema(data);
|
|
87
90
|
})
|
|
88
91
|
}else{
|
|
92
|
+
// console.log("AmisWrapper===>==useEffect==result", result)
|
|
89
93
|
setSchema(result)
|
|
90
94
|
}
|
|
91
|
-
}, [JSON.stringify($schema)]) //, JSON.stringify(props.data)
|
|
95
|
+
}, [JSON.stringify($schema), JSON.stringify(props.data?.recordId)]) //, JSON.stringify(props.data)
|
|
92
96
|
|
|
93
97
|
if (!schema)
|
|
94
98
|
return render('body', {
|
|
@@ -114,7 +114,7 @@ const getRecordPageInitSchema = async function (objectApiName, userSession) {
|
|
|
114
114
|
{
|
|
115
115
|
"actionType": "reload",
|
|
116
116
|
"data": {
|
|
117
|
-
"name": `\${event.data.record.${uiSchema
|
|
117
|
+
"name": `\${event.data.record.${uiSchema.NAME_FIELD_KEY || 'name'}}`,
|
|
118
118
|
"record": `\${event.data.record}`,
|
|
119
119
|
"recordLoaded": true,
|
|
120
120
|
}
|
|
@@ -123,7 +123,7 @@ const getRecordPageInitSchema = async function (objectApiName, userSession) {
|
|
|
123
123
|
"actionType": "reload",
|
|
124
124
|
"componentId": `page_readonly_${objectApiName}_header`, //刷新标题, 详细页面header service 嵌套太多, 导致仅刷新第一层service无法更新recordName
|
|
125
125
|
"data": {
|
|
126
|
-
"name": `\${event.data.record.${uiSchema
|
|
126
|
+
"name": `\${event.data.record.${uiSchema.NAME_FIELD_KEY || 'name'}}`,
|
|
127
127
|
"record": `\${event.data.record}`,
|
|
128
128
|
"recordLoaded": true,
|
|
129
129
|
}
|
|
@@ -144,7 +144,7 @@ const getRecordPageInitSchema = async function (objectApiName, userSession) {
|
|
|
144
144
|
{
|
|
145
145
|
"actionType": "reload",
|
|
146
146
|
"data": {
|
|
147
|
-
"name": `\${record.${uiSchema
|
|
147
|
+
"name": `\${record.${uiSchema.NAME_FIELD_KEY || 'name'}}`,
|
|
148
148
|
"_master.record": `\${record}`,
|
|
149
149
|
// 不清楚reload 如何给对象下的某个key复制, 所以此处重复设置_master的objectName、recordId
|
|
150
150
|
"_master.objectName": "${objectName}",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-plugin-amis",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0-beta.1",
|
|
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": "5da093d78baa6f2d7011348060c30671354cc7f0",
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"tailwindcss": "3.2.4"
|
|
19
19
|
}
|