@steedos/service-plugin-amis 2.5.0-beta.6 → 2.5.0-beta.8

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.
@@ -219,28 +219,28 @@
219
219
  // return div;
220
220
  // },
221
221
  jumpTo: (to, action) => {
222
- if (to === 'goBack') {
223
- return window.history.back();
224
- }
222
+ if (to === 'goBack') {
223
+ return window.history.back();
224
+ }
225
225
 
226
- to = normalizeLink(to);
226
+ to = normalizeLink(to);
227
227
 
228
- if (action && action.actionType === 'url') {
229
- action.blank === false ? (window.location.href = to) : window.open(to);
230
- return;
231
- }
228
+ if (action && action.actionType === 'url') {
229
+ action.blank === false ? (window.location.href = to) : window.open(to);
230
+ return;
231
+ }
232
232
 
233
- // 主要是支持 nav 中的跳转
234
- if (action && to && action.target) {
235
- window.open(to, action.target);
236
- return;
237
- }
233
+ // 主要是支持 nav 中的跳转
234
+ if (action && to && action.target) {
235
+ window.open(to, action.target);
236
+ return;
237
+ }
238
238
 
239
- if (/^https?:\/\//.test(to)) {
240
- window.location.replace(to);
241
- } else {
242
- FlowRouter.go(to);
243
- }
239
+ if (/^https?:\/\//.test(to)) {
240
+ window.location.replace(to);
241
+ } else {
242
+ FlowRouter.go(to);
243
+ }
244
244
  },
245
245
  theme: 'antd',
246
246
  isCurrentUrl: isCurrentUrl,
@@ -100,67 +100,22 @@ const getRecordPageInitSchema = async function (objectApiName, userSession) {
100
100
  if (hasRelatedLists) {
101
101
  content.tabs.push(related)
102
102
  }
103
- const amisSchema = {
104
- "type": "service",
105
- "body": [
106
- {
107
- "type": "steedos-record-detail-header",
108
- "label": "标题面板",
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
- body.push(amisSchema);
110
+ content
111
+ ];
159
112
  return {
160
- type: 'page',
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.6",
3
+ "version": "2.5.0-beta.8",
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": "2bdc2b57b63d3b78e5181cc93fd3c482ba69a85e",
16
+ "gitHead": "537101194e8c7c61a4eed846d28382126d947775",
17
17
  "devDependencies": {
18
18
  "tailwindcss": "3.2.4"
19
19
  }